@tarojs/components 3.5.7 → 3.5.8
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.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-button-core.cjs.entry.js +5 -0
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-movable-area-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-movable-view-core.cjs.entry.js +18 -43
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +5 -0
- package/dist/cjs/taro-video-control_3.cjs.entry.js +98 -181
- package/dist/collection/components/button/button.js +11 -0
- package/dist/collection/components/movable-area/area.css +2 -2
- package/dist/collection/components/movable-area/movable-view.js +18 -33
- package/dist/collection/components/swiper/swiper.js +23 -0
- package/dist/collection/components/video/video-control.js +22 -39
- package/dist/collection/components/video/video-danmu.js +39 -52
- package/dist/collection/components/video/video.js +37 -60
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-button-core.entry.js +5 -0
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-movable-area-core.entry.js +1 -1
- package/dist/esm/taro-movable-view-core.entry.js +18 -43
- package/dist/esm/taro-swiper-core_2.entry.js +5 -0
- package/dist/esm/taro-video-control_3.entry.js +98 -181
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-button-core.entry.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-movable-area-core.entry.js +1 -1
- package/dist/esm-es5/taro-movable-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-video-control_3.entry.js +55 -55
- package/dist/taro-components/p-0380841f.system.js +1 -1
- package/dist/taro-components/{p-a94524c9.system.entry.js → p-06b9d39c.system.entry.js} +1 -1
- package/dist/taro-components/{p-63a0c6b0.entry.js → p-34178401.entry.js} +1 -1
- package/dist/taro-components/p-3549b6d2.entry.js +1 -0
- package/dist/taro-components/p-4262d1b6.entry.js +1 -0
- package/dist/taro-components/{p-f8b9c4b0.entry.js → p-42630f45.entry.js} +1 -1
- package/dist/taro-components/{p-f81a74bb.system.entry.js → p-4c1a7cae.system.entry.js} +81 -81
- package/dist/taro-components/{p-3744e978.entry.js → p-99d17a1a.entry.js} +52 -52
- package/dist/taro-components/{p-13f0b11f.system.entry.js → p-a5496bf5.system.entry.js} +1 -1
- package/dist/taro-components/p-f40e1218.system.entry.js +1 -0
- package/dist/taro-components/{p-1c775a11.system.entry.js → p-f5f1c3b7.system.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/button/button.d.ts +1 -0
- package/dist/types/components/swiper/swiper.d.ts +4 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +15 -12
- package/types/Ad.d.ts +20 -21
- package/types/AnimationVideo.d.ts +62 -0
- package/types/AnimationView.d.ts +45 -0
- package/types/ArCamera.d.ts +50 -0
- package/types/Audio.d.ts +5 -5
- package/types/AwemeData.d.ts +43 -0
- package/types/Button.d.ts +67 -70
- package/types/Camera.d.ts +15 -16
- package/types/Canvas.d.ts +22 -27
- package/types/Checkbox.d.ts +7 -7
- package/types/CommentDetail.d.ts +72 -0
- package/types/CommentList.d.ts +128 -0
- package/types/ContactButton.d.ts +53 -0
- package/types/CoverImage.d.ts +15 -15
- package/types/CoverView.d.ts +5 -5
- package/types/FollowSwan.d.ts +28 -0
- package/types/Form.d.ts +10 -10
- package/types/Image.d.ts +20 -20
- package/types/InlinePaymentPanel.d.ts +58 -0
- package/types/Input.d.ts +23 -21
- package/types/Lifestyle.d.ts +26 -0
- package/types/Like.d.ts +107 -0
- package/types/LivePlayer.d.ts +31 -25
- package/types/LivePusher.d.ts +5 -5
- package/types/Login.d.ts +45 -0
- package/types/Lottie.d.ts +113 -0
- package/types/Map.d.ts +66 -71
- package/types/MovableView.d.ts +5 -14
- package/types/NativeSlot.d.ts +32 -0
- package/types/Navigator.d.ts +10 -10
- package/types/OpenData.d.ts +5 -5
- package/types/PageContainer.d.ts +7 -10
- package/types/PageMeta.d.ts +14 -14
- package/types/Picker.d.ts +1 -5
- package/types/PickerView.d.ts +11 -21
- package/types/Progress.d.ts +5 -5
- package/types/RadioGroup.d.ts +5 -5
- package/types/RichText.d.ts +17 -17
- package/types/RtcRoom.d.ts +104 -0
- package/types/RtcRoomItem.d.ts +26 -0
- package/types/ScrollView.d.ts +46 -30
- package/types/Slider.d.ts +10 -10
- package/types/Slot.d.ts +1 -1
- package/types/Swiper.d.ts +31 -19
- package/types/Switch.d.ts +5 -5
- package/types/TabItem.d.ts +35 -0
- package/types/Tabs.d.ts +58 -0
- package/types/Textarea.d.ts +32 -32
- package/types/Video.d.ts +120 -111
- package/types/View.d.ts +20 -13
- package/types/VoipRoom.d.ts +5 -5
- package/types/WebView.d.ts +11 -5
- package/types/index.vue3.d.ts +267 -259
- package/dist/taro-components/p-6800ac6f.entry.js +0 -1
- package/dist/taro-components/p-7f93fa08.entry.js +0 -1
- package/dist/taro-components/p-9e1572c5.system.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as t,h as r,H as a,g as e}from"./p-059912fd.js";import{c as i}from"./p-76724e58.js";let n=class{constructor(r){o(this,r),this.onSubmit=t(this,"tarobuttonsubmit",7),this.onReset=t(this,"tarobuttonreset",7),this.hoverClass="button-hover",this.type="",this.hoverStartTime=20,this.hoverStayTime=70,this.loading=!1,this.formType=null,this.hover=!1,this.touch=!1}onClick(o){this.disabled&&o.stopPropagation()}onTouchStart(){this.disabled||(this.touch=!0,this.hoverClass&&!this.disabled&&setTimeout((()=>{this.touch&&(this.hover=!0)}),this.hoverStartTime))}onTouchEnd(){this.disabled||(this.touch=!1,this.hoverClass&&!this.disabled&&setTimeout((()=>{this.touch||(this.hover=!1)}),this.hoverStayTime),"submit"===this.formType?this.onSubmit.emit():"reset"===this.formType&&this.onReset.emit())}render(){const{disabled:o,hoverClass:t,type:e,size:n,plain:b,loading:c,hover:d}=this,l=i({[`${t}`]:d&&!o});return r(a,{class:l,type:e,plain:b,loading:c,size:n,disabled:o},c&&r("i",{class:"weui-loading"}),r("slot",null))}get el(){return e(this)}};n.style='taro-button-core{display:block;overflow:hidden;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;margin-left:auto;margin-right:auto;padding-left:14px;padding-right:14px;border-width:0;border-radius:5px;width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;background-color:#f8f8f8;line-height:2.55555556;text-decoration:none;text-align:center;font-size:18px;color:#000;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}taro-button-core:focus{outline:0}taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0, 0, 0, 0.6)}taro-button-core::after{position:absolute;left:0;top:0;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid rgba(0, 0, 0, 0.2);border-radius:10px;width:200%;height:200%;content:" ";-webkit-transform:scale(0.5);transform:scale(0.5);-webkit-transform-origin:0 0;transform-origin:0 0}taro-button-core+taro-button-core{margin-top:15px}taro-button-core[type=default]{background-color:#f8f8f8;color:#000}taro-button-core[type=default]:not([disabled]):visited{color:#000}taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0, 0, 0, 0.6)}taro-button-core[size=mini]{display:inline-block;padding:0 1.32em;width:auto;line-height:2.3;font-size:13px}taro-button-core[plain],taro-button-core[plain][type=default],taro-button-core[plain][type=primary]{border-width:1px;background-color:transparent}taro-button-core[disabled]{color:rgba(255, 255, 255, 0.6)}taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0, 0, 0, 0.3)}taro-button-core[disabled][type=primary]{background-color:#9ed99d}taro-button-core[disabled][type=warn]{background-color:#ec8b89}taro-button-core[loading] .weui-loading{margin:-0.2em 0.34em 0 0}taro-button-core[loading][type=primary],taro-button-core[loading][type=warn]{color:rgba(255, 255, 255, 0.6)}taro-button-core[loading][type=primary]{background-color:#179b16}taro-button-core[loading][type=warn]{background-color:#ce3c39}taro-button-core[plain][type=primary]{border:1px solid #1aad19;color:#1aad19}taro-button-core[plain][type=primary]:not([disabled]):active{border-color:rgba(26, 173, 25, 0.6);background-color:transparent;color:rgba(26, 173, 25, 0.6)}taro-button-core[plain][type=primary]::after{border-width:0}taro-button-core[plain],taro-button-core[plain][type=default]{border:1px solid #353535;color:#353535}taro-button-core[plain]:not([disabled]):active,taro-button-core[plain][type=default]:not([disabled]):active{border-color:rgba(53, 53, 53, 0.6);background-color:transparent;color:rgba(53, 53, 53, 0.6)}taro-button-core[plain]::after,taro-button-core[plain][type=default]::after{border-width:0}taro-button-core[type=primary]{background-color:#1aad19;color:#fff}taro-button-core[type=primary]:not([disabled]):visited{color:#fff}taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:rgba(255, 255, 255, 0.6)}taro-button-core[type=warn]{background-color:#e64340;color:#fff}taro-button-core[type=warn]:not([disabled]):visited{color:#fff}taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:rgba(255, 255, 255, 0.6)}taro-button-core[plain][disabled]{border:1px solid rgba(0, 0, 0, 0.2);background-color:#f7f7f7;color:rgba(0, 0, 0, 0.3)}taro-button-core[plain][disabled][type=primary]{border:1px solid rgba(0, 0, 0, 0.2);background-color:#f7f7f7;color:rgba(0, 0, 0, 0.3)}';export{n as taro_button_core}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as i,g as h,H as e}from"./p-059912fd.js";let a=class{constructor(i){t(this,i),this.onChange=s(this,"change",7),this.onScale=s(this,"scale",7),this.onHTouchMove=s(this,"htouchmove",7),this.onVTouchMove=s(this,"vtouchmove",7),this.x=0,this.y=0,this.direction="none",this.outOfBounds=!1,this.inertia=!1,this.friction=2,this.damping=20,this.disabled=!1,this.scale=!1,this.scaleMin=.5,this.scaleMax=10,this.scaleValue=1,this.animation=!0,this.translateX=0,this.translateY=0,this.origin={x:0,y:0},this.area={width:0,height:0},this.originScale=1,this.currentScale=1,this.width=0,this.height=0,this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.baseX=0,this.baseY=0,this.offset={x:0,y:0},this.scaleOffset={x:0,y:0},this.getLimitXY=(t,s)=>{let i=!1;return t>this.maxX?(t=this.maxX,i=!0):t<this.minX&&(t=this.minX,i=!0),s>this.maxY?(s=this.maxY,i=!0):s<this.minY&&(s=this.minY,i=!0),{x:t,y:s,outOfBounds:i}},this.animationTo=(t,s,i,h,e,a,n)=>{this.animation?(this.setTransform(t,s,i,h,e,a),null==n||n()):this.setTransform(t,s,i,h,e,a)},this.setTransform=(t,s,i,h,e,a)=>{if(t=Number(t.toFixed(1)),s=Number(s.toFixed(1)),i=Number((null!=i?i:this.currentScale).toFixed(3)),!this.outOfBounds){const i=this.getLimitXY(t,s);t=i.x,s=i.y}const n=(t,s)=>+((1e3*t-1e3*s)/1e3).toFixed(1),c=n(t,this.scaleOffset.x),r=n(s,this.scaleOffset.y);this.translateX===t&&this.translateY===s||!e&&this.onChange.emit({x:c,y:r,source:h}),i!==this.currentScale&&a&&this.onScale.emit({scale:i,x:c,y:r});const o=`translateX(${t}px) translateY(${s}px) translateZ(0px) scale(${i})`;this.element.style.transform=o,this.element.style.webkitTransform=o,this.translateX=t,this.translateY=s,this.currentScale=i},this.updateOffset=()=>{const t=(s,i)=>{if(s===i||!s.offsetParent)return{left:0,top:0};const h=t(s.offsetParent,i);return{left:s.offsetLeft+h.left,top:s.offsetTop+h.top}};if(!this.parent)return;const s=t(this.element,this.parent);this.offset.x=s.left,this.offset.y=s.top},this.updateScaleOffset=(t=this.currentScale)=>{const s=this.element.getBoundingClientRect();this.height=s.height/this.currentScale,this.width=s.width/this.currentScale,this.scaleOffset.x=(this.width*t-this.width)/2,this.scaleOffset.y=(this.height*t-this.height)/2},this.updateBoundary=()=>{const t=0-this.offset.x+this.scaleOffset.x,s=this.area.width-this.width-this.offset.x-this.scaleOffset.x;this.minX=Math.min(t,s),this.maxX=Math.max(t,s);const i=0-this.offset.y+this.scaleOffset.y,h=this.area.height-this.height-this.offset.y-this.scaleOffset.y;this.minY=Math.min(i,h),this.maxY=Math.max(i,h)},this.updateScale=(t,s,i)=>{if(!this.scale)return;const h=this.adjustScale(t);this.updateScaleOffset(h),this.updateBoundary();const{x:e,y:a}=this.getLimitXY(this.translateX,this.translateY);s?this.animationTo(e,a,h,"",!0,!0,i):this.updating||(this.updating=!0,requestAnimationFrame((()=>{this.setTransform(e,a,h,"",!0,!0),this.updating=!1})))},this.setOriginScale=t=>{this.originScale=t},this.adjustScale=t=>Math.min(10,this.scaleMax,Math.max(.5,this.scaleMin,t)),this.handleTouchStart=t=>{const s=t.touches;if(this.disabled||s.length>1||!this.element)return;const i=s[0];this.touching=!0,this.firstMoveFireEvent=!1,this.origin.x=i.screenX,this.origin.y=i.screenY,this.baseX=this.translateX,this.baseY=this.translateY,this.element.style.willChange="transform"},this.handleTouchMove=t=>{const s=t.touches;if(this.disabled||!this.element||this.scaling||!this.touching||s.length>1)return;t.preventDefault();const i=s[0],h=i.screenX-this.origin.x,e=i.screenY-this.origin.y;this.setTransform(this.xMove?h+this.baseX:0,this.yMove?e+this.baseY:0),this.firstMoveFireEvent||(this.firstMoveFireEvent=!0,(Math.abs(h)>Math.abs(e)?this.onHTouchMove:this.onVTouchMove).emit({originalEvent:t,bubbles:!1,capturePhase:!1,composed:!0,extraFields:{touches:t.touches||{},changedTouches:t.changedTouches||{}}}))},this.handleTouchEnd=t=>{const s=t.changedTouches[0];!this.disabled&&this.touching&&s&&(this.touching=!1,this.setTransform(this.xMove?s.screenX-this.origin.x+this.baseX:0,this.yMove?s.screenY-this.origin.y+this.baseY:0))}}watchX(t){this.setTransform(parseFloat(`${t||0}`),this.translateY)}watchY(t){this.setTransform(this.translateX,parseFloat(`${t||0}`))}watchScaleMinOrMax(){if(!this.scale)return!1;this.updateScale(this.currentScale,!0),this.setOriginScale(this.currentScale)}watchScaleValue(t){return!!this.scale&&(this.updateScale(t,!0),this.setOriginScale(t),t)}async setParent({element:t,area:s}){const i=this.scale?this.scaleValue:1;this.area=s,this.parent=t,this.updateOffset(),this.updateScaleOffset(i),this.updateBoundary(),this.setTransform(Number(this.x)+this.scaleOffset.x,Number(this.y)+this.scaleOffset.y,i,"",!0),this.setOriginScale(i)}async endScale(){this.scaling=!1,this.setOriginScale(this.currentScale)}async setScale(t){this.scale&&(this.scaling=!0,this.updateScale(t*this.originScale))}connectedCallback(){this.observer=new MutationObserver((t=>{t.forEach((t=>{const s=t.attributeName;if(s&&["class","style"].includes(s)){const i=t.oldValue,h=t.target.getAttribute(s);if(i===h)return;const e=t=>null==t?void 0:t.split(";").filter((t=>!["transform","will-change"].find((s=>t.trim().startsWith(s))))).join(";");if("style"===s&&e(h)===e(i))return;this.updateOffset(),this.updateScaleOffset(),this.updateBoundary(),this.setTransform(this.translateX,this.translateY)}}))})),this.observer.observe(this.element,{attributes:!0,attributeOldValue:!0})}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}componentDidLoad(){if(this.element.style.transformOrigin="center",this.xMove=["horizontal","all"].includes(this.direction),this.yMove=["vertical","all"].includes(this.direction),this.friction<=0&&(this.friction=2),this.x||this.y){const t=parseFloat(`${this.x||0}`),s=parseFloat(`${this.y||0}`);this.setTransform(t,s)}}render(){return i(e,{onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd})}get element(){return h(this)}static get watchers(){return{x:["watchX"],y:["watchY"],scaleMin:["watchScaleMinOrMax"],scaleMax:["watchScaleMinOrMax"],scaleValue:["watchScaleValue"]}}};a.style="taro-movable-view-core{display:inline-block;position:absolute;left:0;top:0;width:10px;height:10px}";export{a as taro_movable_view_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as i,g as s,H as o}from"./p-059912fd.js";let h=class{constructor(i){t(this,i),this.views=[],this.scaleLength=0,this.viewsChanged=()=>{this.views=[];const t=this.element.querySelectorAll("taro-movable-view-core");Array.from(t).forEach((t=>{this.views.push(t)})),this.updateArea()},this.handleTouchStart=t=>{const i=t.touches;if(!i||i.length<=1)return;const s=i[1].pageX-i[0].pageX,o=i[1].pageY-i[0].pageY;if(this.scaleLength=Math.sqrt(s*s+o*o),this.scaleArea)return;const h=(t,i)=>{const s=(t,i)=>!!(t=t.parentNode)&&(!(t instanceof HTMLElement)||t!==document.body)&&(t===i||t===i.element||t.element===i||s(t,i));for(let o=0;o<i.length;o++){const h=i[o];if(t===h.element||s(t,h))return h}},e=h(i[0].target,this.views),r=h(i[1].target,this.views);this.scaleTarget=e&&e===r?e:void 0},this.handleTouchMove=t=>{const i=t.touches;if(!i||i.length<=1)return;t.preventDefault();const s=i[1].pageX-i[0].pageX,o=i[1].pageY-i[0].pageY;this.scaleLength>0&&this.updateScale(Math.sqrt(s*s+o*o)/this.scaleLength)},this.handleTouchEnd=t=>{var i,s;t.touches&&t.touches.length||!t.changedTouches||(this.scaleLength=0,this.scaleArea?this.views.forEach((t=>{var i;null===(i=t.endScale)||void 0===i||i.call(t)})):null===(s=null===(i=this.scaleTarget)||void 0===i?void 0:i.endScale)||void 0===s||s.call(i),this.scaleTarget=void 0)},this.updateScale=t=>{var i,s;t&&1!==t&&(this.scaleArea?this.views.forEach((i=>{var s;null===(s=i.setScale)||void 0===s||s.call(i,t)})):null===(s=null===(i=this.scaleTarget)||void 0===i?void 0:i.setScale)||void 0===s||s.call(i,t))},this.updateArea=()=>{const t=window.getComputedStyle(this.element),i=this.element.getBoundingClientRect(),s=["Left","Right"].map((i=>parseFloat(t["border"+i+"Width"])+parseFloat(t["padding"+i]))),o=["Top","Bottom"].map((i=>parseFloat(t["border"+i+"Width"])+parseFloat(t["padding"+i])));this.views.forEach((t=>{var h;null===(h=t.setParent)||void 0===h||h.call(t,{element:this.element,area:{height:i.height-o[0]-o[1],width:i.width-s[0]-s[1]}})}))}}connectedCallback(){this.observer=new MutationObserver((t=>{t.forEach((t=>{var i,s;if("class"===t.attributeName||"style"===t.attributeName){const t=this.element.offsetWidth,o=this.element.offsetHeight;t===(null===(i=this.offset)||void 0===i?void 0:i.width)&&o===(null===(s=this.offset)||void 0===s?void 0:s.height)||this.updateArea(),this.offset={width:t,height:o}}}))})),this.observer.observe(this.element,{attributes:!0})}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}componentDidLoad(){this.viewsChanged()}render(){return i(o,{onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd})}get element(){return s(this)}};h.style="taro-movable-area-core{display:block;
|
|
1
|
+
import{r as t,h as i,g as s,H as o}from"./p-059912fd.js";let h=class{constructor(i){t(this,i),this.views=[],this.scaleLength=0,this.viewsChanged=()=>{this.views=[];const t=this.element.querySelectorAll("taro-movable-view-core");Array.from(t).forEach((t=>{this.views.push(t)})),this.updateArea()},this.handleTouchStart=t=>{const i=t.touches;if(!i||i.length<=1)return;const s=i[1].pageX-i[0].pageX,o=i[1].pageY-i[0].pageY;if(this.scaleLength=Math.sqrt(s*s+o*o),this.scaleArea)return;const h=(t,i)=>{const s=(t,i)=>!!(t=t.parentNode)&&(!(t instanceof HTMLElement)||t!==document.body)&&(t===i||t===i.element||t.element===i||s(t,i));for(let o=0;o<i.length;o++){const h=i[o];if(t===h.element||s(t,h))return h}},e=h(i[0].target,this.views),r=h(i[1].target,this.views);this.scaleTarget=e&&e===r?e:void 0},this.handleTouchMove=t=>{const i=t.touches;if(!i||i.length<=1)return;t.preventDefault();const s=i[1].pageX-i[0].pageX,o=i[1].pageY-i[0].pageY;this.scaleLength>0&&this.updateScale(Math.sqrt(s*s+o*o)/this.scaleLength)},this.handleTouchEnd=t=>{var i,s;t.touches&&t.touches.length||!t.changedTouches||(this.scaleLength=0,this.scaleArea?this.views.forEach((t=>{var i;null===(i=t.endScale)||void 0===i||i.call(t)})):null===(s=null===(i=this.scaleTarget)||void 0===i?void 0:i.endScale)||void 0===s||s.call(i),this.scaleTarget=void 0)},this.updateScale=t=>{var i,s;t&&1!==t&&(this.scaleArea?this.views.forEach((i=>{var s;null===(s=i.setScale)||void 0===s||s.call(i,t)})):null===(s=null===(i=this.scaleTarget)||void 0===i?void 0:i.setScale)||void 0===s||s.call(i,t))},this.updateArea=()=>{const t=window.getComputedStyle(this.element),i=this.element.getBoundingClientRect(),s=["Left","Right"].map((i=>parseFloat(t["border"+i+"Width"])+parseFloat(t["padding"+i]))),o=["Top","Bottom"].map((i=>parseFloat(t["border"+i+"Width"])+parseFloat(t["padding"+i])));this.views.forEach((t=>{var h;null===(h=t.setParent)||void 0===h||h.call(t,{element:this.element,area:{height:i.height-o[0]-o[1],width:i.width-s[0]-s[1]}})}))}}connectedCallback(){this.observer=new MutationObserver((t=>{t.forEach((t=>{var i,s;if("class"===t.attributeName||"style"===t.attributeName){const t=this.element.offsetWidth,o=this.element.offsetHeight;t===(null===(i=this.offset)||void 0===i?void 0:i.width)&&o===(null===(s=this.offset)||void 0===s?void 0:s.height)||this.updateArea(),this.offset={width:t,height:o}}}))})),this.observer.observe(this.element,{attributes:!0})}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}componentDidLoad(){this.viewsChanged()}render(){return i(o,{onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd})}get element(){return s(this)}};h.style="taro-movable-area-core{display:block;position:relative;width:10px;height:10px}";export{h as taro_movable_area_core}
|