@tarojs/components 3.7.0-canary.6 → 4.0.0-alpha.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 (70) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/taro-components.cjs.js +1 -1
  3. package/dist/cjs/{taro-pull-to-refresh.cjs.entry.js → taro-pull-to-refresh-core.cjs.entry.js} +14 -12
  4. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +68 -47
  5. package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +14 -12
  6. package/dist/collection/components/swiper/swiper-item.js +54 -33
  7. package/dist/collection/components/swiper/swiper.js +31 -14
  8. package/dist/components/index.d.ts +1 -1
  9. package/dist/components/index.js +1 -1
  10. package/dist/components/taro-pull-to-refresh-core.d.ts +11 -0
  11. package/dist/components/{taro-pull-to-refresh.js → taro-pull-to-refresh-core.js} +18 -16
  12. package/dist/components/taro-swiper-core.js +31 -14
  13. package/dist/components/taro-swiper-item-core.js +40 -36
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/taro-components.js +1 -1
  16. package/dist/esm/{taro-pull-to-refresh.entry.js → taro-pull-to-refresh-core.entry.js} +14 -12
  17. package/dist/esm/taro-swiper-core_2.entry.js +68 -47
  18. package/dist/esm-es5/loader.js +1 -1
  19. package/dist/esm-es5/taro-components.js +1 -1
  20. package/dist/esm-es5/{taro-pull-to-refresh.entry.js → taro-pull-to-refresh-core.entry.js} +1 -1
  21. package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
  22. package/dist/taro-components/{p-4f1d180d.entry.js → p-c99e14b5.entry.js} +1 -1
  23. package/dist/taro-components/p-cbcaad0e.system.entry.js +1 -0
  24. package/dist/taro-components/{p-7102ecf5.system.entry.js → p-d025a415.system.entry.js} +1 -1
  25. package/dist/taro-components/{p-d8fe59c7.entry.js → p-dadd02ca.entry.js} +1 -1
  26. package/dist/taro-components/p-ed331c06.system.js +1 -1
  27. package/dist/taro-components/taro-components.esm.js +1 -1
  28. package/dist/types/components/swiper/swiper-item.d.ts +3 -0
  29. package/dist/types/components/swiper/swiper.d.ts +1 -2
  30. package/dist/types/components.d.ts +14 -12
  31. package/lib/react/components.d.ts +1 -1
  32. package/lib/react/components.js +2 -2
  33. package/lib/react/components.js.map +1 -1
  34. package/lib/vue2/components.d.ts +1 -0
  35. package/lib/vue2/components.js +4 -3
  36. package/lib/vue2/components.js.map +1 -1
  37. package/lib/vue3/components.d.ts +1 -1
  38. package/lib/vue3/components.js +4 -3
  39. package/lib/vue3/components.js.map +1 -1
  40. package/package.json +7 -4
  41. package/types/Button.d.ts +5 -5
  42. package/types/Camera.d.ts +1 -1
  43. package/types/Canvas.d.ts +1 -1
  44. package/types/Checkbox.d.ts +5 -5
  45. package/types/CoverImage.d.ts +1 -1
  46. package/types/Form.d.ts +2 -2
  47. package/types/Icon.d.ts +3 -3
  48. package/types/Image.d.ts +3 -2
  49. package/types/Input.d.ts +15 -15
  50. package/types/Label.d.ts +1 -1
  51. package/types/NavigationBar.d.ts +1 -1
  52. package/types/Navigator.d.ts +1 -1
  53. package/types/Picker.d.ts +20 -20
  54. package/types/PickerView.d.ts +1 -1
  55. package/types/PickerViewColumn.d.ts +1 -1
  56. package/types/Progress.d.ts +1 -1
  57. package/types/Radio.d.ts +5 -5
  58. package/types/RadioGroup.d.ts +1 -1
  59. package/types/ScrollView.d.ts +4 -4
  60. package/types/Slider.d.ts +14 -14
  61. package/types/Slot.d.ts +1 -1
  62. package/types/Swiper.d.ts +11 -9
  63. package/types/SwiperItem.d.ts +6 -1
  64. package/types/Switch.d.ts +5 -5
  65. package/types/Text.d.ts +2 -2
  66. package/types/Textarea.d.ts +7 -7
  67. package/types/Video.d.ts +16 -16
  68. package/types/common.d.ts +2 -1
  69. package/dist/components/taro-pull-to-refresh.d.ts +0 -11
  70. package/dist/taro-components/p-60faf73e.system.entry.js +0 -1
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../types/components";
2
-
3
- interface TaroPullToRefresh extends Components.TaroPullToRefresh, HTMLElement {}
4
- export const TaroPullToRefresh: {
5
- prototype: TaroPullToRefresh;
6
- new (): TaroPullToRefresh;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1 +0,0 @@
1
- System.register(["./p-7e6b54cb.system.js","@tarojs/taro","./p-2ec68968.system.js"],(function(e){"use strict";var t,r,n,i,o,a,s;return{setters:[function(e){t=e.r;r=e.c;n=e.h;i=e.H;o=e.g},function(e){a=e.default},function(e){s=e.c}],execute:function(){var c=".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100%}.rmc-pull-to-refresh-transition{-webkit-transition:-webkit-transform 0.3s;transition:-webkit-transform 0.3s;transition:transform 0.3s;transition:transform 0.3s, -webkit-transform 0.3s}@-webkit-keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{display:inline-block;margin:3px;border-radius:100%;width:6px;height:6px;background-color:grey;-webkit-animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;-webkit-animation-fill-mode:both;animation-fill-mode:both}.rmc-pull-to-refresh-indicator>div:nth-child(0){-webkit-animation-delay:-0.1s !important;animation-delay:-0.1s !important}.rmc-pull-to-refresh-indicator>div:nth-child(1){-webkit-animation-delay:-0.2s !important;animation-delay:-0.2s !important}.rmc-pull-to-refresh-indicator>div:nth-child(2){-webkit-animation-delay:-0.3s !important;animation-delay:-0.3s !important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";function l(e,t){e.transform=t;e.webkitTransform=t;e.MozTransform=t}var u=typeof navigator!=="undefined"&&/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);var d={activate:"release",deactivate:"pull",release:"loading",finish:"finish"};var f=false;try{var h=Object.defineProperty({},"passive",{get:function(){f=true}});window.addEventListener("cancel",(function(){return{}}),h)}catch(e){}var p=f?{passive:false}:false;var v=e("taro_pull_to_refresh",function(){function e(e){var n=this;t(this,e);this.onRefresh=r(this,"refresh",7);this._ScreenY=0;this._startScreenY=0;this._lastScreenY=0;this._isMounted=false;this.triggerPullDownRefresh=function(e){if(!n.dragOnEdge&&n._isMounted){if(e){n._lastScreenY=n.distanceToRefresh+1;n.currSt="release";n.setContentStyle(n._lastScreenY)}else{n.currSt="finish";n.reset()}}};this.init=function(){var e=n.scrollContainer;var t=n.el.querySelector(".rmc-pull-to-refresh-content");n.el.appendChild=t===null||t===void 0?void 0:t.appendChild.bind(t);n.el.insertBefore=t===null||t===void 0?void 0:t.insertBefore.bind(t);n.el.replaceChild=t===null||t===void 0?void 0:t.replaceChild.bind(t);n.el.removeChild=t===null||t===void 0?void 0:t.removeChild.bind(t);n._to={touchstart:n.onTouchStart.bind(n,e),touchmove:n.onTouchMove.bind(n,e),touchend:n.onTouchEnd.bind(n,e),touchcancel:n.onTouchEnd.bind(n,e)};Object.keys(n._to).forEach((function(t){e.addEventListener(t,n._to[t],p)}))};this.destroy=function(){var e=n.scrollContainer;Object.keys(n._to).forEach((function(t){e.removeEventListener(t,n._to[t])}))};this.onTouchStart=function(e,t){n._ScreenY=n._startScreenY=t.touches[0].screenY;n._lastScreenY=n._lastScreenY||0};this.isEdge=function(e){var t=n.scrollContainer;if(t&&t===document.body){var r=document.scrollingElement?document.scrollingElement:document.body;return r.scrollTop<=0}return e.scrollTop<=0};this.damp=function(e){if(Math.abs(n._lastScreenY)>n.damping){return 0}var t=Math.abs(n._ScreenY-n._startScreenY)/window.screen.height;e*=(1-t)*.6;return e};this.onTouchMove=function(e,t){var r=t.touches[0].screenY;if(n._startScreenY>r){return}if(n.isEdge(e)){if(!n.dragOnEdge){n._ScreenY=n._startScreenY=t.touches[0].screenY;n.dragOnEdge=true}if(t.cancelable){t.preventDefault()}var i=Math.round(r-n._ScreenY);n._ScreenY=r;n._lastScreenY+=n.damp(i);n.setContentStyle(n._lastScreenY);if(Math.abs(n._lastScreenY)<n.distanceToRefresh){if(n.currSt!=="deactivate"){n.currSt="deactivate"}}else{if(n.currSt==="deactivate"){n.currSt="activate"}}if(u&&t.changedTouches[0].clientY<0){n.onTouchEnd()}}};this.onTouchEnd=function(){if(n.dragOnEdge){n.dragOnEdge=false}if(n.currSt==="activate"){n.currSt="release";n.onRefresh.emit(n);n._lastScreenY=n.distanceToRefresh+1;n.setContentStyle(n._lastScreenY)}else if(n.currSt==="release"){n._lastScreenY=n.distanceToRefresh+1;n.setContentStyle(n._lastScreenY)}else{n.reset()}};this.reset=function(){n._lastScreenY=0;n.setContentStyle(0)};this.setContentStyle=function(e){if(n.contentRef){if(e){l(n.contentRef.style,"translate3d(0px,".concat(e,"px,0)"))}else{l(n.contentRef.style,"")}}};this.prefixCls="rmc-pull-to-refresh";this.distanceToRefresh=50;this.damping=100;this.indicator=d;this.currSt="deactivate";this.dragOnEdge=false}Object.defineProperty(e.prototype,"scrollContainer",{get:function(){return this.el.parentElement||this.el.closest(".taro_page_stationed")||document.querySelector(".taro_page_stationed")||document.querySelector(".taro_page")||document.querySelector(".taro_router")||document.querySelector(".taro-tabbar__panel")||document.body},enumerable:false,configurable:true});e.prototype.statusChange=function(){var e,t,r,n;var i=this.scrollContainer;switch(this.currSt){case"release":(t=(e=i===null||i===void 0?void 0:i.__page)===null||e===void 0?void 0:e.onPullDownRefresh)===null||t===void 0?void 0:t.call(e);break;case"deactivate":(n=(r=i===null||i===void 0?void 0:i.__page)===null||r===void 0?void 0:r.onPullIntercept)===null||n===void 0?void 0:n.call(r)}};e.prototype.disconnectedCallback=function(){this.destroy()};e.prototype.componentDidLoad=function(){var e=this;this.init();this._isMounted=true;a.eventCenter.on("__taroStartPullDownRefresh",(function(t){var r=t.successHandler,n=t.errorHandler;try{e.triggerPullDownRefresh(true);r({errMsg:"startPullDownRefresh: ok"})}catch(e){n({errMsg:"startPullDownRefresh: fail"})}}));a.eventCenter.on("__taroStopPullDownRefresh",(function(t){var r=t.successHandler,n=t.errorHandler;try{e.triggerPullDownRefresh(false);r({errMsg:"stopPullDownRefresh: ok"})}catch(e){n({errMsg:"stopPullDownRefresh: fail"})}}))};e.prototype.render=function(){var e=this;var t=function(t){var r=e,i=r.currSt,o=r.dragOnEdge,a=r.prefixCls;var c=s(t,!o&&"".concat(a,"-transition"));var l=i==="activate"||i==="release";return n("div",{class:"".concat(a,"-content-wrapper")},n("div",{class:c,ref:function(t){e.contentRef=t}},l&&n("div",{class:"".concat(a,"-indicator")},n("div",null),n("div",null),n("div",null)),n("slot",null)))};if(this.scrollContainer){return t("".concat(this.prefixCls,"-content ").concat(this.prefixCls,"-down"))}return n(i,{class:s(this.prefixCls,"".concat(this.prefixCls,"-down"))},t("".concat(this.prefixCls,"-content")))};Object.defineProperty(e.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{currSt:["statusChange"]}},enumerable:false,configurable:true});return e}());v.style=c}}}));