@tarojs/components 3.4.6 → 3.4.9

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 (188) hide show
  1. package/dist/cjs/index-47a1959e.js +34 -0
  2. package/dist/{esm/index-3c78bcaf.js → cjs/index-dffbd352.js} +12 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/taro-button-core.cjs.entry.js +2 -2
  5. package/dist/cjs/taro-canvas-core.cjs.entry.js +1 -1
  6. package/dist/cjs/taro-checkbox-core_2.cjs.entry.js +1 -1
  7. package/dist/cjs/taro-components.cjs.js +1 -1
  8. package/dist/cjs/taro-cover-view-core.cjs.entry.js +1 -1
  9. package/dist/cjs/taro-icon-core.cjs.entry.js +1 -1
  10. package/dist/cjs/taro-image-core.cjs.entry.js +2 -2
  11. package/dist/cjs/taro-input-core.cjs.entry.js +1 -1
  12. package/dist/cjs/taro-navigator-core.cjs.entry.js +3 -3
  13. package/dist/cjs/taro-picker-core_2.cjs.entry.js +1 -1
  14. package/dist/cjs/taro-picker-view-column-core.cjs.entry.js +79 -3
  15. package/dist/cjs/taro-picker-view-core.cjs.entry.js +71 -2
  16. package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +9 -8
  17. package/dist/cjs/taro-scroll-view-core.cjs.entry.js +5 -13
  18. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +5 -13
  19. package/dist/cjs/taro-tabbar.cjs.entry.js +24 -24
  20. package/dist/cjs/taro-text-core.cjs.entry.js +2 -2
  21. package/dist/cjs/taro-textarea-core.cjs.entry.js +1 -1
  22. package/dist/cjs/taro-video-control_3.cjs.entry.js +27859 -221
  23. package/dist/cjs/taro-view-core.cjs.entry.js +4 -4
  24. package/dist/cjs/taro-web-view-core.cjs.entry.js +1 -1
  25. package/dist/collection/components/button/style/index.css +49 -49
  26. package/dist/collection/components/canvas/canvas.js +1 -1
  27. package/dist/collection/components/canvas/style/index.css +6 -6
  28. package/dist/collection/components/checkbox/style/index.css +21 -22
  29. package/dist/collection/components/image/style/index.css +4 -4
  30. package/dist/collection/components/input/index.css +2 -2
  31. package/dist/collection/components/navigator/navigator.js +2 -2
  32. package/dist/collection/components/navigator/{navigator.css → style/index.css} +3 -3
  33. package/dist/collection/components/picker/style/index.css +2 -1
  34. package/dist/collection/components/picker-view/picker-view-column.js +218 -4
  35. package/dist/collection/components/picker-view/picker-view.js +217 -3
  36. package/dist/collection/components/picker-view/style/column.css +12 -0
  37. package/dist/collection/components/picker-view/style/index.css +28 -0
  38. package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +8 -7
  39. package/dist/collection/components/pull-to-refresh/style/index.css +53 -50
  40. package/dist/collection/components/scroll-view/scroll-view.js +3 -11
  41. package/dist/collection/components/swiper/swiper.js +2 -10
  42. package/dist/collection/components/tabbar/style/index.css +7 -6
  43. package/dist/collection/components/text/style/index.css +0 -6
  44. package/dist/collection/components/textarea/style/index.css +5 -5
  45. package/dist/collection/components/video/style/index.css +89 -109
  46. package/dist/collection/components/video/utils.js +96 -109
  47. package/dist/collection/components/video/video-control.js +6 -6
  48. package/dist/collection/components/video/video.js +48 -7
  49. package/dist/collection/components/view/style/index.css +3 -5
  50. package/dist/collection/components/view/view.js +2 -2
  51. package/dist/collection/components/web-view/style/index.css +1 -1
  52. package/dist/collection/utils/index.js +23 -83
  53. package/dist/collection/utils/style.js +10 -0
  54. package/dist/collection/utils/url.js +67 -0
  55. package/dist/esm/index-cad8203e.js +31 -0
  56. package/dist/{cjs/index-b9715722.js → esm/index-cd1a2d33.js} +6 -2
  57. package/dist/esm/loader.js +1 -1
  58. package/dist/esm/taro-button-core.entry.js +2 -2
  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 +1 -1
  62. package/dist/esm/taro-cover-view-core.entry.js +1 -1
  63. package/dist/esm/taro-icon-core.entry.js +1 -1
  64. package/dist/esm/taro-image-core.entry.js +2 -2
  65. package/dist/esm/taro-input-core.entry.js +1 -1
  66. package/dist/esm/taro-navigator-core.entry.js +3 -3
  67. package/dist/esm/taro-picker-core_2.entry.js +1 -1
  68. package/dist/esm/taro-picker-view-column-core.entry.js +80 -4
  69. package/dist/esm/taro-picker-view-core.entry.js +72 -3
  70. package/dist/esm/taro-pull-to-refresh.entry.js +9 -8
  71. package/dist/esm/taro-scroll-view-core.entry.js +4 -12
  72. package/dist/esm/taro-swiper-core_2.entry.js +2 -10
  73. package/dist/esm/taro-tabbar.entry.js +24 -24
  74. package/dist/esm/taro-text-core.entry.js +2 -2
  75. package/dist/esm/taro-textarea-core.entry.js +1 -1
  76. package/dist/esm/taro-video-control_3.entry.js +27858 -220
  77. package/dist/esm/taro-view-core.entry.js +4 -4
  78. package/dist/esm/taro-web-view-core.entry.js +1 -1
  79. package/dist/esm-es5/index-cad8203e.js +1 -0
  80. package/dist/esm-es5/index-cd1a2d33.js +7 -0
  81. package/dist/esm-es5/loader.js +1 -1
  82. package/dist/esm-es5/taro-button-core.entry.js +1 -1
  83. package/dist/esm-es5/taro-canvas-core.entry.js +1 -1
  84. package/dist/esm-es5/taro-checkbox-core_2.entry.js +1 -1
  85. package/dist/esm-es5/taro-components.js +1 -1
  86. package/dist/esm-es5/taro-cover-view-core.entry.js +1 -1
  87. package/dist/esm-es5/taro-icon-core.entry.js +1 -1
  88. package/dist/esm-es5/taro-image-core.entry.js +1 -1
  89. package/dist/esm-es5/taro-input-core.entry.js +1 -1
  90. package/dist/esm-es5/taro-navigator-core.entry.js +1 -1
  91. package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
  92. package/dist/esm-es5/taro-picker-view-column-core.entry.js +1 -1
  93. package/dist/esm-es5/taro-picker-view-core.entry.js +1 -1
  94. package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
  95. package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
  96. package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
  97. package/dist/esm-es5/taro-tabbar.entry.js +1 -1
  98. package/dist/esm-es5/taro-text-core.entry.js +1 -1
  99. package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
  100. package/dist/esm-es5/taro-video-control_3.entry.js +365 -1
  101. package/dist/esm-es5/taro-view-core.entry.js +1 -1
  102. package/dist/esm-es5/taro-web-view-core.entry.js +1 -1
  103. package/dist/taro-components/p-00089605.entry.js +365 -0
  104. package/dist/taro-components/{p-293531af.system.entry.js → p-03eb37e5.system.entry.js} +1 -1
  105. package/dist/taro-components/{p-4dbed323.entry.js → p-07062966.entry.js} +1 -1
  106. package/dist/taro-components/{p-9fc88fc1.system.entry.js → p-0c18bd18.system.entry.js} +1 -1
  107. package/dist/taro-components/p-16bf117a.system.entry.js +1 -0
  108. package/dist/taro-components/{p-fc4939c6.system.entry.js → p-288b38f9.system.entry.js} +1 -1
  109. package/dist/taro-components/p-2d066d28.entry.js +1 -0
  110. package/dist/taro-components/{p-2d2f8064.entry.js → p-33c5efb5.entry.js} +1 -1
  111. package/dist/taro-components/p-33ee636a.system.js +1 -1
  112. package/dist/taro-components/p-3593c5f1.system.entry.js +1 -0
  113. package/dist/taro-components/{p-74540410.entry.js → p-42eb4f16.entry.js} +1 -1
  114. package/dist/taro-components/{p-d567b95e.entry.js → p-431080b8.entry.js} +1 -1
  115. package/dist/taro-components/{p-17039974.system.entry.js → p-50be38a1.system.entry.js} +1 -1
  116. package/dist/taro-components/p-51401bdc.entry.js +1 -0
  117. package/dist/taro-components/p-5746d7ce.js +1 -0
  118. package/dist/taro-components/{p-2b0d5c90.system.entry.js → p-58623cdd.system.entry.js} +1 -1
  119. package/dist/taro-components/{p-d041b413.entry.js → p-5c6aeb55.entry.js} +1 -1
  120. package/dist/taro-components/p-5f4d0d5b.system.js +7 -0
  121. package/dist/taro-components/p-61c0caae.entry.js +1 -0
  122. package/dist/taro-components/p-663d1bb9.system.js +1 -0
  123. package/dist/taro-components/{p-865c21b5.entry.js → p-668a6262.entry.js} +1 -1
  124. package/dist/taro-components/p-6c211370.system.entry.js +1 -0
  125. package/dist/taro-components/p-7e5d2d7a.js +7 -0
  126. package/dist/taro-components/p-7fdd59f0.entry.js +1 -0
  127. package/dist/taro-components/{p-99ed3ed2.system.entry.js → p-8bea1c4d.system.entry.js} +1 -1
  128. package/dist/taro-components/{p-fd8312e5.system.entry.js → p-8e0150eb.system.entry.js} +1 -1
  129. package/dist/taro-components/p-92a31933.system.entry.js +1 -0
  130. package/dist/taro-components/p-a05d66d1.system.entry.js +1 -0
  131. package/dist/taro-components/p-aae3e479.entry.js +1 -0
  132. package/dist/taro-components/p-b0bd2cf1.system.entry.js +1 -0
  133. package/dist/taro-components/p-b4f94eb0.entry.js +1 -0
  134. package/dist/taro-components/{p-5ae86835.system.entry.js → p-bc97b854.system.entry.js} +1 -1
  135. package/dist/taro-components/p-c06f1610.system.entry.js +1 -0
  136. package/dist/taro-components/{p-fe156231.system.entry.js → p-c792a826.system.entry.js} +1 -1
  137. package/dist/taro-components/p-cd2af8b4.entry.js +1 -0
  138. package/dist/taro-components/{p-8bc82aaa.entry.js → p-d0c608a8.entry.js} +1 -1
  139. package/dist/taro-components/p-d19aeb27.entry.js +1 -0
  140. package/dist/taro-components/p-e38a81c9.entry.js +1 -0
  141. package/dist/taro-components/p-e3c9421d.entry.js +1 -0
  142. package/dist/taro-components/p-e61d2113.system.entry.js +1 -0
  143. package/dist/taro-components/{p-98b47fc9.system.entry.js → p-ed3bf934.system.entry.js} +1 -1
  144. package/dist/taro-components/{p-1c1336f5.entry.js → p-edcb9726.entry.js} +1 -1
  145. package/dist/taro-components/{p-4e54216b.entry.js → p-f5fe8711.entry.js} +1 -1
  146. package/dist/taro-components/p-fbd45c24.system.entry.js +1 -0
  147. package/dist/taro-components/p-ff032a23.system.entry.js +365 -0
  148. package/dist/taro-components/taro-components.esm.js +1 -1
  149. package/dist/types/components/picker-view/picker-view-column.d.ts +15 -1
  150. package/dist/types/components/picker-view/picker-view.d.ts +24 -0
  151. package/dist/types/components/scroll-view/scroll-view.d.ts +1 -1
  152. package/dist/types/components/swiper/swiper.d.ts +2 -2
  153. package/dist/types/components/video/utils.d.ts +8 -0
  154. package/dist/types/components/video/video-control.d.ts +1 -1
  155. package/dist/types/components.d.ts +22 -0
  156. package/dist/types/utils/index.d.ts +4 -8
  157. package/dist/types/utils/style.d.ts +1 -0
  158. package/dist/types/utils/url.d.ts +6 -0
  159. package/package.json +6 -4
  160. package/types/Input.d.ts +5 -4
  161. package/types/PickerViewColumn.d.ts +2 -2
  162. package/types/Video.d.ts +1 -1
  163. package/types/index.vue3.d.ts +159 -0
  164. package/vue3.d.ts +3 -0
  165. package/dist/esm-es5/index-3c78bcaf.js +0 -7
  166. package/dist/taro-components/p-11932905.entry.js +0 -1
  167. package/dist/taro-components/p-17cf8b5b.entry.js +0 -1
  168. package/dist/taro-components/p-32937866.entry.js +0 -1
  169. package/dist/taro-components/p-37cfdd8f.js +0 -7
  170. package/dist/taro-components/p-431197bc.entry.js +0 -1
  171. package/dist/taro-components/p-43de2f12.system.entry.js +0 -1
  172. package/dist/taro-components/p-50066d5e.system.entry.js +0 -1
  173. package/dist/taro-components/p-5c420456.entry.js +0 -1
  174. package/dist/taro-components/p-6de12779.entry.js +0 -1
  175. package/dist/taro-components/p-71e14298.entry.js +0 -1
  176. package/dist/taro-components/p-83dedaa2.entry.js +0 -1
  177. package/dist/taro-components/p-8486c251.system.entry.js +0 -1
  178. package/dist/taro-components/p-94c20f60.system.js +0 -7
  179. package/dist/taro-components/p-95529dc0.entry.js +0 -1
  180. package/dist/taro-components/p-b15d0302.system.entry.js +0 -1
  181. package/dist/taro-components/p-b32442fc.system.entry.js +0 -1
  182. package/dist/taro-components/p-cc818a13.entry.js +0 -1
  183. package/dist/taro-components/p-d394a61f.system.entry.js +0 -1
  184. package/dist/taro-components/p-d5971476.entry.js +0 -1
  185. package/dist/taro-components/p-e0af1d0d.system.entry.js +0 -1
  186. package/dist/taro-components/p-fb2252b7.system.entry.js +0 -1
  187. package/dist/taro-components/p-fd0d1168.system.entry.js +0 -1
  188. package/dist/taro-components/p-fde3a009.system.entry.js +0 -1
@@ -1 +1 @@
1
- var __spreadArray=this&&this.__spreadArray||function(e,a){for(var t=0,r=a.length,o=e.length;t<r;t++,o++)e[o]=a[t];return e};import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-5bd7cbab.js";import Taro from"@tarojs/taro";import{c as classnames}from"./index-3c78bcaf.js";function isAbsolute(e){return e.charAt(0)==="/"}function spliceOne(e,a){for(var t=a,r=t+1,o=e.length;r<o;t+=1,r+=1){e[t]=e[r]}e.pop()}function resolvePathname(e,a){if(a===undefined)a="";var t=e&&e.split("/")||[];var r=a&&a.split("/")||[];var o=e&&isAbsolute(e);var n=a&&isAbsolute(a);var s=o||n;if(e&&isAbsolute(e)){r=t}else if(t.length){r.pop();r=r.concat(t)}if(!r.length)return"/";var i;if(r.length){var l=r[r.length-1];i=l==="."||l===".."||l===""}else{i=false}var b=0;for(var d=r.length;d>=0;d--){var h=r[d];if(h==="."){spliceOne(r,d)}else if(h===".."){spliceOne(r,d);b++}else if(b){spliceOne(r,d);b--}}if(!s)for(;b--;b)r.unshift("..");if(s&&r[0]!==""&&(!r[0]||!isAbsolute(r[0])))r.unshift("");var c=r.join("/");if(i&&c.substr(-1)!=="/")c+="/";return c}var splitUrl=function(e){var a=e||"";var t;var r={path:null,query:null,fragment:null};t=a.indexOf("#");if(t>-1){r.fragment=a.substring(t+1);a=a.substring(0,t)}t=a.indexOf("?");if(t>-1){r.query=a.substring(t+1);a=a.substring(0,t)}r.path=a;return r};var TabbarItem=function(e){var a=e.index,t=e.isSelected,r=t===void 0?false:t,o=e.textColor,n=e.iconPath,s=e.badgeText,i=e.showRedDot,l=i===void 0?false:i,b=e.text,d=e.onSelect;var c=classnames("weui-tabbar__item",{"weui-bar__item_on":r});var f={position:"absolute",top:"-2px",right:"-13px"};var u={position:"absolute",top:"0",right:"-6px"};function v(){d(a)}return h("a",{key:a,href:"javascript:;",class:c,onClick:v},h("span",{style:{display:"inline-block",position:"relative"}},h("img",{src:n,alt:"",class:"weui-tabbar__icon"}),!!s&&h("span",{class:"weui-badge taro-tabbar-badge",style:f},s),l&&h("span",{class:"weui-badge weui-badge_dot",style:u})),h("p",{class:"weui-tabbar__label",style:{color:o}},b))};var indexCss="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:auto}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0;margin-bottom:constant(safe-area-inset-bottom);margin-bottom:env(safe-area-inset-bottom)}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";var addLeadingSlash=function(e){return e[0]==="/"?e:"/"+e};var hasBasename=function(e,a){return new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(e)};var stripBasename=function(e,a){return hasBasename(e,a)?e.substr(a.length):e};var STATUS_SHOW=0;var STATUS_HIDE=1;var STATUS_SLIDEOUT=2;var basicTabBarClassName="taro-tabbar__tabbar";var hideTabBarClassName="taro-tabbar__tabbar-hide";var hideTabBarWithAnimationClassName="taro-tabbar__tabbar-slideout";var Tabbar=function(){function e(e){var a=this;registerInstance(this,e);this.onLongPress=createEvent(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=STATUS_SHOW;this.getOriginUrl=function(e){var t=a.customRoutes.filter((function(a){var t=a[1];var r=splitUrl(t).path;var o=splitUrl(e).path;return r===o}));return t.length?t[0][0]:e};this.getSelectedIndex=function(e){var t=-1;a.list.forEach((function(a,r){var o=a.pagePath;var n=splitUrl(e).path;var s=splitUrl(o).path;if(n===s){t=r}}));return t};this.switchTab=function(e){a.selectedIndex=e;Taro.switchTab({url:a.list[e].pagePath})};this.switchTabHandler=function(e){var t=e.url,r=e.successHandler,o=e.errorHandler;var n=a.getOriginUrl(a.getCurrentUrl()||a.homePage);var s=resolvePathname(t,n);var i=a.getSelectedIndex(s);if(i>-1){a.switchTab(i);r({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+s+'" is not found'})}};this.routerChangeHandler=function(e){var t;var r;if(e){t=e.toLocation}if(t&&t.path){var o=addLeadingSlash(t.path);r=stripBasename(o==="/"?a.homePage:o,a.conf.basename||"/")}else{r=a.getCurrentUrl()}a.selectedIndex=a.getSelectedIndex(a.getOriginUrl(r))};this.setTabBarBadgeHandler=function(e){var t=e.index,r=e.text,o=e.successHandler,n=e.errorHandler;var s=__spreadArray([],a.list);if(t in s){s[t].showRedDot=false;s[t].badgeText=r;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}a.list=s};this.removeTabBarBadgeHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].badgeText=null;r({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}a.list=n};this.showTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].showRedDot=true;r({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}a.list=n};this.hideTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].showRedDot=false;r({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}a.list=n};this.showTabBarHandler=function(e){var t=e.successHandler;a.status=STATUS_SHOW;t({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var t=e.animation,r=e.successHandler;a.status=t?STATUS_SLIDEOUT:STATUS_HIDE;r({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var t=e.color,r=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,s=e.successHandler;if(o)a.backgroundColor=o;if(n)a.borderStyle=n;if(t)a.color=t;if(r)a.selectedColor=r;s({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var t=e.index,r=e.iconPath,o=e.selectedIconPath,n=e.text,s=e.successHandler,i=e.errorHandler;var l=__spreadArray([],a.list);if(t in l){if(r)l[t].iconPath=r;if(o)l[t].selectedIconPath=o;if(n)l[t].text=n;s({errMsg:"setTabBarItem:ok"})}else{i({errMsg:"setTabBarItem:fail tabbar item not found"})}a.list=l};var t=this.conf.list;var r=this.conf.customRoutes;if(Object.prototype.toString.call(t)!=="[object Array]"||t.length<2||t.length>5){throw new Error("tabBar 配置错误")}this.homePage=addLeadingSlash(this.conf.homePage);var o=function(e){var a;var t=r[e];e=addLeadingSlash(e);if(typeof t==="string"){n.customRoutes.push([e,addLeadingSlash(t)])}else if((t===null||t===void 0?void 0:t.length)>0){(a=n.customRoutes).push.apply(a,t.map((function(a){return[e,addLeadingSlash(a)]})))}};var n=this;for(var s in r){o(s)}t.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=t;this.borderStyle=this.conf.borderStyle;this.backgroundColor=this.conf.backgroundColor;this.color=this.conf.color;this.selectedColor=this.conf.selectedColor}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var a=this.conf.basename||"/";var t;if(e==="hash"){var r=window.location.href;var o=r.indexOf("#");t=o===-1?"":r.substring(o+1)}else{t=location.pathname}var n=addLeadingSlash(stripBasename(t,a));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){Taro.eventCenter.on("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.on("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){Taro.eventCenter.off("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.off("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,a;var t=this;var r=this.tabbarPos,o=r===void 0?"bottom":r;var n=this.status;var s=classnames("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var i=this.selectedIndex===-1||n===STATUS_HIDE;var l=n===STATUS_SLIDEOUT;return h(Host,{class:classnames(basicTabBarClassName,basicTabBarClassName+"-"+o,(a={},a[hideTabBarClassName]=i,a[hideTabBarWithAnimationClassName]=l,a))},h("div",{class:s,style:{backgroundColor:this.backgroundColor||"",height:"inherit"}},this.list.map((function(e,a){var r=t.selectedIndex===a;var o;var n;if(r){o=t.selectedColor||"";n=e.selectedIconPath}else{o=t.color||"";n=e.iconPath}return h(TabbarItem,{index:a,onSelect:t.switchTab.bind(t),isSelected:r,textColor:o,iconPath:n,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Tabbar.style=indexCss;export{Tabbar as taro_tabbar};
1
+ var __spreadArray=this&&this.__spreadArray||function(e,a){for(var t=0,r=a.length,o=e.length;t<r;t++,o++)e[o]=a[t];return e};import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-5bd7cbab.js";import Taro from"@tarojs/taro";import{c as classnames}from"./index-cd1a2d33.js";var splitUrl=function(e){var a=e||"";var t;var r={path:null,query:null,fragment:null};t=a.indexOf("#");if(t>-1){r.fragment=a.substring(t+1);a=a.substring(0,t)}t=a.indexOf("?");if(t>-1){r.query=a.substring(t+1);a=a.substring(0,t)}r.path=a;return r};function isAbsolute(e){return e.charAt(0)==="/"}function spliceOne(e,a){for(var t=a,r=t+1,o=e.length;r<o;t+=1,r+=1){e[t]=e[r]}e.pop()}function resolvePathname(e,a){if(a===undefined)a="";var t=e&&e.split("/")||[];var r=a&&a.split("/")||[];var o=e&&isAbsolute(e);var n=a&&isAbsolute(a);var s=o||n;if(e&&isAbsolute(e)){r=t}else if(t.length){r.pop();r=r.concat(t)}if(!r.length)return"/";var i;if(r.length){var l=r[r.length-1];i=l==="."||l===".."||l===""}else{i=false}var d=0;for(var b=r.length;b>=0;b--){var h=r[b];if(h==="."){spliceOne(r,b)}else if(h===".."){spliceOne(r,b);d++}else if(d){spliceOne(r,b);d--}}if(!s)for(;d--;d)r.unshift("..");if(s&&r[0]!==""&&(!r[0]||!isAbsolute(r[0])))r.unshift("");var c=r.join("/");if(i&&c.substr(-1)!=="/")c+="/";return c}var TabbarItem=function(e){var a=e.index,t=e.isSelected,r=t===void 0?false:t,o=e.textColor,n=e.iconPath,s=e.badgeText,i=e.showRedDot,l=i===void 0?false:i,d=e.text,b=e.onSelect;var c=classnames("weui-tabbar__item",{"weui-bar__item_on":r});var f={position:"absolute",top:"-2px",right:"-13px"};var u={position:"absolute",top:"0",right:"-6px"};function v(){b(a)}return h("a",{key:a,href:"javascript:;",class:c,onClick:v},h("span",{style:{display:"inline-block",position:"relative"}},h("img",{src:n,alt:"",class:"weui-tabbar__icon"}),!!s&&h("span",{class:"weui-badge taro-tabbar-badge",style:f},s),l&&h("span",{class:"weui-badge weui-badge_dot",style:u})),h("p",{class:"weui-tabbar__label",style:{color:o}},d))};var indexCss="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column;height:100%}.taro-tabbar__panel{overflow:auto;position:relative;-ms-flex:1;flex:1;-webkit-overflow-scrolling:auto}.taro-tabbar__tabbar{position:relative;width:100%;height:50px;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0;margin-bottom:constant(safe-area-inset-bottom);margin-bottom:env(safe-area-inset-bottom)}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";var addLeadingSlash=function(e){return e[0]==="/"?e:"/"+e};var hasBasename=function(e,a){return new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(e)};var stripBasename=function(e,a){return hasBasename(e,a)?e.substr(a.length):e};var STATUS_SHOW=0;var STATUS_HIDE=1;var STATUS_SLIDEOUT=2;var basicTabBarClassName="taro-tabbar__tabbar";var hideTabBarClassName="taro-tabbar__tabbar-hide";var hideTabBarWithAnimationClassName="taro-tabbar__tabbar-slideout";var Tabbar=function(){function e(e){var a=this;registerInstance(this,e);this.onLongPress=createEvent(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=STATUS_SHOW;this.getOriginUrl=function(e){var t=a.customRoutes.filter((function(a){var t=a[1];var r=splitUrl(t).path;var o=splitUrl(e).path;return r===o}));return t.length?t[0][0]:e};this.getSelectedIndex=function(e){var t=-1;a.list.forEach((function(a,r){var o=a.pagePath;var n=splitUrl(e).path;var s=splitUrl(o).path;if(n===s){t=r}}));return t};this.switchTab=function(e){a.selectedIndex=e;Taro.switchTab({url:a.list[e].pagePath})};this.switchTabHandler=function(e){var t=e.url,r=e.successHandler,o=e.errorHandler;var n=a.getOriginUrl(a.getCurrentUrl()||a.homePage);var s=resolvePathname(t,n);var i=a.getSelectedIndex(s);if(i>-1){a.switchTab(i);r({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+s+'" is not found'})}};this.routerChangeHandler=function(e){var t;var r;if(e){t=e.toLocation}if(t&&t.path){var o=addLeadingSlash(t.path);r=stripBasename(o==="/"?a.homePage:o,a.conf.basename||"/")}else{r=a.getCurrentUrl()}a.selectedIndex=a.getSelectedIndex(a.getOriginUrl(r))};this.setTabBarBadgeHandler=function(e){var t=e.index,r=e.text,o=e.successHandler,n=e.errorHandler;var s=__spreadArray([],a.list);if(t in s){s[t].showRedDot=false;s[t].badgeText=r;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}a.list=s};this.removeTabBarBadgeHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].badgeText=null;r({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}a.list=n};this.showTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].showRedDot=true;r({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}a.list=n};this.hideTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].showRedDot=false;r({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}a.list=n};this.showTabBarHandler=function(e){var t=e.successHandler;a.status=STATUS_SHOW;t({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var t=e.animation,r=e.successHandler;a.status=t?STATUS_SLIDEOUT:STATUS_HIDE;r({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var t=e.color,r=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,s=e.successHandler;if(o)a.backgroundColor=o;if(n)a.borderStyle=n;if(t)a.color=t;if(r)a.selectedColor=r;s({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var t=e.index,r=e.iconPath,o=e.selectedIconPath,n=e.text,s=e.successHandler,i=e.errorHandler;var l=__spreadArray([],a.list);if(t in l){if(r)l[t].iconPath=r;if(o)l[t].selectedIconPath=o;if(n)l[t].text=n;s({errMsg:"setTabBarItem:ok"})}else{i({errMsg:"setTabBarItem:fail tabbar item not found"})}a.list=l};var t=this.conf.list;var r=this.conf.customRoutes;if(Object.prototype.toString.call(t)!=="[object Array]"||t.length<2||t.length>5){throw new Error("tabBar 配置错误")}this.homePage=addLeadingSlash(this.conf.homePage);var o=function(e){var a;var t=r[e];e=addLeadingSlash(e);if(typeof t==="string"){n.customRoutes.push([e,addLeadingSlash(t)])}else if((t===null||t===void 0?void 0:t.length)>0){(a=n.customRoutes).push.apply(a,t.map((function(a){return[e,addLeadingSlash(a)]})))}};var n=this;for(var s in r){o(s)}t.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=t;this.borderStyle=this.conf.borderStyle;this.backgroundColor=this.conf.backgroundColor;this.color=this.conf.color;this.selectedColor=this.conf.selectedColor}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var a=this.conf.basename||"/";var t;if(e==="hash"){var r=window.location.href;var o=r.indexOf("#");t=o===-1?"":r.substring(o+1)}else{t=location.pathname}var n=addLeadingSlash(stripBasename(t,a));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){Taro.eventCenter.on("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.on("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){Taro.eventCenter.off("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.off("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,a;var t=this;var r=this.tabbarPos,o=r===void 0?"bottom":r;var n=this.status;var s=classnames("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var i=this.selectedIndex===-1||n===STATUS_HIDE;var l=n===STATUS_SLIDEOUT;return h(Host,{class:classnames(basicTabBarClassName,basicTabBarClassName+"-"+o,(a={},a[hideTabBarClassName]=i,a[hideTabBarWithAnimationClassName]=l,a))},h("div",{class:s,style:{backgroundColor:this.backgroundColor||"",height:"inherit"}},this.list.map((function(e,a){var r=t.selectedIndex===a;var o;var n;if(r){o=t.selectedColor||"";n=e.selectedIconPath}else{o=t.color||"";n=e.iconPath}return h(TabbarItem,{index:a,onSelect:t.switchTab.bind(t),isSelected:r,textColor:o,iconPath:n,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Tabbar.style=indexCss;export{Tabbar as taro_tabbar};
@@ -1 +1 @@
1
- import{r as registerInstance,h,H as Host}from"./index-5bd7cbab.js";import{c as classnames}from"./index-3c78bcaf.js";var 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}";var Text=function(){function e(e){registerInstance(this,e);this.selectable=false}e.prototype.render=function(){var e=classnames({"taro-text__selectable":this.selectable});return h(Host,{class:e},h("slot",null))};return e}();Text.style=indexCss;export{Text as taro_text_core};
1
+ import{r as registerInstance,h,H as Host}from"./index-5bd7cbab.js";import{c as classnames}from"./index-cd1a2d33.js";var indexCss="taro-text-core{display:inline;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:pre-wrap}.taro-text__selectable{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}";var Text=function(){function e(e){registerInstance(this,e);this.selectable=false}e.prototype.render=function(){var e=classnames({"taro-text__selectable":this.selectable});return h(Host,{class:e},h("slot",null))};return e}();Text.style=indexCss;export{Text as taro_text_core};
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-5bd7cbab.js";var 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}";function fixControlledValue(e){return e!==null&&e!==void 0?e:""}var Textarea=function(){function e(e){var t=this;registerInstance(this,e);this.onInput=createEvent(this,"input",7);this.onFocus=createEvent(this,"focus",7);this.onBlur=createEvent(this,"blur",7);this.onChange=createEvent(this,"change",7);this.onLineChange=createEvent(this,"linechange",7);this.disabled=false;this.maxlength=140;this.autoFocus=false;this.autoHeight=false;this.nativeProps={};this.line=1;this.handleInput=function(e){e.stopPropagation();t.handleLineChange();t.onInput.emit({value:e.target.value,cursor:e.target.value.length})};this.handleFocus=function(e){t.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){t.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();t.onChange.emit({value:e.target.value})};this.handleLineChange=function(){var e=t.getNumberOfLines();if(e!==t.line){t.line=e;t.onLineChange.emit({height:t.textareaRef.clientHeight,lineCount:t.line})}};this.calculateContentHeight=function(e,t){var n=e.style.height,a=e.offsetHeight,i=e.scrollHeight,o=e.style.overflow,r=e.style.minHeight||null;if(a>=i){e.style.minHeight=0;e.style.height=a+t+"px";e.style.overflow="hidden";if(i<e.scrollHeight){while(e.offsetHeight>=e.scrollHeight){e.style.height=(a-=t)+"px"}while(e.offsetHeight<e.scrollHeight){e.style.height=a+++"px"}e.style.height=n;e.style.overflow=o;e.style.minHeight=r;return a}}else{return i}};this.getNumberOfLines=function(){var e=t.textareaRef,n=window.getComputedStyle?window.getComputedStyle(e):e.style,a=parseInt(n.lineHeight,10),i=t.calculateContentHeight(e,a),o=Math.floor(i/a);return o}}e.prototype.componentDidLoad=function(){var e=this;Object.defineProperty(this.el,"value",{get:function(){return e.textareaRef.value},set:function(t){return e.value=t},configurable:true});this.autoFocus&&this.textareaRef.focus()};e.prototype.render=function(){var e=this;var t=this,n=t.value,a=t.placeholder,i=t.disabled,o=t.maxlength,r=t.autoFocus,l=t.autoHeight,s=t.name,u=t.nativeProps,c=t.handleInput,g=t.handleFocus,f=t.handleBlur,d=t.handleChange;var p={};if(l){p.rows=this.line}return h("textarea",Object.assign({ref:function(t){if(t){e.textareaRef=t}},class:"taro-textarea "+(l?"auto-height":""),value:fixControlledValue(n),placeholder:a,name:s,disabled:i,maxlength:o,autofocus:r,onInput:c,onFocus:g,onBlur:f,onChange:d},u,p))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Textarea.style=indexCss;export{Textarea as taro_textarea_core};
1
+ import{r as registerInstance,c as createEvent,h,g as getElement}from"./index-5bd7cbab.js";var indexCss="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{display:block;position:relative;border:0;width:100%;height:150px;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;line-height:1.5}.taro-textarea:focus{outline:none}";function fixControlledValue(e){return e!==null&&e!==void 0?e:""}var Textarea=function(){function e(e){var t=this;registerInstance(this,e);this.onInput=createEvent(this,"input",7);this.onFocus=createEvent(this,"focus",7);this.onBlur=createEvent(this,"blur",7);this.onChange=createEvent(this,"change",7);this.onLineChange=createEvent(this,"linechange",7);this.disabled=false;this.maxlength=140;this.autoFocus=false;this.autoHeight=false;this.nativeProps={};this.line=1;this.handleInput=function(e){e.stopPropagation();t.handleLineChange();t.onInput.emit({value:e.target.value,cursor:e.target.value.length})};this.handleFocus=function(e){t.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){t.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();t.onChange.emit({value:e.target.value})};this.handleLineChange=function(){var e=t.getNumberOfLines();if(e!==t.line){t.line=e;t.onLineChange.emit({height:t.textareaRef.clientHeight,lineCount:t.line})}};this.calculateContentHeight=function(e,t){var n=e.style.height,a=e.offsetHeight,i=e.scrollHeight,o=e.style.overflow,r=e.style.minHeight||null;if(a>=i){e.style.minHeight=0;e.style.height=a+t+"px";e.style.overflow="hidden";if(i<e.scrollHeight){while(e.offsetHeight>=e.scrollHeight){e.style.height=(a-=t)+"px"}while(e.offsetHeight<e.scrollHeight){e.style.height=a+++"px"}e.style.height=n;e.style.overflow=o;e.style.minHeight=r;return a}}else{return i}};this.getNumberOfLines=function(){var e=t.textareaRef,n=window.getComputedStyle?window.getComputedStyle(e):e.style,a=parseInt(n.lineHeight,10),i=t.calculateContentHeight(e,a),o=Math.floor(i/a);return o}}e.prototype.componentDidLoad=function(){var e=this;Object.defineProperty(this.el,"value",{get:function(){return e.textareaRef.value},set:function(t){return e.value=t},configurable:true});this.autoFocus&&this.textareaRef.focus()};e.prototype.render=function(){var e=this;var t=this,n=t.value,a=t.placeholder,i=t.disabled,o=t.maxlength,r=t.autoFocus,l=t.autoHeight,s=t.name,u=t.nativeProps,c=t.handleInput,g=t.handleFocus,f=t.handleBlur,p=t.handleChange;var d={};if(l){d.rows=this.line}return h("textarea",Object.assign({ref:function(t){if(t){e.textareaRef=t}},class:"taro-textarea "+(l?"auto-height":""),value:fixControlledValue(n),placeholder:a,name:s,disabled:i,maxlength:o,autofocus:r,onInput:c,onFocus:g,onBlur:f,onChange:p},u,d))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Textarea.style=indexCss;export{Textarea as taro_textarea_core};