@tarojs/components 4.3.1-alpha.4 → 4.3.1-alpha.5

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.
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy(JSON.parse("[[\"taro-checkbox-core_2.cjs\",[[4,\"taro-checkbox-core\",{\"name\":[1],\"value\":[1032],\"color\":[1],\"id\":[1025],\"checked\":[4],\"disabled\":[4],\"nativeProps\":[16],\"isWillLoadCalled\":[32]}],[0,\"taro-checkbox-group-core\",{\"name\":[8]},[[0,\"checkboxchange\",\"function\"]]]]],[\"taro-movable-area-core_2.cjs\",[[0,\"taro-movable-area-core\",{\"scaleArea\":[4,\"scale-area\"]}],[0,\"taro-movable-view-core\",{\"x\":[8],\"y\":[8],\"direction\":[1],\"outOfBounds\":[4,\"out-of-bounds\"],\"inertia\":[4],\"friction\":[2],\"damping\":[2],\"disabled\":[4],\"scale\":[4],\"scaleMin\":[2,\"scale-min\"],\"scaleMax\":[2,\"scale-max\"],\"scaleValue\":[2,\"scale-value\"],\"animation\":[4],\"setParent\":[64],\"endScale\":[64],\"setScale\":[64]}]]],[\"taro-picker-view-column-core_2.cjs\",[[0,\"taro-picker-view-column-core\",{\"col\":[1],\"initialPosition\":[1,\"initial-position\"],\"paddingVertical\":[2,\"padding-vertical\"],\"isInit\":[32]},[[1,\"touchstart\",\"onTouchStart\"],[1,\"touchend\",\"onTouchEnd\"]]],[4,\"taro-picker-view-core\",{\"indicatorStyle\":[1,\"indicator-style\"],\"indicatorClass\":[1,\"indicator-class\"],\"value\":[16],\"maskStyle\":[1,\"mask-style\"],\"maskClass\":[1,\"mask-class\"]},[[0,\"onselect\",\"onSelect\"],[0,\"onselectstart\",\"onSelectStart\"],[0,\"onselectend\",\"onPickerColEnd\"]]]]],[\"taro-radio-core_2.cjs\",[[4,\"taro-radio-core\",{\"name\":[1],\"value\":[1],\"id\":[1025],\"checked\":[1540],\"disabled\":[4],\"nativeProps\":[16],\"isWillLoadCalled\":[32]}],[0,\"taro-radio-group-core\",{\"name\":[8]},[[0,\"radiochange\",\"function\"]]]]],[\"taro-swiper-core_2.cjs\",[[4,\"taro-swiper-core\",{\"indicatorDots\":[4,\"indicator-dots\"],\"indicatorColor\":[1,\"indicator-color\"],\"indicatorActiveColor\":[1,\"indicator-active-color\"],\"autoplay\":[4],\"current\":[2],\"currentItemId\":[1,\"current-item-id\"],\"interval\":[2],\"duration\":[2],\"circular\":[4],\"vertical\":[4],\"previousMargin\":[1,\"previous-margin\"],\"nextMargin\":[1,\"next-margin\"],\"displayMultipleItems\":[2,\"display-multiple-items\"],\"full\":[4],\"zoom\":[4],\"effectsProps\":[16],\"swiperWrapper\":[32],\"swiper\":[32],\"isWillLoadCalled\":[32],\"observer\":[32]}],[4,\"taro-swiper-item-core\",{\"itemId\":[1,\"item-id\"]}]]],[\"taro-ad-core.cjs\",[[0,\"taro-ad-core\"]]],[\"taro-ad-custom-core.cjs\",[[0,\"taro-ad-custom-core\"]]],[\"taro-animation-video-core.cjs\",[[0,\"taro-animation-video-core\"]]],[\"taro-animation-view-core.cjs\",[[0,\"taro-animation-view-core\"]]],[\"taro-ar-camera-core.cjs\",[[0,\"taro-ar-camera-core\"]]],[\"taro-audio-core.cjs\",[[0,\"taro-audio-core\",{\"src\":[1],\"controls\":[4],\"autoplay\":[4],\"loop\":[4],\"muted\":[4],\"nativeProps\":[16]}]]],[\"taro-aweme-data-core.cjs\",[[0,\"taro-aweme-data-core\"]]],[\"taro-block-core.cjs\",[[0,\"taro-block-core\"]]],[\"taro-button-core.cjs\",[[4,\"taro-button-core\",{\"disabled\":[516],\"hoverClass\":[1,\"hover-class\"],\"type\":[1],\"hoverStartTime\":[2,\"hover-start-time\"],\"hoverStayTime\":[2,\"hover-stay-time\"],\"size\":[1],\"plain\":[4],\"loading\":[4],\"formType\":[513,\"form-type\"],\"hover\":[32],\"touch\":[32]},[[0,\"click\",\"onClick\"],[1,\"touchstart\",\"onTouchStart\"],[1,\"touchend\",\"onTouchEnd\"]]]]],[\"taro-camera-core.cjs\",[[0,\"taro-camera-core\"]]],[\"taro-canvas-core.cjs\",[[0,\"taro-canvas-core\",{\"canvasId\":[1,\"id\"],\"height\":[1537],\"width\":[1537],\"nativeProps\":[16]}]]],[\"taro-channel-live-core.cjs\",[[0,\"taro-channel-live-core\"]]],[\"taro-channel-video-core.cjs\",[[0,\"taro-channel-video-core\"]]],[\"taro-comment-detail-core.cjs\",[[0,\"taro-comment-detail-core\"]]],[\"taro-comment-list-core.cjs\",[[0,\"taro-comment-list-core\"]]],[\"taro-contact-button-core.cjs\",[[0,\"taro-contact-button-core\"]]],[\"taro-cover-image-core.cjs\",[[0,\"taro-cover-image-core\",{\"src\":[1],\"nativeProps\":[16]}]]],[\"taro-cover-view-core.cjs\",[[4,\"taro-cover-view-core\",{\"animation\":[1],\"hoverClass\":[1,\"hover-class\"],\"hoverStartTime\":[2,\"hover-start-time\"],\"hoverStayTime\":[2,\"hover-stay-time\"],\"hover\":[32],\"touch\":[32]},[[1,\"touchstart\",\"onTouchStart\"],[1,\"touchmove\",\"onTouchMove\"],[1,\"touchend\",\"onTouchEnd\"]]]]],[\"taro-custom-wrapper-core.cjs\",[[0,\"taro-custom-wrapper-core\"]]],[\"taro-double-tap-gesture-handler-core.cjs\",[[0,\"taro-double-tap-gesture-handler-core\"]]],[\"taro-draggable-sheet-core.cjs\",[[0,\"taro-draggable-sheet-core\"]]],[\"taro-editor-core.cjs\",[[0,\"taro-editor-core\"]]],[\"taro-follow-swan-core.cjs\",[[0,\"taro-follow-swan-core\"]]],[\"taro-force-press-gesture-handler-core.cjs\",[[0,\"taro-force-press-gesture-handler-core\"]]],[\"taro-form-core.cjs\",[[4,\"taro-form-core\",null,[[0,\"tarobuttonsubmit\",\"onButtonSubmit\"],[0,\"tarobuttonreset\",\"onButtonReset\"]]]]],[\"taro-functional-page-navigator-core.cjs\",[[0,\"taro-functional-page-navigator-core\"]]],[\"taro-grid-builder-core.cjs\",[[0,\"taro-grid-builder-core\"]]],[\"taro-grid-view-core.cjs\",[[0,\"taro-grid-view-core\"]]],[\"taro-horizontal-drag-gesture-handler-core.cjs\",[[0,\"taro-horizontal-drag-gesture-handler-core\"]]],[\"taro-icon-core.cjs\",[[0,\"taro-icon-core\",{\"type\":[1],\"size\":[8],\"color\":[1]}]]],[\"taro-image-core.cjs\",[[0,\"taro-image-core\",{\"src\":[1],\"mode\":[1],\"lazyLoad\":[4,\"lazy-load\"],\"nativeProps\":[16],\"disableDefaultSize\":[4,\"disable-default-size\"],\"didLoad\":[32]}]]],[\"taro-inline-payment-panel-core.cjs\",[[0,\"taro-inline-payment-panel-core\"]]],[\"taro-input-core.cjs\",[[0,\"taro-input-core\",{\"value\":[1025],\"type\":[1],\"password\":[4],\"placeholder\":[1],\"disabled\":[4],\"maxlength\":[2],\"autoFocus\":[4,\"focus\"],\"confirmType\":[1,\"confirm-type\"],\"name\":[1],\"readonly\":[4],\"nativeProps\":[16],\"focus\":[64]}]]],[\"taro-keyboard-accessory-core.cjs\",[[0,\"taro-keyboard-accessory-core\"]]],[\"taro-label-core.cjs\",[[4,\"taro-label-core\",{\"for\":[1]}]]],[\"taro-lifestyle-core.cjs\",[[0,\"taro-lifestyle-core\"]]],[\"taro-like-core.cjs\",[[0,\"taro-like-core\"]]],[\"taro-list-builder-core.cjs\",[[0,\"taro-list-builder-core\"]]],[\"taro-list-view-core.cjs\",[[0,\"taro-list-view-core\"]]],[\"taro-live-player-core.cjs\",[[0,\"taro-live-player-core\"]]],[\"taro-live-pusher-core.cjs\",[[0,\"taro-live-pusher-core\"]]],[\"taro-login-core.cjs\",[[0,\"taro-login-core\"]]],[\"taro-long-press-gesture-handler-core.cjs\",[[0,\"taro-long-press-gesture-handler-core\"]]],[\"taro-lottie-core.cjs\",[[0,\"taro-lottie-core\"]]],[\"taro-map-core.cjs\",[[0,\"taro-map-core\",{\"latitude\":[2],\"longitude\":[2],\"scale\":[2],\"minScale\":[2,\"min-scale\"],\"maxScale\":[2,\"max-scale\"],\"markers\":[16],\"polyline\":[16],\"circles\":[16],\"polygons\":[16],\"subkey\":[1],\"layerStyle\":[2,\"layer-style\"],\"rotate\":[2],\"skew\":[2],\"showCompass\":[4,\"show-compass\"],\"showScale\":[4,\"show-scale\"],\"enableOverlooking\":[4,\"enable-overlooking\"],\"enableZoom\":[4,\"enable-zoom\"],\"enableScroll\":[4,\"enable-scroll\"],\"enableRotate\":[4,\"enable-rotate\"],\"enableSatellite\":[4,\"enable-satellite\"],\"enableTraffic\":[4,\"enable-traffic\"],\"enableBuilding\":[4,\"enable-building\"],\"enableAutoMaxOverlooking\":[4,\"enable-auto-max-overlooking\"],\"enable3D\":[4,\"enable-3-d\"],\"width\":[1],\"height\":[1]}]]],[\"taro-match-media-core.cjs\",[[0,\"taro-match-media-core\"]]],[\"taro-native-slot-core.cjs\",[[0,\"taro-native-slot-core\"]]],[\"taro-navigation-bar-core.cjs\",[[0,\"taro-navigation-bar-core\"]]],[\"taro-navigator-core.cjs\",[[0,\"taro-navigator-core\",{\"hoverClass\":[1,\"hover-class\"],\"url\":[1],\"openType\":[1,\"open-type\"],\"isHover\":[4,\"is-hover\"],\"delta\":[2]},[[0,\"click\",\"onClick\"]]]]],[\"taro-nested-scroll-body-core.cjs\",[[0,\"taro-nested-scroll-body-core\"]]],[\"taro-nested-scroll-header-core.cjs\",[[0,\"taro-nested-scroll-header-core\"]]],[\"taro-official-account-core.cjs\",[[0,\"taro-official-account-core\"]]],[\"taro-open-container-core.cjs\",[[0,\"taro-open-container-core\"]]],[\"taro-open-data-core.cjs\",[[0,\"taro-open-data-core\"]]],[\"taro-open-embedded-atomicservice-core.cjs\",[[0,\"taro-open-embedded-atomicservice-core\"]]],[\"taro-page-container-core.cjs\",[[0,\"taro-page-container-core\"]]],[\"taro-page-meta-core.cjs\",[[0,\"taro-page-meta-core\"]]],[\"taro-pan-gesture-handler-core.cjs\",[[0,\"taro-pan-gesture-handler-core\"]]],[\"taro-progress-core.cjs\",[[0,\"taro-progress-core\",{\"percent\":[2],\"showInfo\":[4,\"show-info\"],\"borderRadius\":[8,\"border-radius\"],\"fontSize\":[8,\"font-size\"],\"strokeWidth\":[8,\"stroke-width\"],\"activeColor\":[1,\"active-color\"],\"backgroundColor\":[1,\"background-color\"],\"active\":[4]}]]],[\"taro-pull-to-refresh-core.cjs\",[[4,\"taro-pull-to-refresh-core\",{\"prefixCls\":[1,\"prefix-cls\"],\"distanceToRefresh\":[2,\"distance-to-refresh\"],\"damping\":[2],\"indicator\":[16],\"currSt\":[32],\"dragOnEdge\":[32]}]]],[\"taro-rich-text-core.cjs\",[[0,\"taro-rich-text-core\",{\"nodes\":[1],\"selectable\":[1028],\"userSelect\":[1028,\"user-select\"],\"space\":[1]}]]],[\"taro-root-portal-core.cjs\",[[0,\"taro-root-portal-core\"]]],[\"taro-rtc-room-core.cjs\",[[0,\"taro-rtc-room-core\"]]],[\"taro-rtc-room-item-core.cjs\",[[0,\"taro-rtc-room-item-core\"]]],[\"taro-scale-gesture-handler-core.cjs\",[[0,\"taro-scale-gesture-handler-core\"]]],[\"taro-script-core.cjs\",[[0,\"taro-script-core\"]]],[\"taro-scroll-view-core.cjs\",[[4,\"taro-scroll-view-core\",{\"scrollX\":[4,\"scroll-x\"],\"scrollY\":[4,\"scroll-y\"],\"upperThreshold\":[8,\"upper-threshold\"],\"lowerThreshold\":[8,\"lower-threshold\"],\"mpScrollTop\":[520,\"scroll-top\"],\"mpScrollLeft\":[520,\"scroll-left\"],\"mpScrollIntoView\":[513,\"scroll-into-view\"],\"mpScrollIntoViewAlignment\":[1,\"scroll-into-view-alignment\"],\"animated\":[4,\"scroll-with-animation\"],\"enhanced\":[4],\"showScrollbar\":[4,\"show-scrollbar\"],\"stopTouchMovePropagation\":[4,\"stop-touch-move-propagation\"],\"mpScrollToMethod\":[64],\"mpScrollIntoViewMethod\":[64]},[[1,\"scroll\",\"handleScroll\"],[1,\"touchmove\",\"handleTouchMove\"]]]]],[\"taro-share-element-core.cjs\",[[0,\"taro-share-element-core\"]]],[\"taro-slider-core.cjs\",[[0,\"taro-slider-core\",{\"min\":[2],\"max\":[2],\"step\":[2],\"disabled\":[4],\"value\":[1538],\"activeColor\":[1,\"active-color\"],\"backgroundColor\":[1,\"background-color\"],\"blockSize\":[2,\"block-size\"],\"blockColor\":[1,\"block-color\"],\"showValue\":[4,\"show-value\"],\"name\":[1],\"totalWidth\":[32],\"touching\":[32],\"ogX\":[32],\"touchId\":[32],\"percent\":[32],\"ogPercent\":[32],\"isWillLoadCalled\":[32]}]]],[\"taro-slot-core.cjs\",[[0,\"taro-slot-core\"]]],[\"taro-snapshot-core.cjs\",[[0,\"taro-snapshot-core\"]]],[\"taro-span-core.cjs\",[[0,\"taro-span-core\"]]],[\"taro-sticky-header-core.cjs\",[[0,\"taro-sticky-header-core\"]]],[\"taro-sticky-section-core.cjs\",[[0,\"taro-sticky-section-core\"]]],[\"taro-switch-core.cjs\",[[0,\"taro-switch-core\",{\"type\":[1],\"checked\":[1028],\"color\":[1],\"name\":[1],\"disabled\":[4],\"nativeProps\":[16],\"isWillLoadCalled\":[32]}]]],[\"taro-tab-item-core.cjs\",[[0,\"taro-tab-item-core\"]]],[\"taro-tabbar.cjs\",[[0,\"taro-tabbar\",{\"conf\":[16],\"list\":[32],\"borderStyle\":[32],\"backgroundColor\":[32],\"color\":[32],\"selectedColor\":[32],\"selectedIndex\":[32],\"status\":[32]}]]],[\"taro-tabs-core.cjs\",[[0,\"taro-tabs-core\"]]],[\"taro-tap-gesture-handler-core.cjs\",[[0,\"taro-tap-gesture-handler-core\"]]],[\"taro-text-core.cjs\",[[4,\"taro-text-core\",{\"selectable\":[1028],\"userSelect\":[1028,\"user-select\"],\"space\":[1025],\"numberOfLines\":[2,\"number-of-lines\"]}]]],[\"taro-textarea-core.cjs\",[[0,\"taro-textarea-core\",{\"value\":[1025],\"placeholder\":[1],\"disabled\":[4],\"maxlength\":[2],\"autoFocus\":[4,\"focus\"],\"autoHeight\":[4,\"auto-height\"],\"name\":[1],\"nativeProps\":[16],\"line\":[32],\"compositionValue\":[32],\"focus\":[64]}]]],[\"taro-vertical-drag-gesture-handler-core.cjs\",[[0,\"taro-vertical-drag-gesture-handler-core\"]]],[\"taro-view-core.cjs\",[[4,\"taro-view-core\",{\"animation\":[1],\"hoverClass\":[1,\"hover-class\"],\"hoverStartTime\":[2,\"hover-start-time\"],\"hoverStayTime\":[2,\"hover-stay-time\"],\"hover\":[32],\"touch\":[32]},[[1,\"touchstart\",\"onTouchStart\"],[1,\"touchmove\",\"onTouchMove\"],[1,\"touchend\",\"onTouchEnd\"]]]]],[\"taro-voip-room-core.cjs\",[[0,\"taro-voip-room-core\"]]],[\"taro-web-view-core.cjs\",[[0,\"taro-web-view-core\",{\"src\":[1]}]]],[\"taro-picker-core_2.cjs\",[[4,\"taro-picker-core\",{\"mode\":[1],\"disabled\":[4],\"range\":[16],\"rangeKey\":[1,\"range-key\"],\"value\":[1032],\"start\":[1],\"end\":[1],\"fields\":[1],\"name\":[1],\"textProps\":[16],\"pickerValue\":[32],\"height\":[32],\"hidden\":[32],\"fadeOut\":[32],\"isWillLoadCalled\":[32]}],[0,\"taro-picker-group\",{\"mode\":[1],\"range\":[16],\"rangeKey\":[1,\"range-key\"],\"height\":[2],\"columnId\":[1,\"column-id\"],\"updateHeight\":[16],\"updateDay\":[16],\"startY\":[32],\"preY\":[32],\"hadMove\":[32],\"touchEnd\":[32],\"isMove\":[32],\"handleMoveStart\":[64],\"handleMoving\":[64],\"handleMoveEnd\":[64]},[[1,\"mousedown\",\"onMouseDown\"],[3,\"mousemove\",\"onMouseMove\"],[1,\"mouseup\",\"onMouseMoveEnd\"],[1,\"mouseleave\",\"onMouseMoveEnd\"],[1,\"touchstart\",\"onTouchStart\"],[3,\"touchmove\",\"onTouchMove\"],[1,\"touchend\",\"onTouchEnd\"]]]]],[\"taro-video-control_3.cjs\",[[0,\"taro-video-core\",{\"src\":[1],\"duration\":[2],\"controls\":[4],\"autoplay\":[4],\"loop\":[4],\"muted\":[4],\"initialTime\":[2,\"initial-time\"],\"poster\":[1],\"objectFit\":[1,\"object-fit\"],\"showProgress\":[4,\"show-progress\"],\"showFullscreenBtn\":[4,\"show-fullscreen-btn\"],\"showPlayBtn\":[4,\"show-play-btn\"],\"showCenterPlayBtn\":[4,\"show-center-play-btn\"],\"showMuteBtn\":[4,\"show-mute-btn\"],\"danmuList\":[16],\"danmuBtn\":[4,\"danmu-btn\"],\"enableDanmu\":[4,\"enable-danmu\"],\"enablePlayGesture\":[4,\"enable-play-gesture\"],\"enableProgressGesture\":[4,\"enable-progress-gesture\"],\"vslideGesture\":[4,\"vslide-gesture\"],\"vslideGestureInFullscreen\":[4,\"vslide-gesture-in-fullscreen\"],\"nativeProps\":[16],\"_duration\":[32],\"_enableDanmu\":[32],\"isPlaying\":[32],\"isFirst\":[32],\"isFullScreen\":[32],\"fullScreenTimestamp\":[32],\"isMute\":[32],\"getHlsObject\":[64],\"play\":[64],\"pause\":[64],\"stop\":[64],\"seek\":[64],\"requestFullScreen\":[64],\"exitFullScreen\":[64]},[[5,\"touchmove\",\"onDocumentTouchMove\"],[5,\"touchend\",\"onDocumentTouchEnd\"],[5,\"touchcancel\",\"onDocumentTouchEnd\"]]],[4,\"taro-video-control\",{\"controls\":[4],\"currentTime\":[2,\"current-time\"],\"duration\":[2],\"isPlaying\":[4,\"is-playing\"],\"pauseFunc\":[16],\"playFunc\":[16],\"seekFunc\":[16],\"showPlayBtn\":[4,\"show-play-btn\"],\"showProgress\":[4,\"show-progress\"],\"setProgressBall\":[64],\"toggleVisibility\":[64],\"getIsDraggingProgressBall\":[64],\"setCurrentTime\":[64]},[[5,\"touchmove\",\"onDocumentTouchMove\"],[5,\"touchend\",\"onDocumentTouchEnd\"],[5,\"touchcancel\",\"onDocumentTouchEnd\"]]],[0,\"taro-video-danmu\",{\"enable\":[4],\"danmuList\":[32],\"sendDanmu\":[64],\"tick\":[64]}]]]]"), options);
20
+ return index.bootstrapLazy(JSON.parse("[[\"taro-checkbox-core_2.cjs\",[[4,\"taro-checkbox-core\",{\"name\":[1],\"value\":[1032],\"color\":[1],\"id\":[1025],\"checked\":[4],\"disabled\":[4],\"nativeProps\":[16],\"isWillLoadCalled\":[32]}],[0,\"taro-checkbox-group-core\",{\"name\":[8]},[[0,\"checkboxchange\",\"function\"]]]]],[\"taro-movable-area-core_2.cjs\",[[0,\"taro-movable-area-core\",{\"scaleArea\":[4,\"scale-area\"]}],[0,\"taro-movable-view-core\",{\"x\":[8],\"y\":[8],\"direction\":[1],\"outOfBounds\":[4,\"out-of-bounds\"],\"inertia\":[4],\"friction\":[2],\"damping\":[2],\"disabled\":[4],\"scale\":[4],\"scaleMin\":[2,\"scale-min\"],\"scaleMax\":[2,\"scale-max\"],\"scaleValue\":[2,\"scale-value\"],\"animation\":[4],\"setParent\":[64],\"endScale\":[64],\"setScale\":[64]}]]],[\"taro-picker-view-column-core_2.cjs\",[[0,\"taro-picker-view-column-core\",{\"col\":[1],\"initialPosition\":[1,\"initial-position\"],\"paddingVertical\":[2,\"padding-vertical\"],\"isInit\":[32]},[[1,\"touchstart\",\"onTouchStart\"],[1,\"touchend\",\"onTouchEnd\"]]],[4,\"taro-picker-view-core\",{\"indicatorStyle\":[1,\"indicator-style\"],\"indicatorClass\":[1,\"indicator-class\"],\"value\":[16],\"maskStyle\":[1,\"mask-style\"],\"maskClass\":[1,\"mask-class\"]},[[0,\"onselect\",\"onSelect\"],[0,\"onselectstart\",\"onSelectStart\"],[0,\"onselectend\",\"onPickerColEnd\"]]]]],[\"taro-radio-core_2.cjs\",[[4,\"taro-radio-core\",{\"name\":[1],\"value\":[1],\"id\":[1025],\"checked\":[1540],\"disabled\":[4],\"nativeProps\":[16],\"isWillLoadCalled\":[32]}],[0,\"taro-radio-group-core\",{\"name\":[8]},[[0,\"radiochange\",\"function\"]]]]],[\"taro-swiper-core_2.cjs\",[[4,\"taro-swiper-core\",{\"indicatorDots\":[4,\"indicator-dots\"],\"indicatorColor\":[1,\"indicator-color\"],\"indicatorActiveColor\":[1,\"indicator-active-color\"],\"autoplay\":[4],\"current\":[2],\"currentItemId\":[1,\"current-item-id\"],\"interval\":[2],\"duration\":[2],\"circular\":[4],\"vertical\":[4],\"previousMargin\":[1,\"previous-margin\"],\"nextMargin\":[1,\"next-margin\"],\"displayMultipleItems\":[2,\"display-multiple-items\"],\"full\":[4],\"zoom\":[4],\"effectsProps\":[16]}],[4,\"taro-swiper-item-core\",{\"itemId\":[1,\"item-id\"]}]]],[\"taro-ad-core.cjs\",[[0,\"taro-ad-core\"]]],[\"taro-ad-custom-core.cjs\",[[0,\"taro-ad-custom-core\"]]],[\"taro-animation-video-core.cjs\",[[0,\"taro-animation-video-core\"]]],[\"taro-animation-view-core.cjs\",[[0,\"taro-animation-view-core\"]]],[\"taro-ar-camera-core.cjs\",[[0,\"taro-ar-camera-core\"]]],[\"taro-audio-core.cjs\",[[0,\"taro-audio-core\",{\"src\":[1],\"controls\":[4],\"autoplay\":[4],\"loop\":[4],\"muted\":[4],\"nativeProps\":[16]}]]],[\"taro-aweme-data-core.cjs\",[[0,\"taro-aweme-data-core\"]]],[\"taro-block-core.cjs\",[[0,\"taro-block-core\"]]],[\"taro-button-core.cjs\",[[4,\"taro-button-core\",{\"disabled\":[516],\"hoverClass\":[1,\"hover-class\"],\"type\":[1],\"hoverStartTime\":[2,\"hover-start-time\"],\"hoverStayTime\":[2,\"hover-stay-time\"],\"size\":[1],\"plain\":[4],\"loading\":[4],\"formType\":[513,\"form-type\"],\"hover\":[32],\"touch\":[32]},[[0,\"click\",\"onClick\"],[1,\"touchstart\",\"onTouchStart\"],[1,\"touchend\",\"onTouchEnd\"]]]]],[\"taro-camera-core.cjs\",[[0,\"taro-camera-core\"]]],[\"taro-canvas-core.cjs\",[[0,\"taro-canvas-core\",{\"canvasId\":[1,\"id\"],\"height\":[1537],\"width\":[1537],\"nativeProps\":[16]}]]],[\"taro-channel-live-core.cjs\",[[0,\"taro-channel-live-core\"]]],[\"taro-channel-video-core.cjs\",[[0,\"taro-channel-video-core\"]]],[\"taro-comment-detail-core.cjs\",[[0,\"taro-comment-detail-core\"]]],[\"taro-comment-list-core.cjs\",[[0,\"taro-comment-list-core\"]]],[\"taro-contact-button-core.cjs\",[[0,\"taro-contact-button-core\"]]],[\"taro-cover-image-core.cjs\",[[0,\"taro-cover-image-core\",{\"src\":[1],\"nativeProps\":[16]}]]],[\"taro-cover-view-core.cjs\",[[4,\"taro-cover-view-core\",{\"animation\":[1],\"hoverClass\":[1,\"hover-class\"],\"hoverStartTime\":[2,\"hover-start-time\"],\"hoverStayTime\":[2,\"hover-stay-time\"],\"hover\":[32],\"touch\":[32]},[[1,\"touchstart\",\"onTouchStart\"],[1,\"touchmove\",\"onTouchMove\"],[1,\"touchend\",\"onTouchEnd\"]]]]],[\"taro-custom-wrapper-core.cjs\",[[0,\"taro-custom-wrapper-core\"]]],[\"taro-double-tap-gesture-handler-core.cjs\",[[0,\"taro-double-tap-gesture-handler-core\"]]],[\"taro-draggable-sheet-core.cjs\",[[0,\"taro-draggable-sheet-core\"]]],[\"taro-editor-core.cjs\",[[0,\"taro-editor-core\"]]],[\"taro-follow-swan-core.cjs\",[[0,\"taro-follow-swan-core\"]]],[\"taro-force-press-gesture-handler-core.cjs\",[[0,\"taro-force-press-gesture-handler-core\"]]],[\"taro-form-core.cjs\",[[4,\"taro-form-core\",null,[[0,\"tarobuttonsubmit\",\"onButtonSubmit\"],[0,\"tarobuttonreset\",\"onButtonReset\"]]]]],[\"taro-functional-page-navigator-core.cjs\",[[0,\"taro-functional-page-navigator-core\"]]],[\"taro-grid-builder-core.cjs\",[[0,\"taro-grid-builder-core\"]]],[\"taro-grid-view-core.cjs\",[[0,\"taro-grid-view-core\"]]],[\"taro-horizontal-drag-gesture-handler-core.cjs\",[[0,\"taro-horizontal-drag-gesture-handler-core\"]]],[\"taro-icon-core.cjs\",[[0,\"taro-icon-core\",{\"type\":[1],\"size\":[8],\"color\":[1]}]]],[\"taro-image-core.cjs\",[[0,\"taro-image-core\",{\"src\":[1],\"mode\":[1],\"lazyLoad\":[4,\"lazy-load\"],\"nativeProps\":[16],\"disableDefaultSize\":[4,\"disable-default-size\"],\"didLoad\":[32]}]]],[\"taro-inline-payment-panel-core.cjs\",[[0,\"taro-inline-payment-panel-core\"]]],[\"taro-input-core.cjs\",[[0,\"taro-input-core\",{\"value\":[1025],\"type\":[1],\"password\":[4],\"placeholder\":[1],\"disabled\":[4],\"maxlength\":[2],\"autoFocus\":[4,\"focus\"],\"confirmType\":[1,\"confirm-type\"],\"name\":[1],\"readonly\":[4],\"nativeProps\":[16],\"focus\":[64]}]]],[\"taro-keyboard-accessory-core.cjs\",[[0,\"taro-keyboard-accessory-core\"]]],[\"taro-label-core.cjs\",[[4,\"taro-label-core\",{\"for\":[1]}]]],[\"taro-lifestyle-core.cjs\",[[0,\"taro-lifestyle-core\"]]],[\"taro-like-core.cjs\",[[0,\"taro-like-core\"]]],[\"taro-list-builder-core.cjs\",[[0,\"taro-list-builder-core\"]]],[\"taro-list-view-core.cjs\",[[0,\"taro-list-view-core\"]]],[\"taro-live-player-core.cjs\",[[0,\"taro-live-player-core\"]]],[\"taro-live-pusher-core.cjs\",[[0,\"taro-live-pusher-core\"]]],[\"taro-login-core.cjs\",[[0,\"taro-login-core\"]]],[\"taro-long-press-gesture-handler-core.cjs\",[[0,\"taro-long-press-gesture-handler-core\"]]],[\"taro-lottie-core.cjs\",[[0,\"taro-lottie-core\"]]],[\"taro-map-core.cjs\",[[0,\"taro-map-core\",{\"latitude\":[2],\"longitude\":[2],\"scale\":[2],\"minScale\":[2,\"min-scale\"],\"maxScale\":[2,\"max-scale\"],\"markers\":[16],\"polyline\":[16],\"circles\":[16],\"polygons\":[16],\"subkey\":[1],\"layerStyle\":[2,\"layer-style\"],\"rotate\":[2],\"skew\":[2],\"showCompass\":[4,\"show-compass\"],\"showScale\":[4,\"show-scale\"],\"enableOverlooking\":[4,\"enable-overlooking\"],\"enableZoom\":[4,\"enable-zoom\"],\"enableScroll\":[4,\"enable-scroll\"],\"enableRotate\":[4,\"enable-rotate\"],\"enableSatellite\":[4,\"enable-satellite\"],\"enableTraffic\":[4,\"enable-traffic\"],\"enableBuilding\":[4,\"enable-building\"],\"enableAutoMaxOverlooking\":[4,\"enable-auto-max-overlooking\"],\"enable3D\":[4,\"enable-3-d\"],\"width\":[1],\"height\":[1]}]]],[\"taro-match-media-core.cjs\",[[0,\"taro-match-media-core\"]]],[\"taro-native-slot-core.cjs\",[[0,\"taro-native-slot-core\"]]],[\"taro-navigation-bar-core.cjs\",[[0,\"taro-navigation-bar-core\"]]],[\"taro-navigator-core.cjs\",[[0,\"taro-navigator-core\",{\"hoverClass\":[1,\"hover-class\"],\"url\":[1],\"openType\":[1,\"open-type\"],\"isHover\":[4,\"is-hover\"],\"delta\":[2]},[[0,\"click\",\"onClick\"]]]]],[\"taro-nested-scroll-body-core.cjs\",[[0,\"taro-nested-scroll-body-core\"]]],[\"taro-nested-scroll-header-core.cjs\",[[0,\"taro-nested-scroll-header-core\"]]],[\"taro-official-account-core.cjs\",[[0,\"taro-official-account-core\"]]],[\"taro-open-container-core.cjs\",[[0,\"taro-open-container-core\"]]],[\"taro-open-data-core.cjs\",[[0,\"taro-open-data-core\"]]],[\"taro-open-embedded-atomicservice-core.cjs\",[[0,\"taro-open-embedded-atomicservice-core\"]]],[\"taro-page-container-core.cjs\",[[0,\"taro-page-container-core\"]]],[\"taro-page-meta-core.cjs\",[[0,\"taro-page-meta-core\"]]],[\"taro-pan-gesture-handler-core.cjs\",[[0,\"taro-pan-gesture-handler-core\"]]],[\"taro-progress-core.cjs\",[[0,\"taro-progress-core\",{\"percent\":[2],\"showInfo\":[4,\"show-info\"],\"borderRadius\":[8,\"border-radius\"],\"fontSize\":[8,\"font-size\"],\"strokeWidth\":[8,\"stroke-width\"],\"activeColor\":[1,\"active-color\"],\"backgroundColor\":[1,\"background-color\"],\"active\":[4]}]]],[\"taro-pull-to-refresh-core.cjs\",[[4,\"taro-pull-to-refresh-core\",{\"prefixCls\":[1,\"prefix-cls\"],\"distanceToRefresh\":[2,\"distance-to-refresh\"],\"damping\":[2],\"indicator\":[16],\"currSt\":[32],\"dragOnEdge\":[32]}]]],[\"taro-rich-text-core.cjs\",[[0,\"taro-rich-text-core\",{\"nodes\":[1],\"selectable\":[1028],\"userSelect\":[1028,\"user-select\"],\"space\":[1]}]]],[\"taro-root-portal-core.cjs\",[[0,\"taro-root-portal-core\"]]],[\"taro-rtc-room-core.cjs\",[[0,\"taro-rtc-room-core\"]]],[\"taro-rtc-room-item-core.cjs\",[[0,\"taro-rtc-room-item-core\"]]],[\"taro-scale-gesture-handler-core.cjs\",[[0,\"taro-scale-gesture-handler-core\"]]],[\"taro-script-core.cjs\",[[0,\"taro-script-core\"]]],[\"taro-scroll-view-core.cjs\",[[4,\"taro-scroll-view-core\",{\"scrollX\":[4,\"scroll-x\"],\"scrollY\":[4,\"scroll-y\"],\"upperThreshold\":[8,\"upper-threshold\"],\"lowerThreshold\":[8,\"lower-threshold\"],\"mpScrollTop\":[520,\"scroll-top\"],\"mpScrollLeft\":[520,\"scroll-left\"],\"mpScrollIntoView\":[513,\"scroll-into-view\"],\"mpScrollIntoViewAlignment\":[1,\"scroll-into-view-alignment\"],\"animated\":[4,\"scroll-with-animation\"],\"enhanced\":[4],\"showScrollbar\":[4,\"show-scrollbar\"],\"stopTouchMovePropagation\":[4,\"stop-touch-move-propagation\"],\"mpScrollToMethod\":[64],\"mpScrollIntoViewMethod\":[64]},[[1,\"scroll\",\"handleScroll\"],[1,\"touchmove\",\"handleTouchMove\"]]]]],[\"taro-share-element-core.cjs\",[[0,\"taro-share-element-core\"]]],[\"taro-slider-core.cjs\",[[0,\"taro-slider-core\",{\"min\":[2],\"max\":[2],\"step\":[2],\"disabled\":[4],\"value\":[1538],\"activeColor\":[1,\"active-color\"],\"backgroundColor\":[1,\"background-color\"],\"blockSize\":[2,\"block-size\"],\"blockColor\":[1,\"block-color\"],\"showValue\":[4,\"show-value\"],\"name\":[1],\"totalWidth\":[32],\"touching\":[32],\"ogX\":[32],\"touchId\":[32],\"percent\":[32],\"ogPercent\":[32],\"isWillLoadCalled\":[32]}]]],[\"taro-slot-core.cjs\",[[0,\"taro-slot-core\"]]],[\"taro-snapshot-core.cjs\",[[0,\"taro-snapshot-core\"]]],[\"taro-span-core.cjs\",[[0,\"taro-span-core\"]]],[\"taro-sticky-header-core.cjs\",[[0,\"taro-sticky-header-core\"]]],[\"taro-sticky-section-core.cjs\",[[0,\"taro-sticky-section-core\"]]],[\"taro-switch-core.cjs\",[[0,\"taro-switch-core\",{\"type\":[1],\"checked\":[1028],\"color\":[1],\"name\":[1],\"disabled\":[4],\"nativeProps\":[16],\"isWillLoadCalled\":[32]}]]],[\"taro-tab-item-core.cjs\",[[0,\"taro-tab-item-core\"]]],[\"taro-tabbar.cjs\",[[0,\"taro-tabbar\",{\"conf\":[16],\"list\":[32],\"borderStyle\":[32],\"backgroundColor\":[32],\"color\":[32],\"selectedColor\":[32],\"selectedIndex\":[32],\"status\":[32]}]]],[\"taro-tabs-core.cjs\",[[0,\"taro-tabs-core\"]]],[\"taro-tap-gesture-handler-core.cjs\",[[0,\"taro-tap-gesture-handler-core\"]]],[\"taro-text-core.cjs\",[[4,\"taro-text-core\",{\"selectable\":[1028],\"userSelect\":[1028,\"user-select\"],\"space\":[1025],\"numberOfLines\":[2,\"number-of-lines\"]}]]],[\"taro-textarea-core.cjs\",[[0,\"taro-textarea-core\",{\"value\":[1025],\"placeholder\":[1],\"disabled\":[4],\"maxlength\":[2],\"autoFocus\":[4,\"focus\"],\"autoHeight\":[4,\"auto-height\"],\"name\":[1],\"nativeProps\":[16],\"line\":[32],\"compositionValue\":[32],\"focus\":[64]}]]],[\"taro-vertical-drag-gesture-handler-core.cjs\",[[0,\"taro-vertical-drag-gesture-handler-core\"]]],[\"taro-view-core.cjs\",[[4,\"taro-view-core\",{\"animation\":[1],\"hoverClass\":[1,\"hover-class\"],\"hoverStartTime\":[2,\"hover-start-time\"],\"hoverStayTime\":[2,\"hover-stay-time\"],\"hover\":[32],\"touch\":[32]},[[1,\"touchstart\",\"onTouchStart\"],[1,\"touchmove\",\"onTouchMove\"],[1,\"touchend\",\"onTouchEnd\"]]]]],[\"taro-voip-room-core.cjs\",[[0,\"taro-voip-room-core\"]]],[\"taro-web-view-core.cjs\",[[0,\"taro-web-view-core\",{\"src\":[1]}]]],[\"taro-picker-core_2.cjs\",[[4,\"taro-picker-core\",{\"mode\":[1],\"disabled\":[4],\"range\":[16],\"rangeKey\":[1,\"range-key\"],\"value\":[1032],\"start\":[1],\"end\":[1],\"fields\":[1],\"name\":[1],\"textProps\":[16],\"pickerValue\":[32],\"height\":[32],\"hidden\":[32],\"fadeOut\":[32],\"isWillLoadCalled\":[32]}],[0,\"taro-picker-group\",{\"mode\":[1],\"range\":[16],\"rangeKey\":[1,\"range-key\"],\"height\":[2],\"columnId\":[1,\"column-id\"],\"updateHeight\":[16],\"updateDay\":[16],\"startY\":[32],\"preY\":[32],\"hadMove\":[32],\"touchEnd\":[32],\"isMove\":[32],\"handleMoveStart\":[64],\"handleMoving\":[64],\"handleMoveEnd\":[64]},[[1,\"mousedown\",\"onMouseDown\"],[3,\"mousemove\",\"onMouseMove\"],[1,\"mouseup\",\"onMouseMoveEnd\"],[1,\"mouseleave\",\"onMouseMoveEnd\"],[1,\"touchstart\",\"onTouchStart\"],[3,\"touchmove\",\"onTouchMove\"],[1,\"touchend\",\"onTouchEnd\"]]]]],[\"taro-video-control_3.cjs\",[[0,\"taro-video-core\",{\"src\":[1],\"duration\":[2],\"controls\":[4],\"autoplay\":[4],\"loop\":[4],\"muted\":[4],\"initialTime\":[2,\"initial-time\"],\"poster\":[1],\"objectFit\":[1,\"object-fit\"],\"showProgress\":[4,\"show-progress\"],\"showFullscreenBtn\":[4,\"show-fullscreen-btn\"],\"showPlayBtn\":[4,\"show-play-btn\"],\"showCenterPlayBtn\":[4,\"show-center-play-btn\"],\"showMuteBtn\":[4,\"show-mute-btn\"],\"danmuList\":[16],\"danmuBtn\":[4,\"danmu-btn\"],\"enableDanmu\":[4,\"enable-danmu\"],\"enablePlayGesture\":[4,\"enable-play-gesture\"],\"enableProgressGesture\":[4,\"enable-progress-gesture\"],\"vslideGesture\":[4,\"vslide-gesture\"],\"vslideGestureInFullscreen\":[4,\"vslide-gesture-in-fullscreen\"],\"nativeProps\":[16],\"_duration\":[32],\"_enableDanmu\":[32],\"isPlaying\":[32],\"isFirst\":[32],\"isFullScreen\":[32],\"fullScreenTimestamp\":[32],\"isMute\":[32],\"getHlsObject\":[64],\"play\":[64],\"pause\":[64],\"stop\":[64],\"seek\":[64],\"requestFullScreen\":[64],\"exitFullScreen\":[64]},[[5,\"touchmove\",\"onDocumentTouchMove\"],[5,\"touchend\",\"onDocumentTouchEnd\"],[5,\"touchcancel\",\"onDocumentTouchEnd\"]]],[4,\"taro-video-control\",{\"controls\":[4],\"currentTime\":[2,\"current-time\"],\"duration\":[2],\"isPlaying\":[4,\"is-playing\"],\"pauseFunc\":[16],\"playFunc\":[16],\"seekFunc\":[16],\"showPlayBtn\":[4,\"show-play-btn\"],\"showProgress\":[4,\"show-progress\"],\"setProgressBall\":[64],\"toggleVisibility\":[64],\"getIsDraggingProgressBall\":[64],\"setCurrentTime\":[64]},[[5,\"touchmove\",\"onDocumentTouchMove\"],[5,\"touchend\",\"onDocumentTouchEnd\"],[5,\"touchcancel\",\"onDocumentTouchEnd\"]]],[0,\"taro-video-danmu\",{\"enable\":[4],\"danmuList\":[32],\"sendDanmu\":[64],\"tick\":[64]}]]]]"), options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -2,13 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const swiper = require('./swiper-3ab835bb.js');
5
+ const swiper = require('./swiper-f67b39e6.js');
6
6
  require('./index-ae99cbcc.js');
7
7
  require('./index-b873e40f.js');
8
8
  require('./helper-ad6306f6.js');
9
9
  require('@tarojs/taro');
10
10
  require('swiper/bundle');
11
- require('./index-8a70c333.js');
12
11
 
13
12
 
14
13
 
@@ -14,10 +14,9 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
14
14
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
15
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
16
16
  };
17
- var _Swiper_id, _Swiper_source, _Swiper_swiperResetting, _Swiper_domChangeByOutSide, _Swiper_lastSwiperActiveIndex;
17
+ var _Swiper_id, _Swiper_source, _Swiper_swiperResetting, _Swiper_lastSwiperActiveIndex, _Swiper_pendingCurrentItemId, _Swiper_didLoad, _Swiper_container, _Swiper_sizeTimer;
18
18
  import { h, Host } from '@stencil/core';
19
19
  import SwiperJS from 'swiper/bundle';
20
- import { debounce } from '../../utils';
21
20
  let INSTANCE_ID = 0;
22
21
  const ONE_ADDITIONAL_SLIDES_THRESHOLD = 5;
23
22
  const TWO_ADDITIONAL_SLIDES_THRESHOLD = 7;
@@ -25,33 +24,41 @@ export class Swiper {
25
24
  constructor() {
26
25
  _Swiper_id.set(this, INSTANCE_ID++);
27
26
  _Swiper_source.set(this, 'autoplay');
28
- _Swiper_swiperResetting.set(this, false
29
- // dom 变化是否由外部引起,因为 swiper 的循环模式也会引起 dom 的变化。如果不是由外部引起的 dom 变化,就不需要重新初始化 swiper
30
- );
31
- // dom 变化是否由外部引起,因为 swiper 的循环模式也会引起 dom 的变化。如果不是由外部引起的 dom 变化,就不需要重新初始化 swiper
32
- _Swiper_domChangeByOutSide.set(this, false);
27
+ _Swiper_swiperResetting.set(this, false);
33
28
  _Swiper_lastSwiperActiveIndex.set(this, 0);
34
- this.handleSwiperSizeDebounce = debounce(() => {
35
- if (!this.swiper || !this.isWillLoadCalled)
36
- return;
37
- if (this.circular) {
38
- if (__classPrivateFieldGet(this, _Swiper_domChangeByOutSide, "f")) {
39
- this.reset();
40
- __classPrivateFieldSet(this, _Swiper_domChangeByOutSide, false, "f");
29
+ _Swiper_pendingCurrentItemId.set(this, null);
30
+ _Swiper_didLoad.set(this, false);
31
+ _Swiper_container.set(this, null);
32
+ _Swiper_sizeTimer.set(this, void 0);
33
+ this.swiper = null;
34
+ this.observer = null;
35
+ this.handleSwiperSizeDebounce = () => {
36
+ clearTimeout(__classPrivateFieldGet(this, _Swiper_sizeTimer, "f"));
37
+ const swiper = this.swiper;
38
+ __classPrivateFieldSet(this, _Swiper_sizeTimer, setTimeout(() => {
39
+ if (this.swiper !== swiper || !swiper)
40
+ return;
41
+ if (this.circular) {
42
+ if (__classPrivateFieldGet(this, _Swiper_swiperResetting, "f"))
43
+ this.reset();
44
+ }
45
+ else {
46
+ swiper.update();
41
47
  __classPrivateFieldSet(this, _Swiper_swiperResetting, false, "f");
42
48
  }
49
+ }, 50), "f");
50
+ };
51
+ this.reset = (current) => {
52
+ this.destroySwiper();
53
+ if (current !== undefined)
54
+ __classPrivateFieldSet(this, _Swiper_lastSwiperActiveIndex, current, "f");
55
+ __classPrivateFieldSet(this, _Swiper_swiperResetting, true, "f");
56
+ try {
57
+ this.handleInit(true);
43
58
  }
44
- else {
45
- this.swiper.update();
59
+ finally {
46
60
  __classPrivateFieldSet(this, _Swiper_swiperResetting, false, "f");
47
61
  }
48
- }, 50);
49
- this.reset = () => {
50
- __classPrivateFieldSet(this, _Swiper_swiperResetting, true, "f");
51
- __classPrivateFieldSet(this, _Swiper_lastSwiperActiveIndex, this.swiper.realIndex, "f");
52
- this.swiper.destroy();
53
- this.handleInit(true);
54
- __classPrivateFieldSet(this, _Swiper_swiperResetting, false, "f");
55
62
  };
56
63
  // 下面为方法函数
57
64
  this.getSlidersList = () => this.el.querySelectorAll('taro-swiper-item-core:not(.swiper-slide-duplicate)') || [];
@@ -66,9 +73,6 @@ export class Swiper {
66
73
  const [, nextMargin] = /^(\d+)px/.exec(this.nextMargin) || [];
67
74
  return [parseInt(previousMargin) || 0, parseInt(nextMargin) || 0];
68
75
  };
69
- this.swiperWrapper = undefined;
70
- this.swiper = undefined;
71
- this.isWillLoadCalled = false;
72
76
  this.indicatorDots = false;
73
77
  this.indicatorColor = 'rgba(0, 0, 0, .3)';
74
78
  this.indicatorActiveColor = '#000000';
@@ -85,29 +89,46 @@ export class Swiper {
85
89
  this.full = false;
86
90
  this.zoom = false;
87
91
  this.effectsProps = {};
88
- this.observer = undefined;
92
+ }
93
+ // 属性入口统一恢复失效实例,事件回调只需排除旧实例
94
+ getSwiper(current) {
95
+ const swiper = this.swiper;
96
+ if (swiper && (swiper.destroyed || !swiper.wrapperEl || !swiper.slidesEl))
97
+ this.reset(current);
98
+ return this.swiper;
89
99
  }
90
100
  watchCurrent(newVal) {
91
- if (this.currentItemId || !this.isWillLoadCalled || !this.swiper)
101
+ if (this.currentItemId || !__classPrivateFieldGet(this, _Swiper_didLoad, "f"))
92
102
  return;
93
103
  const n = parseInt(newVal, 10);
94
- if (isNaN(n) || n === this.swiper.realIndex)
104
+ if (isNaN(n))
105
+ return;
106
+ const swiper = this.getSwiper(n);
107
+ if (!swiper) {
108
+ __classPrivateFieldSet(this, _Swiper_lastSwiperActiveIndex, n, "f");
109
+ return;
110
+ }
111
+ if (n === swiper.realIndex)
95
112
  return;
96
113
  __classPrivateFieldSet(this, _Swiper_source, '', "f");
97
114
  if (this.circular) {
98
- this.swiper.slideToLoop(n); // 更新下标
99
- this.autoplay && this.swiper.autoplay.pause();
115
+ swiper.slideToLoop(n); // 更新下标
116
+ this.autoplay && swiper.autoplay.pause();
100
117
  // @ts-ignore
101
- this.swiper.loopFix();
102
- this.autoplay && this.swiper.autoplay.start();
118
+ swiper.loopFix();
119
+ this.autoplay && swiper.autoplay.start();
103
120
  }
104
121
  else {
105
- this.swiper.slideTo(n); // 更新下标
122
+ swiper.slideTo(n); // 更新下标
106
123
  }
107
124
  }
108
125
  watchCurrentItemId(newVal) {
109
- if (!this.swiperWrapper || !this.isWillLoadCalled)
126
+ const swiper = this.getSwiper();
127
+ if (!swiper) {
128
+ __classPrivateFieldSet(this, _Swiper_pendingCurrentItemId, newVal, "f");
110
129
  return;
130
+ }
131
+ __classPrivateFieldSet(this, _Swiper_pendingCurrentItemId, null, "f");
111
132
  let itemIdIndex = 0;
112
133
  this.getSlidersList().forEach((swiperItem, index) => {
113
134
  const itemId = swiperItem.getAttribute('item-id');
@@ -120,32 +141,33 @@ export class Swiper {
120
141
  }
121
142
  }
122
143
  });
123
- if (itemIdIndex === this.swiper.realIndex)
144
+ if (itemIdIndex === swiper.realIndex)
124
145
  return; // 无需更新
125
146
  __classPrivateFieldSet(this, _Swiper_source, '', "f");
126
147
  if (this.circular) {
127
- this.swiper.slideToLoop(itemIdIndex); // 更新下标
148
+ swiper.slideToLoop(itemIdIndex); // 更新下标
128
149
  // @ts-ignore
129
- this.swiper.loopFix();
130
- this.autoplay && this.swiper.autoplay.start();
150
+ swiper.loopFix();
151
+ this.autoplay && swiper.autoplay.start();
131
152
  }
132
153
  else {
133
- this.swiper.slideTo(itemIdIndex); // 更新下标
154
+ swiper.slideTo(itemIdIndex); // 更新下标
134
155
  }
135
156
  }
136
157
  watchAutoplay(newVal) {
137
- if (!this.isWillLoadCalled || !this.swiper)
158
+ const swiper = this.getSwiper();
159
+ if (!swiper)
138
160
  return;
139
- const swiperAutoplay = this.swiper.autoplay;
161
+ const swiperAutoplay = swiper.autoplay;
140
162
  if (swiperAutoplay) {
141
163
  if (swiperAutoplay.running === newVal)
142
164
  return;
143
165
  if (newVal) {
144
- if (this.swiper.params && typeof this.swiper.params.autoplay === 'object') {
145
- if (this.swiper.params.autoplay.disableOnInteraction === true) {
146
- this.swiper.params.autoplay.disableOnInteraction = false;
166
+ if (swiper.params && typeof swiper.params.autoplay === 'object') {
167
+ if (swiper.params.autoplay.disableOnInteraction === true) {
168
+ swiper.params.autoplay.disableOnInteraction = false;
147
169
  }
148
- this.swiper.params.autoplay.delay = this.interval;
170
+ swiper.params.autoplay.delay = this.interval;
149
171
  }
150
172
  swiperAutoplay.start();
151
173
  }
@@ -155,110 +177,114 @@ export class Swiper {
155
177
  }
156
178
  }
157
179
  watchDuration(newVal) {
158
- if (!this.swiper || !this.isWillLoadCalled)
180
+ const swiper = this.getSwiper();
181
+ if (!swiper)
159
182
  return;
160
- this.swiper.params.speed = newVal;
183
+ swiper.params.speed = newVal;
161
184
  }
162
185
  watchInterval(newVal) {
163
- if (!this.swiper || !this.isWillLoadCalled)
186
+ const swiper = this.getSwiper();
187
+ if (!swiper)
164
188
  return;
165
- if (typeof this.swiper.params.autoplay === 'object') {
166
- this.swiper.params.autoplay.delay = newVal;
189
+ if (typeof swiper.params.autoplay === 'object') {
190
+ swiper.params.autoplay.delay = newVal;
167
191
  }
168
192
  }
169
- watchSwiperWrapper(newVal) {
170
- if (!this.isWillLoadCalled || !this.swiper)
171
- return;
172
- if (!newVal)
173
- return;
193
+ bindWrapper(wrapper) {
174
194
  const beforeDomOperation = () => {
175
- __classPrivateFieldSet(this, _Swiper_domChangeByOutSide, true, "f");
176
- // 如果是由于外部子节点的变化引起的 dom 变化,需要重新初始化 swiper。
177
- // 在初dom操作之前,需要调用 loopDestroy,把子节点的顺序恢复
178
- this.swiper.loopDestroy();
179
- this.swiper.params.loop = false;
180
- };
181
- this.el.appendChild = (newChild) => {
195
+ const swiper = this.swiper;
196
+ if (!swiper)
197
+ return;
198
+ const firstChange = !__classPrivateFieldGet(this, _Swiper_swiperResetting, "f");
182
199
  __classPrivateFieldSet(this, _Swiper_swiperResetting, true, "f");
183
- if (!__classPrivateFieldGet(this, _Swiper_domChangeByOutSide, "f") && this.circular) {
184
- beforeDomOperation();
200
+ if (firstChange && this.circular) {
201
+ swiper.autoplay.stop();
202
+ if (swiper.wrapperEl && swiper.slidesEl)
203
+ swiper.loopDestroy();
204
+ swiper.params.loop = false;
185
205
  }
186
- return newVal.appendChild(newChild);
206
+ this.handleSwiperSizeDebounce();
207
+ };
208
+ this.el.appendChild = (newChild) => {
209
+ beforeDomOperation();
210
+ return wrapper.appendChild(newChild);
187
211
  };
188
212
  this.el.insertBefore = (newChild, refChild) => {
189
- __classPrivateFieldSet(this, _Swiper_swiperResetting, true, "f");
190
- if (!__classPrivateFieldGet(this, _Swiper_domChangeByOutSide, "f") && this.circular) {
191
- beforeDomOperation();
192
- }
193
- return newVal.insertBefore(newChild, refChild);
213
+ beforeDomOperation();
214
+ return wrapper.insertBefore(newChild, refChild);
194
215
  };
195
216
  this.el.replaceChild = (newChild, oldChild) => {
196
- __classPrivateFieldSet(this, _Swiper_swiperResetting, true, "f");
197
- if (!__classPrivateFieldGet(this, _Swiper_domChangeByOutSide, "f") && this.circular) {
198
- beforeDomOperation();
199
- }
200
- return newVal.replaceChild(newChild, oldChild);
217
+ beforeDomOperation();
218
+ return wrapper.replaceChild(newChild, oldChild);
201
219
  };
202
220
  this.el.removeChild = (oldChild) => {
203
- __classPrivateFieldSet(this, _Swiper_swiperResetting, true, "f");
204
- if (!__classPrivateFieldGet(this, _Swiper_domChangeByOutSide, "f") && this.circular) {
205
- beforeDomOperation();
206
- }
207
- return newVal.removeChild(oldChild);
221
+ beforeDomOperation();
222
+ return wrapper.removeChild(oldChild);
208
223
  };
209
224
  }
210
225
  watchCircular() {
211
- if (!this.swiper || !this.isWillLoadCalled)
212
- return;
213
- this.reset();
226
+ if (__classPrivateFieldGet(this, _Swiper_didLoad, "f"))
227
+ this.reset();
214
228
  }
215
229
  watchDisplayMultipleItems() {
216
- if (!this.swiper || !this.isWillLoadCalled)
217
- return;
218
- this.reset();
230
+ if (__classPrivateFieldGet(this, _Swiper_didLoad, "f"))
231
+ this.reset();
219
232
  }
220
- componentWillLoad() {
221
- this.isWillLoadCalled = true;
233
+ connectedCallback() {
234
+ if (__classPrivateFieldGet(this, _Swiper_didLoad, "f"))
235
+ this.handleInit(true);
222
236
  }
223
237
  componentDidLoad() {
238
+ __classPrivateFieldSet(this, _Swiper_didLoad, true, "f");
224
239
  this.handleInit();
225
- if (!this.swiper || !this.swiperWrapper)
226
- return;
227
- this.observer = new MutationObserver(this.handleSwiperSizeDebounce);
228
- this.observer.observe(this.swiperWrapper, {
229
- childList: true
230
- });
231
240
  }
232
241
  disconnectedCallback() {
242
+ this.destroySwiper();
243
+ }
244
+ destroySwiper() {
233
245
  var _a;
246
+ clearTimeout(__classPrivateFieldGet(this, _Swiper_sizeTimer, "f"));
234
247
  (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
248
+ this.observer = null;
249
+ const swiper = this.swiper;
250
+ this.swiper = null;
251
+ if (swiper && !swiper.destroyed) {
252
+ __classPrivateFieldSet(this, _Swiper_lastSwiperActiveIndex, swiper.realIndex, "f");
253
+ swiper.autoplay.stop();
254
+ // 失效节点无法还原循环顺序,但实例的事件和观察器仍需释放
255
+ if (!swiper.wrapperEl || !swiper.slidesEl)
256
+ swiper.params.loop = false;
257
+ swiper.destroy();
258
+ }
259
+ __classPrivateFieldSet(this, _Swiper_swiperResetting, false, "f");
235
260
  }
236
261
  handleInit(reset = false) {
262
+ var _a;
263
+ if (!this.el.isConnected || !__classPrivateFieldGet(this, _Swiper_container, "f") || this.swiper)
264
+ return;
237
265
  const { autoplay, circular, current, currentItemId, displayMultipleItems, duration, interval, effectsProps, vertical } = this;
238
266
  let initialSlide = current;
239
267
  if (reset) {
240
268
  initialSlide = __classPrivateFieldGet(this, _Swiper_lastSwiperActiveIndex, "f");
241
269
  }
242
- else {
243
- if (currentItemId) {
244
- let itemIdIndex = 0;
245
- this.getSlidersList().forEach((swiperItem, index) => {
246
- // @ts-ignore
247
- if (swiperItem.itemId && swiperItem.itemId === currentItemId) {
248
- itemIdIndex = index;
249
- }
250
- });
251
- initialSlide = itemIdIndex;
252
- }
270
+ else if (currentItemId) {
271
+ let itemIdIndex = 0;
272
+ this.getSlidersList().forEach((swiperItem, index) => {
273
+ // @ts-ignore
274
+ if (swiperItem.itemId && swiperItem.itemId === currentItemId) {
275
+ itemIdIndex = index;
276
+ }
277
+ });
278
+ initialSlide = itemIdIndex;
253
279
  }
254
280
  const loopAdditionalSlides = this.getLoopAdditionalSlides();
255
281
  const centeredSlides = displayMultipleItems === 1 && this.getNeedFixLoop();
256
282
  const slidesPerView = displayMultipleItems;
257
283
  // eslint-disable-next-line @typescript-eslint/no-this-alias
258
284
  const that = this;
259
- const options = Object.assign(Object.assign({ pagination: { el: `.taro-swiper-${__classPrivateFieldGet(this, _Swiper_id, "f")} > .swiper-container > .swiper-pagination` }, direction: vertical ? 'vertical' : 'horizontal', loop: circular, slidesPerView: slidesPerView, initialSlide: initialSlide, loopAdditionalSlides: loopAdditionalSlides, speed: duration, observeParents: true, observer: true, centeredSlides: centeredSlides, zoom: this.zoom, nested: true, touchReleaseOnEdges: true, threshold: 0 }, effectsProps), { on: {
285
+ const options = Object.assign(Object.assign({ pagination: { el: __classPrivateFieldGet(this, _Swiper_container, "f").querySelector('.swiper-pagination') }, direction: vertical ? 'vertical' : 'horizontal', loop: circular, slidesPerView: slidesPerView, initialSlide: initialSlide, loopAdditionalSlides: loopAdditionalSlides, speed: duration, observeParents: true, observer: true, centeredSlides: centeredSlides, zoom: this.zoom, nested: true, touchReleaseOnEdges: true, threshold: 0 }, effectsProps), { init: false, on: {
260
286
  transitionEnd(e) {
261
- if (__classPrivateFieldGet(that, _Swiper_swiperResetting, "f") || __classPrivateFieldGet(that, _Swiper_lastSwiperActiveIndex, "f") === this.realIndex)
287
+ if (e !== that.swiper || __classPrivateFieldGet(that, _Swiper_swiperResetting, "f") || __classPrivateFieldGet(that, _Swiper_lastSwiperActiveIndex, "f") === this.realIndex)
262
288
  return;
263
289
  __classPrivateFieldSet(that, _Swiper_lastSwiperActiveIndex, this.realIndex, "f");
264
290
  that.getNeedFixLoop() && e.loopFix();
@@ -271,11 +297,13 @@ export class Swiper {
271
297
  });
272
298
  __classPrivateFieldSet(that, _Swiper_source, 'autoplay', "f");
273
299
  },
274
- touchMove() {
300
+ touchMove(e) {
301
+ if (e !== that.swiper)
302
+ return;
275
303
  __classPrivateFieldSet(that, _Swiper_source, 'touch', "f");
276
304
  },
277
305
  slideChange(e) {
278
- if (__classPrivateFieldGet(that, _Swiper_swiperResetting, "f") || __classPrivateFieldGet(that, _Swiper_lastSwiperActiveIndex, "f") === this.realIndex)
306
+ if (e !== that.swiper || __classPrivateFieldGet(that, _Swiper_swiperResetting, "f") || __classPrivateFieldGet(that, _Swiper_lastSwiperActiveIndex, "f") === this.realIndex)
279
307
  return;
280
308
  const currentItemId = that.getCurrentItemId(e);
281
309
  that.onChange.emit({
@@ -284,19 +312,21 @@ export class Swiper {
284
312
  currentItemId,
285
313
  });
286
314
  },
287
- init: (e) => {
288
- that.getNeedFixLoop() && e.loopFix();
289
- that.autoplay && e.autoplay.start();
290
- },
291
315
  touchEnd: (e) => {
316
+ if (e !== that.swiper)
317
+ return;
292
318
  __classPrivateFieldSet(that, _Swiper_source, 'touch', "f");
293
319
  that.autoplay && e.autoplay.start();
294
320
  },
295
321
  touchStart: (e) => {
322
+ if (e !== that.swiper)
323
+ return;
296
324
  __classPrivateFieldSet(that, _Swiper_source, 'touch', "f");
297
325
  that.autoplay && e.autoplay.pause();
298
326
  },
299
327
  autoplay(e) {
328
+ if (e !== that.swiper)
329
+ return;
300
330
  // Note: 修复 autoplay 时,切换到其他页面再切回来,autoplay 会停止的问题
301
331
  // autoplay 会调用 slideTo 方法,里面会判断是否 animating,如果 animating 为 true,就会被 return
302
332
  // 参考源码:https://github.com/nolimits4web/swiper/blob/v11.1.0/src/core/slide/slideTo.mjs#27 27行
@@ -312,30 +342,51 @@ export class Swiper {
312
342
  disableOnInteraction: false
313
343
  };
314
344
  }
315
- this.swiper = new SwiperJS(`.taro-swiper-${__classPrivateFieldGet(this, _Swiper_id, "f")} > .swiper-container`, options);
345
+ // 使用组件内的真实节点,避免全局选择器在脱离文档或重建时匹配失败
346
+ const swiper = new SwiperJS(__classPrivateFieldGet(this, _Swiper_container, "f"), options);
347
+ try {
348
+ swiper.init();
349
+ }
350
+ finally {
351
+ if (!swiper.initialized) {
352
+ // 初始化失败时跳过循环节点还原,释放实例并保留原始初始化异常
353
+ swiper.params.loop = false;
354
+ swiper.destroy();
355
+ }
356
+ }
357
+ if (!swiper.initialized)
358
+ return;
359
+ this.swiper = swiper;
360
+ this.getNeedFixLoop() && swiper.loopFix();
316
361
  // Note: 这里是拦截了 swiper 的 minTranslate 和 maxTranslate 方法,手动修复了 loop 模式下的 margin 问题
317
362
  // 因为这两个属性会影响滑动到哪个位置进行 fixloop
318
363
  // 可参考源码:https://github.com/nolimits4web/swiper/blob/v11.1.0/src/core/events/onTouchMove.mjs
319
364
  // https://github.com/nolimits4web/swiper/blob/v11.1.0/src/core/loop/loopFix.mjs
320
365
  if (this.getNeedFixLoop()) {
321
366
  // @ts-ignore
322
- const minTranslate = this.swiper.minTranslate.bind(this.swiper);
367
+ const minTranslate = swiper.minTranslate.bind(this.swiper);
323
368
  //@ts-ignore
324
- const maxTranslate = this.swiper.maxTranslate.bind(this.swiper);
369
+ const maxTranslate = swiper.maxTranslate.bind(this.swiper);
325
370
  if (centeredSlides && this.getSlidersList().length < 4) {
326
371
  //@ts-ignore
327
- this.swiper.minTranslate = () => minTranslate() + this.parseMargin()[1];
372
+ swiper.minTranslate = () => minTranslate() + this.parseMargin()[1];
328
373
  //@ts-ignore
329
- this.swiper.maxTranslate = () => maxTranslate() - this.parseMargin()[0];
374
+ swiper.maxTranslate = () => maxTranslate() - this.parseMargin()[0];
330
375
  }
331
376
  else {
332
377
  //@ts-ignore
333
- this.swiper.minTranslate = () => minTranslate() - this.parseMargin()[0];
378
+ swiper.minTranslate = () => minTranslate() - this.parseMargin()[0];
334
379
  //@ts-ignore
335
- this.swiper.maxTranslate = () => maxTranslate() + this.parseMargin()[1];
380
+ swiper.maxTranslate = () => maxTranslate() + this.parseMargin()[1];
336
381
  }
337
382
  }
338
- this.swiperWrapper = this.swiper.wrapperEl;
383
+ this.bindWrapper(swiper.wrapperEl);
384
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
385
+ this.observer = new MutationObserver(this.handleSwiperSizeDebounce);
386
+ this.observer.observe(swiper.wrapperEl, { childList: true });
387
+ // 脱离文档期间更新的目标项,在实例恢复后应用一次
388
+ if (__classPrivateFieldGet(this, _Swiper_pendingCurrentItemId, "f") !== null)
389
+ this.watchCurrentItemId(__classPrivateFieldGet(this, _Swiper_pendingCurrentItemId, "f"));
339
390
  }
340
391
  // Note: loop 的时候添加 additionalSlides 可以避免循环的时候由于 loopFix 不及时,出现空白的问题。但是并不是 additionalSlides 越多越好,因为 additionalSlides 越多,如果 swiper-item 的数量不够,会导致出现 bug。
341
392
  // 目前的策略是 swiper-item 的数量小于等于 5 时,不添加 additionalSlides,大于 5 小于等于 7 时,添加 1 个 additionalSlides,大于 7 时,添加 2 个 additionalSlides。
@@ -351,7 +402,7 @@ export class Swiper {
351
402
  const slides = swiper.slides;
352
403
  const activeIndex = swiper.activeIndex;
353
404
  const currentSlide = slides[activeIndex];
354
- return currentSlide.getAttribute('item-id');
405
+ return (currentSlide === null || currentSlide === void 0 ? void 0 : currentSlide.getAttribute('item-id')) || '';
355
406
  }
356
407
  render() {
357
408
  const { vertical, indicatorDots, indicatorColor, indicatorActiveColor } = this;
@@ -369,7 +420,7 @@ export class Swiper {
369
420
  if (this.full) {
370
421
  hostStyle.height = '100%';
371
422
  }
372
- return (h(Host, { class: `taro-swiper-${__classPrivateFieldGet(this, _Swiper_id, "f")}`, style: hostStyle }, h("div", { class: 'swiper-container' }, h("style", { type: 'text/css' }, `
423
+ return (h(Host, { class: `taro-swiper-${__classPrivateFieldGet(this, _Swiper_id, "f")}`, style: hostStyle }, h("div", { class: 'swiper-container', ref: el => { __classPrivateFieldSet(this, _Swiper_container, el || null, "f"); } }, h("style", { type: 'text/css' }, `
373
424
  .taro-swiper-${__classPrivateFieldGet(this, _Swiper_id, "f")} > .swiper-container > .swiper-pagination > .swiper-pagination-bullet { background: ${indicatorColor} }
374
425
  .taro-swiper-${__classPrivateFieldGet(this, _Swiper_id, "f")} > .swiper-container > .swiper-pagination > .swiper-pagination-bullet-active { background: ${indicatorActiveColor} }
375
426
  .taro-swiper-${__classPrivateFieldGet(this, _Swiper_id, "f")} > .swiper-container { ${swiperContainerStyleList.join('')} }
@@ -681,14 +732,6 @@ export class Swiper {
681
732
  }
682
733
  };
683
734
  }
684
- static get states() {
685
- return {
686
- "swiperWrapper": {},
687
- "swiper": {},
688
- "isWillLoadCalled": {},
689
- "observer": {}
690
- };
691
- }
692
735
  static get events() {
693
736
  return [{
694
737
  "method": "onChange",
@@ -739,9 +782,6 @@ export class Swiper {
739
782
  }, {
740
783
  "propName": "interval",
741
784
  "methodName": "watchInterval"
742
- }, {
743
- "propName": "swiperWrapper",
744
- "methodName": "watchSwiperWrapper"
745
785
  }, {
746
786
  "propName": "circular",
747
787
  "methodName": "watchCircular"
@@ -751,4 +791,4 @@ export class Swiper {
751
791
  }];
752
792
  }
753
793
  }
754
- _Swiper_id = new WeakMap(), _Swiper_source = new WeakMap(), _Swiper_swiperResetting = new WeakMap(), _Swiper_domChangeByOutSide = new WeakMap(), _Swiper_lastSwiperActiveIndex = new WeakMap();
794
+ _Swiper_id = new WeakMap(), _Swiper_source = new WeakMap(), _Swiper_swiperResetting = new WeakMap(), _Swiper_lastSwiperActiveIndex = new WeakMap(), _Swiper_pendingCurrentItemId = new WeakMap(), _Swiper_didLoad = new WeakMap(), _Swiper_container = new WeakMap(), _Swiper_sizeTimer = new WeakMap();