@tarojs/components 3.6.0-canary.10 → 3.6.0-canary.12
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/taro-swiper-core_2.cjs.entry.js +3 -5
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/swiper/swiper.js +3 -5
- package/dist/collection/components/swiper/swiper.js.map +1 -1
- package/dist/components/helper.js +15 -0
- package/dist/components/helper.js.map +1 -0
- package/dist/components/hls.js +27622 -0
- package/dist/components/hls.js.map +1 -0
- package/dist/components/index.d.ts +97 -0
- package/dist/components/index.js +79 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index2.js +78 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/index3.js +33 -0
- package/dist/components/index3.js.map +1 -0
- package/dist/components/intersection-observer.js +728 -0
- package/dist/components/intersection-observer.js.map +1 -0
- package/dist/components/picker-group.js +220 -0
- package/dist/components/picker-group.js.map +1 -0
- package/dist/components/taro-ad-core.d.ts +11 -0
- package/dist/components/taro-ad-core.js +35 -0
- package/dist/components/taro-ad-core.js.map +1 -0
- package/dist/components/taro-ad-custom-core.d.ts +11 -0
- package/dist/components/taro-ad-custom-core.js +35 -0
- package/dist/components/taro-ad-custom-core.js.map +1 -0
- package/dist/components/taro-animation-video-core.d.ts +11 -0
- package/dist/components/taro-animation-video-core.js +35 -0
- package/dist/components/taro-animation-video-core.js.map +1 -0
- package/dist/components/taro-animation-view-core.d.ts +11 -0
- package/dist/components/taro-animation-view-core.js +35 -0
- package/dist/components/taro-animation-view-core.js.map +1 -0
- package/dist/components/taro-ar-camera-core.d.ts +11 -0
- package/dist/components/taro-ar-camera-core.js +35 -0
- package/dist/components/taro-ar-camera-core.js.map +1 -0
- package/dist/components/taro-audio-core.d.ts +11 -0
- package/dist/components/taro-audio-core.js +80 -0
- package/dist/components/taro-audio-core.js.map +1 -0
- package/dist/components/taro-aweme-data-core.d.ts +11 -0
- package/dist/components/taro-aweme-data-core.js +35 -0
- package/dist/components/taro-aweme-data-core.js.map +1 -0
- package/dist/components/taro-block-core.d.ts +11 -0
- package/dist/components/taro-block-core.js +31 -0
- package/dist/components/taro-block-core.js.map +1 -0
- package/dist/components/taro-button-core.d.ts +11 -0
- package/dist/components/taro-button-core.js +102 -0
- package/dist/components/taro-button-core.js.map +1 -0
- package/dist/components/taro-camera-core.d.ts +11 -0
- package/dist/components/taro-camera-core.js +35 -0
- package/dist/components/taro-camera-core.js.map +1 -0
- package/dist/components/taro-canvas-core.d.ts +11 -0
- package/dist/components/taro-canvas-core.js +57 -0
- package/dist/components/taro-canvas-core.js.map +1 -0
- package/dist/components/taro-checkbox-core.d.ts +11 -0
- package/dist/components/taro-checkbox-core.js +81 -0
- package/dist/components/taro-checkbox-core.js.map +1 -0
- package/dist/components/taro-checkbox-group-core.d.ts +11 -0
- package/dist/components/taro-checkbox-group-core.js +71 -0
- package/dist/components/taro-checkbox-group-core.js.map +1 -0
- package/dist/components/taro-comment-detail-core.d.ts +11 -0
- package/dist/components/taro-comment-detail-core.js +35 -0
- package/dist/components/taro-comment-detail-core.js.map +1 -0
- package/dist/components/taro-comment-list-core.d.ts +11 -0
- package/dist/components/taro-comment-list-core.js +35 -0
- package/dist/components/taro-comment-list-core.js.map +1 -0
- package/dist/components/taro-contact-button-core.d.ts +11 -0
- package/dist/components/taro-contact-button-core.js +35 -0
- package/dist/components/taro-contact-button-core.js.map +1 -0
- package/dist/components/taro-cover-image-core.d.ts +11 -0
- package/dist/components/taro-cover-image-core.js +52 -0
- package/dist/components/taro-cover-image-core.js.map +1 -0
- package/dist/components/taro-cover-view-core.d.ts +11 -0
- package/dist/components/taro-cover-view-core.js +89 -0
- package/dist/components/taro-cover-view-core.js.map +1 -0
- package/dist/components/taro-custom-wrapper-core.d.ts +11 -0
- package/dist/components/taro-custom-wrapper-core.js +31 -0
- package/dist/components/taro-custom-wrapper-core.js.map +1 -0
- package/dist/components/taro-editor-core.d.ts +11 -0
- package/dist/components/taro-editor-core.js +35 -0
- package/dist/components/taro-editor-core.js.map +1 -0
- package/dist/components/taro-follow-swan-core.d.ts +11 -0
- package/dist/components/taro-follow-swan-core.js +35 -0
- package/dist/components/taro-follow-swan-core.js.map +1 -0
- package/dist/components/taro-form-core.d.ts +11 -0
- package/dist/components/taro-form-core.js +140 -0
- package/dist/components/taro-form-core.js.map +1 -0
- package/dist/components/taro-functional-page-navigator-core.d.ts +11 -0
- package/dist/components/taro-functional-page-navigator-core.js +35 -0
- package/dist/components/taro-functional-page-navigator-core.js.map +1 -0
- package/dist/components/taro-icon-core.d.ts +11 -0
- package/dist/components/taro-icon-core.js +48 -0
- package/dist/components/taro-icon-core.js.map +1 -0
- package/dist/components/taro-image-core.d.ts +11 -0
- package/dist/components/taro-image-core.js +81 -0
- package/dist/components/taro-image-core.js.map +1 -0
- package/dist/components/taro-inline-payment-panel-core.d.ts +11 -0
- package/dist/components/taro-inline-payment-panel-core.js +35 -0
- package/dist/components/taro-inline-payment-panel-core.js.map +1 -0
- package/dist/components/taro-input-core.d.ts +11 -0
- package/dist/components/taro-input-core.js +246 -0
- package/dist/components/taro-input-core.js.map +1 -0
- package/dist/components/taro-keyboard-accessory-core.d.ts +11 -0
- package/dist/components/taro-keyboard-accessory-core.js +35 -0
- package/dist/components/taro-keyboard-accessory-core.js.map +1 -0
- package/dist/components/taro-label-core.d.ts +11 -0
- package/dist/components/taro-label-core.js +34 -0
- package/dist/components/taro-label-core.js.map +1 -0
- package/dist/components/taro-lifestyle-core.d.ts +11 -0
- package/dist/components/taro-lifestyle-core.js +35 -0
- package/dist/components/taro-lifestyle-core.js.map +1 -0
- package/dist/components/taro-like-core.d.ts +11 -0
- package/dist/components/taro-like-core.js +35 -0
- package/dist/components/taro-like-core.js.map +1 -0
- package/dist/components/taro-live-player-core.d.ts +11 -0
- package/dist/components/taro-live-player-core.js +35 -0
- package/dist/components/taro-live-player-core.js.map +1 -0
- package/dist/components/taro-live-pusher-core.d.ts +11 -0
- package/dist/components/taro-live-pusher-core.js +35 -0
- package/dist/components/taro-live-pusher-core.js.map +1 -0
- package/dist/components/taro-login-core.d.ts +11 -0
- package/dist/components/taro-login-core.js +35 -0
- package/dist/components/taro-login-core.js.map +1 -0
- package/dist/components/taro-lottie-core.d.ts +11 -0
- package/dist/components/taro-lottie-core.js +35 -0
- package/dist/components/taro-lottie-core.js.map +1 -0
- package/dist/components/taro-map-core.d.ts +11 -0
- package/dist/components/taro-map-core.js +35 -0
- package/dist/components/taro-map-core.js.map +1 -0
- package/dist/components/taro-match-media-core.d.ts +11 -0
- package/dist/components/taro-match-media-core.js +35 -0
- package/dist/components/taro-match-media-core.js.map +1 -0
- package/dist/components/taro-movable-area-core.d.ts +11 -0
- package/dist/components/taro-movable-area-core.js +175 -0
- package/dist/components/taro-movable-area-core.js.map +1 -0
- package/dist/components/taro-movable-view-core.d.ts +11 -0
- package/dist/components/taro-movable-view-core.js +361 -0
- package/dist/components/taro-movable-view-core.js.map +1 -0
- package/dist/components/taro-native-slot-core.d.ts +11 -0
- package/dist/components/taro-native-slot-core.js +35 -0
- package/dist/components/taro-native-slot-core.js.map +1 -0
- package/dist/components/taro-navigation-bar-core.d.ts +11 -0
- package/dist/components/taro-navigation-bar-core.js +35 -0
- package/dist/components/taro-navigation-bar-core.js.map +1 -0
- package/dist/components/taro-navigator-core.d.ts +11 -0
- package/dist/components/taro-navigator-core.js +96 -0
- package/dist/components/taro-navigator-core.js.map +1 -0
- package/dist/components/taro-official-account-core.d.ts +11 -0
- package/dist/components/taro-official-account-core.js +35 -0
- package/dist/components/taro-official-account-core.js.map +1 -0
- package/dist/components/taro-open-data-core.d.ts +11 -0
- package/dist/components/taro-open-data-core.js +35 -0
- package/dist/components/taro-open-data-core.js.map +1 -0
- package/dist/components/taro-page-container-core.d.ts +11 -0
- package/dist/components/taro-page-container-core.js +35 -0
- package/dist/components/taro-page-container-core.js.map +1 -0
- package/dist/components/taro-page-meta-core.d.ts +11 -0
- package/dist/components/taro-page-meta-core.js +35 -0
- package/dist/components/taro-page-meta-core.js.map +1 -0
- package/dist/components/taro-picker-core.d.ts +11 -0
- package/dist/components/taro-picker-core.js +538 -0
- package/dist/components/taro-picker-core.js.map +1 -0
- package/dist/components/taro-picker-group.d.ts +11 -0
- package/dist/components/taro-picker-group.js +8 -0
- package/dist/components/taro-picker-group.js.map +1 -0
- package/dist/components/taro-picker-view-column-core.d.ts +11 -0
- package/dist/components/taro-picker-view-column-core.js +115 -0
- package/dist/components/taro-picker-view-column-core.js.map +1 -0
- package/dist/components/taro-picker-view-core.d.ts +11 -0
- package/dist/components/taro-picker-view-core.js +114 -0
- package/dist/components/taro-picker-view-core.js.map +1 -0
- package/dist/components/taro-progress-core.d.ts +11 -0
- package/dist/components/taro-progress-core.js +62 -0
- package/dist/components/taro-progress-core.js.map +1 -0
- package/dist/components/taro-pull-to-refresh.d.ts +11 -0
- package/dist/components/taro-pull-to-refresh.js +284 -0
- package/dist/components/taro-pull-to-refresh.js.map +1 -0
- package/dist/components/taro-radio-core.d.ts +11 -0
- package/dist/components/taro-radio-core.js +83 -0
- package/dist/components/taro-radio-core.js.map +1 -0
- package/dist/components/taro-radio-group-core.d.ts +11 -0
- package/dist/components/taro-radio-group-core.js +82 -0
- package/dist/components/taro-radio-group-core.js.map +1 -0
- package/dist/components/taro-rich-text-core.d.ts +11 -0
- package/dist/components/taro-rich-text-core.js +86 -0
- package/dist/components/taro-rich-text-core.js.map +1 -0
- package/dist/components/taro-root-portal-core.d.ts +11 -0
- package/dist/components/taro-root-portal-core.js +35 -0
- package/dist/components/taro-root-portal-core.js.map +1 -0
- package/dist/components/taro-rtc-room-core.d.ts +11 -0
- package/dist/components/taro-rtc-room-core.js +35 -0
- package/dist/components/taro-rtc-room-core.js.map +1 -0
- package/dist/components/taro-rtc-room-item-core.d.ts +11 -0
- package/dist/components/taro-rtc-room-item-core.js +35 -0
- package/dist/components/taro-rtc-room-item-core.js.map +1 -0
- package/dist/components/taro-scroll-view-core.d.ts +11 -0
- package/dist/components/taro-scroll-view-core.js +184 -0
- package/dist/components/taro-scroll-view-core.js.map +1 -0
- package/dist/components/taro-share-element-core.d.ts +11 -0
- package/dist/components/taro-share-element-core.js +35 -0
- package/dist/components/taro-share-element-core.js.map +1 -0
- package/dist/components/taro-slider-core.d.ts +11 -0
- package/dist/components/taro-slider-core.js +196 -0
- package/dist/components/taro-slider-core.js.map +1 -0
- package/dist/components/taro-slot-core.d.ts +11 -0
- package/dist/components/taro-slot-core.js +35 -0
- package/dist/components/taro-slot-core.js.map +1 -0
- package/dist/components/taro-swiper-core.d.ts +11 -0
- package/dist/components/taro-swiper-core.js +10165 -0
- package/dist/components/taro-swiper-core.js.map +1 -0
- package/dist/components/taro-swiper-item-core.d.ts +11 -0
- package/dist/components/taro-swiper-item-core.js +34 -0
- package/dist/components/taro-swiper-item-core.js.map +1 -0
- package/dist/components/taro-switch-core.d.ts +11 -0
- package/dist/components/taro-switch-core.js +87 -0
- package/dist/components/taro-switch-core.js.map +1 -0
- package/dist/components/taro-tab-item-core.d.ts +11 -0
- package/dist/components/taro-tab-item-core.js +35 -0
- package/dist/components/taro-tab-item-core.js.map +1 -0
- package/dist/components/taro-tabbar.d.ts +11 -0
- package/dist/components/taro-tabbar.js +457 -0
- package/dist/components/taro-tabbar.js.map +1 -0
- package/dist/components/taro-tabs-core.d.ts +11 -0
- package/dist/components/taro-tabs-core.js +35 -0
- package/dist/components/taro-tabs-core.js.map +1 -0
- package/dist/components/taro-text-core.d.ts +11 -0
- package/dist/components/taro-text-core.js +41 -0
- package/dist/components/taro-text-core.js.map +1 -0
- package/dist/components/taro-textarea-core.d.ts +11 -0
- package/dist/components/taro-textarea-core.js +164 -0
- package/dist/components/taro-textarea-core.js.map +1 -0
- package/dist/components/taro-video-control.d.ts +11 -0
- package/dist/components/taro-video-control.js +8 -0
- package/dist/components/taro-video-control.js.map +1 -0
- package/dist/components/taro-video-core.d.ts +11 -0
- package/dist/components/taro-video-core.js +485 -0
- package/dist/components/taro-video-core.js.map +1 -0
- package/dist/components/taro-video-danmu.d.ts +11 -0
- package/dist/components/taro-video-danmu.js +8 -0
- package/dist/components/taro-video-danmu.js.map +1 -0
- package/dist/components/taro-view-core.d.ts +11 -0
- package/dist/components/taro-view-core.js +101 -0
- package/dist/components/taro-view-core.js.map +1 -0
- package/dist/components/taro-voip-room-core.d.ts +11 -0
- package/dist/components/taro-voip-room-core.js +35 -0
- package/dist/components/taro-voip-room-core.js.map +1 -0
- package/dist/components/taro-web-view-core.d.ts +11 -0
- package/dist/components/taro-web-view-core.js +46 -0
- package/dist/components/taro-web-view-core.js.map +1 -0
- package/dist/components/video-control.js +233 -0
- package/dist/components/video-control.js.map +1 -0
- package/dist/components/video-danmu.js +110 -0
- package/dist/components/video-danmu.js.map +1 -0
- package/dist/esm/taro-swiper-core_2.entry.js +3 -5
- package/dist/esm/taro-swiper-core_2.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/taro-components/{p-d388c097.entry.js → p-22315b9d.entry.js} +2 -2
- package/dist/taro-components/p-22315b9d.entry.js.map +1 -0
- package/dist/taro-components/{p-6831f7b1.system.entry.js → p-c3c37cbb.system.entry.js} +2 -2
- package/dist/taro-components/p-c3c37cbb.system.entry.js.map +1 -0
- package/dist/taro-components/p-cb17d8bd.system.js +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/lib/react/components.d.ts +82 -0
- package/lib/react/components.js +85 -0
- package/lib/react/components.js.map +1 -0
- package/lib/react/helper.d.ts +10 -0
- package/lib/react/helper.js +7 -0
- package/lib/react/helper.js.map +1 -0
- package/lib/react/index.d.ts +1 -0
- package/lib/react/index.js +2 -0
- package/lib/react/index.js.map +1 -0
- package/lib/react/interfaces-4f837811.d.ts +30 -0
- package/lib/react/react-component-lib/createComponent.d.ts +10 -0
- package/lib/react/react-component-lib/createComponent.js +70 -0
- package/lib/react/react-component-lib/createComponent.js.map +1 -0
- package/lib/react/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/lib/react/react-component-lib/createOverlayComponent.js +91 -0
- package/lib/react/react-component-lib/createOverlayComponent.js.map +1 -0
- package/lib/react/react-component-lib/index.d.ts +2 -0
- package/lib/react/react-component-lib/index.js +3 -0
- package/lib/react/react-component-lib/index.js.map +1 -0
- package/lib/react/react-component-lib/utils/attachProps.d.ts +13 -0
- package/lib/react/react-component-lib/utils/attachProps.js +101 -0
- package/lib/react/react-component-lib/utils/attachProps.js.map +1 -0
- package/lib/react/react-component-lib/utils/case.d.ts +3 -0
- package/lib/react/react-component-lib/utils/case.js +9 -0
- package/lib/react/react-component-lib/utils/case.js.map +1 -0
- package/lib/react/react-component-lib/utils/index.d.ts +11 -0
- package/lib/react/react-component-lib/utils/index.js +37 -0
- package/lib/react/react-component-lib/utils/index.js.map +1 -0
- package/lib/vue2/components.d.ts +352 -0
- package/lib/vue2/components.js +620 -0
- package/lib/vue2/components.js.map +1 -0
- package/lib/vue2/index.d.ts +3 -0
- package/lib/vue2/index.js +21 -0
- package/lib/vue2/index.js.map +1 -0
- package/lib/vue2/vue-component-lib/utils.d.ts +6 -0
- package/lib/vue2/vue-component-lib/utils.js +32 -0
- package/lib/vue2/vue-component-lib/utils.js.map +1 -0
- package/lib/vue3/components.d.ts +82 -0
- package/lib/vue3/components.js +386 -0
- package/lib/vue3/components.js.map +1 -0
- package/lib/vue3/index.d.ts +3 -0
- package/lib/vue3/index.js +15 -0
- package/lib/vue3/index.js.map +1 -0
- package/lib/vue3/vue-component-lib/utils.d.ts +21 -0
- package/lib/vue3/vue-component-lib/utils.js +163 -0
- package/lib/vue3/vue-component-lib/utils.js.map +1 -0
- package/package.json +9 -7
- package/types/index.vue3.d.ts +4 -4
- package/dist/react/component-lib/index.js +0 -74
- package/dist/react/component-lib/input.js +0 -17
- package/dist/react/component-lib/reactify-wc.js +0 -206
- package/dist/react/components.js +0 -82
- package/dist/react/helper.js +0 -8
- package/dist/react/index.js +0 -1
- package/dist/react/react-component-lib/createComponent.js +0 -99
- package/dist/react/react-component-lib/createOverlayComponent.js +0 -178
- package/dist/react/react-component-lib/index.js +0 -2
- package/dist/react/react-component-lib/interfaces.js +0 -0
- package/dist/react/react-component-lib/utils/attachProps.js +0 -98
- package/dist/react/react-component-lib/utils/case.js +0 -10
- package/dist/react/react-component-lib/utils/dev.js +0 -12
- package/dist/react/react-component-lib/utils/index.js +0 -37
- package/dist/taro-components/p-6831f7b1.system.entry.js.map +0 -1
- package/dist/taro-components/p-d388c097.entry.js.map +0 -1
- package/dist/vue2/component-lib/components.js +0 -71
- package/dist/vue2/component-lib/createComponent.js +0 -21
- package/dist/vue2/component-lib/createFormsComponent.js +0 -53
- package/dist/vue2/component-lib/icon.js +0 -19
- package/dist/vue2/component-lib/image.js +0 -20
- package/dist/vue2/component-lib/index.js +0 -28
- package/dist/vue2/component-lib/mixins/listeners.js +0 -14
- package/dist/vue2/component-lib/mixins/refs.js +0 -44
- package/dist/vue2/component-lib/picker.js +0 -40
- package/dist/vue2/component-lib/scroll-view.js +0 -32
- package/dist/vue2/component-lib/text.js +0 -20
- package/dist/vue2/components.js +0 -542
- package/dist/vue2/index.js +0 -22
- package/dist/vue2/vue-component-lib/utils.js +0 -40
- package/dist/vue3/component-lib/createComponent.js +0 -23
- package/dist/vue3/component-lib/createFormsComponent.js +0 -43
- package/dist/vue3/component-lib/forwardRef.js +0 -9
- package/dist/vue3/component-lib/icon.js +0 -21
- package/dist/vue3/component-lib/image.js +0 -22
- package/dist/vue3/component-lib/index.js +0 -76
- package/dist/vue3/component-lib/scroll-view.js +0 -28
- package/dist/vue3/component-lib/text.js +0 -22
- package/dist/vue3/components.js +0 -80
- package/dist/vue3/index.js +0 -17
- package/dist/vue3/vue-component-lib/utils.js +0 -175
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
4
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
6
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
7
|
-
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
8
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
9
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
10
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
11
|
-
var _excluded = ["children", "isOpen", "onDidDismiss", "onDidPresent", "onWillDismiss", "onWillPresent"];
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import ReactDOM from 'react-dom';
|
|
14
|
-
import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
export var createOverlayComponent = function createOverlayComponent(tagName, controller, customElement) {
|
|
17
|
-
defineCustomElement(tagName, customElement);
|
|
18
|
-
var displayName = dashToPascalCase(tagName);
|
|
19
|
-
var didDismissEventName = "on".concat(displayName, "DidDismiss");
|
|
20
|
-
var didPresentEventName = "on".concat(displayName, "DidPresent");
|
|
21
|
-
var willDismissEventName = "on".concat(displayName, "WillDismiss");
|
|
22
|
-
var willPresentEventName = "on".concat(displayName, "WillPresent");
|
|
23
|
-
var isDismissing = false;
|
|
24
|
-
var Overlay = /*#__PURE__*/function (_React$Component) {
|
|
25
|
-
_inherits(Overlay, _React$Component);
|
|
26
|
-
var _super = _createSuper(Overlay);
|
|
27
|
-
function Overlay(props) {
|
|
28
|
-
var _this;
|
|
29
|
-
_classCallCheck(this, Overlay);
|
|
30
|
-
_this = _super.call(this, props);
|
|
31
|
-
_defineProperty(_assertThisInitialized(_this), "overlay", void 0);
|
|
32
|
-
_defineProperty(_assertThisInitialized(_this), "el", void 0);
|
|
33
|
-
if (typeof document !== 'undefined') {
|
|
34
|
-
_this.el = document.createElement('div');
|
|
35
|
-
}
|
|
36
|
-
_this.handleDismiss = _this.handleDismiss.bind(_assertThisInitialized(_this));
|
|
37
|
-
return _this;
|
|
38
|
-
}
|
|
39
|
-
_createClass(Overlay, [{
|
|
40
|
-
key: "componentDidMount",
|
|
41
|
-
value: function componentDidMount() {
|
|
42
|
-
if (this.props.isOpen) {
|
|
43
|
-
this.present();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}, {
|
|
47
|
-
key: "componentWillUnmount",
|
|
48
|
-
value: function componentWillUnmount() {
|
|
49
|
-
if (this.overlay) {
|
|
50
|
-
this.overlay.dismiss();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: "handleDismiss",
|
|
55
|
-
value: function handleDismiss(event) {
|
|
56
|
-
if (this.props.onDidDismiss) {
|
|
57
|
-
this.props.onDidDismiss(event);
|
|
58
|
-
}
|
|
59
|
-
setRef(this.props.forwardedRef, null);
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
key: "shouldComponentUpdate",
|
|
63
|
-
value: function shouldComponentUpdate(nextProps) {
|
|
64
|
-
// Check if the overlay component is about to dismiss
|
|
65
|
-
if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
|
|
66
|
-
isDismissing = true;
|
|
67
|
-
}
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
}, {
|
|
71
|
-
key: "componentDidUpdate",
|
|
72
|
-
value: function () {
|
|
73
|
-
var _componentDidUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(prevProps) {
|
|
74
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
75
|
-
while (1) {
|
|
76
|
-
switch (_context.prev = _context.next) {
|
|
77
|
-
case 0:
|
|
78
|
-
if (this.overlay) {
|
|
79
|
-
attachProps(this.overlay, this.props, prevProps);
|
|
80
|
-
}
|
|
81
|
-
if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
|
|
82
|
-
this.present(prevProps);
|
|
83
|
-
}
|
|
84
|
-
if (!(this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false)) {
|
|
85
|
-
_context.next = 7;
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
_context.next = 5;
|
|
89
|
-
return this.overlay.dismiss();
|
|
90
|
-
case 5:
|
|
91
|
-
isDismissing = false;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Now that the overlay is dismissed
|
|
95
|
-
* we need to render again so that any
|
|
96
|
-
* inner components will be unmounted
|
|
97
|
-
*/
|
|
98
|
-
this.forceUpdate();
|
|
99
|
-
case 7:
|
|
100
|
-
case "end":
|
|
101
|
-
return _context.stop();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}, _callee, this);
|
|
105
|
-
}));
|
|
106
|
-
function componentDidUpdate(_x) {
|
|
107
|
-
return _componentDidUpdate.apply(this, arguments);
|
|
108
|
-
}
|
|
109
|
-
return componentDidUpdate;
|
|
110
|
-
}()
|
|
111
|
-
}, {
|
|
112
|
-
key: "present",
|
|
113
|
-
value: function () {
|
|
114
|
-
var _present = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(prevProps) {
|
|
115
|
-
var _this2 = this,
|
|
116
|
-
_objectSpread2;
|
|
117
|
-
var _this$props, children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent, cProps, elementProps;
|
|
118
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
119
|
-
while (1) {
|
|
120
|
-
switch (_context2.prev = _context2.next) {
|
|
121
|
-
case 0:
|
|
122
|
-
_this$props = this.props, children = _this$props.children, isOpen = _this$props.isOpen, onDidDismiss = _this$props.onDidDismiss, onDidPresent = _this$props.onDidPresent, onWillDismiss = _this$props.onWillDismiss, onWillPresent = _this$props.onWillPresent, cProps = _objectWithoutProperties(_this$props, _excluded);
|
|
123
|
-
elementProps = _objectSpread(_objectSpread({}, cProps), {}, (_objectSpread2 = {
|
|
124
|
-
ref: this.props.forwardedRef
|
|
125
|
-
}, _defineProperty(_objectSpread2, didDismissEventName, this.handleDismiss), _defineProperty(_objectSpread2, didPresentEventName, function (e) {
|
|
126
|
-
return _this2.props.onDidPresent && _this2.props.onDidPresent(e);
|
|
127
|
-
}), _defineProperty(_objectSpread2, willDismissEventName, function (e) {
|
|
128
|
-
return _this2.props.onWillDismiss && _this2.props.onWillDismiss(e);
|
|
129
|
-
}), _defineProperty(_objectSpread2, willPresentEventName, function (e) {
|
|
130
|
-
return _this2.props.onWillPresent && _this2.props.onWillPresent(e);
|
|
131
|
-
}), _objectSpread2));
|
|
132
|
-
_context2.next = 4;
|
|
133
|
-
return controller.create(_objectSpread(_objectSpread({}, elementProps), {}, {
|
|
134
|
-
component: this.el,
|
|
135
|
-
componentProps: {}
|
|
136
|
-
}));
|
|
137
|
-
case 4:
|
|
138
|
-
this.overlay = _context2.sent;
|
|
139
|
-
setRef(this.props.forwardedRef, this.overlay);
|
|
140
|
-
attachProps(this.overlay, elementProps, prevProps);
|
|
141
|
-
_context2.next = 9;
|
|
142
|
-
return this.overlay.present();
|
|
143
|
-
case 9:
|
|
144
|
-
case "end":
|
|
145
|
-
return _context2.stop();
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}, _callee2, this);
|
|
149
|
-
}));
|
|
150
|
-
function present(_x2) {
|
|
151
|
-
return _present.apply(this, arguments);
|
|
152
|
-
}
|
|
153
|
-
return present;
|
|
154
|
-
}()
|
|
155
|
-
}, {
|
|
156
|
-
key: "render",
|
|
157
|
-
value: function render() {
|
|
158
|
-
/**
|
|
159
|
-
* Continue to render the component even when
|
|
160
|
-
* overlay is dismissing otherwise component
|
|
161
|
-
* will be hidden before animation is done.
|
|
162
|
-
*/
|
|
163
|
-
return /*#__PURE__*/ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
|
|
164
|
-
}
|
|
165
|
-
}], [{
|
|
166
|
-
key: "displayName",
|
|
167
|
-
get: function get() {
|
|
168
|
-
return displayName;
|
|
169
|
-
}
|
|
170
|
-
}]);
|
|
171
|
-
return Overlay;
|
|
172
|
-
}(React.Component);
|
|
173
|
-
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
174
|
-
return /*#__PURE__*/_jsx(Overlay, _objectSpread(_objectSpread({}, props), {}, {
|
|
175
|
-
forwardedRef: ref
|
|
176
|
-
}));
|
|
177
|
-
});
|
|
178
|
-
};
|
|
File without changes
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
-
import { camelToDashCase } from './case';
|
|
3
|
-
export var attachProps = function attachProps(node, newProps) {
|
|
4
|
-
var oldProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
5
|
-
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
|
|
6
|
-
if (node instanceof Element) {
|
|
7
|
-
// add any classes in className to the class list
|
|
8
|
-
var className = getClassName(node.classList, newProps, oldProps);
|
|
9
|
-
if (className !== '') {
|
|
10
|
-
node.className = className;
|
|
11
|
-
}
|
|
12
|
-
Object.keys(newProps).forEach(function (name) {
|
|
13
|
-
if (name === 'children' || name === 'style' || name === 'ref' || name === 'class' || name === 'className' || name === 'forwardedRef') {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
17
|
-
var eventName = name.substring(2);
|
|
18
|
-
var eventNameLc = eventName.toLowerCase();
|
|
19
|
-
if (!isCoveredByReact(eventNameLc)) {
|
|
20
|
-
syncEvent(node, eventNameLc, newProps[name]);
|
|
21
|
-
}
|
|
22
|
-
} else {
|
|
23
|
-
node[name] = newProps[name];
|
|
24
|
-
var propType = _typeof(newProps[name]);
|
|
25
|
-
if (propType === 'string') {
|
|
26
|
-
node.setAttribute(camelToDashCase(name), newProps[name]);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
export var getClassName = function getClassName(classList, newProps, oldProps) {
|
|
33
|
-
var newClassProp = newProps.className || newProps.class;
|
|
34
|
-
var oldClassProp = oldProps.className || oldProps.class;
|
|
35
|
-
// map the classes to Maps for performance
|
|
36
|
-
var currentClasses = arrayToMap(classList);
|
|
37
|
-
var incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
|
|
38
|
-
var oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
|
|
39
|
-
var finalClassNames = [];
|
|
40
|
-
// loop through each of the current classes on the component
|
|
41
|
-
// to see if it should be a part of the classNames added
|
|
42
|
-
currentClasses.forEach(function (currentClass) {
|
|
43
|
-
if (incomingPropClasses.has(currentClass)) {
|
|
44
|
-
// add it as its already included in classnames coming in from newProps
|
|
45
|
-
finalClassNames.push(currentClass);
|
|
46
|
-
incomingPropClasses.delete(currentClass);
|
|
47
|
-
} else if (!oldPropClasses.has(currentClass)) {
|
|
48
|
-
// add it as it has NOT been removed by user
|
|
49
|
-
finalClassNames.push(currentClass);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
incomingPropClasses.forEach(function (s) {
|
|
53
|
-
return finalClassNames.push(s);
|
|
54
|
-
});
|
|
55
|
-
return finalClassNames.join(' ');
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Checks if an event is supported in the current execution environment.
|
|
60
|
-
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
61
|
-
*/
|
|
62
|
-
export var isCoveredByReact = function isCoveredByReact(eventNameSuffix) {
|
|
63
|
-
if (typeof document === 'undefined') {
|
|
64
|
-
return true;
|
|
65
|
-
} else {
|
|
66
|
-
var eventName = 'on' + eventNameSuffix;
|
|
67
|
-
var isSupported = (eventName in document);
|
|
68
|
-
if (!isSupported) {
|
|
69
|
-
var element = document.createElement('div');
|
|
70
|
-
element.setAttribute(eventName, 'return;');
|
|
71
|
-
isSupported = typeof element[eventName] === 'function';
|
|
72
|
-
}
|
|
73
|
-
return isSupported;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
export var syncEvent = function syncEvent(node, eventName, newEventHandler) {
|
|
77
|
-
var eventStore = node.__events || (node.__events = {});
|
|
78
|
-
var oldEventHandler = eventStore[eventName];
|
|
79
|
-
|
|
80
|
-
// Remove old listener so they don't double up.
|
|
81
|
-
if (oldEventHandler) {
|
|
82
|
-
node.removeEventListener(eventName, oldEventHandler);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Bind new listener.
|
|
86
|
-
node.addEventListener(eventName, eventStore[eventName] = function handler(e) {
|
|
87
|
-
if (newEventHandler) {
|
|
88
|
-
newEventHandler.call(this, e);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
var arrayToMap = function arrayToMap(arr) {
|
|
93
|
-
var map = new Map();
|
|
94
|
-
arr.forEach(function (s) {
|
|
95
|
-
return map.set(s, s);
|
|
96
|
-
});
|
|
97
|
-
return map;
|
|
98
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export var dashToPascalCase = function dashToPascalCase(str) {
|
|
2
|
-
return str.toLowerCase().split('-').map(function (segment) {
|
|
3
|
-
return segment.charAt(0).toUpperCase() + segment.slice(1);
|
|
4
|
-
}).join('');
|
|
5
|
-
};
|
|
6
|
-
export var camelToDashCase = function camelToDashCase(str) {
|
|
7
|
-
return str.replace(/([A-Z])/g, function (m) {
|
|
8
|
-
return "-".concat(m[0].toLowerCase());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export var isDevMode = function isDevMode() {
|
|
2
|
-
return process && process.env && process.env.NODE_ENV === 'development';
|
|
3
|
-
};
|
|
4
|
-
var warnings = {};
|
|
5
|
-
export var deprecationWarning = function deprecationWarning(key, message) {
|
|
6
|
-
if (isDevMode()) {
|
|
7
|
-
if (!warnings[key]) {
|
|
8
|
-
console.warn(message);
|
|
9
|
-
warnings[key] = true;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export var setRef = function setRef(ref, value) {
|
|
5
|
-
if (typeof ref === 'function') {
|
|
6
|
-
ref(value);
|
|
7
|
-
} else if (ref != null) {
|
|
8
|
-
// Cast as a MutableRef so we can assign current
|
|
9
|
-
ref.current = value;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export var mergeRefs = function mergeRefs() {
|
|
13
|
-
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
|
-
refs[_key] = arguments[_key];
|
|
15
|
-
}
|
|
16
|
-
return function (value) {
|
|
17
|
-
refs.forEach(function (ref) {
|
|
18
|
-
setRef(ref, value);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export var createForwardRef = function createForwardRef(ReactComponent, displayName) {
|
|
23
|
-
var forwardRef = function forwardRef(props, ref) {
|
|
24
|
-
return /*#__PURE__*/_jsx(ReactComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
25
|
-
forwardedRef: ref
|
|
26
|
-
}));
|
|
27
|
-
};
|
|
28
|
-
forwardRef.displayName = displayName;
|
|
29
|
-
return /*#__PURE__*/React.forwardRef(forwardRef);
|
|
30
|
-
};
|
|
31
|
-
export var defineCustomElement = function defineCustomElement(tagName, customElement) {
|
|
32
|
-
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
|
|
33
|
-
customElements.define(tagName, customElement);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
export * from './attachProps';
|
|
37
|
-
export * from './case';
|