@tarojs/components 3.6.0-canary.1 → 3.6.0-canary.10
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-animation-video-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-animation-video-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-animation-view-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-animation-view-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-ar-camera-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-ar-camera-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-aweme-data-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-aweme-data-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-button-core.cjs.entry.js +5 -0
- package/dist/cjs/taro-button-core.cjs.entry.js.map +1 -1
- package/dist/cjs/taro-comment-detail-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-comment-detail-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-comment-list-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-comment-list-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-contact-button-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-contact-button-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-follow-swan-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-follow-swan-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-inline-payment-panel-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-inline-payment-panel-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-lifestyle-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-lifestyle-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-like-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-like-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-login-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-login-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-lottie-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-lottie-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-native-slot-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-native-slot-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-rtc-room-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-rtc-room-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-rtc-room-item-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-rtc-room-item-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js.map +1 -1
- package/dist/cjs/taro-slot-core.cjs.entry.js +5 -0
- package/dist/cjs/taro-slot-core.cjs.entry.js.map +1 -1
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +2 -0
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js.map +1 -1
- package/dist/cjs/taro-tab-item-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-tab-item-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-tabbar.cjs.entry.js.map +1 -1
- package/dist/cjs/taro-tabs-core.cjs.entry.js +23 -0
- package/dist/cjs/taro-tabs-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-view-core.cjs.entry.js +6 -2
- package/dist/cjs/taro-view-core.cjs.entry.js.map +1 -1
- package/dist/collection/collection-manifest.json +18 -0
- package/dist/collection/components/animation-video/animation-video.js +12 -0
- package/dist/collection/components/animation-video/animation-video.js.map +1 -0
- package/dist/collection/components/animation-view/animation-view.js +12 -0
- package/dist/collection/components/animation-view/animation-view.js.map +1 -0
- package/dist/collection/components/ar-camera/ar-camera.js +12 -0
- package/dist/collection/components/ar-camera/ar-camera.js.map +1 -0
- package/dist/collection/components/aweme-data/aweme-data.js +12 -0
- package/dist/collection/components/aweme-data/aweme-data.js.map +1 -0
- package/dist/collection/components/button/button.js +11 -0
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/comment/comment-detail.js +12 -0
- package/dist/collection/components/comment/comment-detail.js.map +1 -0
- package/dist/collection/components/comment/comment-list.js +12 -0
- package/dist/collection/components/comment/comment-list.js.map +1 -0
- package/dist/collection/components/contact-button/contact-button.js +12 -0
- package/dist/collection/components/contact-button/contact-button.js.map +1 -0
- package/dist/collection/components/follow-swan/follow-swan.js +12 -0
- package/dist/collection/components/follow-swan/follow-swan.js.map +1 -0
- package/dist/collection/components/inline-payment-panel/inline-payment-panel.js +12 -0
- package/dist/collection/components/inline-payment-panel/inline-payment-panel.js.map +1 -0
- package/dist/collection/components/lifestyle/lifestyle.js +12 -0
- package/dist/collection/components/lifestyle/lifestyle.js.map +1 -0
- package/dist/collection/components/like/like.js +12 -0
- package/dist/collection/components/like/like.js.map +1 -0
- package/dist/collection/components/login/login.js +12 -0
- package/dist/collection/components/login/login.js.map +1 -0
- package/dist/collection/components/lottie/lottie.js +12 -0
- package/dist/collection/components/lottie/lottie.js.map +1 -0
- package/dist/collection/components/rtc-room/rtc-room-item.js +12 -0
- package/dist/collection/components/rtc-room/rtc-room-item.js.map +1 -0
- package/dist/collection/components/rtc-room/rtc-room.js +12 -0
- package/dist/collection/components/rtc-room/rtc-room.js.map +1 -0
- package/dist/collection/components/scroll-view/scroll-view.js +1 -1
- package/dist/collection/components/scroll-view/scroll-view.js.map +1 -1
- package/dist/collection/components/slot/native-slot.js +12 -0
- package/dist/collection/components/slot/native-slot.js.map +1 -0
- package/dist/collection/components/slot/slot.js +4 -0
- package/dist/collection/components/slot/slot.js.map +1 -1
- package/dist/collection/components/swiper/swiper.js +20 -0
- package/dist/collection/components/swiper/swiper.js.map +1 -1
- package/dist/collection/components/tabs/tab-item.js +12 -0
- package/dist/collection/components/tabs/tab-item.js.map +1 -0
- package/dist/collection/components/tabs/tabs.js +12 -0
- package/dist/collection/components/tabs/tabs.js.map +1 -0
- package/dist/collection/components/view/view.js +6 -2
- package/dist/collection/components/view/view.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-animation-video-core.entry.js +19 -0
- package/dist/esm/taro-animation-video-core.entry.js.map +1 -0
- package/dist/esm/taro-animation-view-core.entry.js +19 -0
- package/dist/esm/taro-animation-view-core.entry.js.map +1 -0
- package/dist/esm/taro-ar-camera-core.entry.js +19 -0
- package/dist/esm/taro-ar-camera-core.entry.js.map +1 -0
- package/dist/esm/taro-aweme-data-core.entry.js +19 -0
- package/dist/esm/taro-aweme-data-core.entry.js.map +1 -0
- package/dist/esm/taro-button-core.entry.js +5 -0
- package/dist/esm/taro-button-core.entry.js.map +1 -1
- package/dist/esm/taro-comment-detail-core.entry.js +19 -0
- package/dist/esm/taro-comment-detail-core.entry.js.map +1 -0
- package/dist/esm/taro-comment-list-core.entry.js +19 -0
- package/dist/esm/taro-comment-list-core.entry.js.map +1 -0
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-contact-button-core.entry.js +19 -0
- package/dist/esm/taro-contact-button-core.entry.js.map +1 -0
- package/dist/esm/taro-follow-swan-core.entry.js +19 -0
- package/dist/esm/taro-follow-swan-core.entry.js.map +1 -0
- package/dist/esm/taro-inline-payment-panel-core.entry.js +19 -0
- package/dist/esm/taro-inline-payment-panel-core.entry.js.map +1 -0
- package/dist/esm/taro-lifestyle-core.entry.js +19 -0
- package/dist/esm/taro-lifestyle-core.entry.js.map +1 -0
- package/dist/esm/taro-like-core.entry.js +19 -0
- package/dist/esm/taro-like-core.entry.js.map +1 -0
- package/dist/esm/taro-login-core.entry.js +19 -0
- package/dist/esm/taro-login-core.entry.js.map +1 -0
- package/dist/esm/taro-lottie-core.entry.js +19 -0
- package/dist/esm/taro-lottie-core.entry.js.map +1 -0
- package/dist/esm/taro-native-slot-core.entry.js +19 -0
- package/dist/esm/taro-native-slot-core.entry.js.map +1 -0
- package/dist/esm/taro-rtc-room-core.entry.js +19 -0
- package/dist/esm/taro-rtc-room-core.entry.js.map +1 -0
- package/dist/esm/taro-rtc-room-item-core.entry.js +19 -0
- package/dist/esm/taro-rtc-room-item-core.entry.js.map +1 -0
- package/dist/esm/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm/taro-scroll-view-core.entry.js.map +1 -1
- package/dist/esm/taro-slot-core.entry.js +5 -0
- package/dist/esm/taro-slot-core.entry.js.map +1 -1
- package/dist/esm/taro-swiper-core_2.entry.js +2 -0
- package/dist/esm/taro-swiper-core_2.entry.js.map +1 -1
- package/dist/esm/taro-tab-item-core.entry.js +19 -0
- package/dist/esm/taro-tab-item-core.entry.js.map +1 -0
- package/dist/esm/taro-tabbar.entry.js.map +1 -1
- package/dist/esm/taro-tabs-core.entry.js +19 -0
- package/dist/esm/taro-tabs-core.entry.js.map +1 -0
- package/dist/esm/taro-view-core.entry.js +6 -2
- package/dist/esm/taro-view-core.entry.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/taro-animation-video-core.entry.js +2 -0
- package/dist/esm-es5/taro-animation-video-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-animation-view-core.entry.js +2 -0
- package/dist/esm-es5/taro-animation-view-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-ar-camera-core.entry.js +2 -0
- package/dist/esm-es5/taro-ar-camera-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-aweme-data-core.entry.js +2 -0
- package/dist/esm-es5/taro-aweme-data-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-button-core.entry.js +1 -1
- package/dist/esm-es5/taro-button-core.entry.js.map +1 -1
- package/dist/esm-es5/taro-comment-detail-core.entry.js +2 -0
- package/dist/esm-es5/taro-comment-detail-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-comment-list-core.entry.js +2 -0
- package/dist/esm-es5/taro-comment-list-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-components.js.map +1 -1
- package/dist/esm-es5/taro-contact-button-core.entry.js +2 -0
- package/dist/esm-es5/taro-contact-button-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-follow-swan-core.entry.js +2 -0
- package/dist/esm-es5/taro-follow-swan-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-inline-payment-panel-core.entry.js +2 -0
- package/dist/esm-es5/taro-inline-payment-panel-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-lifestyle-core.entry.js +2 -0
- package/dist/esm-es5/taro-lifestyle-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-like-core.entry.js +2 -0
- package/dist/esm-es5/taro-like-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-login-core.entry.js +2 -0
- package/dist/esm-es5/taro-login-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-lottie-core.entry.js +2 -0
- package/dist/esm-es5/taro-lottie-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-native-slot-core.entry.js +2 -0
- package/dist/esm-es5/taro-native-slot-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-rtc-room-core.entry.js +2 -0
- package/dist/esm-es5/taro-rtc-room-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-rtc-room-item-core.entry.js +2 -0
- package/dist/esm-es5/taro-rtc-room-item-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js.map +1 -1
- package/dist/esm-es5/taro-slot-core.entry.js +1 -1
- package/dist/esm-es5/taro-slot-core.entry.js.map +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js.map +1 -1
- package/dist/esm-es5/taro-tab-item-core.entry.js +2 -0
- package/dist/esm-es5/taro-tab-item-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-tabbar.entry.js.map +1 -1
- package/dist/esm-es5/taro-tabs-core.entry.js +2 -0
- package/dist/esm-es5/taro-tabs-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-view-core.entry.js.map +1 -1
- package/dist/react/component-lib/index.js +20 -10
- package/dist/react/component-lib/input.js +4 -10
- package/dist/react/component-lib/reactify-wc.js +21 -60
- package/dist/react/components.js +21 -4
- package/dist/react/helper.js +1 -6
- package/dist/react/react-component-lib/createComponent.js +99 -0
- package/dist/react/react-component-lib/createOverlayComponent.js +178 -0
- package/dist/react/react-component-lib/interfaces.js +0 -1
- package/dist/react/react-component-lib/utils/attachProps.js +10 -19
- package/dist/react/react-component-lib/utils/index.js +37 -0
- package/dist/taro-components/p-0be383a9.system.entry.js +2 -0
- package/dist/taro-components/p-0be383a9.system.entry.js.map +1 -0
- package/dist/taro-components/p-186ad7ff.entry.js +2 -0
- package/dist/taro-components/p-186ad7ff.entry.js.map +1 -0
- package/dist/taro-components/{p-e9abe3e2.entry.js → p-19afe402.entry.js} +2 -2
- package/dist/taro-components/p-19afe402.entry.js.map +1 -0
- package/dist/taro-components/p-1a47133c.system.entry.js +2 -0
- package/dist/taro-components/p-1a47133c.system.entry.js.map +1 -0
- package/dist/taro-components/p-1ad0aa95.system.entry.js +2 -0
- package/dist/taro-components/p-1ad0aa95.system.entry.js.map +1 -0
- package/dist/taro-components/p-1b1420c9.system.entry.js +2 -0
- package/dist/taro-components/p-1b1420c9.system.entry.js.map +1 -0
- package/dist/taro-components/p-281a2bcf.entry.js +2 -0
- package/dist/taro-components/p-281a2bcf.entry.js.map +1 -0
- package/dist/taro-components/p-28dade4f.entry.js +2 -0
- package/dist/taro-components/p-28dade4f.entry.js.map +1 -0
- package/dist/taro-components/p-31e10d77.system.entry.js +2 -0
- package/dist/taro-components/p-31e10d77.system.entry.js.map +1 -0
- package/dist/taro-components/p-36c64ed0.system.entry.js +2 -0
- package/dist/taro-components/p-36c64ed0.system.entry.js.map +1 -0
- package/dist/taro-components/p-37d71e63.entry.js +2 -0
- package/dist/taro-components/p-37d71e63.entry.js.map +1 -0
- package/dist/taro-components/p-386b9de8.entry.js +2 -0
- package/dist/taro-components/p-386b9de8.entry.js.map +1 -0
- package/dist/taro-components/{p-22f9f9fa.entry.js → p-427a2872.entry.js} +2 -2
- package/dist/taro-components/p-427a2872.entry.js.map +1 -0
- package/dist/taro-components/p-49a6cae4.system.entry.js.map +1 -1
- package/dist/taro-components/p-51040638.entry.js +2 -0
- package/dist/taro-components/p-51040638.entry.js.map +1 -0
- package/dist/taro-components/p-5bd1c1a1.entry.js +2 -0
- package/dist/taro-components/p-5bd1c1a1.entry.js.map +1 -0
- package/dist/taro-components/p-62d750a7.entry.js +2 -0
- package/dist/taro-components/p-62d750a7.entry.js.map +1 -0
- package/dist/taro-components/p-632f9a72.system.entry.js +2 -0
- package/dist/taro-components/p-632f9a72.system.entry.js.map +1 -0
- package/dist/taro-components/p-65971d99.entry.js +2 -0
- package/dist/taro-components/p-65971d99.entry.js.map +1 -0
- package/dist/taro-components/{p-1cd1c507.system.entry.js → p-6831f7b1.system.entry.js} +2 -2
- package/dist/taro-components/p-6831f7b1.system.entry.js.map +1 -0
- package/dist/taro-components/p-6c622fa2.system.entry.js +2 -0
- package/dist/taro-components/p-6c622fa2.system.entry.js.map +1 -0
- package/dist/taro-components/p-6cd941bc.entry.js +2 -0
- package/dist/taro-components/p-6cd941bc.entry.js.map +1 -0
- package/dist/taro-components/p-70defa84.entry.js +2 -0
- package/dist/taro-components/p-70defa84.entry.js.map +1 -0
- package/dist/taro-components/p-73106bc9.entry.js +2 -0
- package/dist/taro-components/p-73106bc9.entry.js.map +1 -0
- package/dist/taro-components/p-7afc274a.entry.js +2 -0
- package/dist/taro-components/p-7afc274a.entry.js.map +1 -0
- package/dist/taro-components/p-7bafbe22.entry.js +2 -0
- package/dist/taro-components/p-7bafbe22.entry.js.map +1 -0
- package/dist/taro-components/p-7e7a1e62.entry.js +2 -0
- package/dist/taro-components/p-7e7a1e62.entry.js.map +1 -0
- package/dist/taro-components/p-876edf66.entry.js +2 -0
- package/dist/taro-components/p-876edf66.entry.js.map +1 -0
- package/dist/taro-components/p-898aba38.system.entry.js +2 -0
- package/dist/taro-components/p-898aba38.system.entry.js.map +1 -0
- package/dist/taro-components/p-98901e99.system.entry.js +2 -0
- package/dist/taro-components/p-98901e99.system.entry.js.map +1 -0
- package/dist/taro-components/p-9f780103.system.entry.js +2 -0
- package/dist/taro-components/p-9f780103.system.entry.js.map +1 -0
- package/dist/taro-components/p-a4961ddd.entry.js +2 -0
- package/dist/taro-components/p-a4961ddd.entry.js.map +1 -0
- package/dist/taro-components/p-ad25cc91.system.entry.js +2 -0
- package/dist/taro-components/p-ad25cc91.system.entry.js.map +1 -0
- package/dist/taro-components/p-b4cccb3e.system.entry.js +2 -0
- package/dist/taro-components/p-b4cccb3e.system.entry.js.map +1 -0
- package/dist/taro-components/p-b6733e23.system.entry.js +2 -0
- package/dist/taro-components/p-b6733e23.system.entry.js.map +1 -0
- package/dist/taro-components/{p-c3acf0ea.system.entry.js → p-c43fe342.system.entry.js} +2 -2
- package/dist/taro-components/p-c43fe342.system.entry.js.map +1 -0
- package/dist/taro-components/p-cb17d8bd.system.js +1 -1
- package/dist/taro-components/p-cb17d8bd.system.js.map +1 -1
- package/dist/taro-components/{p-a2aab820.entry.js → p-d388c097.entry.js} +2 -2
- package/dist/taro-components/p-d388c097.entry.js.map +1 -0
- package/dist/taro-components/p-d6441fd8.entry.js +2 -0
- package/dist/taro-components/p-d6441fd8.entry.js.map +1 -0
- package/dist/taro-components/{p-057159bc.system.entry.js → p-dcfb7d97.system.entry.js} +2 -2
- package/dist/taro-components/p-dcfb7d97.system.entry.js.map +1 -0
- package/dist/taro-components/p-e0d6b00b.entry.js.map +1 -1
- package/dist/taro-components/p-e5607803.system.entry.js +2 -0
- package/dist/taro-components/p-e5607803.system.entry.js.map +1 -0
- package/dist/taro-components/p-e7965c55.system.entry.js +2 -0
- package/dist/taro-components/p-e7965c55.system.entry.js.map +1 -0
- package/dist/taro-components/p-f00ee372.system.entry.js +2 -0
- package/dist/taro-components/p-f00ee372.system.entry.js.map +1 -0
- package/dist/taro-components/{p-7baff0b4.entry.js → p-f120c272.entry.js} +2 -2
- package/dist/taro-components/p-f120c272.entry.js.map +1 -0
- package/dist/taro-components/p-f81d14ad.entry.js +2 -0
- package/dist/taro-components/p-f81d14ad.entry.js.map +1 -0
- package/dist/taro-components/p-fae28cc1.system.entry.js +2 -0
- package/dist/taro-components/p-fae28cc1.system.entry.js.map +1 -0
- package/dist/taro-components/p-fb843ff2.system.entry.js +2 -0
- package/dist/taro-components/p-fb843ff2.system.entry.js.map +1 -0
- package/dist/taro-components/p-fc0fbcce.system.entry.js +2 -0
- package/dist/taro-components/p-fc0fbcce.system.entry.js.map +1 -0
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/taro-components/taro-components.esm.js.map +1 -1
- package/dist/types/components/animation-video/animation-video.d.ts +5 -0
- package/dist/types/components/animation-view/animation-view.d.ts +5 -0
- package/dist/types/components/ar-camera/ar-camera.d.ts +5 -0
- package/dist/types/components/aweme-data/aweme-data.d.ts +5 -0
- package/dist/types/components/button/button.d.ts +1 -0
- package/dist/types/components/comment/comment-detail.d.ts +5 -0
- package/dist/types/components/comment/comment-list.d.ts +5 -0
- package/dist/types/components/contact-button/contact-button.d.ts +5 -0
- package/dist/types/components/follow-swan/follow-swan.d.ts +5 -0
- package/dist/types/components/inline-payment-panel/inline-payment-panel.d.ts +5 -0
- package/dist/types/components/lifestyle/lifestyle.d.ts +5 -0
- package/dist/types/components/like/like.d.ts +5 -0
- package/dist/types/components/login/login.d.ts +5 -0
- package/dist/types/components/lottie/lottie.d.ts +5 -0
- package/dist/types/components/rtc-room/rtc-room-item.d.ts +5 -0
- package/dist/types/components/rtc-room/rtc-room.d.ts +5 -0
- package/dist/types/components/slot/native-slot.d.ts +5 -0
- package/dist/types/components/slot/slot.d.ts +1 -0
- package/dist/types/components/swiper/swiper.d.ts +4 -0
- package/dist/types/components/tabs/tab-item.d.ts +5 -0
- package/dist/types/components/tabs/tabs.d.ts +5 -0
- package/dist/types/components.d.ts +242 -0
- package/dist/vue2/component-lib/components.js +22 -11
- package/dist/vue2/component-lib/createComponent.js +1 -1
- package/dist/vue2/component-lib/createFormsComponent.js +2 -12
- package/dist/vue2/component-lib/index.js +7 -9
- package/dist/vue2/component-lib/mixins/listeners.js +1 -6
- package/dist/vue2/component-lib/mixins/refs.js +1 -6
- package/dist/vue2/component-lib/picker.js +1 -6
- package/dist/vue2/component-lib/scroll-view.js +1 -6
- package/dist/vue2/components.js +58 -6
- package/dist/vue2/index.js +5 -9
- package/dist/vue2/vue-component-lib/utils.js +2 -7
- package/dist/vue3/component-lib/createComponent.js +2 -2
- package/dist/vue3/component-lib/createFormsComponent.js +6 -15
- package/dist/vue3/component-lib/forwardRef.js +0 -2
- package/dist/vue3/component-lib/icon.js +2 -2
- package/dist/vue3/component-lib/image.js +2 -2
- package/dist/vue3/component-lib/index.js +22 -11
- package/dist/vue3/component-lib/scroll-view.js +2 -2
- package/dist/vue3/component-lib/text.js +2 -2
- package/dist/vue3/components.js +19 -3
- package/dist/vue3/index.js +3 -5
- package/dist/vue3/vue-component-lib/utils.js +10 -36
- package/package.json +12 -6
- package/types/Ad.d.ts +1 -1
- 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 +1 -1
- package/types/AwemeData.d.ts +43 -0
- package/types/Button.d.ts +1 -1
- package/types/Camera.d.ts +1 -1
- package/types/Canvas.d.ts +1 -1
- package/types/Checkbox.d.ts +1 -1
- package/types/CheckboxGroup.d.ts +1 -1
- package/types/CommentDetail.d.ts +72 -0
- package/types/CommentList.d.ts +127 -0
- package/types/ContactButton.d.ts +53 -0
- package/types/CoverImage.d.ts +1 -1
- package/types/CoverView.d.ts +102 -4
- package/types/CustomWrapper.d.ts +2 -1
- package/types/FollowSwan.d.ts +28 -0
- package/types/Form.d.ts +1 -1
- package/types/Icon.d.ts +1 -1
- package/types/Image.d.ts +1 -1
- package/types/InlinePaymentPanel.d.ts +58 -0
- package/types/Input.d.ts +88 -11
- package/types/Label.d.ts +1 -1
- package/types/Lifestyle.d.ts +26 -0
- package/types/Like.d.ts +107 -0
- package/types/LivePlayer.d.ts +1 -1
- package/types/LivePusher.d.ts +1 -1
- package/types/Login.d.ts +45 -0
- package/types/Lottie.d.ts +113 -0
- package/types/Map.d.ts +2 -2
- package/types/MatchMedia.d.ts +1 -1
- package/types/MovableArea.d.ts +2 -2
- package/types/MovableView.d.ts +17 -17
- package/types/NativeSlot.d.ts +33 -0
- package/types/NavigationBar.d.ts +2 -1
- package/types/Navigator.d.ts +1 -1
- package/types/OpenData.d.ts +1 -1
- package/types/PageContainer.d.ts +28 -18
- package/types/PageMeta.d.ts +1 -1
- package/types/Picker.d.ts +1 -1
- package/types/PickerView.d.ts +1 -1
- package/types/PickerViewColumn.d.ts +1 -1
- package/types/Progress.d.ts +1 -1
- package/types/Radio.d.ts +1 -1
- package/types/RadioGroup.d.ts +1 -1
- package/types/RichText.d.ts +1 -1
- package/types/RootPortal.d.ts +11 -2
- package/types/RtcRoom.d.ts +104 -0
- package/types/RtcRoomItem.d.ts +26 -0
- package/types/ScrollView.d.ts +1 -1
- package/types/ShareElement.d.ts +20 -10
- package/types/Slider.d.ts +1 -1
- package/types/Slot.d.ts +3 -2
- package/types/Swiper.d.ts +13 -1
- package/types/SwiperItem.d.ts +3 -2
- package/types/Switch.d.ts +1 -1
- package/types/TabItem.d.ts +35 -0
- package/types/Tabs.d.ts +58 -0
- package/types/Text.d.ts +1 -1
- package/types/Textarea.d.ts +7 -1
- package/types/Video.d.ts +7 -3
- package/types/View.d.ts +8 -7
- package/types/VoipRoom.d.ts +1 -1
- package/types/WebView.d.ts +1 -1
- package/types/index.vue3.d.ts +268 -259
- package/virtual-list/index.d.ts +3 -120
- package/virtual-list/index.js +4 -7
- package/dist/taro-components/p-057159bc.system.entry.js.map +0 -1
- package/dist/taro-components/p-1cd1c507.system.entry.js.map +0 -1
- package/dist/taro-components/p-1e436d5b.entry.js +0 -2
- package/dist/taro-components/p-1e436d5b.entry.js.map +0 -1
- package/dist/taro-components/p-22f9f9fa.entry.js.map +0 -1
- package/dist/taro-components/p-7baff0b4.entry.js.map +0 -1
- package/dist/taro-components/p-946c0799.system.entry.js +0 -2
- package/dist/taro-components/p-946c0799.system.entry.js.map +0 -1
- package/dist/taro-components/p-a2aab820.entry.js.map +0 -1
- package/dist/taro-components/p-c3acf0ea.system.entry.js.map +0 -1
- package/dist/taro-components/p-d5579efa.system.entry.js +0 -2
- package/dist/taro-components/p-d5579efa.system.entry.js.map +0 -1
- package/dist/taro-components/p-e9abe3e2.entry.js.map +0 -1
- package/virtual-list/domHelpers.js +0 -40
- package/virtual-list/memoize.js +0 -38
- package/virtual-list/react/FixedSizeList.js +0 -193
- package/virtual-list/react/createListComponent.js +0 -654
- package/virtual-list/react/index.d.ts +0 -123
- package/virtual-list/react/index.js +0 -67
- package/virtual-list/timer.js +0 -24
- package/virtual-list/vue/index.js +0 -589
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as registerInstance,h,H as Host}from"./index-5d881caf.js";import{n as notSupport}from"./helper-3d0ecf0f.js";import"@tarojs/taro";var TabItem=function(){function t(t){registerInstance(this,t)}t.prototype.componentDidLoad=function(){notSupport("TabItem",this)};t.prototype.render=function(){return h(Host,null)};return t}();export{TabItem as taro_tab_item_core};
|
|
2
|
+
//# sourceMappingURL=taro-tab-item-core.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["src/components/tabs/tab-item.tsx"],"names":["TabItem","prototype","componentDidLoad","notSupport","this","render","h","Host"],"mappings":"8IAOaA,QAAO,kDAClBA,EAAAC,UAAAC,iBAAA,WACEC,WAAW,UAAWC,OAGxBJ,EAAAC,UAAAI,OAAA,WACE,OACEC,EAACC,KAAI,gBAPS","sourcesContent":["import { Component, ComponentInterface, h, Host } from '@stencil/core'\n\nimport { notSupport } from '../../utils'\n\n@Component({\n tag: 'taro-tab-item-core'\n})\nexport class TabItem implements ComponentInterface {\n componentDidLoad () {\n notSupport('TabItem', this)\n }\n\n render () {\n return (\n <Host />\n )\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/utils/url.ts","../taro-router/dist/utils/index.js","../../node_modules/.pnpm/registry.npmjs.org+resolve-pathname@3.0.0/node_modules/resolve-pathname/esm/resolve-pathname.js","src/components/tabbar/tabbar-item.tsx","src/components/tabbar/style/index.scss?tag=taro-tabbar","src/components/tabbar/tabbar.tsx"],"names":["splitUrl","_url","url","pos","res","path","query","fragment","indexOf","substring","addLeadingSlash","charAt","hasBasename","prefix","RegExp","test","stripBasename","length","stripSuffix","suffix","includes","isAbsolute","pathname","spliceOne","list","index","i","k","n","pop","resolvePathname","to","from","undefined","toParts","split","fromParts","isToAbs","isFromAbs","mustEndAbs","concat","hasTrailingSlash","last","up","part","unshift","result","join","substr","TabbarItem","_b","_c","isSelected","textColor","iconPath","badgeText","_d","showRedDot","text","onSelect","className","classNames","weui-bar__item_on","badgeStyle","position","top","right","dotStyle","onClick","h","key","href","class","style","display","src","alt","color","indexCss","STATUS_SHOW","STATUS_HIDE","STATUS_SLIDEOUT","basicTabBarClassName","hideTabBarClassName","hideTabBarWithAnimationClassName","Tabbar","hostRef","_this","this","homePage","customRoutes","tabbarPos","getOriginUrl","customRoute","filter","customUrl","pathA","pathB","getSelectedIndex","foundIndex","forEach","idx","pagePath","switchTab","selectedIndex","Taro","switchTabHandler","successHandler","errorHandler","currentUrl","getCurrentUrl","nextTab","errMsg","routerChangeHandler","options","_a","toLocation","currentPage","routerBasename","conf","basename","setTabBarBadgeHandler","__spreadArray","removeTabBarBadgeHandler","showTabBarRedDotHandler","hideTabBarRedDotHandler","showTabBarHandler","status","hideTabBarHandler","animation","setTabBarStyleHandler","selectedColor","backgroundColor","borderStyle","setTabBarItemHandler","selectedIconPath","Object","prototype","toString","call","Error","this_1","push","apply","map","p","item","routerMode","mode","window","location","hashIndex","processedUrl","decodeURI","bindEvent","eventCenter","on","removeEvent","off","componentDidLoad","tabbar","nextElementSibling","disconnectedCallback","render","containerCls","shouldHideTabBar","shouldSlideout","Host","height","bind"],"mappings":"saAsDO,IAAMA,SAAW,SAAAC,GACtB,IAAIC,EAAMD,GAAQ,GAClB,IAAIE,EACJ,IAAMC,EAAM,CACVC,KAAM,KACNC,MAAO,KACPC,SAAU,MAGZJ,EAAMD,EAAIM,QAAQ,KAClB,GAAIL,GAAO,EAAG,CACZC,EAAIG,SAAWL,EAAIO,UAAUN,EAAM,GACnCD,EAAMA,EAAIO,UAAU,EAAGN,GAGzBA,EAAMD,EAAIM,QAAQ,KAClB,GAAIL,GAAO,EAAG,CACZC,EAAIE,MAAQJ,EAAIO,UAAUN,EAAM,GAChCD,EAAMA,EAAIO,UAAU,EAAGN,GAGzBC,EAAIC,KAAOH,EAEX,OAAOE,GC3EF,IAAMM,gBAAkB,SAACR,GAAA,GAAAA,SAAA,EAAA,CAAAA,EAAA,GAAQ,OAAMA,EAAIS,OAAO,KAAO,IAAMT,EAAM,IAAMA,GAC3E,IAAMU,YAAc,SAACP,EAAWQ,GAAX,GAAAR,SAAA,EAAA,CAAAA,EAAA,GAAW,GAAAQ,SAAA,EAAA,CAAAA,EAAA,GAAgB,OAAA,IAAIC,OAAO,IAAMD,EAAS,gBAAiB,KAAKE,KAAKV,IAASA,IAASQ,GACvH,IAAMG,cAAgB,SAACX,EAAWQ,GAAX,GAAAR,SAAA,EAAA,CAAAA,EAAA,GAAW,GAAAQ,SAAA,EAAA,CAAAA,EAAA,GAAgB,OAAAD,YAAYP,EAAMQ,GAAUR,EAAKI,UAAUI,EAAOI,QAAUZ,GAE9G,IAAMa,YAAc,SAACb,EAAWc,GAAX,GAAAd,SAAA,EAAA,CAAAA,EAAA,GAAW,GAAAc,SAAA,EAAA,CAAAA,EAAA,GAAgB,OAAAd,EAAKe,SAASD,GAAUd,EAAKI,UAAU,EAAGJ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,EACPkC,SAAU4B,EAAKgB,UAAUkE,KAAKlF,GAC9BnC,WAAYA,EACZC,UAAWA,EACXC,SAAUA,EACVI,KAAMwF,EAAKxF,KACXH,UAAW2F,EAAK3F,UAChBE,WAAYyF,EAAKzF,qJAzUd","sourcesContent":["export const normalizePath = url => {\n let _isRelative\n let _leadingParents = ''\n let _parent, _pos\n\n // handle relative paths\n if (url.charAt(0) !== '/') {\n _isRelative = true\n url = '/' + url\n }\n\n // handle relative files (as opposed to directories)\n if (url.substring(-3) === '/..' || url.slice(-2) === '/.') {\n url += '/'\n }\n\n // resolve simples\n url = url.replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g, '/').replace(/\\/{2,}/g, '/')\n\n // remember leading parents\n if (_isRelative) {\n _leadingParents = url.substring(1).match(/^(\\.\\.\\/)+/) || ''\n if (_leadingParents) {\n _leadingParents = _leadingParents[0]\n }\n }\n\n // resolve parents\n while (true) {\n _parent = url.search(/\\/\\.\\.(\\/|$)/)\n if (_parent === -1) {\n // no more ../ to resolve\n break\n } else if (_parent === 0) {\n // top level cannot be relative, skip it\n url = url.substring(3)\n continue\n }\n\n _pos = url.substring(0, _parent).lastIndexOf('/')\n if (_pos === -1) {\n _pos = _parent\n }\n url = url.substring(0, _pos) + url.substring(_parent + 3)\n }\n\n // revert to relative\n if (_isRelative) {\n url = _leadingParents + url.substring(1)\n }\n\n return url\n}\n\nexport const splitUrl = _url => {\n let url = _url || ''\n let pos\n const res = {\n path: null,\n query: null,\n fragment: null\n }\n\n pos = url.indexOf('#')\n if (pos > -1) {\n res.fragment = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n pos = url.indexOf('?')\n if (pos > -1) {\n res.query = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n res.path = url\n\n return res\n}\n","// export const removeLeadingSlash = (str = '') => str.replace(/^\\.?\\//, '')\n// export const removeTrailingSearch = (str = '') => str.replace(/\\?[\\s\\S]*$/, '')\nexport const addLeadingSlash = (url = '') => (url.charAt(0) === '/' ? url : '/' + url);\nexport const hasBasename = (path = '', prefix = '') => new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path) || path === prefix;\nexport const stripBasename = (path = '', prefix = '') => hasBasename(path, prefix) ? path.substring(prefix.length) : path;\nexport const stripTrailing = (str = '') => str.replace(/[?#][\\s\\S]*$/, '');\nexport const stripSuffix = (path = '', suffix = '') => path.includes(suffix) ? path.substring(0, path.length - suffix.length) : path;\nclass RoutesAlias {\n constructor() {\n this.conf = [];\n this.getConfig = (url = '') => {\n const customRoute = this.conf.filter((arr) => {\n return arr.includes(url);\n });\n return customRoute[0];\n };\n this.getOrigin = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[0]) || url;\n };\n this.getAlias = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[1]) || url;\n };\n this.getAll = (url = '') => {\n return this.conf\n .filter((arr) => arr.includes(url))\n .reduceRight((p, a) => {\n p.unshift(a[1]);\n return p;\n }, []);\n };\n }\n set(customRoutes = {}) {\n for (let key in customRoutes) {\n const path = customRoutes[key];\n key = addLeadingSlash(key);\n if (typeof path === 'string') {\n this.conf.push([key, addLeadingSlash(path)]);\n }\n else if ((path === null || path === void 0 ? void 0 : path.length) > 0) {\n this.conf.push(...path.map(p => [key, addLeadingSlash(p)]));\n }\n }\n }\n}\nexport const routesAlias = new RoutesAlias();\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","import classNames from 'classnames'\nimport { FunctionalComponent, h } from '@stencil/core'\n\ntype TabbarItemProps = {\n index: number\n isSelected?: boolean\n textColor?: string\n badgeText?: string\n iconPath: string\n showRedDot?: boolean\n text?: string\n onSelect: (index: number) => void\n}\n\nexport const TabbarItem: FunctionalComponent<TabbarItemProps> = ({\n index,\n isSelected = false,\n textColor,\n iconPath,\n badgeText,\n showRedDot = false,\n text,\n onSelect\n}) => {\n const className = classNames('weui-tabbar__item', {\n 'weui-bar__item_on': isSelected\n })\n const badgeStyle = {\n position: 'absolute',\n top: '-2px',\n right: '-13px'\n }\n const dotStyle = {\n position: 'absolute',\n top: '0',\n right: '-6px'\n }\n\n function onClick () {\n onSelect(index)\n }\n\n return (\n <a key={index} href='javascript:;' class={className} onClick={onClick}>\n <span style={{ display: 'inline-block', position: 'relative' }}>\n <img src={iconPath} alt='' class='weui-tabbar__icon' />\n {!!badgeText && (\n <span\n class='weui-badge taro-tabbar-badge'\n style={badgeStyle}>\n {badgeText}\n </span>\n )}\n {showRedDot && (\n <span\n class='weui-badge weui-badge_dot'\n style={dotStyle}\n />\n )}\n </span>\n <p class='weui-tabbar__label' style={{ color: textColor }}>\n {text}\n </p>\n </a>\n )\n}\n","html,\nbody {\n height: 100%;\n}\n\n#app {\n height: 100%;\n}\n\n.taro-tabbar {\n &__border {\n &-white {\n &::before {\n border-top-color: #fff !important;\n }\n }\n }\n\n &__container {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n height: 100%;\n }\n\n &__panel {\n overflow: auto;\n position: relative;\n flex: 1;\n -webkit-overflow-scrolling: auto;\n }\n\n &__tabbar {\n position: relative;\n width: 100%;\n height: 50px;\n transition: bottom 0.2s, top 0.2s;\n\n &-top {\n top: 0;\n }\n\n &-bottom {\n bottom: 0;\n margin-bottom: constant(safe-area-inset-bottom);\n margin-bottom: env(safe-area-inset-bottom);\n }\n\n &-hide {\n display: none;\n }\n\n &-slideout {\n top: -52px;\n flex: 0 0;\n }\n }\n\n &__panel + &__tabbar-slideout {\n top: auto;\n bottom: -52px;\n }\n}\n","import { Component, Prop, h, ComponentInterface, Host, State, Event, EventEmitter, Element } from '@stencil/core'\nimport Taro from '@tarojs/taro'\nimport { addLeadingSlash, stripBasename, stripSuffix } from '@tarojs/router/dist/utils'\nimport { IH5RouterConfig } from '@tarojs/taro/types/compile'\nimport classNames from 'classnames'\nimport resolvePathname from 'resolve-pathname'\n\nimport { splitUrl } from '../../utils'\nimport { TabbarItem } from './tabbar-item'\n\nconst STATUS_SHOW = 0\nconst STATUS_HIDE = 1\nconst STATUS_SLIDEOUT = 2\n\nconst basicTabBarClassName = 'taro-tabbar__tabbar'\nconst hideTabBarClassName = 'taro-tabbar__tabbar-hide'\nconst hideTabBarWithAnimationClassName = 'taro-tabbar__tabbar-slideout'\n\ninterface RouterHandler {\n index: string\n text: string\n url: string\n successHandler: Function\n errorHandler: Function\n animation?: boolean\n}\n\nexport interface Conf {\n color: string\n selectedColor: string\n backgroundColor: string\n borderStyle?: 'black' | 'white'\n list: TabbarList[]\n position?: 'bottom' | 'top'\n custom: boolean\n customRoutes: Record<string, string | string[]>\n mode: IH5RouterConfig['mode']\n basename: string\n homePage: string\n currentPagename: string\n}\n\ninterface TabbarList {\n pagePath: string\n text: string\n iconPath?: string\n selectedIconPath?: string\n badgeText?: string\n showRedDot?: boolean\n}\n\n@Component({\n tag: 'taro-tabbar',\n styleUrl: './style/index.scss'\n})\nexport class Tabbar implements ComponentInterface {\n private homePage = ''\n\n private customRoutes: Array<string[]> = []\n\n private tabbarPos: 'top' | 'bottom' = 'bottom'\n\n @Prop() conf: Conf\n\n @State() list: TabbarList[]\n\n @State() borderStyle: Conf['borderStyle']\n\n @State() backgroundColor: Conf['backgroundColor']\n\n @State() color: Conf['color']\n\n @State() selectedColor: Conf['selectedColor']\n\n @State() selectedIndex = -1\n\n @State() status: 0 | 1 | 2 = STATUS_SHOW\n\n @Event({\n eventName: 'longpress'\n }) onLongPress: EventEmitter\n\n @Element() tabbar: HTMLDivElement\n\n constructor () {\n const list = this.conf.list\n const customRoutes = this.conf.customRoutes\n if (\n Object.prototype.toString.call(list) !== '[object Array]' ||\n list.length < 2 ||\n list.length > 5\n ) {\n throw new Error('tabBar 配置错误')\n }\n\n this.homePage = addLeadingSlash(this.conf.homePage)\n for (let key in customRoutes) {\n const path = customRoutes[key]\n key = addLeadingSlash(key)\n if (typeof path === 'string') {\n this.customRoutes.push([key, addLeadingSlash(path)])\n } else if (path?.length > 0) {\n this.customRoutes.push(...path.map(p => [key, addLeadingSlash(p)]))\n }\n }\n\n list.forEach(item => {\n if (item.pagePath.indexOf('/') !== 0) {\n item.pagePath = '/' + item.pagePath\n }\n })\n\n this.list = list\n this.borderStyle = this.conf.borderStyle\n this.backgroundColor = this.conf.backgroundColor\n this.color = this.conf.color\n this.selectedColor = this.conf.selectedColor\n }\n\n getCurrentUrl () {\n const routerMode = this.conf.mode\n const routerBasename = this.conf.basename || '/'\n let url\n if (routerMode === 'hash') {\n const href = window.location.href\n const hashIndex = href.indexOf('#')\n url = hashIndex === -1\n ? ''\n : href.substring(hashIndex + 1)\n } else {\n url = location.pathname\n }\n const processedUrl = addLeadingSlash(stripBasename(url, routerBasename))\n return decodeURI(processedUrl === '/' ? this.homePage : processedUrl)\n }\n\n getOriginUrl = (url: string) => {\n const customRoute = this.customRoutes.filter(([, customUrl]) => {\n const pathA = splitUrl(customUrl).path\n const pathB = splitUrl(url).path\n return pathA === pathB\n })\n return stripSuffix(customRoute.length ? customRoute[0][0] : url, '.html')\n }\n\n getSelectedIndex = (url: string) => {\n let foundIndex = -1\n this.list.forEach(({ pagePath }, idx) => {\n const pathA = splitUrl(url).path\n const pathB = splitUrl(pagePath).path\n if (pathA === pathB) {\n foundIndex = idx\n }\n })\n return foundIndex\n }\n\n switchTab = (index: number) => {\n this.selectedIndex = index\n Taro.switchTab({\n url: this.list[index].pagePath\n })\n }\n\n switchTabHandler = ({ url, successHandler, errorHandler }: RouterHandler) => {\n const currentUrl = this.getOriginUrl(this.getCurrentUrl() || this.homePage)\n const nextTab = resolvePathname(url, currentUrl)\n const foundIndex = this.getSelectedIndex(nextTab)\n\n if (foundIndex > -1) {\n this.switchTab(foundIndex)\n successHandler({\n errMsg: 'switchTab:ok'\n })\n } else {\n errorHandler({\n errMsg: `switchTab:fail page \"${nextTab}\" is not found`\n })\n }\n }\n\n routerChangeHandler = (options?) => {\n const to = options?.toLocation?.path\n let currentPage\n\n if (typeof to === 'string') {\n const routerBasename = this.conf.basename || '/'\n currentPage = stripBasename(addLeadingSlash(to || this.homePage), routerBasename) || '/'\n } else {\n currentPage = this.getCurrentUrl()\n }\n\n this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage))\n }\n\n setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n list[index].badgeText = text\n successHandler({\n errMsg: 'setTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].badgeText = null\n successHandler({\n errMsg: 'removeTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'removeTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].showRedDot = true\n successHandler({\n errMsg: 'showTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'showTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n successHandler({\n errMsg: 'hideTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'hideTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarHandler = ({ successHandler }) => {\n this.status = STATUS_SHOW\n successHandler({\n errMsg: 'showTabBar:ok'\n })\n }\n\n hideTabBarHandler = ({ animation, successHandler }) => {\n this.status = animation ? STATUS_SLIDEOUT : STATUS_HIDE\n successHandler({\n errMsg: 'hideTabBar:ok'\n })\n }\n\n setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {\n if (backgroundColor) this.backgroundColor = backgroundColor\n if (borderStyle) this.borderStyle = borderStyle\n if (color) this.color = color\n if (selectedColor) this.selectedColor = selectedColor\n successHandler({\n errMsg: 'setTabBarStyle:ok'\n })\n }\n\n setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {\n const list = [...this.list]\n if (index in list) {\n if (iconPath) list[index].iconPath = iconPath\n if (selectedIconPath) list[index].selectedIconPath = selectedIconPath\n if (text) list[index].text = text\n successHandler({\n errMsg: 'setTabBarItem:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarItem:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n bindEvent () {\n Taro.eventCenter.on('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.on('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.on('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.on('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.on('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n removeEvent () {\n Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.off('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.off('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.off('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.off('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n componentDidLoad () {\n this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom'\n this.bindEvent()\n this.routerChangeHandler()\n }\n\n disconnectedCallback () {\n this.removeEvent()\n }\n\n render () {\n const { tabbarPos = 'bottom' } = this\n const status = this.status\n const containerCls = classNames('weui-tabbar', {\n [`taro-tabbar__border-${this.borderStyle || 'black'}`]: true\n })\n const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE\n const shouldSlideout = status === STATUS_SLIDEOUT\n\n return (\n <Host\n class={classNames(\n basicTabBarClassName,\n `${basicTabBarClassName}-${tabbarPos}`, {\n [hideTabBarClassName]: shouldHideTabBar,\n [hideTabBarWithAnimationClassName]: shouldSlideout\n })} >\n <div\n class={containerCls}\n style={{\n backgroundColor: this.backgroundColor || '',\n height: 'inherit'\n }}\n >\n {this.list.map((item, index) => {\n const isSelected = this.selectedIndex === index\n let textColor\n let iconPath\n if (isSelected) {\n textColor = this.selectedColor || ''\n iconPath = item.selectedIconPath\n } else {\n textColor = this.color || ''\n iconPath = item.iconPath\n }\n return (\n <TabbarItem\n index={index}\n onSelect={this.switchTab.bind(this)}\n isSelected={isSelected}\n textColor={textColor}\n iconPath={iconPath}\n text={item.text}\n badgeText={item.badgeText}\n showRedDot={item.showRedDot}\n />\n )\n })}\n </div>\n </Host>\n )\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["src/utils/url.ts","../taro-router/dist/utils/index.js","../../node_modules/.pnpm/registry.npmjs.org+resolve-pathname@3.0.0/node_modules/resolve-pathname/esm/resolve-pathname.js","src/components/tabbar/tabbar-item.tsx","src/components/tabbar/style/index.scss?tag=taro-tabbar","src/components/tabbar/tabbar.tsx"],"names":["splitUrl","_url","url","pos","res","path","query","fragment","indexOf","substring","addLeadingSlash","charAt","hasBasename","prefix","RegExp","test","stripBasename","length","stripSuffix","suffix","includes","isAbsolute","pathname","spliceOne","list","index","i","k","n","pop","resolvePathname","to","from","undefined","toParts","split","fromParts","isToAbs","isFromAbs","mustEndAbs","concat","hasTrailingSlash","last","up","part","unshift","result","join","substr","TabbarItem","_b","_c","isSelected","textColor","iconPath","badgeText","_d","showRedDot","text","onSelect","className","classNames","weui-bar__item_on","badgeStyle","position","top","right","dotStyle","onClick","h","key","href","class","style","display","src","alt","color","indexCss","STATUS_SHOW","STATUS_HIDE","STATUS_SLIDEOUT","basicTabBarClassName","hideTabBarClassName","hideTabBarWithAnimationClassName","Tabbar","hostRef","_this","this","homePage","customRoutes","tabbarPos","getOriginUrl","customRoute","filter","customUrl","pathA","pathB","getSelectedIndex","foundIndex","forEach","idx","pagePath","switchTab","selectedIndex","Taro","switchTabHandler","successHandler","errorHandler","currentUrl","getCurrentUrl","nextTab","errMsg","routerChangeHandler","options","_a","toLocation","currentPage","routerBasename","conf","basename","setTabBarBadgeHandler","__spreadArray","removeTabBarBadgeHandler","showTabBarRedDotHandler","hideTabBarRedDotHandler","showTabBarHandler","status","hideTabBarHandler","animation","setTabBarStyleHandler","selectedColor","backgroundColor","borderStyle","setTabBarItemHandler","selectedIconPath","Object","prototype","toString","call","Error","this_1","push","apply","map","p","item","routerMode","mode","window","location","hashIndex","processedUrl","decodeURI","bindEvent","eventCenter","on","removeEvent","off","componentDidLoad","tabbar","nextElementSibling","disconnectedCallback","render","containerCls","shouldHideTabBar","shouldSlideout","Host","height","bind"],"mappings":"saAsDO,IAAMA,SAAW,SAAAC,GACtB,IAAIC,EAAMD,GAAQ,GAClB,IAAIE,EACJ,IAAMC,EAAM,CACVC,KAAM,KACNC,MAAO,KACPC,SAAU,MAGZJ,EAAMD,EAAIM,QAAQ,KAClB,GAAIL,GAAO,EAAG,CACZC,EAAIG,SAAWL,EAAIO,UAAUN,EAAM,GACnCD,EAAMA,EAAIO,UAAU,EAAGN,GAGzBA,EAAMD,EAAIM,QAAQ,KAClB,GAAIL,GAAO,EAAG,CACZC,EAAIE,MAAQJ,EAAIO,UAAUN,EAAM,GAChCD,EAAMA,EAAIO,UAAU,EAAGN,GAGzBC,EAAIC,KAAOH,EAEX,OAAOE,GC3EF,IAAMM,gBAAkB,SAACR,GAAA,GAAAA,SAAA,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,iBAAmB,GAAKuB,IAAW/C,YACjE,IAAMsF,EAAiBvC,IAAW9C,gBAElC,OACEZ,EAACkG,KAAI,CACH/F,MAAOX,WACLqB,qBACA,GAAA1C,OAAG0C,qBAAoB,KAAA1C,OAAImD,IAAWxC,EAAA,GACpCA,EAACgC,qBAAsBkF,EACvBlH,EAACiC,kCAAmCkF,OAExCjG,EAAA,MAAA,CACEG,MAAO4F,EACP3F,MAAO,CACL2D,gBAAiB5C,KAAK4C,iBAAmB,GACzCoC,OAAQ,YAGThF,KAAKhE,KAAKwH,KAAI,SAACE,EAAMzH,GACpB,IAAM2B,EAAamC,EAAKiB,gBAAkB/E,EAC1C,IAAI4B,EACJ,IAAIC,EACJ,GAAIF,EAAY,CACdC,EAAYkC,EAAK4C,eAAiB,GAClC7E,EAAW4F,EAAKX,qBACX,CACLlF,EAAYkC,EAAKV,OAAS,GAC1BvB,EAAW4F,EAAK5F,SAElB,OACEe,EAACpB,WAAU,CACTxB,MAAOA,EACPkC,SAAU4B,EAAKgB,UAAUkE,KAAKlF,GAC9BnC,WAAYA,EACZC,UAAWA,EACXC,SAAUA,EACVI,KAAMwF,EAAKxF,KACXH,UAAW2F,EAAK3F,UAChBE,WAAYyF,EAAKzF,qJAzUd","sourcesContent":["export const normalizePath = url => {\n let _isRelative\n let _leadingParents = ''\n let _parent, _pos\n\n // handle relative paths\n if (url.charAt(0) !== '/') {\n _isRelative = true\n url = '/' + url\n }\n\n // handle relative files (as opposed to directories)\n if (url.substring(-3) === '/..' || url.slice(-2) === '/.') {\n url += '/'\n }\n\n // resolve simples\n url = url.replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g, '/').replace(/\\/{2,}/g, '/')\n\n // remember leading parents\n if (_isRelative) {\n _leadingParents = url.substring(1).match(/^(\\.\\.\\/)+/) || ''\n if (_leadingParents) {\n _leadingParents = _leadingParents[0]\n }\n }\n\n // resolve parents\n while (true) {\n _parent = url.search(/\\/\\.\\.(\\/|$)/)\n if (_parent === -1) {\n // no more ../ to resolve\n break\n } else if (_parent === 0) {\n // top level cannot be relative, skip it\n url = url.substring(3)\n continue\n }\n\n _pos = url.substring(0, _parent).lastIndexOf('/')\n if (_pos === -1) {\n _pos = _parent\n }\n url = url.substring(0, _pos) + url.substring(_parent + 3)\n }\n\n // revert to relative\n if (_isRelative) {\n url = _leadingParents + url.substring(1)\n }\n\n return url\n}\n\nexport const splitUrl = _url => {\n let url = _url || ''\n let pos\n const res = {\n path: null,\n query: null,\n fragment: null\n }\n\n pos = url.indexOf('#')\n if (pos > -1) {\n res.fragment = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n pos = url.indexOf('?')\n if (pos > -1) {\n res.query = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n res.path = url\n\n return res\n}\n","// export const removeLeadingSlash = (str = '') => str.replace(/^\\.?\\//, '')\n// export const removeTrailingSearch = (str = '') => str.replace(/\\?[\\s\\S]*$/, '')\nexport const addLeadingSlash = (url = '') => (url.charAt(0) === '/' ? url : '/' + url);\nexport const hasBasename = (path = '', prefix = '') => new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path) || path === prefix;\nexport const stripBasename = (path = '', prefix = '') => hasBasename(path, prefix) ? path.substring(prefix.length) : path;\nexport const stripTrailing = (str = '') => str.replace(/[?#][\\s\\S]*$/, '');\nexport const stripSuffix = (path = '', suffix = '') => path.includes(suffix) ? path.substring(0, path.length - suffix.length) : path;\nexport const getHomePage = (path = '', basename = '', customRoutes = {}, entryPagePath = '') => {\n var _a;\n const routePath = addLeadingSlash(stripBasename(path, basename));\n const alias = ((_a = Object.entries(customRoutes).find(([key]) => key === routePath)) === null || _a === void 0 ? void 0 : _a[1]) || routePath;\n return entryPagePath || (typeof alias === 'string' ? alias : alias[0]) || basename;\n};\nclass RoutesAlias {\n constructor() {\n this.conf = [];\n this.getConfig = (url = '') => {\n const customRoute = this.conf.filter((arr) => {\n return arr.includes(url);\n });\n return customRoute[0];\n };\n this.getOrigin = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[0]) || url;\n };\n this.getAlias = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[1]) || url;\n };\n this.getAll = (url = '') => {\n return this.conf\n .filter((arr) => arr.includes(url))\n .reduceRight((p, a) => {\n p.unshift(a[1]);\n return p;\n }, []);\n };\n }\n set(customRoutes = {}) {\n for (let key in customRoutes) {\n const path = customRoutes[key];\n key = addLeadingSlash(key);\n if (typeof path === 'string') {\n this.conf.push([key, addLeadingSlash(path)]);\n }\n else if ((path === null || path === void 0 ? void 0 : path.length) > 0) {\n this.conf.push(...path.map(p => [key, addLeadingSlash(p)]));\n }\n }\n }\n}\nexport const routesAlias = new RoutesAlias();\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","import classNames from 'classnames'\nimport { FunctionalComponent, h } from '@stencil/core'\n\ntype TabbarItemProps = {\n index: number\n isSelected?: boolean\n textColor?: string\n badgeText?: string\n iconPath: string\n showRedDot?: boolean\n text?: string\n onSelect: (index: number) => void\n}\n\nexport const TabbarItem: FunctionalComponent<TabbarItemProps> = ({\n index,\n isSelected = false,\n textColor,\n iconPath,\n badgeText,\n showRedDot = false,\n text,\n onSelect\n}) => {\n const className = classNames('weui-tabbar__item', {\n 'weui-bar__item_on': isSelected\n })\n const badgeStyle = {\n position: 'absolute',\n top: '-2px',\n right: '-13px'\n }\n const dotStyle = {\n position: 'absolute',\n top: '0',\n right: '-6px'\n }\n\n function onClick () {\n onSelect(index)\n }\n\n return (\n <a key={index} href='javascript:;' class={className} onClick={onClick}>\n <span style={{ display: 'inline-block', position: 'relative' }}>\n <img src={iconPath} alt='' class='weui-tabbar__icon' />\n {!!badgeText && (\n <span\n class='weui-badge taro-tabbar-badge'\n style={badgeStyle}>\n {badgeText}\n </span>\n )}\n {showRedDot && (\n <span\n class='weui-badge weui-badge_dot'\n style={dotStyle}\n />\n )}\n </span>\n <p class='weui-tabbar__label' style={{ color: textColor }}>\n {text}\n </p>\n </a>\n )\n}\n","html,\nbody {\n height: 100%;\n}\n\n#app {\n height: 100%;\n}\n\n.taro-tabbar {\n &__border {\n &-white {\n &::before {\n border-top-color: #fff !important;\n }\n }\n }\n\n &__container {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n height: 100%;\n }\n\n &__panel {\n overflow: auto;\n position: relative;\n flex: 1;\n -webkit-overflow-scrolling: auto;\n }\n\n &__tabbar {\n position: relative;\n width: 100%;\n height: 50px;\n transition: bottom 0.2s, top 0.2s;\n\n &-top {\n top: 0;\n }\n\n &-bottom {\n bottom: 0;\n margin-bottom: constant(safe-area-inset-bottom);\n margin-bottom: env(safe-area-inset-bottom);\n }\n\n &-hide {\n display: none;\n }\n\n &-slideout {\n top: -52px;\n flex: 0 0;\n }\n }\n\n &__panel + &__tabbar-slideout {\n top: auto;\n bottom: -52px;\n }\n}\n","import { Component, Prop, h, ComponentInterface, Host, State, Event, EventEmitter, Element } from '@stencil/core'\nimport Taro from '@tarojs/taro'\nimport { addLeadingSlash, stripBasename, stripSuffix } from '@tarojs/router/dist/utils'\nimport { IH5RouterConfig } from '@tarojs/taro/types/compile'\nimport classNames from 'classnames'\nimport resolvePathname from 'resolve-pathname'\n\nimport { splitUrl } from '../../utils'\nimport { TabbarItem } from './tabbar-item'\n\nconst STATUS_SHOW = 0\nconst STATUS_HIDE = 1\nconst STATUS_SLIDEOUT = 2\n\nconst basicTabBarClassName = 'taro-tabbar__tabbar'\nconst hideTabBarClassName = 'taro-tabbar__tabbar-hide'\nconst hideTabBarWithAnimationClassName = 'taro-tabbar__tabbar-slideout'\n\ninterface RouterHandler {\n index: string\n text: string\n url: string\n successHandler: Function\n errorHandler: Function\n animation?: boolean\n}\n\nexport interface Conf {\n color: string\n selectedColor: string\n backgroundColor: string\n borderStyle?: 'black' | 'white'\n list: TabbarList[]\n position?: 'bottom' | 'top'\n custom: boolean\n customRoutes: Record<string, string | string[]>\n mode: IH5RouterConfig['mode']\n basename: string\n homePage: string\n currentPagename: string\n}\n\ninterface TabbarList {\n pagePath: string\n text: string\n iconPath?: string\n selectedIconPath?: string\n badgeText?: string\n showRedDot?: boolean\n}\n\n@Component({\n tag: 'taro-tabbar',\n styleUrl: './style/index.scss'\n})\nexport class Tabbar implements ComponentInterface {\n private homePage = ''\n\n private customRoutes: Array<string[]> = []\n\n private tabbarPos: 'top' | 'bottom' = 'bottom'\n\n @Prop() conf: Conf\n\n @State() list: TabbarList[]\n\n @State() borderStyle: Conf['borderStyle']\n\n @State() backgroundColor: Conf['backgroundColor']\n\n @State() color: Conf['color']\n\n @State() selectedColor: Conf['selectedColor']\n\n @State() selectedIndex = -1\n\n @State() status: 0 | 1 | 2 = STATUS_SHOW\n\n @Event({\n eventName: 'longpress'\n }) onLongPress: EventEmitter\n\n @Element() tabbar: HTMLDivElement\n\n constructor () {\n const list = this.conf.list\n const customRoutes = this.conf.customRoutes\n if (\n Object.prototype.toString.call(list) !== '[object Array]' ||\n list.length < 2 ||\n list.length > 5\n ) {\n throw new Error('tabBar 配置错误')\n }\n\n this.homePage = addLeadingSlash(this.conf.homePage)\n for (let key in customRoutes) {\n const path = customRoutes[key]\n key = addLeadingSlash(key)\n if (typeof path === 'string') {\n this.customRoutes.push([key, addLeadingSlash(path)])\n } else if (path?.length > 0) {\n this.customRoutes.push(...path.map(p => [key, addLeadingSlash(p)]))\n }\n }\n\n list.forEach(item => {\n if (item.pagePath.indexOf('/') !== 0) {\n item.pagePath = '/' + item.pagePath\n }\n })\n\n this.list = list\n this.borderStyle = this.conf.borderStyle\n this.backgroundColor = this.conf.backgroundColor\n this.color = this.conf.color\n this.selectedColor = this.conf.selectedColor\n }\n\n getCurrentUrl () {\n const routerMode = this.conf.mode\n const routerBasename = this.conf.basename || '/'\n let url\n if (routerMode === 'hash') {\n const href = window.location.href\n const hashIndex = href.indexOf('#')\n url = hashIndex === -1\n ? ''\n : href.substring(hashIndex + 1)\n } else {\n url = location.pathname\n }\n const processedUrl = addLeadingSlash(stripBasename(url, routerBasename))\n return decodeURI(processedUrl === '/' ? this.homePage : processedUrl)\n }\n\n getOriginUrl = (url: string) => {\n const customRoute = this.customRoutes.filter(([, customUrl]) => {\n const pathA = splitUrl(customUrl).path\n const pathB = splitUrl(url).path\n return pathA === pathB\n })\n return stripSuffix(customRoute.length ? customRoute[0][0] : url, '.html')\n }\n\n getSelectedIndex = (url: string) => {\n let foundIndex = -1\n this.list.forEach(({ pagePath }, idx) => {\n const pathA = splitUrl(url).path\n const pathB = splitUrl(pagePath).path\n if (pathA === pathB) {\n foundIndex = idx\n }\n })\n return foundIndex\n }\n\n switchTab = (index: number) => {\n this.selectedIndex = index\n Taro.switchTab({\n url: this.list[index].pagePath\n })\n }\n\n switchTabHandler = ({ url, successHandler, errorHandler }: RouterHandler) => {\n const currentUrl = this.getOriginUrl(this.getCurrentUrl() || this.homePage)\n const nextTab = resolvePathname(url, currentUrl)\n const foundIndex = this.getSelectedIndex(nextTab)\n\n if (foundIndex > -1) {\n this.switchTab(foundIndex)\n successHandler({\n errMsg: 'switchTab:ok'\n })\n } else {\n errorHandler({\n errMsg: `switchTab:fail page \"${nextTab}\" is not found`\n })\n }\n }\n\n routerChangeHandler = (options?) => {\n const to = options?.toLocation?.path\n let currentPage\n\n if (typeof to === 'string') {\n const routerBasename = this.conf.basename || '/'\n currentPage = stripBasename(addLeadingSlash(to || this.homePage), routerBasename) || '/'\n } else {\n currentPage = this.getCurrentUrl()\n }\n\n this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage))\n }\n\n setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n list[index].badgeText = text\n successHandler({\n errMsg: 'setTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].badgeText = null\n successHandler({\n errMsg: 'removeTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'removeTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].showRedDot = true\n successHandler({\n errMsg: 'showTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'showTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n successHandler({\n errMsg: 'hideTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'hideTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarHandler = ({ successHandler }) => {\n this.status = STATUS_SHOW\n successHandler({\n errMsg: 'showTabBar:ok'\n })\n }\n\n hideTabBarHandler = ({ animation, successHandler }) => {\n this.status = animation ? STATUS_SLIDEOUT : STATUS_HIDE\n successHandler({\n errMsg: 'hideTabBar:ok'\n })\n }\n\n setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {\n if (backgroundColor) this.backgroundColor = backgroundColor\n if (borderStyle) this.borderStyle = borderStyle\n if (color) this.color = color\n if (selectedColor) this.selectedColor = selectedColor\n successHandler({\n errMsg: 'setTabBarStyle:ok'\n })\n }\n\n setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {\n const list = [...this.list]\n if (index in list) {\n if (iconPath) list[index].iconPath = iconPath\n if (selectedIconPath) list[index].selectedIconPath = selectedIconPath\n if (text) list[index].text = text\n successHandler({\n errMsg: 'setTabBarItem:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarItem:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n bindEvent () {\n Taro.eventCenter.on('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.on('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.on('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.on('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.on('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n removeEvent () {\n Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.off('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.off('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.off('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.off('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n componentDidLoad () {\n this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom'\n this.bindEvent()\n this.routerChangeHandler()\n }\n\n disconnectedCallback () {\n this.removeEvent()\n }\n\n render () {\n const { tabbarPos = 'bottom' } = this\n const status = this.status\n const containerCls = classNames('weui-tabbar', {\n [`taro-tabbar__border-${this.borderStyle || 'black'}`]: true\n })\n const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE\n const shouldSlideout = status === STATUS_SLIDEOUT\n\n return (\n <Host\n class={classNames(\n basicTabBarClassName,\n `${basicTabBarClassName}-${tabbarPos}`, {\n [hideTabBarClassName]: shouldHideTabBar,\n [hideTabBarWithAnimationClassName]: shouldSlideout\n })} >\n <div\n class={containerCls}\n style={{\n backgroundColor: this.backgroundColor || '',\n height: 'inherit'\n }}\n >\n {this.list.map((item, index) => {\n const isSelected = this.selectedIndex === index\n let textColor\n let iconPath\n if (isSelected) {\n textColor = this.selectedColor || ''\n iconPath = item.selectedIconPath\n } else {\n textColor = this.color || ''\n iconPath = item.iconPath\n }\n return (\n <TabbarItem\n index={index}\n onSelect={this.switchTab.bind(this)}\n isSelected={isSelected}\n textColor={textColor}\n iconPath={iconPath}\n text={item.text}\n badgeText={item.badgeText}\n showRedDot={item.showRedDot}\n />\n )\n })}\n </div>\n </Host>\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as registerInstance,h,H as Host}from"./index-5d881caf.js";import{n as notSupport}from"./helper-3d0ecf0f.js";import"@tarojs/taro";var Tabs=function(){function t(t){registerInstance(this,t)}t.prototype.componentDidLoad=function(){notSupport("Tabs",this)};t.prototype.render=function(){return h(Host,null)};return t}();export{Tabs as taro_tabs_core};
|
|
2
|
+
//# sourceMappingURL=taro-tabs-core.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["src/components/tabs/tabs.tsx"],"names":["Tabs","prototype","componentDidLoad","notSupport","this","render","h","Host"],"mappings":"8IAOaA,KAAI,kDACfA,EAAAC,UAAAC,iBAAA,WACEC,WAAW,OAAQC,OAGrBJ,EAAAC,UAAAI,OAAA,WACE,OACEC,EAACC,KAAI,gBAPM","sourcesContent":["import { Component, ComponentInterface, h, Host } from '@stencil/core'\n\nimport { notSupport } from '../../utils'\n\n@Component({\n tag: 'taro-tabs-core'\n})\nexport class Tabs implements ComponentInterface {\n componentDidLoad () {\n notSupport('Tabs', this)\n }\n\n render () {\n return (\n <Host />\n )\n }\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-5d881caf.js";import{c as classnames}from"./index-1d8e8acd.js";var indexCss="body,html{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}taro-view-core{display:block}";var View=function(){function t(t){registerInstance(this,t);this.onLongPress=createEvent(this,"longpress",7);this.startTime=0;this.animation=undefined;this.hoverClass=undefined;this.hoverStartTime=50;this.hoverStayTime=400;this.hover=false;this.touch=false}t.prototype.onTouchStart=function(){var t=this;if(this.hoverClass){this.touch=true;setTimeout((function(){if(t.touch){t.hover=true}}),this.hoverStartTime)}this.timeoutEvent=setTimeout((function(){t.onLongPress.emit()}),350);this.startTime=Date.now()};t.prototype.onTouchMove=function(){clearTimeout(this.timeoutEvent)};t.prototype.onTouchEnd=function(){var t=this;var e=Date.now()-this.startTime;if(e<350){clearTimeout(this.timeoutEvent)}if(this.hoverClass){this.touch=false;setTimeout((function(){if(!t.touch){t.hover=false}}),this.hoverStayTime)}};t.prototype.componentDidRender=function(){var t=this.el;t.childNodes.forEach((function(t){if(t.nodeType===document.COMMENT_NODE&&t["s-cn"])t["s-cn"]=false}))};t.prototype.render=function(){var t;var e=classnames((t={},t["".concat(this.hoverClass)]=this.hover,t));var
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-5d881caf.js";import{c as classnames}from"./index-1d8e8acd.js";var indexCss="body,html{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}taro-view-core{display:block}";var View=function(){function t(t){registerInstance(this,t);this.onLongPress=createEvent(this,"longpress",7);this.startTime=0;this.animation=undefined;this.hoverClass=undefined;this.hoverStartTime=50;this.hoverStayTime=400;this.hover=false;this.touch=false}t.prototype.onTouchStart=function(){var t=this;if(this.hoverClass){this.touch=true;setTimeout((function(){if(t.touch){t.hover=true}}),this.hoverStartTime)}this.timeoutEvent=setTimeout((function(){t.onLongPress.emit()}),350);this.startTime=Date.now()};t.prototype.onTouchMove=function(){clearTimeout(this.timeoutEvent)};t.prototype.onTouchEnd=function(){var t=this;var e=Date.now()-this.startTime;if(e<350){clearTimeout(this.timeoutEvent)}if(this.hoverClass){this.touch=false;setTimeout((function(){if(!t.touch){t.hover=false}}),this.hoverStayTime)}};t.prototype.componentDidRender=function(){var t=this.el;t.childNodes.forEach((function(t){if(t.nodeType===document.COMMENT_NODE&&t["s-cn"])t["s-cn"]=false;if(t.nodeType!==document.COMMENT_NODE&&t["s-sr"])t["s-sr"]=false}))};t.prototype.render=function(){var t;var e=classnames((t={},t["".concat(this.hoverClass)]=this.hover,t));var s={};if(!!this.animation){s["animation"]=this.animation;s["data-animation"]=this.animation}return h(Host,Object.assign({class:e},s),h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();View.style=indexCss;export{View as taro_view_core};
|
|
2
2
|
//# sourceMappingURL=taro-view-core.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/components/view/style/index.scss?tag=taro-view-core","src/components/view/view.tsx"],"names":["indexCss","View","this","startTime","prototype","onTouchStart","_this","hoverClass","touch","setTimeout","hover","hoverStartTime","timeoutEvent","onLongPress","emit","Date","now","onTouchMove","clearTimeout","onTouchEnd","spanTime","hoverStayTime","componentDidRender","el","childNodes","forEach","item","nodeType","document","COMMENT_NODE","render","cls","classNames","_a","concat","attr","animation","h","Host","Object","assign","class"],"mappings":"qJAAA,IAAMA,SAAW,gLCOJC,KAAI,mGAePC,KAAAC,UAAY,yEAVK,sBACD,eACP,iBACA,MAUjBF,EAAAG,UAAAC,aAAA,WAAA,IAAAC,EAAAJ,KACE,GAAIA,KAAKK,WAAY,CACnBL,KAAKM,MAAQ,KACbC,YAAW,WACT,GAAIH,EAAKE,MAAO,CACdF,EAAKI,MAAQ,QAEdR,KAAKS,gBAGVT,KAAKU,aAAeH,YAAW,WAC7BH,EAAKO,YAAYC,SAChB,KACHZ,KAAKC,UAAYY,KAAKC,OAIxBf,EAAAG,UAAAa,YAAA,WACEC,aAAahB,KAAKU,eAIpBX,EAAAG,UAAAe,WAAA,WAAA,IAAAb,EAAAJ,KACE,IAAMkB,EAAWL,KAAKC,MAAQd,KAAKC,UACnC,GAAIiB,EAAW,IAAK,CAClBF,aAAahB,KAAKU,cAEpB,GAAIV,KAAKK,WAAY,CACnBL,KAAKM,MAAQ,MACbC,YAAW,WACT,IAAKH,EAAKE,MAAO,CACfF,EAAKI,MAAQ,SAEdR,KAAKmB,iBAIZpB,EAAAG,UAAAkB,mBAAA,WACE,IAAMC,EAAKrB,KAAKqB,GAChBA,EAAGC,WAAWC,SAAQ,SAAAC,
|
|
1
|
+
{"version":3,"sources":["src/components/view/style/index.scss?tag=taro-view-core","src/components/view/view.tsx"],"names":["indexCss","View","this","startTime","prototype","onTouchStart","_this","hoverClass","touch","setTimeout","hover","hoverStartTime","timeoutEvent","onLongPress","emit","Date","now","onTouchMove","clearTimeout","onTouchEnd","spanTime","hoverStayTime","componentDidRender","el","childNodes","forEach","item","nodeType","document","COMMENT_NODE","render","cls","classNames","_a","concat","attr","animation","h","Host","Object","assign","class"],"mappings":"qJAAA,IAAMA,SAAW,gLCOJC,KAAI,mGAePC,KAAAC,UAAY,yEAVK,sBACD,eACP,iBACA,MAUjBF,EAAAG,UAAAC,aAAA,WAAA,IAAAC,EAAAJ,KACE,GAAIA,KAAKK,WAAY,CACnBL,KAAKM,MAAQ,KACbC,YAAW,WACT,GAAIH,EAAKE,MAAO,CACdF,EAAKI,MAAQ,QAEdR,KAAKS,gBAGVT,KAAKU,aAAeH,YAAW,WAC7BH,EAAKO,YAAYC,SAChB,KACHZ,KAAKC,UAAYY,KAAKC,OAIxBf,EAAAG,UAAAa,YAAA,WACEC,aAAahB,KAAKU,eAIpBX,EAAAG,UAAAe,WAAA,WAAA,IAAAb,EAAAJ,KACE,IAAMkB,EAAWL,KAAKC,MAAQd,KAAKC,UACnC,GAAIiB,EAAW,IAAK,CAClBF,aAAahB,KAAKU,cAEpB,GAAIV,KAAKK,WAAY,CACnBL,KAAKM,MAAQ,MACbC,YAAW,WACT,IAAKH,EAAKE,MAAO,CACfF,EAAKI,MAAQ,SAEdR,KAAKmB,iBAIZpB,EAAAG,UAAAkB,mBAAA,WACE,IAAMC,EAAKrB,KAAKqB,GAChBA,EAAGC,WAAWC,SAAQ,SAAAC,GAEpB,GAAIA,EAAKC,WAAaC,SAASC,cAAgBH,EAAK,QAASA,EAAK,QAAU,MAE5E,GAAIA,EAAKC,WAAaC,SAASC,cAAgBH,EAAK,QAASA,EAAK,QAAU,UAIhFzB,EAAAG,UAAA0B,OAAA,iBACE,IAAMC,EAAMC,YAAUC,EAAA,GACpBA,EAAC,GAAAC,OAAGhC,KAAKK,aAAeL,KAAKQ,UAE/B,IAAIyB,EAAO,GACX,KAAMjC,KAAKkC,UAAW,CACpBD,EAAK,aAAejC,KAAKkC,UACzBD,EAAK,kBAAoBjC,KAAKkC,UAEhC,OACEC,EAACC,KAAIC,OAAAC,OAAA,CAACC,MAAOV,GAASI,GACpBE,EAAA,OAAA,sIA5ES","sourcesContent":["body,\nhtml {\n user-select: none;\n -webkit-tap-highlight-color: rgb(0 0 0 / 0%);\n}\n\ntaro-view-core {\n display: block;\n}\n","import { Component, Prop, h, ComponentInterface, Host, Listen, State, Event, EventEmitter, Element } from '@stencil/core'\nimport classNames from 'classnames'\n\n@Component({\n tag: 'taro-view-core',\n styleUrl: './style/index.scss'\n})\nexport class View implements ComponentInterface {\n @Element() el: HTMLElement\n\n @Prop() animation: string\n @Prop() hoverClass: string\n @Prop() hoverStartTime = 50\n @Prop() hoverStayTime = 400\n @State() hover = false\n @State() touch = false\n\n @Event({\n eventName: 'longpress'\n }) onLongPress: EventEmitter\n\n private timeoutEvent: ReturnType<typeof setTimeout>\n private startTime = 0\n\n @Listen('touchstart')\n onTouchStart () {\n if (this.hoverClass) {\n this.touch = true\n setTimeout(() => {\n if (this.touch) {\n this.hover = true\n }\n }, this.hoverStartTime)\n }\n\n this.timeoutEvent = setTimeout(() => {\n this.onLongPress.emit()\n }, 350)\n this.startTime = Date.now()\n }\n\n @Listen('touchmove')\n onTouchMove () {\n clearTimeout(this.timeoutEvent)\n }\n\n @Listen('touchend')\n onTouchEnd () {\n const spanTime = Date.now() - this.startTime\n if (spanTime < 350) {\n clearTimeout(this.timeoutEvent)\n }\n if (this.hoverClass) {\n this.touch = false\n setTimeout(() => {\n if (!this.touch) {\n this.hover = false\n }\n }, this.hoverStayTime)\n }\n }\n\n componentDidRender () {\n const el = this.el\n el.childNodes.forEach(item => {\n // Note: ['s-cn'] Content Reference Node\n if (item.nodeType === document.COMMENT_NODE && item['s-cn']) item['s-cn'] = false\n // Note: ['s-sr'] Is a slot reference node (渲染完成后禁用 slotRelocation 特性, 避免 Stencil 组件相互调用时内置排序与第三方 UI 框架冲突导致组件顺序混乱)\n if (item.nodeType !== document.COMMENT_NODE && item['s-sr']) item['s-sr'] = false\n })\n }\n\n render() {\n const cls = classNames({\n [`${this.hoverClass}`]: this.hover\n })\n let attr = {}\n if (!!this.animation) {\n attr['animation'] = this.animation\n attr['data-animation'] = this.animation\n }\n return (\n <Host class={cls} {...attr}>\n <slot></slot>\n </Host>\n )\n }\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
|
-
import reactifyWc from './reactify-wc';
|
|
2
|
+
import reactifyWc from './reactify-wc';
|
|
3
3
|
|
|
4
|
+
// 视图容器
|
|
4
5
|
export var CoverImage = reactifyWc('taro-cover-image-core');
|
|
5
6
|
export var CoverView = reactifyWc('taro-cover-view-core');
|
|
6
7
|
export var MatchMedia = reactifyWc('taro-match-media-core');
|
|
@@ -12,13 +13,15 @@ export var ScrollView = reactifyWc('taro-scroll-view-core');
|
|
|
12
13
|
export var ShareElement = reactifyWc('taro-share-element-core');
|
|
13
14
|
export var Swiper = reactifyWc('taro-swiper-core');
|
|
14
15
|
export var SwiperItem = reactifyWc('taro-swiper-item-core');
|
|
15
|
-
export var View = reactifyWc('taro-view-core');
|
|
16
|
+
export var View = reactifyWc('taro-view-core');
|
|
16
17
|
|
|
18
|
+
// 基础内容
|
|
17
19
|
export var Icon = reactifyWc('taro-icon-core');
|
|
18
20
|
export var Progress = reactifyWc('taro-progress-core');
|
|
19
21
|
export var RichText = reactifyWc('taro-rich-text-core');
|
|
20
|
-
export var Text = reactifyWc('taro-text-core');
|
|
22
|
+
export var Text = reactifyWc('taro-text-core');
|
|
21
23
|
|
|
24
|
+
// 表单组件
|
|
22
25
|
export var Button = reactifyWc('taro-button-core');
|
|
23
26
|
export var Checkbox = reactifyWc('taro-checkbox-core');
|
|
24
27
|
export var CheckboxGroup = reactifyWc('taro-checkbox-group-core');
|
|
@@ -34,31 +37,38 @@ export var Radio = reactifyWc('taro-radio-core');
|
|
|
34
37
|
export var RadioGroup = reactifyWc('taro-radio-group-core');
|
|
35
38
|
export var Slider = reactifyWc('taro-slider-core');
|
|
36
39
|
export var Switch = reactifyWc('taro-switch-core');
|
|
37
|
-
export var Textarea = reactifyWc('taro-textarea-core');
|
|
40
|
+
export var Textarea = reactifyWc('taro-textarea-core');
|
|
38
41
|
|
|
42
|
+
// 导航
|
|
39
43
|
export var FunctionalPageNavigator = reactifyWc('taro-functional-page-navigator-core');
|
|
40
44
|
export var Navigator = reactifyWc('taro-navigator-core');
|
|
41
|
-
export var NavigationBar = reactifyWc('taro-navigation-bar-core');
|
|
45
|
+
export var NavigationBar = reactifyWc('taro-navigation-bar-core');
|
|
42
46
|
|
|
47
|
+
// 媒体组件
|
|
43
48
|
export var Audio = reactifyWc('taro-audio-core');
|
|
44
49
|
export var Camera = reactifyWc('taro-camera-core');
|
|
45
50
|
export var Image = reactifyWc('taro-image-core');
|
|
46
51
|
export var LivePlayer = reactifyWc('taro-live-player-core');
|
|
47
52
|
export var LivePusher = reactifyWc('taro-live-pusher-core');
|
|
48
53
|
export var Video = reactifyWc('taro-video-core');
|
|
49
|
-
export var VoipRoom = reactifyWc('taro-voip-room-core');
|
|
54
|
+
export var VoipRoom = reactifyWc('taro-voip-room-core');
|
|
50
55
|
|
|
51
|
-
|
|
56
|
+
// 地图
|
|
57
|
+
export var Map = reactifyWc('taro-map-core');
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
// 画布
|
|
60
|
+
export var Canvas = reactifyWc('taro-canvas-core');
|
|
54
61
|
|
|
62
|
+
// 开放能力
|
|
55
63
|
export var Ad = reactifyWc('taro-ad-core');
|
|
56
64
|
export var AdCustom = reactifyWc('taro-ad-custom-core');
|
|
57
65
|
export var OfficialAccount = reactifyWc('taro-official-account-core');
|
|
58
66
|
export var OpenData = reactifyWc('taro-open-data-core');
|
|
59
|
-
export var WebView = reactifyWc('taro-web-view-core');
|
|
67
|
+
export var WebView = reactifyWc('taro-web-view-core');
|
|
60
68
|
|
|
61
|
-
|
|
69
|
+
// 页面属性配置节点
|
|
70
|
+
export var PageMeta = reactifyWc('taro-page-meta-core');
|
|
62
71
|
|
|
72
|
+
// 其他
|
|
63
73
|
export var Block = Fragment;
|
|
64
74
|
export var CustomWrapper = reactifyWc('taro-custom-wrapper-core');
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
2
|
import React from 'react';
|
|
8
3
|
import reactifyWc from './reactify-wc';
|
|
9
4
|
var Input = reactifyWc('taro-input-core');
|
|
10
|
-
var h = React.createElement;
|
|
5
|
+
var h = React.createElement;
|
|
11
6
|
|
|
12
|
-
|
|
7
|
+
// eslint-disable-next-line react/display-name
|
|
8
|
+
export default /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13
9
|
var args = _objectSpread({}, props);
|
|
14
|
-
|
|
15
10
|
if (args.hasOwnProperty('focus')) {
|
|
16
11
|
args.autoFocus = Boolean(args.focus);
|
|
17
12
|
delete args.focus;
|
|
18
13
|
}
|
|
19
|
-
|
|
20
14
|
return h(Input, _objectSpread(_objectSpread({}, args), {}, {
|
|
21
15
|
ref: ref
|
|
22
16
|
}));
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
-
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
-
|
|
15
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
|
-
|
|
17
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
-
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
4
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
9
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
19
11
|
/**
|
|
20
12
|
* https://github.com/BBKolton/reactify-wc/
|
|
21
13
|
* modified event naming
|
|
@@ -23,8 +15,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
23
15
|
import React, { createElement, createRef } from 'react';
|
|
24
16
|
var h = React.createElement;
|
|
25
17
|
var SCROLL_VIEW = 'taro-scroll-view-core';
|
|
26
|
-
var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
18
|
+
var IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
|
|
27
19
|
|
|
20
|
+
// 为了不要覆盖 wc 中 host 内置的 class 和 stencil 加入的 class
|
|
28
21
|
function getClassName(wc, prevProps, props) {
|
|
29
22
|
var classList = Array.from(wc.classList);
|
|
30
23
|
var oldClassNames = (prevProps.className || prevProps.class || '').split(' ');
|
|
@@ -43,7 +36,6 @@ function getClassName(wc, prevProps, props) {
|
|
|
43
36
|
finalClassNames = [].concat(_toConsumableArray(finalClassNames), _toConsumableArray(incomingClassNames));
|
|
44
37
|
return finalClassNames.join(' ');
|
|
45
38
|
}
|
|
46
|
-
|
|
47
39
|
function updateStyle(dom, key, val) {
|
|
48
40
|
if (/^--/.test(key)) {
|
|
49
41
|
// css variable
|
|
@@ -54,32 +46,26 @@ function updateStyle(dom, key, val) {
|
|
|
54
46
|
dom.style[key] = val + 'px';
|
|
55
47
|
}
|
|
56
48
|
}
|
|
57
|
-
|
|
58
49
|
function updateProp(ctx, comp, propKey, prevProps, props) {
|
|
59
50
|
var dom = ctx.ref.current;
|
|
60
51
|
var val = props[propKey];
|
|
61
52
|
var prevVal = prevProps ? prevProps[propKey] : undefined;
|
|
62
|
-
|
|
63
53
|
if (propKey === 'children') {
|
|
64
54
|
return;
|
|
65
55
|
}
|
|
66
|
-
|
|
67
56
|
if (propKey.toLowerCase() === 'classname') {
|
|
68
57
|
dom.className = prevProps ? getClassName(dom, prevProps, props) : val;
|
|
69
58
|
return;
|
|
70
59
|
}
|
|
71
|
-
|
|
72
60
|
if (propKey === 'style') {
|
|
73
61
|
if (typeof val === 'string') {
|
|
74
62
|
dom.setAttribute(propKey, val);
|
|
75
63
|
return;
|
|
76
64
|
}
|
|
77
|
-
|
|
78
65
|
if (!val) {
|
|
79
66
|
dom.removeAttribute(propKey);
|
|
80
67
|
return;
|
|
81
68
|
}
|
|
82
|
-
|
|
83
69
|
if (prevProps) {
|
|
84
70
|
if (typeof prevVal === 'string') {
|
|
85
71
|
dom.style.cssText = '';
|
|
@@ -89,82 +75,66 @@ function updateProp(ctx, comp, propKey, prevProps, props) {
|
|
|
89
75
|
}
|
|
90
76
|
}
|
|
91
77
|
}
|
|
92
|
-
|
|
93
78
|
for (var _styleKey in val) {
|
|
94
79
|
updateStyle(dom, _styleKey, val[_styleKey]);
|
|
95
80
|
}
|
|
96
|
-
|
|
97
81
|
return;
|
|
98
82
|
}
|
|
99
|
-
|
|
100
83
|
if (/^data-.+/.test(propKey)) {
|
|
101
84
|
dom.setAttribute(propKey, val);
|
|
102
85
|
}
|
|
103
|
-
|
|
104
86
|
if (comp === SCROLL_VIEW) {
|
|
105
87
|
if (propKey === 'scrollTop') {
|
|
106
88
|
dom.mpScrollTop = val;
|
|
107
89
|
return;
|
|
108
90
|
}
|
|
109
|
-
|
|
110
91
|
if (propKey === 'scrollLeft') {
|
|
111
92
|
dom.mpScrollLeft = val;
|
|
112
93
|
return;
|
|
113
94
|
}
|
|
114
|
-
|
|
115
95
|
if (propKey === 'scrollIntoView') {
|
|
116
96
|
dom.mpScrollIntoView = val;
|
|
117
97
|
return;
|
|
118
98
|
}
|
|
119
99
|
}
|
|
120
|
-
|
|
121
100
|
if (typeof val === 'function' && propKey.match(/^on[A-Z]/)) {
|
|
122
101
|
var event = propKey.substr(2).toLowerCase();
|
|
123
102
|
ctx.eventHandlers.push([event, val]);
|
|
124
103
|
return dom.addEventListener(event, val);
|
|
125
104
|
}
|
|
126
|
-
|
|
127
105
|
if (typeof val === 'string' || typeof val === 'number') {
|
|
128
106
|
dom.setAttribute(propKey, val);
|
|
129
107
|
dom[propKey] = val;
|
|
130
108
|
return;
|
|
131
109
|
}
|
|
132
|
-
|
|
133
110
|
if (typeof val === 'boolean') {
|
|
134
111
|
if (val) {
|
|
135
112
|
dom[propKey] = true;
|
|
136
113
|
return dom.setAttribute(propKey, val);
|
|
137
114
|
}
|
|
138
|
-
|
|
139
115
|
dom[propKey] = false;
|
|
140
116
|
return dom.removeAttribute(propKey);
|
|
141
117
|
}
|
|
142
|
-
|
|
143
118
|
dom[propKey] = val;
|
|
144
119
|
}
|
|
145
|
-
|
|
146
120
|
var reactifyWebComponent = function reactifyWebComponent(WC) {
|
|
147
121
|
var Index = /*#__PURE__*/function (_React$Component) {
|
|
148
122
|
_inherits(Index, _React$Component);
|
|
149
|
-
|
|
150
123
|
var _super = _createSuper(Index);
|
|
151
|
-
|
|
152
124
|
function Index(props) {
|
|
153
125
|
var _this;
|
|
154
|
-
|
|
155
126
|
_classCallCheck(this, Index);
|
|
156
|
-
|
|
157
127
|
_this = _super.call(this, props);
|
|
128
|
+
_defineProperty(_assertThisInitialized(_this), "eventHandlers", void 0);
|
|
129
|
+
_defineProperty(_assertThisInitialized(_this), "ref", void 0);
|
|
158
130
|
_this.eventHandlers = [];
|
|
159
|
-
_this.ref = createRef();
|
|
131
|
+
_this.ref = /*#__PURE__*/createRef();
|
|
160
132
|
return _this;
|
|
161
133
|
}
|
|
162
|
-
|
|
163
134
|
_createClass(Index, [{
|
|
164
135
|
key: "update",
|
|
165
136
|
value: function update(prevProps) {
|
|
166
137
|
var _this2 = this;
|
|
167
|
-
|
|
168
138
|
this.clearEventHandlers();
|
|
169
139
|
if (!this.ref.current) return;
|
|
170
140
|
Object.keys(prevProps || {}).forEach(function (key) {
|
|
@@ -185,7 +155,6 @@ var reactifyWebComponent = function reactifyWebComponent(WC) {
|
|
|
185
155
|
key: "componentDidMount",
|
|
186
156
|
value: function componentDidMount() {
|
|
187
157
|
var forwardRef = this.props.forwardRef;
|
|
188
|
-
|
|
189
158
|
if (typeof forwardRef === 'function') {
|
|
190
159
|
forwardRef(this.ref.current);
|
|
191
160
|
} else if (forwardRef && _typeof(forwardRef) === 'object' && forwardRef.hasOwnProperty('current')) {
|
|
@@ -193,7 +162,6 @@ var reactifyWebComponent = function reactifyWebComponent(WC) {
|
|
|
193
162
|
} else if (typeof forwardRef === 'string') {
|
|
194
163
|
console.warn('内置组件不支持字符串 ref');
|
|
195
164
|
}
|
|
196
|
-
|
|
197
165
|
this.update(undefined);
|
|
198
166
|
}
|
|
199
167
|
}, {
|
|
@@ -205,14 +173,11 @@ var reactifyWebComponent = function reactifyWebComponent(WC) {
|
|
|
205
173
|
key: "clearEventHandlers",
|
|
206
174
|
value: function clearEventHandlers() {
|
|
207
175
|
var _this3 = this;
|
|
208
|
-
|
|
209
176
|
this.eventHandlers.forEach(function (_ref) {
|
|
210
177
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
178
|
+
event = _ref2[0],
|
|
179
|
+
handler = _ref2[1];
|
|
214
180
|
if (!_this3.ref.current) return;
|
|
215
|
-
|
|
216
181
|
_this3.ref.current.removeEventListener(event, handler);
|
|
217
182
|
});
|
|
218
183
|
this.eventHandlers = [];
|
|
@@ -221,25 +186,21 @@ var reactifyWebComponent = function reactifyWebComponent(WC) {
|
|
|
221
186
|
key: "render",
|
|
222
187
|
value: function render() {
|
|
223
188
|
var _this$props = this.props,
|
|
224
|
-
|
|
225
|
-
|
|
189
|
+
children = _this$props.children,
|
|
190
|
+
dangerouslySetInnerHTML = _this$props.dangerouslySetInnerHTML;
|
|
226
191
|
var props = {
|
|
227
192
|
ref: this.ref
|
|
228
193
|
};
|
|
229
194
|
if (dangerouslySetInnerHTML) props.dangerouslySetInnerHTML = dangerouslySetInnerHTML;
|
|
230
|
-
return createElement(WC, props, children);
|
|
195
|
+
return /*#__PURE__*/createElement(WC, props, children);
|
|
231
196
|
}
|
|
232
197
|
}]);
|
|
233
|
-
|
|
234
198
|
return Index;
|
|
235
199
|
}(React.Component); // eslint-disable-next-line react/display-name
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
return React.forwardRef(function (props, ref) {
|
|
200
|
+
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
239
201
|
return h(Index, _objectSpread(_objectSpread({}, props), {}, {
|
|
240
202
|
forwardRef: ref
|
|
241
203
|
}));
|
|
242
204
|
});
|
|
243
205
|
};
|
|
244
|
-
|
|
245
206
|
export default reactifyWebComponent;
|