@tarojs/components 3.5.7-alpha.6 → 3.6.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/helper-db78e01a.js +2 -0
- package/dist/cjs/helper-db78e01a.js.map +1 -0
- package/dist/cjs/index-47a1959e.js +2 -0
- package/dist/cjs/index-47a1959e.js.map +1 -0
- package/dist/cjs/{index-7c61bee9.js → index-9174e0b1.js} +477 -234
- package/dist/cjs/index-9174e0b1.js.map +1 -0
- package/dist/cjs/index-f9d21cc5.js +2 -0
- package/dist/cjs/index-f9d21cc5.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/intersection-observer-dc4cfcef.js +2 -0
- package/dist/cjs/intersection-observer-dc4cfcef.js.map +1 -0
- package/dist/cjs/loader.cjs.js +5 -3
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/taro-ad-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-ad-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-ad-custom-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-ad-custom-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-audio-core.cjs.entry.js +5 -2
- package/dist/cjs/taro-audio-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-block-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-block-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-button-core.cjs.entry.js +7 -2
- package/dist/cjs/taro-button-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-camera-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-camera-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-canvas-core.cjs.entry.js +6 -3
- package/dist/cjs/taro-canvas-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-checkbox-core_2.cjs.entry.js +14 -8
- package/dist/cjs/taro-checkbox-core_2.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-components.cjs.js +5 -3
- package/dist/cjs/taro-components.cjs.js.map +1 -0
- package/dist/cjs/taro-cover-image-core.cjs.entry.js +5 -2
- package/dist/cjs/taro-cover-image-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-cover-view-core.cjs.entry.js +7 -3
- package/dist/cjs/taro-cover-view-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-custom-wrapper-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-custom-wrapper-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-editor-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-editor-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-form-core.cjs.entry.js +5 -2
- package/dist/cjs/taro-form-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-functional-page-navigator-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-functional-page-navigator-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-icon-core.cjs.entry.js +6 -2
- package/dist/cjs/taro-icon-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-image-core.cjs.entry.js +5 -2
- package/dist/cjs/taro-image-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-input-core.cjs.entry.js +18 -10
- package/dist/cjs/taro-input-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-keyboard-accessory-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-keyboard-accessory-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-label-core.cjs.entry.js +5 -2
- package/dist/cjs/taro-label-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-live-player-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-live-player-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-live-pusher-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-live-pusher-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-map-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-map-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-match-media-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-match-media-core.cjs.entry.js.map +1 -0
- package/dist/cjs/{taro-movable-view-core.cjs.entry.js → taro-movable-area-core_2.cjs.entry.js} +187 -97
- package/dist/cjs/taro-movable-area-core_2.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-navigation-bar-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-navigation-bar-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-navigator-core.cjs.entry.js +6 -2
- package/dist/cjs/taro-navigator-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-official-account-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-official-account-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-open-data-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-open-data-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-page-container-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-page-container-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-page-meta-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-page-meta-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-picker-core_2.cjs.entry.js +31 -15
- package/dist/cjs/taro-picker-core_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{taro-picker-view-core.cjs.entry.js → taro-picker-view-column-core_2.cjs.entry.js} +101 -6
- package/dist/cjs/taro-picker-view-column-core_2.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-progress-core.cjs.entry.js +7 -5
- package/dist/cjs/taro-progress-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +10 -8
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-radio-core_2.cjs.entry.js +15 -9
- package/dist/cjs/taro-radio-core_2.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-rich-text-core.cjs.entry.js +5 -2
- package/dist/cjs/taro-rich-text-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-root-portal-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-root-portal-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +28 -22
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-share-element-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-share-element-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-slider-core.cjs.entry.js +23 -19
- package/dist/cjs/taro-slider-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-slot-core.cjs.entry.js +4 -7
- package/dist/cjs/taro-slot-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +25 -56
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-switch-core.cjs.entry.js +12 -8
- package/dist/cjs/taro-switch-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-tabbar.cjs.entry.js +12 -4
- package/dist/cjs/taro-tabbar.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-text-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-text-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-textarea-core.cjs.entry.js +13 -8
- package/dist/cjs/taro-textarea-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-video-control_3.cjs.entry.js +142 -260
- package/dist/cjs/taro-video-control_3.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-view-core.cjs.entry.js +7 -3
- package/dist/cjs/taro-view-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-voip-room-core.cjs.entry.js +4 -2
- package/dist/cjs/taro-voip-room-core.cjs.entry.js.map +1 -0
- package/dist/cjs/taro-web-view-core.cjs.entry.js +5 -2
- package/dist/cjs/taro-web-view-core.cjs.entry.js.map +1 -0
- package/dist/collection/collection-manifest.json +16 -4
- package/dist/collection/components/ad/ad.js +2 -1
- package/dist/collection/components/ad/ad.js.map +1 -0
- package/dist/collection/components/ad-custom/ad-custom.js +2 -1
- package/dist/collection/components/ad-custom/ad-custom.js.map +1 -0
- package/dist/collection/components/audio/audio.js +199 -190
- package/dist/collection/components/audio/audio.js.map +1 -0
- package/dist/collection/components/block/block.js +2 -2
- package/dist/collection/components/block/block.js.map +1 -0
- package/dist/collection/components/button/button.js +224 -211
- package/dist/collection/components/button/button.js.map +1 -0
- package/dist/collection/components/camera/camera.js +2 -1
- package/dist/collection/components/camera/camera.js.map +1 -0
- package/dist/collection/components/canvas/canvas.js +67 -58
- package/dist/collection/components/canvas/canvas.js.map +1 -0
- package/dist/collection/components/checkbox/checkbox-group.js +50 -42
- package/dist/collection/components/checkbox/checkbox-group.js.map +1 -0
- package/dist/collection/components/checkbox/checkbox.js +174 -161
- package/dist/collection/components/checkbox/checkbox.js.map +1 -0
- package/dist/collection/components/cover-image/cover-image.js +81 -72
- package/dist/collection/components/cover-image/cover-image.js.map +1 -0
- package/dist/collection/components/cover-view/cover-view.js +131 -118
- package/dist/collection/components/cover-view/cover-view.js.map +1 -0
- package/dist/collection/components/custom-wrapper/custom-wrapper.js +2 -2
- package/dist/collection/components/custom-wrapper/custom-wrapper.js.map +1 -0
- package/dist/collection/components/editor/editor.js +2 -1
- package/dist/collection/components/editor/editor.js.map +1 -0
- package/dist/collection/components/form/form.js +48 -40
- package/dist/collection/components/form/form.js.map +1 -0
- package/dist/collection/components/functional-page-navigator/functional-page-navigator.js +2 -1
- package/dist/collection/components/functional-page-navigator/functional-page-navigator.js.map +1 -0
- package/dist/collection/components/icon/icon.js +61 -56
- package/dist/collection/components/icon/icon.js.map +1 -0
- package/dist/collection/components/image/image.js +123 -111
- package/dist/collection/components/image/image.js.map +1 -0
- package/dist/collection/components/input/input.js +310 -293
- package/dist/collection/components/input/input.js.map +1 -0
- package/dist/collection/components/keyboard-accessory/keyboard-accessory.js +2 -1
- package/dist/collection/components/keyboard-accessory/keyboard-accessory.js.map +1 -0
- package/dist/collection/components/label/label.js +27 -22
- package/dist/collection/components/label/label.js.map +1 -0
- package/dist/collection/components/live-player/live-player.js +2 -1
- package/dist/collection/components/live-player/live-player.js.map +1 -0
- package/dist/collection/components/live-pusher/live-pusher.js +2 -1
- package/dist/collection/components/live-pusher/live-pusher.js.map +1 -0
- package/dist/collection/components/map/map.js +2 -1
- package/dist/collection/components/map/map.js.map +1 -0
- package/dist/collection/components/match-media/match-media.js +2 -1
- package/dist/collection/components/match-media/match-media.js.map +1 -0
- package/dist/collection/components/movable-area/movable-area.js +34 -26
- package/dist/collection/components/movable-area/movable-area.js.map +1 -0
- package/dist/collection/components/movable-area/movable-view.js +415 -457
- package/dist/collection/components/movable-area/movable-view.js.map +1 -0
- package/dist/collection/components/navigation-bar/navigation-bar.js +2 -1
- package/dist/collection/components/navigation-bar/navigation-bar.js.map +1 -0
- package/dist/collection/components/navigator/navigator.js +158 -145
- package/dist/collection/components/navigator/navigator.js.map +1 -0
- package/dist/collection/components/official-account/official-account.js +2 -1
- package/dist/collection/components/official-account/official-account.js.map +1 -0
- package/dist/collection/components/open-data/open-data.js +2 -1
- package/dist/collection/components/open-data/open-data.js.map +1 -0
- package/dist/collection/components/page-container/page-container.js +2 -1
- package/dist/collection/components/page-container/page-container.js.map +1 -0
- package/dist/collection/components/page-meta/page-meta.js +2 -1
- package/dist/collection/components/page-meta/page-meta.js.map +1 -0
- package/dist/collection/components/picker/constant.js +1 -0
- package/dist/collection/components/picker/constant.js.map +1 -0
- package/dist/collection/components/picker/picker-group.js +194 -179
- package/dist/collection/components/picker/picker-group.js.map +1 -0
- package/dist/collection/components/picker/picker.js +261 -257
- package/dist/collection/components/picker/picker.js.map +1 -0
- package/dist/collection/components/picker/utils.js +1 -0
- package/dist/collection/components/picker/utils.js.map +1 -0
- package/dist/collection/components/picker-view/picker-view-column.js +158 -147
- package/dist/collection/components/picker-view/picker-view-column.js.map +1 -0
- package/dist/collection/components/picker-view/picker-view.js +171 -159
- package/dist/collection/components/picker-view/picker-view.js.map +1 -0
- package/dist/collection/components/progress/progress.js +153 -157
- package/dist/collection/components/progress/progress.js.map +1 -0
- package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +121 -114
- package/dist/collection/components/pull-to-refresh/pull-to-refresh.js.map +1 -0
- package/dist/collection/components/radio/radio-group.js +50 -43
- package/dist/collection/components/radio/radio-group.js.map +1 -0
- package/dist/collection/components/radio/radio.js +152 -144
- package/dist/collection/components/radio/radio.js.map +1 -0
- package/dist/collection/components/rich-text/rich-text.js +27 -23
- package/dist/collection/components/rich-text/rich-text.js.map +1 -0
- package/dist/collection/components/root-portal/root-portal.js +2 -1
- package/dist/collection/components/root-portal/root-portal.js.map +1 -0
- package/dist/collection/components/scroll-view/scroll-view.js +242 -220
- package/dist/collection/components/scroll-view/scroll-view.js.map +1 -0
- package/dist/collection/components/share-element/share-element.js +2 -1
- package/dist/collection/components/share-element/share-element.js.map +1 -0
- package/dist/collection/components/slider/slider.js +267 -263
- package/dist/collection/components/slider/slider.js.map +1 -0
- package/dist/collection/components/slot/slot.js +2 -5
- package/dist/collection/components/slot/slot.js.map +1 -0
- package/dist/collection/components/swiper/swiper-item.js +26 -21
- package/dist/collection/components/swiper/swiper-item.js.map +1 -0
- package/dist/collection/components/swiper/swiper.js +325 -352
- package/dist/collection/components/swiper/swiper.js.map +1 -0
- package/dist/collection/components/switch/switch.js +153 -139
- package/dist/collection/components/switch/switch.js.map +1 -0
- package/dist/collection/components/tabbar/tabbar-item.js +2 -6
- package/dist/collection/components/tabbar/tabbar-item.js.map +1 -0
- package/dist/collection/components/tabbar/tabbar.js +86 -70
- package/dist/collection/components/tabbar/tabbar.js.map +1 -0
- package/dist/collection/components/text/text.js +35 -30
- package/dist/collection/components/text/text.js.map +1 -0
- package/dist/collection/components/textarea/textarea.js +239 -226
- package/dist/collection/components/textarea/textarea.js.map +1 -0
- package/dist/collection/components/video/utils.js +1 -0
- package/dist/collection/components/video/utils.js.map +1 -0
- package/dist/collection/components/video/video-control.js +274 -286
- package/dist/collection/components/video/video-control.js.map +1 -0
- package/dist/collection/components/video/video-danmu.js +111 -118
- package/dist/collection/components/video/video-danmu.js.map +1 -0
- package/dist/collection/components/video/video.js +740 -810
- package/dist/collection/components/video/video.js.map +1 -0
- package/dist/collection/components/view/view.js +131 -118
- package/dist/collection/components/view/view.js.map +1 -0
- package/dist/collection/components/voip-room/voip-room.js +2 -1
- package/dist/collection/components/voip-room/voip-room.js.map +1 -0
- package/dist/collection/components/web-view/web-view.js +68 -57
- package/dist/collection/components/web-view/web-view.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/utils/helper.js +1 -0
- package/dist/collection/utils/helper.js.map +1 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/collection/utils/index.js.map +1 -0
- package/dist/collection/utils/style.js +1 -0
- package/dist/collection/utils/style.js.map +1 -0
- package/dist/collection/utils/url.js +1 -0
- package/dist/collection/utils/url.js.map +1 -0
- package/dist/esm/helper-3d0ecf0f.js +2 -0
- package/dist/esm/helper-3d0ecf0f.js.map +1 -0
- package/dist/esm/index-1d8e8acd.js +2 -0
- package/dist/esm/index-1d8e8acd.js.map +1 -0
- package/dist/esm/{index-8809c729.js → index-5d881caf.js} +477 -234
- package/dist/esm/index-5d881caf.js.map +1 -0
- package/dist/esm/index-cad8203e.js +2 -0
- package/dist/esm/index-cad8203e.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/intersection-observer-8e4c7135.js +2 -0
- package/dist/esm/intersection-observer-8e4c7135.js.map +1 -0
- package/dist/esm/loader.js +5 -3
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/taro-ad-core.entry.js +4 -2
- package/dist/esm/taro-ad-core.entry.js.map +1 -0
- package/dist/esm/taro-ad-custom-core.entry.js +4 -2
- package/dist/esm/taro-ad-custom-core.entry.js.map +1 -0
- package/dist/esm/taro-audio-core.entry.js +5 -2
- package/dist/esm/taro-audio-core.entry.js.map +1 -0
- package/dist/esm/taro-block-core.entry.js +4 -2
- package/dist/esm/taro-block-core.entry.js.map +1 -0
- package/dist/esm/taro-button-core.entry.js +7 -2
- package/dist/esm/taro-button-core.entry.js.map +1 -0
- package/dist/esm/taro-camera-core.entry.js +4 -2
- package/dist/esm/taro-camera-core.entry.js.map +1 -0
- package/dist/esm/taro-canvas-core.entry.js +6 -3
- package/dist/esm/taro-canvas-core.entry.js.map +1 -0
- package/dist/esm/taro-checkbox-core_2.entry.js +14 -8
- package/dist/esm/taro-checkbox-core_2.entry.js.map +1 -0
- package/dist/esm/taro-components.js +5 -3
- package/dist/esm/taro-components.js.map +1 -0
- package/dist/esm/taro-cover-image-core.entry.js +5 -2
- package/dist/esm/taro-cover-image-core.entry.js.map +1 -0
- package/dist/esm/taro-cover-view-core.entry.js +7 -3
- package/dist/esm/taro-cover-view-core.entry.js.map +1 -0
- package/dist/esm/taro-custom-wrapper-core.entry.js +4 -2
- package/dist/esm/taro-custom-wrapper-core.entry.js.map +1 -0
- package/dist/esm/taro-editor-core.entry.js +4 -2
- package/dist/esm/taro-editor-core.entry.js.map +1 -0
- package/dist/esm/taro-form-core.entry.js +5 -2
- package/dist/esm/taro-form-core.entry.js.map +1 -0
- package/dist/esm/taro-functional-page-navigator-core.entry.js +4 -2
- package/dist/esm/taro-functional-page-navigator-core.entry.js.map +1 -0
- package/dist/esm/taro-icon-core.entry.js +6 -2
- package/dist/esm/taro-icon-core.entry.js.map +1 -0
- package/dist/esm/taro-image-core.entry.js +5 -2
- package/dist/esm/taro-image-core.entry.js.map +1 -0
- package/dist/esm/taro-input-core.entry.js +18 -10
- package/dist/esm/taro-input-core.entry.js.map +1 -0
- package/dist/esm/taro-keyboard-accessory-core.entry.js +4 -2
- package/dist/esm/taro-keyboard-accessory-core.entry.js.map +1 -0
- package/dist/esm/taro-label-core.entry.js +5 -2
- package/dist/esm/taro-label-core.entry.js.map +1 -0
- package/dist/esm/taro-live-player-core.entry.js +4 -2
- package/dist/esm/taro-live-player-core.entry.js.map +1 -0
- package/dist/esm/taro-live-pusher-core.entry.js +4 -2
- package/dist/esm/taro-live-pusher-core.entry.js.map +1 -0
- package/dist/esm/taro-map-core.entry.js +4 -2
- package/dist/esm/taro-map-core.entry.js.map +1 -0
- package/dist/esm/taro-match-media-core.entry.js +4 -2
- package/dist/esm/taro-match-media-core.entry.js.map +1 -0
- package/dist/esm/{taro-movable-view-core.entry.js → taro-movable-area-core_2.entry.js} +187 -98
- package/dist/esm/taro-movable-area-core_2.entry.js.map +1 -0
- package/dist/esm/taro-navigation-bar-core.entry.js +4 -2
- package/dist/esm/taro-navigation-bar-core.entry.js.map +1 -0
- package/dist/esm/taro-navigator-core.entry.js +6 -2
- package/dist/esm/taro-navigator-core.entry.js.map +1 -0
- package/dist/esm/taro-official-account-core.entry.js +4 -2
- package/dist/esm/taro-official-account-core.entry.js.map +1 -0
- package/dist/esm/taro-open-data-core.entry.js +4 -2
- package/dist/esm/taro-open-data-core.entry.js.map +1 -0
- package/dist/esm/taro-page-container-core.entry.js +4 -2
- package/dist/esm/taro-page-container-core.entry.js.map +1 -0
- package/dist/esm/taro-page-meta-core.entry.js +4 -2
- package/dist/esm/taro-page-meta-core.entry.js.map +1 -0
- package/dist/esm/taro-picker-core_2.entry.js +31 -15
- package/dist/esm/taro-picker-core_2.entry.js.map +1 -0
- package/dist/esm/{taro-picker-view-core.entry.js → taro-picker-view-column-core_2.entry.js} +97 -3
- package/dist/esm/taro-picker-view-column-core_2.entry.js.map +1 -0
- package/dist/esm/taro-progress-core.entry.js +7 -5
- package/dist/esm/taro-progress-core.entry.js.map +1 -0
- package/dist/esm/taro-pull-to-refresh.entry.js +10 -8
- package/dist/esm/taro-pull-to-refresh.entry.js.map +1 -0
- package/dist/esm/taro-radio-core_2.entry.js +15 -9
- package/dist/esm/taro-radio-core_2.entry.js.map +1 -0
- package/dist/esm/taro-rich-text-core.entry.js +5 -2
- package/dist/esm/taro-rich-text-core.entry.js.map +1 -0
- package/dist/esm/taro-root-portal-core.entry.js +4 -2
- package/dist/esm/taro-root-portal-core.entry.js.map +1 -0
- package/dist/esm/taro-scroll-view-core.entry.js +28 -22
- package/dist/esm/taro-scroll-view-core.entry.js.map +1 -0
- package/dist/esm/taro-share-element-core.entry.js +4 -2
- package/dist/esm/taro-share-element-core.entry.js.map +1 -0
- package/dist/esm/taro-slider-core.entry.js +23 -19
- package/dist/esm/taro-slider-core.entry.js.map +1 -0
- package/dist/esm/taro-slot-core.entry.js +4 -7
- package/dist/esm/taro-slot-core.entry.js.map +1 -0
- package/dist/esm/taro-swiper-core_2.entry.js +25 -56
- package/dist/esm/taro-swiper-core_2.entry.js.map +1 -0
- package/dist/esm/taro-switch-core.entry.js +12 -8
- package/dist/esm/taro-switch-core.entry.js.map +1 -0
- package/dist/esm/taro-tabbar.entry.js +12 -4
- package/dist/esm/taro-tabbar.entry.js.map +1 -0
- package/dist/esm/taro-text-core.entry.js +4 -2
- package/dist/esm/taro-text-core.entry.js.map +1 -0
- package/dist/esm/taro-textarea-core.entry.js +13 -8
- package/dist/esm/taro-textarea-core.entry.js.map +1 -0
- package/dist/esm/taro-video-control_3.entry.js +142 -260
- package/dist/esm/taro-video-control_3.entry.js.map +1 -0
- package/dist/esm/taro-view-core.entry.js +7 -3
- package/dist/esm/taro-view-core.entry.js.map +1 -0
- package/dist/esm/taro-voip-room-core.entry.js +4 -2
- package/dist/esm/taro-voip-room-core.entry.js.map +1 -0
- package/dist/esm/taro-web-view-core.entry.js +5 -2
- package/dist/esm/taro-web-view-core.entry.js.map +1 -0
- package/dist/esm-es5/helper-3d0ecf0f.js +2 -1
- package/dist/esm-es5/helper-3d0ecf0f.js.map +1 -0
- package/dist/esm-es5/index-1d8e8acd.js +2 -1
- package/dist/esm-es5/index-1d8e8acd.js.map +1 -0
- package/dist/esm-es5/index-5d881caf.js +3 -0
- package/dist/esm-es5/index-5d881caf.js.map +1 -0
- package/dist/esm-es5/index-cad8203e.js +2 -1
- package/dist/esm-es5/index-cad8203e.js.map +1 -0
- package/dist/esm-es5/index.js +2 -0
- package/dist/esm-es5/index.js.map +1 -0
- package/dist/esm-es5/intersection-observer-8e4c7135.js +2 -1
- package/dist/esm-es5/intersection-observer-8e4c7135.js.map +1 -0
- package/dist/esm-es5/loader.js +2 -1
- package/dist/esm-es5/loader.js.map +1 -0
- package/dist/esm-es5/taro-ad-core.entry.js +2 -1
- package/dist/esm-es5/taro-ad-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-ad-custom-core.entry.js +2 -1
- package/dist/esm-es5/taro-ad-custom-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-audio-core.entry.js +2 -1
- package/dist/esm-es5/taro-audio-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-block-core.entry.js +2 -1
- package/dist/esm-es5/taro-block-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-button-core.entry.js +2 -1
- package/dist/esm-es5/taro-button-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-camera-core.entry.js +2 -1
- package/dist/esm-es5/taro-camera-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-canvas-core.entry.js +2 -1
- package/dist/esm-es5/taro-canvas-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-checkbox-core_2.entry.js +2 -1
- package/dist/esm-es5/taro-checkbox-core_2.entry.js.map +1 -0
- package/dist/esm-es5/taro-components.js +2 -1
- package/dist/esm-es5/taro-components.js.map +1 -0
- package/dist/esm-es5/taro-cover-image-core.entry.js +2 -1
- package/dist/esm-es5/taro-cover-image-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-cover-view-core.entry.js +2 -1
- package/dist/esm-es5/taro-cover-view-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-custom-wrapper-core.entry.js +2 -1
- package/dist/esm-es5/taro-custom-wrapper-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-editor-core.entry.js +2 -1
- package/dist/esm-es5/taro-editor-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-form-core.entry.js +2 -1
- package/dist/esm-es5/taro-form-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-functional-page-navigator-core.entry.js +2 -1
- package/dist/esm-es5/taro-functional-page-navigator-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-icon-core.entry.js +2 -1
- package/dist/esm-es5/taro-icon-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-image-core.entry.js +2 -1
- package/dist/esm-es5/taro-image-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-input-core.entry.js +2 -1
- package/dist/esm-es5/taro-input-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-keyboard-accessory-core.entry.js +2 -1
- package/dist/esm-es5/taro-keyboard-accessory-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-label-core.entry.js +2 -1
- package/dist/esm-es5/taro-label-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-live-player-core.entry.js +2 -1
- package/dist/esm-es5/taro-live-player-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-live-pusher-core.entry.js +2 -1
- package/dist/esm-es5/taro-live-pusher-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-map-core.entry.js +2 -1
- package/dist/esm-es5/taro-map-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-match-media-core.entry.js +2 -1
- package/dist/esm-es5/taro-match-media-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-movable-area-core_2.entry.js +2 -0
- package/dist/esm-es5/taro-movable-area-core_2.entry.js.map +1 -0
- package/dist/esm-es5/taro-navigation-bar-core.entry.js +2 -1
- package/dist/esm-es5/taro-navigation-bar-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-navigator-core.entry.js +2 -1
- package/dist/esm-es5/taro-navigator-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-official-account-core.entry.js +2 -1
- package/dist/esm-es5/taro-official-account-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-open-data-core.entry.js +2 -1
- package/dist/esm-es5/taro-open-data-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-page-container-core.entry.js +2 -1
- package/dist/esm-es5/taro-page-container-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-page-meta-core.entry.js +2 -1
- package/dist/esm-es5/taro-page-meta-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-picker-core_2.entry.js +2 -1
- package/dist/esm-es5/taro-picker-core_2.entry.js.map +1 -0
- package/dist/esm-es5/taro-picker-view-column-core_2.entry.js +2 -0
- package/dist/esm-es5/taro-picker-view-column-core_2.entry.js.map +1 -0
- package/dist/esm-es5/taro-progress-core.entry.js +2 -1
- package/dist/esm-es5/taro-progress-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +2 -1
- package/dist/esm-es5/taro-pull-to-refresh.entry.js.map +1 -0
- package/dist/esm-es5/taro-radio-core_2.entry.js +2 -1
- package/dist/esm-es5/taro-radio-core_2.entry.js.map +1 -0
- package/dist/esm-es5/taro-rich-text-core.entry.js +2 -1
- package/dist/esm-es5/taro-rich-text-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-root-portal-core.entry.js +2 -1
- package/dist/esm-es5/taro-root-portal-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-scroll-view-core.entry.js +2 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-share-element-core.entry.js +2 -1
- package/dist/esm-es5/taro-share-element-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-slider-core.entry.js +2 -1
- package/dist/esm-es5/taro-slider-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-slot-core.entry.js +2 -1
- package/dist/esm-es5/taro-slot-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-swiper-core_2.entry.js +2 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js.map +1 -0
- package/dist/esm-es5/taro-switch-core.entry.js +2 -1
- package/dist/esm-es5/taro-switch-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-tabbar.entry.js +2 -1
- package/dist/esm-es5/taro-tabbar.entry.js.map +1 -0
- package/dist/esm-es5/taro-text-core.entry.js +2 -1
- package/dist/esm-es5/taro-text-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-textarea-core.entry.js +2 -1
- package/dist/esm-es5/taro-textarea-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-video-control_3.entry.js +56 -55
- package/dist/esm-es5/taro-video-control_3.entry.js.map +1 -0
- package/dist/esm-es5/taro-view-core.entry.js +2 -1
- package/dist/esm-es5/taro-view-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-voip-room-core.entry.js +2 -1
- package/dist/esm-es5/taro-voip-room-core.entry.js.map +1 -0
- package/dist/esm-es5/taro-web-view-core.entry.js +2 -1
- package/dist/esm-es5/taro-web-view-core.entry.js.map +1 -0
- package/{dist-h5/react/components → dist/react/component-lib}/index.js +1 -1
- package/{dist-h5/react/components → dist/react/component-lib}/input.js +5 -5
- package/{dist-h5/react/utils → dist/react/component-lib}/reactify-wc.js +10 -20
- package/dist/react/components.js +65 -0
- package/dist/react/helper.js +13 -0
- package/{dist-h5 → dist}/react/index.js +0 -0
- package/dist/react/react-component-lib/index.js +2 -0
- package/dist/react/react-component-lib/interfaces.js +1 -0
- package/dist/react/react-component-lib/utils/attachProps.js +107 -0
- package/dist/react/react-component-lib/utils/case.js +10 -0
- package/dist/react/react-component-lib/utils/dev.js +12 -0
- package/dist/taro-components/index.esm.js +2 -0
- package/dist/taro-components/index.esm.js.map +1 -0
- package/dist/taro-components/p-001ef419.system.entry.js +2 -0
- package/dist/taro-components/p-001ef419.system.entry.js.map +1 -0
- package/dist/taro-components/{p-a94524c9.system.entry.js → p-057159bc.system.entry.js} +2 -1
- package/dist/taro-components/p-057159bc.system.entry.js.map +1 -0
- package/dist/taro-components/p-07281375.entry.js +2 -0
- package/dist/taro-components/p-07281375.entry.js.map +1 -0
- package/dist/taro-components/p-0a896bc7.entry.js +2 -0
- package/dist/taro-components/p-0a896bc7.entry.js.map +1 -0
- package/dist/taro-components/p-0b38e6c7.system.entry.js +2 -0
- package/dist/taro-components/p-0b38e6c7.system.entry.js.map +1 -0
- package/dist/taro-components/p-0d36ef6b.entry.js +2 -0
- package/dist/taro-components/p-0d36ef6b.entry.js.map +1 -0
- package/dist/taro-components/{p-f81a74bb.system.entry.js → p-0dfbdfdb.system.entry.js} +82 -81
- package/dist/taro-components/p-0dfbdfdb.system.entry.js.map +1 -0
- package/dist/taro-components/p-0ee6a068.entry.js +2 -0
- package/dist/taro-components/p-0ee6a068.entry.js.map +1 -0
- package/dist/taro-components/p-12e4b019.entry.js +2 -0
- package/dist/taro-components/p-12e4b019.entry.js.map +1 -0
- package/dist/taro-components/p-15dced71.system.entry.js +2 -0
- package/dist/taro-components/p-15dced71.system.entry.js.map +1 -0
- package/dist/taro-components/p-15e45ed6.system.js +2 -1
- package/dist/taro-components/p-15e45ed6.system.js.map +1 -0
- package/dist/taro-components/p-17657dca.entry.js +2 -0
- package/dist/taro-components/p-17657dca.entry.js.map +1 -0
- package/dist/taro-components/p-1b2556e2.system.entry.js +2 -0
- package/dist/taro-components/p-1b2556e2.system.entry.js.map +1 -0
- package/dist/taro-components/p-1b64d2a2.entry.js +2 -0
- package/dist/taro-components/p-1b64d2a2.entry.js.map +1 -0
- package/dist/taro-components/p-1bd3d09b.system.entry.js +2 -0
- package/dist/taro-components/p-1bd3d09b.system.entry.js.map +1 -0
- package/dist/taro-components/p-1cb76199.entry.js +2 -0
- package/dist/taro-components/p-1cb76199.entry.js.map +1 -0
- package/dist/taro-components/p-1e436d5b.entry.js +2 -0
- package/dist/taro-components/p-1e436d5b.entry.js.map +1 -0
- package/dist/taro-components/p-2096bc5f.entry.js +2 -0
- package/dist/taro-components/p-2096bc5f.entry.js.map +1 -0
- package/dist/taro-components/p-20ec6387.entry.js +2 -0
- package/dist/taro-components/p-20ec6387.entry.js.map +1 -0
- package/dist/taro-components/{p-c5fd5c7f.system.entry.js → p-21b77a13.system.entry.js} +2 -1
- package/dist/taro-components/p-21b77a13.system.entry.js.map +1 -0
- package/dist/taro-components/p-2243a376.entry.js +2 -0
- package/dist/taro-components/p-2243a376.entry.js.map +1 -0
- package/dist/taro-components/p-22f9f9fa.entry.js +2 -0
- package/dist/taro-components/p-22f9f9fa.entry.js.map +1 -0
- package/dist/taro-components/p-2915c2dd.entry.js +2 -0
- package/dist/taro-components/p-2915c2dd.entry.js.map +1 -0
- package/dist/taro-components/p-29f04296.entry.js +2 -0
- package/dist/taro-components/p-29f04296.entry.js.map +1 -0
- package/dist/taro-components/{p-3e11c8cc.system.entry.js → p-301a8b85.system.entry.js} +2 -1
- package/dist/taro-components/p-301a8b85.system.entry.js.map +1 -0
- package/dist/taro-components/p-3b1d2d37.system.js +2 -1
- package/dist/taro-components/p-3b1d2d37.system.js.map +1 -0
- package/dist/taro-components/p-3b9a1125.entry.js +2 -0
- package/dist/taro-components/p-3b9a1125.entry.js.map +1 -0
- package/dist/taro-components/p-3c256e0e.entry.js +2 -0
- package/dist/taro-components/p-3c256e0e.entry.js.map +1 -0
- package/dist/taro-components/p-3e6b29c6.entry.js +2 -0
- package/dist/taro-components/p-3e6b29c6.entry.js.map +1 -0
- package/dist/taro-components/{p-a63fbc50.system.entry.js → p-439a3349.system.entry.js} +2 -1
- package/dist/taro-components/p-439a3349.system.entry.js.map +1 -0
- package/dist/taro-components/{p-d075934f.system.entry.js → p-45b6ea0c.system.entry.js} +2 -1
- package/dist/taro-components/p-45b6ea0c.system.entry.js.map +1 -0
- package/dist/taro-components/p-49a6cae4.system.entry.js +2 -0
- package/dist/taro-components/p-49a6cae4.system.entry.js.map +1 -0
- package/dist/taro-components/p-4b05e003.entry.js +2 -0
- package/dist/taro-components/p-4b05e003.entry.js.map +1 -0
- package/dist/taro-components/{p-692d986d.system.entry.js → p-4b27df71.system.entry.js} +2 -1
- package/dist/taro-components/p-4b27df71.system.entry.js.map +1 -0
- package/dist/taro-components/{p-f7c80795.system.entry.js → p-4fbb8b4c.system.entry.js} +2 -1
- package/dist/taro-components/p-4fbb8b4c.system.entry.js.map +1 -0
- package/dist/taro-components/p-50ea2036.system.js +2 -1
- package/dist/taro-components/p-50ea2036.system.js.map +1 -0
- package/dist/taro-components/p-51de23e4.entry.js +366 -0
- package/dist/taro-components/p-51de23e4.entry.js.map +1 -0
- package/dist/taro-components/p-55519002.entry.js +2 -0
- package/dist/taro-components/p-55519002.entry.js.map +1 -0
- package/dist/taro-components/p-559bb98a.system.entry.js +2 -0
- package/dist/taro-components/p-559bb98a.system.entry.js.map +1 -0
- package/dist/taro-components/p-570222e2.entry.js +2 -0
- package/dist/taro-components/p-570222e2.entry.js.map +1 -0
- package/dist/taro-components/p-5746d7ce.js +2 -1
- package/dist/taro-components/p-5746d7ce.js.map +1 -0
- package/dist/taro-components/{p-6ad59489.system.entry.js → p-580a72d1.system.entry.js} +2 -1
- package/dist/taro-components/p-580a72d1.system.entry.js.map +1 -0
- package/dist/taro-components/{p-93eed5d7.system.entry.js → p-59418be7.system.entry.js} +2 -1
- package/dist/taro-components/p-59418be7.system.entry.js.map +1 -0
- package/dist/taro-components/p-59e02aca.system.entry.js +2 -0
- package/dist/taro-components/p-59e02aca.system.entry.js.map +1 -0
- package/dist/taro-components/p-5bfefd19.js +3 -0
- package/dist/taro-components/p-5bfefd19.js.map +1 -0
- package/dist/taro-components/p-61f225ef.system.js +2 -1
- package/dist/taro-components/p-61f225ef.system.js.map +1 -0
- package/dist/taro-components/p-663d1bb9.system.js +2 -1
- package/dist/taro-components/p-663d1bb9.system.js.map +1 -0
- package/dist/taro-components/p-6a96da58.js +2 -1
- package/dist/taro-components/p-6a96da58.js.map +1 -0
- package/dist/taro-components/p-6af8be19.entry.js +2 -0
- package/dist/taro-components/p-6af8be19.entry.js.map +1 -0
- package/dist/taro-components/p-6ea2995b.entry.js +2 -0
- package/dist/taro-components/p-6ea2995b.entry.js.map +1 -0
- package/dist/taro-components/p-6f8af69f.entry.js +2 -0
- package/dist/taro-components/p-6f8af69f.entry.js.map +1 -0
- package/dist/taro-components/{p-f4ea8a56.system.entry.js → p-701b0286.system.entry.js} +2 -1
- package/dist/taro-components/p-701b0286.system.entry.js.map +1 -0
- package/dist/taro-components/p-72f327e1.js +2 -1
- package/dist/taro-components/p-72f327e1.js.map +1 -0
- package/dist/taro-components/p-72f626ab.system.entry.js +2 -0
- package/dist/taro-components/p-72f626ab.system.entry.js.map +1 -0
- package/dist/taro-components/p-76724e58.js +3 -2
- package/dist/taro-components/p-76724e58.js.map +1 -0
- package/dist/taro-components/{p-13f0b11f.system.entry.js → p-79e9322e.system.entry.js} +2 -1
- package/dist/taro-components/p-79e9322e.system.entry.js.map +1 -0
- package/dist/taro-components/p-7baff0b4.entry.js +2 -0
- package/dist/taro-components/p-7baff0b4.entry.js.map +1 -0
- package/dist/taro-components/p-8231e748.entry.js +2 -0
- package/dist/taro-components/p-8231e748.entry.js.map +1 -0
- package/dist/taro-components/p-825f8dec.system.entry.js +2 -0
- package/dist/taro-components/p-825f8dec.system.entry.js.map +1 -0
- package/dist/taro-components/{p-07294134.system.entry.js → p-8a3620a6.system.entry.js} +2 -1
- package/dist/taro-components/p-8a3620a6.system.entry.js.map +1 -0
- package/dist/taro-components/p-8a8f286f.system.js +3 -0
- package/dist/taro-components/p-8a8f286f.system.js.map +1 -0
- package/dist/taro-components/{p-7e960ac3.system.entry.js → p-8bec95d4.system.entry.js} +2 -1
- package/dist/taro-components/p-8bec95d4.system.entry.js.map +1 -0
- package/dist/taro-components/{p-e671c8c5.system.entry.js → p-8c8fe164.system.entry.js} +2 -1
- package/dist/taro-components/p-8c8fe164.system.entry.js.map +1 -0
- package/dist/taro-components/p-8e3c923b.entry.js +2 -0
- package/dist/taro-components/p-8e3c923b.entry.js.map +1 -0
- package/dist/taro-components/p-93cc7adc.entry.js +2 -0
- package/dist/taro-components/p-93cc7adc.entry.js.map +1 -0
- package/dist/taro-components/p-946c0799.system.entry.js +2 -0
- package/dist/taro-components/p-946c0799.system.entry.js.map +1 -0
- package/dist/taro-components/p-96a784f1.entry.js +2 -0
- package/dist/taro-components/p-96a784f1.entry.js.map +1 -0
- package/dist/taro-components/p-99bbe34a.system.entry.js +2 -0
- package/dist/taro-components/p-99bbe34a.system.entry.js.map +1 -0
- package/dist/taro-components/{p-075458e5.system.entry.js → p-9f1ca602.system.entry.js} +2 -1
- package/dist/taro-components/p-9f1ca602.system.entry.js.map +1 -0
- package/dist/taro-components/p-a1ace8c7.system.entry.js +2 -0
- package/dist/taro-components/p-a1ace8c7.system.entry.js.map +1 -0
- package/dist/taro-components/p-a29509fa.system.entry.js +2 -0
- package/dist/taro-components/p-a29509fa.system.entry.js.map +1 -0
- package/dist/taro-components/p-a29e3051.entry.js +2 -0
- package/dist/taro-components/p-a29e3051.entry.js.map +1 -0
- package/dist/taro-components/{p-d4da725f.system.entry.js → p-a6f2dc54.system.entry.js} +2 -1
- package/dist/taro-components/p-a6f2dc54.system.entry.js.map +1 -0
- package/dist/taro-components/p-ab105c26.entry.js +2 -0
- package/dist/taro-components/p-ab105c26.entry.js.map +1 -0
- package/dist/taro-components/{p-c93bb915.system.entry.js → p-b04a56bd.system.entry.js} +2 -1
- package/dist/taro-components/p-b04a56bd.system.entry.js.map +1 -0
- package/dist/taro-components/p-b10cb428.entry.js +2 -0
- package/dist/taro-components/p-b10cb428.entry.js.map +1 -0
- package/dist/taro-components/{p-d6662ab3.system.entry.js → p-b500c116.system.entry.js} +2 -1
- package/dist/taro-components/p-b500c116.system.entry.js.map +1 -0
- package/dist/taro-components/p-b832f4e8.entry.js +2 -0
- package/dist/taro-components/p-b832f4e8.entry.js.map +1 -0
- package/dist/taro-components/p-b90926cc.entry.js +2 -0
- package/dist/taro-components/p-b90926cc.entry.js.map +1 -0
- package/dist/taro-components/p-ba743573.entry.js +2 -0
- package/dist/taro-components/p-ba743573.entry.js.map +1 -0
- package/dist/taro-components/p-be3f5ac0.entry.js +2 -0
- package/dist/taro-components/p-be3f5ac0.entry.js.map +1 -0
- package/dist/taro-components/p-beea63a7.entry.js +2 -0
- package/dist/taro-components/p-beea63a7.entry.js.map +1 -0
- package/dist/taro-components/{p-b7681c76.system.entry.js → p-c0e3c822.system.entry.js} +2 -1
- package/dist/taro-components/p-c0e3c822.system.entry.js.map +1 -0
- package/dist/taro-components/p-c3acf0ea.system.entry.js +2 -0
- package/dist/taro-components/p-c3acf0ea.system.entry.js.map +1 -0
- package/dist/taro-components/p-c3bb8fa6.entry.js +2 -0
- package/dist/taro-components/p-c3bb8fa6.entry.js.map +1 -0
- package/dist/taro-components/{p-733cc64a.system.entry.js → p-c4cf58af.system.entry.js} +2 -1
- package/dist/taro-components/p-c4cf58af.system.entry.js.map +1 -0
- package/dist/taro-components/{p-b11aaf69.system.entry.js → p-c5c331bf.system.entry.js} +2 -1
- package/dist/taro-components/p-c5c331bf.system.entry.js.map +1 -0
- package/dist/taro-components/p-ca64c7d4.system.entry.js +2 -0
- package/dist/taro-components/p-ca64c7d4.system.entry.js.map +1 -0
- package/dist/taro-components/p-cb17d8bd.system.js +2 -0
- package/dist/taro-components/p-cb17d8bd.system.js.map +1 -0
- package/dist/taro-components/{p-fc9f4fd7.system.entry.js → p-cbe2436d.system.entry.js} +2 -1
- package/dist/taro-components/p-cbe2436d.system.entry.js.map +1 -0
- package/dist/taro-components/p-cc506879.entry.js +2 -0
- package/dist/taro-components/p-cc506879.entry.js.map +1 -0
- package/dist/taro-components/p-cd6a7eea.entry.js +2 -0
- package/dist/taro-components/p-cd6a7eea.entry.js.map +1 -0
- package/dist/taro-components/p-d4b6f19e.system.entry.js +2 -0
- package/dist/taro-components/p-d4b6f19e.system.entry.js.map +1 -0
- package/dist/taro-components/p-d5579efa.system.entry.js +2 -0
- package/dist/taro-components/p-d5579efa.system.entry.js.map +1 -0
- package/dist/taro-components/p-d619f198.system.entry.js +2 -0
- package/dist/taro-components/p-d619f198.system.entry.js.map +1 -0
- package/dist/taro-components/p-d7ab3e23.system.entry.js +2 -0
- package/dist/taro-components/p-d7ab3e23.system.entry.js.map +1 -0
- package/dist/taro-components/p-d7f4b10f.entry.js +2 -0
- package/dist/taro-components/p-d7f4b10f.entry.js.map +1 -0
- package/dist/taro-components/p-d85b216d.entry.js +2 -0
- package/dist/taro-components/p-d85b216d.entry.js.map +1 -0
- package/dist/taro-components/p-dc75145c.system.entry.js +2 -0
- package/dist/taro-components/p-dc75145c.system.entry.js.map +1 -0
- package/dist/taro-components/p-de762042.entry.js +2 -0
- package/dist/taro-components/p-de762042.entry.js.map +1 -0
- package/dist/taro-components/p-df862d0c.entry.js +2 -0
- package/dist/taro-components/p-df862d0c.entry.js.map +1 -0
- package/dist/taro-components/p-e0d6b00b.entry.js +2 -0
- package/dist/taro-components/p-e0d6b00b.entry.js.map +1 -0
- package/dist/taro-components/p-e25653b4.system.entry.js +2 -0
- package/dist/taro-components/p-e25653b4.system.entry.js.map +1 -0
- package/dist/taro-components/p-e528e0ff.system.entry.js +2 -0
- package/dist/taro-components/p-e528e0ff.system.entry.js.map +1 -0
- package/dist/taro-components/p-e59f999e.entry.js +2 -0
- package/dist/taro-components/p-e59f999e.entry.js.map +1 -0
- package/dist/taro-components/p-e7239faa.system.entry.js +2 -0
- package/dist/taro-components/p-e7239faa.system.entry.js.map +1 -0
- package/dist/taro-components/p-e98c07c3.system.entry.js +2 -0
- package/dist/taro-components/p-e98c07c3.system.entry.js.map +1 -0
- package/dist/taro-components/p-e9abe3e2.entry.js +2 -0
- package/dist/taro-components/p-e9abe3e2.entry.js.map +1 -0
- package/dist/taro-components/{p-8e2b048e.system.entry.js → p-f0d0160d.system.entry.js} +2 -1
- package/dist/taro-components/p-f0d0160d.system.entry.js.map +1 -0
- package/dist/taro-components/p-f273ee4e.entry.js +2 -0
- package/dist/taro-components/p-f273ee4e.entry.js.map +1 -0
- package/dist/taro-components/{p-f2803c2e.system.entry.js → p-f2c75971.system.entry.js} +2 -1
- package/dist/taro-components/p-f2c75971.system.entry.js.map +1 -0
- package/dist/taro-components/p-fc1fe388.entry.js +2 -0
- package/dist/taro-components/p-fc1fe388.entry.js.map +1 -0
- package/dist/taro-components/taro-components.esm.js +2 -1
- package/dist/taro-components/taro-components.esm.js.map +1 -0
- package/dist/taro-components/taro-components.js +2 -1
- package/dist/types/components/input/input.d.ts +1 -1
- package/dist/types/components/movable-area/movable-view.d.ts +3 -3
- package/dist/types/components/progress/progress.d.ts +1 -1
- package/dist/types/components/radio/radio.d.ts +2 -2
- package/dist/types/components/scroll-view/scroll-view.d.ts +1 -1
- package/dist/types/components/slot/slot.d.ts +0 -1
- package/dist/types/components/video/utils.d.ts +1 -1
- package/dist/types/components.d.ts +176 -68
- package/dist/types/stencil-public-runtime.d.ts +20 -4
- package/{dist-h5/vue/components/index.js → dist/vue2/component-lib/components.js} +0 -0
- package/{dist-h5/vue → dist/vue2/component-lib}/createComponent.js +0 -0
- package/{dist-h5/vue → dist/vue2/component-lib}/createFormsComponent.js +0 -0
- package/{dist-h5/vue/components → dist/vue2/component-lib}/icon.js +2 -2
- package/{dist-h5/vue/components → dist/vue2/component-lib}/image.js +2 -2
- package/{dist-h5/vue → dist/vue2/component-lib}/index.js +4 -3
- package/{dist-h5/vue → dist/vue2/component-lib}/mixins/listeners.js +0 -0
- package/{dist-h5/vue → dist/vue2/component-lib}/mixins/refs.js +0 -0
- package/{dist-h5/vue/components → dist/vue2/component-lib}/picker.js +2 -2
- package/{dist-h5/vue/components → dist/vue2/component-lib}/scroll-view.js +2 -2
- package/{dist-h5/vue/components → dist/vue2/component-lib}/text.js +2 -2
- package/dist/vue2/components.js +479 -0
- package/dist/vue2/index.js +26 -0
- package/dist/vue2/vue-component-lib/utils.js +45 -0
- package/{dist-h5/vue3 → dist/vue3/component-lib}/createComponent.js +1 -1
- package/{dist-h5/vue3 → dist/vue3/component-lib}/createFormsComponent.js +0 -0
- package/{dist-h5/vue3 → dist/vue3/component-lib}/forwardRef.js +0 -0
- package/{dist-h5/vue3/components → dist/vue3/component-lib}/icon.js +2 -2
- package/{dist-h5/vue3/components → dist/vue3/component-lib}/image.js +2 -2
- package/{dist-h5/vue3/components → dist/vue3/component-lib}/index.js +2 -2
- package/{dist-h5/vue3/components → dist/vue3/component-lib}/scroll-view.js +2 -2
- package/{dist-h5/vue3/components → dist/vue3/component-lib}/text.js +2 -2
- package/dist/vue3/components.js +64 -0
- package/{dist-h5 → dist}/vue3/index.js +0 -0
- package/dist/vue3/vue-component-lib/utils.js +201 -0
- package/loader/package.json +1 -0
- package/package.json +23 -22
- package/types/Input.d.ts +3 -1
- package/dist/cjs/taro-movable-area-core.cjs.entry.js +0 -157
- package/dist/cjs/taro-picker-view-column-core.cjs.entry.js +0 -95
- package/dist/esm/taro-movable-area-core.entry.js +0 -153
- package/dist/esm/taro-picker-view-column-core.entry.js +0 -91
- package/dist/esm-es5/index-8809c729.js +0 -1
- package/dist/esm-es5/taro-movable-area-core.entry.js +0 -1
- package/dist/esm-es5/taro-movable-view-core.entry.js +0 -1
- package/dist/esm-es5/taro-picker-view-column-core.entry.js +0 -1
- package/dist/esm-es5/taro-picker-view-core.entry.js +0 -1
- package/dist/taro-components/p-028e2728.entry.js +0 -1
- package/dist/taro-components/p-0380841f.system.js +0 -1
- package/dist/taro-components/p-059912fd.js +0 -1
- package/dist/taro-components/p-06178a0c.entry.js +0 -1
- package/dist/taro-components/p-06e6864b.system.entry.js +0 -1
- package/dist/taro-components/p-10c47df8.system.entry.js +0 -1
- package/dist/taro-components/p-232ebfae.system.entry.js +0 -1
- package/dist/taro-components/p-25df0ce9.entry.js +0 -1
- package/dist/taro-components/p-27126803.system.entry.js +0 -1
- package/dist/taro-components/p-275d883f.system.entry.js +0 -1
- package/dist/taro-components/p-27c80869.system.entry.js +0 -1
- package/dist/taro-components/p-2ec47545.entry.js +0 -1
- package/dist/taro-components/p-3255f11f.system.entry.js +0 -1
- package/dist/taro-components/p-362998cf.entry.js +0 -1
- package/dist/taro-components/p-3744e978.entry.js +0 -365
- package/dist/taro-components/p-3c6090fd.entry.js +0 -1
- package/dist/taro-components/p-42630f45.entry.js +0 -1
- package/dist/taro-components/p-44398c17.system.entry.js +0 -1
- package/dist/taro-components/p-44cbb351.system.js +0 -1
- package/dist/taro-components/p-4ada10aa.entry.js +0 -1
- package/dist/taro-components/p-4cf436f9.entry.js +0 -1
- package/dist/taro-components/p-4d826fb7.entry.js +0 -1
- package/dist/taro-components/p-55266a1f.entry.js +0 -1
- package/dist/taro-components/p-56c86512.entry.js +0 -1
- package/dist/taro-components/p-5733124c.entry.js +0 -1
- package/dist/taro-components/p-57a2a441.entry.js +0 -1
- package/dist/taro-components/p-59d93770.entry.js +0 -1
- package/dist/taro-components/p-5a2305e7.entry.js +0 -1
- package/dist/taro-components/p-5a374cb9.entry.js +0 -1
- package/dist/taro-components/p-5c87902f.system.entry.js +0 -1
- package/dist/taro-components/p-5e223bab.system.entry.js +0 -1
- package/dist/taro-components/p-5f18259d.system.entry.js +0 -1
- package/dist/taro-components/p-62fc514e.entry.js +0 -1
- package/dist/taro-components/p-63a0c6b0.entry.js +0 -1
- package/dist/taro-components/p-64447f5a.system.entry.js +0 -1
- package/dist/taro-components/p-67222d90.system.entry.js +0 -1
- package/dist/taro-components/p-6800ac6f.entry.js +0 -1
- package/dist/taro-components/p-6aa557f0.entry.js +0 -1
- package/dist/taro-components/p-72f858e4.entry.js +0 -1
- package/dist/taro-components/p-7374537f.entry.js +0 -1
- package/dist/taro-components/p-7407013d.entry.js +0 -1
- package/dist/taro-components/p-7d329ab0.entry.js +0 -1
- package/dist/taro-components/p-7f93fa08.entry.js +0 -1
- package/dist/taro-components/p-82661d45.system.entry.js +0 -1
- package/dist/taro-components/p-8475421b.system.entry.js +0 -1
- package/dist/taro-components/p-8788dc46.system.entry.js +0 -1
- package/dist/taro-components/p-886571e5.entry.js +0 -1
- package/dist/taro-components/p-888fac99.entry.js +0 -1
- package/dist/taro-components/p-8aea3de3.entry.js +0 -1
- package/dist/taro-components/p-8c8be53b.entry.js +0 -1
- package/dist/taro-components/p-8cf86f31.system.entry.js +0 -1
- package/dist/taro-components/p-9234cc1d.entry.js +0 -1
- package/dist/taro-components/p-92699438.entry.js +0 -1
- package/dist/taro-components/p-9a0e70b1.entry.js +0 -1
- package/dist/taro-components/p-9afbb423.system.entry.js +0 -1
- package/dist/taro-components/p-9b39a940.entry.js +0 -1
- package/dist/taro-components/p-9e1572c5.system.entry.js +0 -1
- package/dist/taro-components/p-ab1256fe.entry.js +0 -1
- package/dist/taro-components/p-ad6ad7e3.system.entry.js +0 -1
- package/dist/taro-components/p-afbcd093.entry.js +0 -1
- package/dist/taro-components/p-b1ae9401.entry.js +0 -1
- package/dist/taro-components/p-b2800ccd.entry.js +0 -1
- package/dist/taro-components/p-b3b677fc.entry.js +0 -1
- package/dist/taro-components/p-b3d961f9.system.entry.js +0 -1
- package/dist/taro-components/p-b60820b4.entry.js +0 -1
- package/dist/taro-components/p-b7639674.entry.js +0 -1
- package/dist/taro-components/p-b7ac0b7f.system.entry.js +0 -1
- package/dist/taro-components/p-b9903f15.system.entry.js +0 -1
- package/dist/taro-components/p-bd706d39.entry.js +0 -1
- package/dist/taro-components/p-c92bafb6.system.entry.js +0 -1
- package/dist/taro-components/p-cf048af9.entry.js +0 -1
- package/dist/taro-components/p-d5f3080c.entry.js +0 -1
- package/dist/taro-components/p-df3b544a.system.entry.js +0 -1
- package/dist/taro-components/p-dff55efd.entry.js +0 -1
- package/dist/taro-components/p-eec00033.entry.js +0 -1
- package/dist/taro-components/p-eeed74e3.system.entry.js +0 -1
- package/dist/taro-components/p-ef006b23.entry.js +0 -1
- package/dist/taro-components/p-f5f1c3b7.system.entry.js +0 -1
- package/dist/taro-components/p-fa2a9bab.entry.js +0 -1
- package/dist/taro-components/p-fec6ac36.entry.js +0 -1
- package/dist/taro-components/p-ff84986d.entry.js +0 -1
- package/dist/taro-components/p-ffefd74f.entry.js +0 -1
|
@@ -22,6 +22,14 @@ function _interopNamespace(e) {
|
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'taro-components';
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Virtual DOM patching algorithm based on Snabbdom by
|
|
27
|
+
* Simon Friis Vindum (@paldepind)
|
|
28
|
+
* Licensed under the MIT License
|
|
29
|
+
* https://github.com/snabbdom/snabbdom/blob/master/LICENSE
|
|
30
|
+
*
|
|
31
|
+
* Modified for Stencil's renderer and slot projection
|
|
32
|
+
*/
|
|
25
33
|
let contentRef;
|
|
26
34
|
let hostTagName;
|
|
27
35
|
let useNativeShadowDom = false;
|
|
@@ -29,63 +37,6 @@ let checkSlotFallbackVisibility = false;
|
|
|
29
37
|
let checkSlotRelocate = false;
|
|
30
38
|
let isSvgMode = false;
|
|
31
39
|
let queuePending = false;
|
|
32
|
-
const win = typeof window !== 'undefined' ? window : {};
|
|
33
|
-
const doc = win.document || { head: {} };
|
|
34
|
-
const plt = {
|
|
35
|
-
$flags$: 0,
|
|
36
|
-
$resourcesUrl$: '',
|
|
37
|
-
jmp: (h) => h(),
|
|
38
|
-
raf: (h) => requestAnimationFrame(h),
|
|
39
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
40
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
41
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
42
|
-
};
|
|
43
|
-
const promiseResolve = (v) => Promise.resolve(v);
|
|
44
|
-
const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
45
|
-
try {
|
|
46
|
-
new CSSStyleSheet();
|
|
47
|
-
return typeof new CSSStyleSheet().replace === 'function';
|
|
48
|
-
}
|
|
49
|
-
catch (e) { }
|
|
50
|
-
return false;
|
|
51
|
-
})()
|
|
52
|
-
;
|
|
53
|
-
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
54
|
-
if (listeners) {
|
|
55
|
-
listeners.map(([flags, name, method]) => {
|
|
56
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
57
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
58
|
-
const opts = hostListenerOpts(flags);
|
|
59
|
-
plt.ael(target, name, handler, opts);
|
|
60
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
65
|
-
try {
|
|
66
|
-
{
|
|
67
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
68
|
-
// instance is ready, let's call it's member method for this event
|
|
69
|
-
hostRef.$lazyInstance$[methodName](ev);
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
catch (e) {
|
|
77
|
-
consoleError(e);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
const getHostListenerTarget = (elm, flags) => {
|
|
81
|
-
if (flags & 4 /* TargetDocument */)
|
|
82
|
-
return doc;
|
|
83
|
-
return elm;
|
|
84
|
-
};
|
|
85
|
-
// prettier-ignore
|
|
86
|
-
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
87
|
-
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
88
|
-
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
89
40
|
const createTime = (fnName, tagName = '') => {
|
|
90
41
|
{
|
|
91
42
|
return () => {
|
|
@@ -100,59 +51,8 @@ const uniqueTime = (key, measureText) => {
|
|
|
100
51
|
};
|
|
101
52
|
}
|
|
102
53
|
};
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
let style = styles.get(scopeId);
|
|
106
|
-
if (supportsConstructibleStylesheets && allowCS) {
|
|
107
|
-
style = (style || new CSSStyleSheet());
|
|
108
|
-
style.replace(cssText);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
style = cssText;
|
|
112
|
-
}
|
|
113
|
-
styles.set(scopeId, style);
|
|
114
|
-
};
|
|
115
|
-
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
116
|
-
let scopeId = getScopeId(cmpMeta);
|
|
117
|
-
let style = styles.get(scopeId);
|
|
118
|
-
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
119
|
-
// so the fallback is to always use the document for the root node in those cases
|
|
120
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
121
|
-
if (style) {
|
|
122
|
-
if (typeof style === 'string') {
|
|
123
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
124
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
125
|
-
let styleElm;
|
|
126
|
-
if (!appliedStyles) {
|
|
127
|
-
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
128
|
-
}
|
|
129
|
-
if (!appliedStyles.has(scopeId)) {
|
|
130
|
-
{
|
|
131
|
-
{
|
|
132
|
-
styleElm = doc.createElement('style');
|
|
133
|
-
styleElm.innerHTML = style;
|
|
134
|
-
}
|
|
135
|
-
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
136
|
-
}
|
|
137
|
-
if (appliedStyles) {
|
|
138
|
-
appliedStyles.add(scopeId);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
143
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return scopeId;
|
|
147
|
-
};
|
|
148
|
-
const attachStyles = (hostRef) => {
|
|
149
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
150
|
-
const elm = hostRef.$hostElement$;
|
|
151
|
-
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
152
|
-
addStyle(elm.getRootNode(), cmpMeta);
|
|
153
|
-
endAttachStyles();
|
|
154
|
-
};
|
|
155
|
-
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
54
|
+
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
|
55
|
+
const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
156
56
|
/**
|
|
157
57
|
* Default style mode id
|
|
158
58
|
*/
|
|
@@ -183,7 +83,7 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
183
83
|
let slotName = null;
|
|
184
84
|
let simple = false;
|
|
185
85
|
let lastSimple = false;
|
|
186
|
-
|
|
86
|
+
const vNodeChildren = [];
|
|
187
87
|
const walk = (c) => {
|
|
188
88
|
for (let i = 0; i < c.length; i++) {
|
|
189
89
|
child = c[i];
|
|
@@ -295,6 +195,137 @@ const convertToPrivate = (node) => {
|
|
|
295
195
|
vnode.$name$ = node.vname;
|
|
296
196
|
return vnode;
|
|
297
197
|
};
|
|
198
|
+
/**
|
|
199
|
+
* Parse a new property value for a given property type.
|
|
200
|
+
*
|
|
201
|
+
* While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
|
|
202
|
+
* it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
|
|
203
|
+
* 1. `any`, the type given to `propValue` in the function signature
|
|
204
|
+
* 2. the type stored from `propType`.
|
|
205
|
+
*
|
|
206
|
+
* This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
|
|
207
|
+
*
|
|
208
|
+
* Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
|
|
209
|
+
* a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
|
|
210
|
+
* based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
|
|
211
|
+
* ```tsx
|
|
212
|
+
* <my-cmp prop-val={0}></my-cmp>
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* HTML prop values on the other hand, will always a string
|
|
216
|
+
*
|
|
217
|
+
* @param propValue the new value to coerce to some type
|
|
218
|
+
* @param propType the type of the prop, expressed as a binary number
|
|
219
|
+
* @returns the parsed/coerced value
|
|
220
|
+
*/
|
|
221
|
+
const parsePropertyValue = (propValue, propType) => {
|
|
222
|
+
// ensure this value is of the correct prop type
|
|
223
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
224
|
+
if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
|
|
225
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
226
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
227
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
228
|
+
}
|
|
229
|
+
if (propType & 2 /* MEMBER_FLAGS.Number */) {
|
|
230
|
+
// force it to be a number
|
|
231
|
+
return parseFloat(propValue);
|
|
232
|
+
}
|
|
233
|
+
if (propType & 1 /* MEMBER_FLAGS.String */) {
|
|
234
|
+
// could have been passed as a number or boolean
|
|
235
|
+
// but we still want it as a string
|
|
236
|
+
return String(propValue);
|
|
237
|
+
}
|
|
238
|
+
// redundant return here for better minification
|
|
239
|
+
return propValue;
|
|
240
|
+
}
|
|
241
|
+
// not sure exactly what type we want
|
|
242
|
+
// so no need to change to a different type
|
|
243
|
+
return propValue;
|
|
244
|
+
};
|
|
245
|
+
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
246
|
+
const createEvent = (ref, name, flags) => {
|
|
247
|
+
const elm = getElement(ref);
|
|
248
|
+
return {
|
|
249
|
+
emit: (detail) => {
|
|
250
|
+
return emitEvent(elm, name, {
|
|
251
|
+
bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
|
|
252
|
+
composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
|
|
253
|
+
cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
|
|
254
|
+
detail,
|
|
255
|
+
});
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* Helper function to create & dispatch a custom Event on a provided target
|
|
261
|
+
* @param elm the target of the Event
|
|
262
|
+
* @param name the name to give the custom Event
|
|
263
|
+
* @param opts options for configuring a custom Event
|
|
264
|
+
* @returns the custom Event
|
|
265
|
+
*/
|
|
266
|
+
const emitEvent = (elm, name, opts) => {
|
|
267
|
+
const ev = plt.ce(name, opts);
|
|
268
|
+
elm.dispatchEvent(ev);
|
|
269
|
+
return ev;
|
|
270
|
+
};
|
|
271
|
+
const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
|
|
272
|
+
const registerStyle = (scopeId, cssText, allowCS) => {
|
|
273
|
+
let style = styles.get(scopeId);
|
|
274
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
275
|
+
style = (style || new CSSStyleSheet());
|
|
276
|
+
if (typeof style === 'string') {
|
|
277
|
+
style = cssText;
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
style.replaceSync(cssText);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
style = cssText;
|
|
285
|
+
}
|
|
286
|
+
styles.set(scopeId, style);
|
|
287
|
+
};
|
|
288
|
+
const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
|
|
289
|
+
let scopeId = getScopeId(cmpMeta);
|
|
290
|
+
const style = styles.get(scopeId);
|
|
291
|
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
|
292
|
+
// so the fallback is to always use the document for the root node in those cases
|
|
293
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
|
|
294
|
+
if (style) {
|
|
295
|
+
if (typeof style === 'string') {
|
|
296
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
297
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
298
|
+
let styleElm;
|
|
299
|
+
if (!appliedStyles) {
|
|
300
|
+
rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
|
|
301
|
+
}
|
|
302
|
+
if (!appliedStyles.has(scopeId)) {
|
|
303
|
+
{
|
|
304
|
+
{
|
|
305
|
+
styleElm = doc.createElement('style');
|
|
306
|
+
styleElm.innerHTML = style;
|
|
307
|
+
}
|
|
308
|
+
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
|
309
|
+
}
|
|
310
|
+
if (appliedStyles) {
|
|
311
|
+
appliedStyles.add(scopeId);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
316
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return scopeId;
|
|
320
|
+
};
|
|
321
|
+
const attachStyles = (hostRef) => {
|
|
322
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
323
|
+
const elm = hostRef.$hostElement$;
|
|
324
|
+
const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
|
|
325
|
+
addStyle(elm.getRootNode(), cmpMeta);
|
|
326
|
+
endAttachStyles();
|
|
327
|
+
};
|
|
328
|
+
const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
|
|
298
329
|
/**
|
|
299
330
|
* Production setAccessor() function based on Preact by
|
|
300
331
|
* Jason Miller (@developit)
|
|
@@ -392,7 +423,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
392
423
|
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
|
|
393
424
|
try {
|
|
394
425
|
if (!elm.tagName.includes('-')) {
|
|
395
|
-
|
|
426
|
+
const n = newValue == null ? '' : newValue;
|
|
396
427
|
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
|
397
428
|
if (memberName === 'list') {
|
|
398
429
|
isProp = false;
|
|
@@ -431,7 +462,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
431
462
|
}
|
|
432
463
|
}
|
|
433
464
|
}
|
|
434
|
-
else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
465
|
+
else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
|
|
435
466
|
newValue = newValue === true ? '' : newValue;
|
|
436
467
|
if (xlink) {
|
|
437
468
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
@@ -449,7 +480,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
449
480
|
// if the element passed in is a shadow root, which is a document fragment
|
|
450
481
|
// then we want to be adding attrs/props to the shadow root's "host" element
|
|
451
482
|
// if it's not a shadow root, then we add attrs/props to the same element
|
|
452
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
|
|
483
|
+
const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
|
|
453
484
|
? newVnode.$elm$.host
|
|
454
485
|
: newVnode.$elm$;
|
|
455
486
|
const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
|
|
@@ -467,9 +498,19 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
|
|
|
467
498
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
|
468
499
|
}
|
|
469
500
|
};
|
|
501
|
+
/**
|
|
502
|
+
* Create a DOM Node corresponding to one of the children of a given VNode.
|
|
503
|
+
*
|
|
504
|
+
* @param oldParentVNode the parent VNode from the previous render
|
|
505
|
+
* @param newParentVNode the parent VNode from the current render
|
|
506
|
+
* @param childIndex the index of the VNode, in the _new_ parent node's
|
|
507
|
+
* children, for which we will create a new DOM node
|
|
508
|
+
* @param parentElm the parent DOM node which our new node will be a child of
|
|
509
|
+
* @returns the newly created node
|
|
510
|
+
*/
|
|
470
511
|
const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
471
512
|
// tslint:disable-next-line: prefer-const
|
|
472
|
-
|
|
513
|
+
const newVNode = newParentVNode.$children$[childIndex];
|
|
473
514
|
let i = 0;
|
|
474
515
|
let elm;
|
|
475
516
|
let childNode;
|
|
@@ -480,23 +521,23 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
480
521
|
if (newVNode.$tag$ === 'slot') {
|
|
481
522
|
newVNode.$flags$ |= newVNode.$children$
|
|
482
523
|
? // slot element has fallback content
|
|
483
|
-
2 /* isSlotFallback */
|
|
524
|
+
2 /* VNODE_FLAGS.isSlotFallback */
|
|
484
525
|
: // slot element does not have fallback content
|
|
485
|
-
1 /* isSlotReference */;
|
|
526
|
+
1 /* VNODE_FLAGS.isSlotReference */;
|
|
486
527
|
}
|
|
487
528
|
}
|
|
488
529
|
if (newVNode.$text$ !== null) {
|
|
489
530
|
// create text node
|
|
490
531
|
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
|
491
532
|
}
|
|
492
|
-
else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
533
|
+
else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
|
|
493
534
|
// create a slot reference node
|
|
494
535
|
elm = newVNode.$elm$ =
|
|
495
536
|
doc.createTextNode('');
|
|
496
537
|
}
|
|
497
538
|
else {
|
|
498
539
|
// create element
|
|
499
|
-
elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* isSlotFallback */
|
|
540
|
+
elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
|
|
500
541
|
? 'slot-fb'
|
|
501
542
|
: newVNode.$tag$));
|
|
502
543
|
// add css classes, attrs, props, listeners, etc.
|
|
@@ -517,7 +558,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
517
558
|
}
|
|
518
559
|
{
|
|
519
560
|
elm['s-hn'] = hostTagName;
|
|
520
|
-
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
561
|
+
if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
|
|
521
562
|
// remember the content reference comment
|
|
522
563
|
elm['s-sr'] = true;
|
|
523
564
|
// remember the content reference comment
|
|
@@ -536,7 +577,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
536
577
|
return elm;
|
|
537
578
|
};
|
|
538
579
|
const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
539
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
580
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
540
581
|
const oldSlotChildNodes = parentElm.childNodes;
|
|
541
582
|
for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
|
|
542
583
|
const childNode = oldSlotChildNodes[i];
|
|
@@ -557,7 +598,7 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
557
598
|
putBackInOriginalLocation(childNode, recursive);
|
|
558
599
|
}
|
|
559
600
|
}
|
|
560
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
601
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
561
602
|
};
|
|
562
603
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
563
604
|
let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
|
|
@@ -596,6 +637,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
596
637
|
}
|
|
597
638
|
}
|
|
598
639
|
};
|
|
640
|
+
/**
|
|
641
|
+
* Reconcile the children of a new VNode with the children of an old VNode by
|
|
642
|
+
* traversing the two collections of children, identifying nodes that are
|
|
643
|
+
* conserved or changed, calling out to `patch` to make any necessary
|
|
644
|
+
* updates to the DOM, and rearranging DOM nodes as needed.
|
|
645
|
+
*
|
|
646
|
+
* The algorithm for reconciling children works by analyzing two 'windows' onto
|
|
647
|
+
* the two arrays of children (`oldCh` and `newCh`). We keep track of the
|
|
648
|
+
* 'windows' by storing start and end indices and references to the
|
|
649
|
+
* corresponding array entries. Initially the two 'windows' are basically equal
|
|
650
|
+
* to the entire array, but we progressively narrow the windows until there are
|
|
651
|
+
* no children left to update by doing the following:
|
|
652
|
+
*
|
|
653
|
+
* 1. Skip any `null` entries at the beginning or end of the two arrays, so
|
|
654
|
+
* that if we have an initial array like the following we'll end up dealing
|
|
655
|
+
* only with a window bounded by the highlighted elements:
|
|
656
|
+
*
|
|
657
|
+
* [null, null, VNode1 , ... , VNode2, null, null]
|
|
658
|
+
* ^^^^^^ ^^^^^^
|
|
659
|
+
*
|
|
660
|
+
* 2. Check to see if the elements at the head and tail positions are equal
|
|
661
|
+
* across the windows. This will basically detect elements which haven't
|
|
662
|
+
* been added, removed, or changed position, i.e. if you had the following
|
|
663
|
+
* VNode elements (represented as HTML):
|
|
664
|
+
*
|
|
665
|
+
* oldVNode: `<div><p><span>HEY</span></p></div>`
|
|
666
|
+
* newVNode: `<div><p><span>THERE</span></p></div>`
|
|
667
|
+
*
|
|
668
|
+
* Then when comparing the children of the `<div>` tag we check the equality
|
|
669
|
+
* of the VNodes corresponding to the `<p>` tags and, since they are the
|
|
670
|
+
* same tag in the same position, we'd be able to avoid completely
|
|
671
|
+
* re-rendering the subtree under them with a new DOM element and would just
|
|
672
|
+
* call out to `patch` to handle reconciling their children and so on.
|
|
673
|
+
*
|
|
674
|
+
* 3. Check, for both windows, to see if the element at the beginning of the
|
|
675
|
+
* window corresponds to the element at the end of the other window. This is
|
|
676
|
+
* a heuristic which will let us identify _some_ situations in which
|
|
677
|
+
* elements have changed position, for instance it _should_ detect that the
|
|
678
|
+
* children nodes themselves have not changed but merely moved in the
|
|
679
|
+
* following example:
|
|
680
|
+
*
|
|
681
|
+
* oldVNode: `<div><element-one /><element-two /></div>`
|
|
682
|
+
* newVNode: `<div><element-two /><element-one /></div>`
|
|
683
|
+
*
|
|
684
|
+
* If we find cases like this then we also need to move the concrete DOM
|
|
685
|
+
* elements corresponding to the moved children to write the re-order to the
|
|
686
|
+
* DOM.
|
|
687
|
+
*
|
|
688
|
+
* 4. Finally, if VNodes have the `key` attribute set on them we check for any
|
|
689
|
+
* nodes in the old children which have the same key as the first element in
|
|
690
|
+
* our window on the new children. If we find such a node we handle calling
|
|
691
|
+
* out to `patch`, moving relevant DOM nodes, and so on, in accordance with
|
|
692
|
+
* what we find.
|
|
693
|
+
*
|
|
694
|
+
* Finally, once we've narrowed our 'windows' to the point that either of them
|
|
695
|
+
* collapse (i.e. they have length 0) we then handle any remaining VNode
|
|
696
|
+
* insertion or deletion that needs to happen to get a DOM state that correctly
|
|
697
|
+
* reflects the new child VNodes. If, for instance, after our window on the old
|
|
698
|
+
* children has collapsed we still have more nodes on the new children that
|
|
699
|
+
* we haven't dealt with yet then we need to add them, or if the new children
|
|
700
|
+
* collapse but we still have unhandled _old_ children then we need to make
|
|
701
|
+
* sure the corresponding DOM nodes are removed.
|
|
702
|
+
*
|
|
703
|
+
* @param parentElm the node into which the parent VNode is rendered
|
|
704
|
+
* @param oldCh the old children of the parent node
|
|
705
|
+
* @param newVNode the new VNode which will replace the parent
|
|
706
|
+
* @param newCh the new children of the parent node
|
|
707
|
+
*/
|
|
599
708
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
600
709
|
let oldStartIdx = 0;
|
|
601
710
|
let newStartIdx = 0;
|
|
@@ -611,7 +720,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
611
720
|
let elmToMove;
|
|
612
721
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
613
722
|
if (oldStartVnode == null) {
|
|
614
|
-
//
|
|
723
|
+
// VNode might have been moved left
|
|
615
724
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
616
725
|
}
|
|
617
726
|
else if (oldEndVnode == null) {
|
|
@@ -624,37 +733,100 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
624
733
|
newEndVnode = newCh[--newEndIdx];
|
|
625
734
|
}
|
|
626
735
|
else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
736
|
+
// if the start nodes are the same then we should patch the new VNode
|
|
737
|
+
// onto the old one, and increment our `newStartIdx` and `oldStartIdx`
|
|
738
|
+
// indices to reflect that. We don't need to move any DOM Nodes around
|
|
739
|
+
// since things are matched up in order.
|
|
627
740
|
patch(oldStartVnode, newStartVnode);
|
|
628
741
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
629
742
|
newStartVnode = newCh[++newStartIdx];
|
|
630
743
|
}
|
|
631
744
|
else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
745
|
+
// likewise, if the end nodes are the same we patch new onto old and
|
|
746
|
+
// decrement our end indices, and also likewise in this case we don't
|
|
747
|
+
// need to move any DOM Nodes.
|
|
632
748
|
patch(oldEndVnode, newEndVnode);
|
|
633
749
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
634
750
|
newEndVnode = newCh[--newEndIdx];
|
|
635
751
|
}
|
|
636
752
|
else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
637
|
-
// Vnode moved right
|
|
753
|
+
// case: "Vnode moved right"
|
|
754
|
+
//
|
|
755
|
+
// We've found that the last node in our window on the new children is
|
|
756
|
+
// the same VNode as the _first_ node in our window on the old children
|
|
757
|
+
// we're dealing with now. Visually, this is the layout of these two
|
|
758
|
+
// nodes:
|
|
759
|
+
//
|
|
760
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
761
|
+
// ^^^^^^^^^^^
|
|
762
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
763
|
+
// ^^^^^^^^^^^^^
|
|
764
|
+
//
|
|
765
|
+
// In this situation we need to patch `newEndVnode` onto `oldStartVnode`
|
|
766
|
+
// and move the DOM element for `oldStartVnode`.
|
|
638
767
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
639
768
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
640
769
|
}
|
|
641
770
|
patch(oldStartVnode, newEndVnode);
|
|
771
|
+
// We need to move the element for `oldStartVnode` into a position which
|
|
772
|
+
// will be appropriate for `newEndVnode`. For this we can use
|
|
773
|
+
// `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
|
|
774
|
+
// sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
|
|
775
|
+
// `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
|
|
776
|
+
//
|
|
777
|
+
// <old-start-node />
|
|
778
|
+
// <some-intervening-node />
|
|
779
|
+
// <old-end-node />
|
|
780
|
+
// <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
|
|
781
|
+
// <next-sibling />
|
|
782
|
+
//
|
|
783
|
+
// If instead `oldEndVnode.$elm$` has no sibling then we just want to put
|
|
784
|
+
// the node for `oldStartVnode` at the end of the children of
|
|
785
|
+
// `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
|
|
786
|
+
// aren't any siblings, and passing `null` to `Node.insertBefore` will
|
|
787
|
+
// append it to the children of the parent element.
|
|
642
788
|
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
643
789
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
644
790
|
newEndVnode = newCh[--newEndIdx];
|
|
645
791
|
}
|
|
646
792
|
else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
647
|
-
// Vnode moved left
|
|
793
|
+
// case: "Vnode moved left"
|
|
794
|
+
//
|
|
795
|
+
// We've found that the first node in our window on the new children is
|
|
796
|
+
// the same VNode as the _last_ node in our window on the old children.
|
|
797
|
+
// Visually, this is the layout of these two nodes:
|
|
798
|
+
//
|
|
799
|
+
// newCh: [..., newStartVnode , ... , newEndVnode , ...]
|
|
800
|
+
// ^^^^^^^^^^^^^
|
|
801
|
+
// oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
|
|
802
|
+
// ^^^^^^^^^^^
|
|
803
|
+
//
|
|
804
|
+
// In this situation we need to patch `newStartVnode` onto `oldEndVnode`
|
|
805
|
+
// (which will handle updating any changed attributes, reconciling their
|
|
806
|
+
// children etc) but we also need to move the DOM node to which
|
|
807
|
+
// `oldEndVnode` corresponds.
|
|
648
808
|
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
|
649
809
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
650
810
|
}
|
|
651
811
|
patch(oldEndVnode, newStartVnode);
|
|
812
|
+
// We've already checked above if `oldStartVnode` and `newStartVnode` are
|
|
813
|
+
// the same node, so since we're here we know that they are not. Thus we
|
|
814
|
+
// can move the element for `oldEndVnode` _before_ the element for
|
|
815
|
+
// `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
|
|
816
|
+
// future.
|
|
652
817
|
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
653
818
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
654
819
|
newStartVnode = newCh[++newStartIdx];
|
|
655
820
|
}
|
|
656
821
|
else {
|
|
657
|
-
//
|
|
822
|
+
// Here we do some checks to match up old and new nodes based on the
|
|
823
|
+
// `$key$` attribute, which is set by putting a `key="my-key"` attribute
|
|
824
|
+
// in the JSX for a DOM element in the implementation of a Stencil
|
|
825
|
+
// component.
|
|
826
|
+
//
|
|
827
|
+
// First we check to see if there are any nodes in the array of old
|
|
828
|
+
// children which have the same key as the first node in the new
|
|
829
|
+
// children.
|
|
658
830
|
idxInOld = -1;
|
|
659
831
|
{
|
|
660
832
|
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
@@ -665,23 +837,32 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
665
837
|
}
|
|
666
838
|
}
|
|
667
839
|
if (idxInOld >= 0) {
|
|
840
|
+
// We found a node in the old children which matches up with the first
|
|
841
|
+
// node in the new children! So let's deal with that
|
|
668
842
|
elmToMove = oldCh[idxInOld];
|
|
669
843
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
844
|
+
// the tag doesn't match so we'll need a new DOM element
|
|
670
845
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
671
846
|
}
|
|
672
847
|
else {
|
|
673
848
|
patch(elmToMove, newStartVnode);
|
|
849
|
+
// invalidate the matching old node so that we won't try to update it
|
|
850
|
+
// again later on
|
|
674
851
|
oldCh[idxInOld] = undefined;
|
|
675
852
|
node = elmToMove.$elm$;
|
|
676
853
|
}
|
|
677
854
|
newStartVnode = newCh[++newStartIdx];
|
|
678
855
|
}
|
|
679
856
|
else {
|
|
680
|
-
//
|
|
857
|
+
// We either didn't find an element in the old children that matches
|
|
858
|
+
// the key of the first new child OR the build is not using `key`
|
|
859
|
+
// attributes at all. In either case we need to create a new element
|
|
860
|
+
// for the new node.
|
|
681
861
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
682
862
|
newStartVnode = newCh[++newStartIdx];
|
|
683
863
|
}
|
|
684
864
|
if (node) {
|
|
865
|
+
// if we created a new node then handle inserting it to the DOM
|
|
685
866
|
{
|
|
686
867
|
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
|
687
868
|
}
|
|
@@ -689,21 +870,43 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
689
870
|
}
|
|
690
871
|
}
|
|
691
872
|
if (oldStartIdx > oldEndIdx) {
|
|
873
|
+
// we have some more new nodes to add which don't match up with old nodes
|
|
692
874
|
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
|
693
875
|
}
|
|
694
876
|
else if (newStartIdx > newEndIdx) {
|
|
877
|
+
// there are nodes in the `oldCh` array which no longer correspond to nodes
|
|
878
|
+
// in the new array, so lets remove them (which entails cleaning up the
|
|
879
|
+
// relevant DOM nodes)
|
|
695
880
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
696
881
|
}
|
|
697
882
|
};
|
|
698
|
-
|
|
883
|
+
/**
|
|
884
|
+
* Compare two VNodes to determine if they are the same
|
|
885
|
+
*
|
|
886
|
+
* **NB**: This function is an equality _heuristic_ based on the available
|
|
887
|
+
* information set on the two VNodes and can be misleading under certain
|
|
888
|
+
* circumstances. In particular, if the two nodes do not have `key` attrs
|
|
889
|
+
* (available under `$key$` on VNodes) then the function falls back on merely
|
|
890
|
+
* checking that they have the same tag.
|
|
891
|
+
*
|
|
892
|
+
* So, in other words, if `key` attrs are not set on VNodes which may be
|
|
893
|
+
* changing order within a `children` array or something along those lines then
|
|
894
|
+
* we could obtain a false positive and then have to do needless re-rendering.
|
|
895
|
+
*
|
|
896
|
+
* @param leftVNode the first VNode to check
|
|
897
|
+
* @param rightVNode the second VNode to check
|
|
898
|
+
* @returns whether they're equal or not
|
|
899
|
+
*/
|
|
900
|
+
const isSameVnode = (leftVNode, rightVNode) => {
|
|
699
901
|
// compare if two vnode to see if they're "technically" the same
|
|
700
902
|
// need to have the same element tag, and same key to be the same
|
|
701
|
-
if (
|
|
702
|
-
if (
|
|
703
|
-
return
|
|
903
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
904
|
+
if (leftVNode.$tag$ === 'slot') {
|
|
905
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
704
906
|
}
|
|
907
|
+
// this will be set if components in the build have `key` attrs set on them
|
|
705
908
|
{
|
|
706
|
-
return
|
|
909
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
707
910
|
}
|
|
708
911
|
}
|
|
709
912
|
return false;
|
|
@@ -716,6 +919,14 @@ const referenceNode = (node) => {
|
|
|
716
919
|
return (node && node['s-ol']) || node;
|
|
717
920
|
};
|
|
718
921
|
const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
|
922
|
+
/**
|
|
923
|
+
* Handle reconciling an outdated VNode with a new one which corresponds to
|
|
924
|
+
* it. This function handles flushing updates to the DOM and reconciling the
|
|
925
|
+
* children of the two nodes (if any).
|
|
926
|
+
*
|
|
927
|
+
* @param oldVNode an old VNode whose DOM element and children we want to update
|
|
928
|
+
* @param newVNode a new VNode representing an updated version of the old one
|
|
929
|
+
*/
|
|
719
930
|
const patch = (oldVNode, newVNode) => {
|
|
720
931
|
const elm = (newVNode.$elm$ = oldVNode.$elm$);
|
|
721
932
|
const oldChildren = oldVNode.$children$;
|
|
@@ -724,7 +935,6 @@ const patch = (oldVNode, newVNode) => {
|
|
|
724
935
|
const text = newVNode.$text$;
|
|
725
936
|
let defaultHolder;
|
|
726
937
|
if (text === null) {
|
|
727
|
-
// element node
|
|
728
938
|
{
|
|
729
939
|
if (tag === 'slot')
|
|
730
940
|
;
|
|
@@ -737,6 +947,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
737
947
|
}
|
|
738
948
|
if (oldChildren !== null && newChildren !== null) {
|
|
739
949
|
// looks like there's child vnodes for both the old and new vnodes
|
|
950
|
+
// so we need to call `updateChildren` to reconcile them
|
|
740
951
|
updateChildren(elm, oldChildren, newVNode, newChildren);
|
|
741
952
|
}
|
|
742
953
|
else if (newChildren !== null) {
|
|
@@ -765,7 +976,7 @@ const patch = (oldVNode, newVNode) => {
|
|
|
765
976
|
};
|
|
766
977
|
const updateFallbackSlotVisibility = (elm) => {
|
|
767
978
|
// tslint:disable-next-line: prefer-const
|
|
768
|
-
|
|
979
|
+
const childNodes = elm.childNodes;
|
|
769
980
|
let childNode;
|
|
770
981
|
let i;
|
|
771
982
|
let ilen;
|
|
@@ -774,7 +985,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
774
985
|
let nodeType;
|
|
775
986
|
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
|
776
987
|
childNode = childNodes[i];
|
|
777
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
988
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
778
989
|
if (childNode['s-sr']) {
|
|
779
990
|
// this is a slot fallback node
|
|
780
991
|
// get the slot name for this slot reference node
|
|
@@ -786,7 +997,7 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
786
997
|
nodeType = childNodes[j].nodeType;
|
|
787
998
|
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
|
788
999
|
// this sibling node is from a different component OR is a named fallback slot node
|
|
789
|
-
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
1000
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
790
1001
|
childNode.hidden = true;
|
|
791
1002
|
break;
|
|
792
1003
|
}
|
|
@@ -795,8 +1006,8 @@ const updateFallbackSlotVisibility = (elm) => {
|
|
|
795
1006
|
// this is a default fallback slot node
|
|
796
1007
|
// any element or text node (with content)
|
|
797
1008
|
// should hide the default fallback slot node
|
|
798
|
-
if (nodeType === 1 /* ElementNode */ ||
|
|
799
|
-
(nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
1009
|
+
if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
|
|
1010
|
+
(nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
|
|
800
1011
|
childNode.hidden = true;
|
|
801
1012
|
break;
|
|
802
1013
|
}
|
|
@@ -818,8 +1029,8 @@ const relocateSlotContent = (elm) => {
|
|
|
818
1029
|
let relocateNodeData;
|
|
819
1030
|
let j;
|
|
820
1031
|
let i = 0;
|
|
821
|
-
|
|
822
|
-
|
|
1032
|
+
const childNodes = elm.childNodes;
|
|
1033
|
+
const ilen = childNodes.length;
|
|
823
1034
|
for (; i < ilen; i++) {
|
|
824
1035
|
childNode = childNodes[i];
|
|
825
1036
|
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
|
@@ -874,13 +1085,13 @@ const relocateSlotContent = (elm) => {
|
|
|
874
1085
|
}
|
|
875
1086
|
}
|
|
876
1087
|
}
|
|
877
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1088
|
+
if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
878
1089
|
relocateSlotContent(childNode);
|
|
879
1090
|
}
|
|
880
1091
|
}
|
|
881
1092
|
};
|
|
882
1093
|
const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
|
|
883
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1094
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
884
1095
|
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
|
885
1096
|
return true;
|
|
886
1097
|
}
|
|
@@ -906,13 +1117,17 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
906
1117
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
907
1118
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
908
1119
|
hostTagName = hostElm.tagName;
|
|
1120
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
1121
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1122
|
+
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
1123
|
+
}
|
|
909
1124
|
rootVnode.$tag$ = null;
|
|
910
|
-
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1125
|
+
rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
|
|
911
1126
|
hostRef.$vnode$ = rootVnode;
|
|
912
1127
|
rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
|
|
913
1128
|
{
|
|
914
1129
|
contentRef = hostElm['s-cr'];
|
|
915
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1130
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
|
|
916
1131
|
// always reset
|
|
917
1132
|
checkSlotFallbackVisibility = false;
|
|
918
1133
|
}
|
|
@@ -921,7 +1136,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
921
1136
|
{
|
|
922
1137
|
// while we're moving nodes around existing nodes, temporarily disable
|
|
923
1138
|
// the disconnectCallback from working
|
|
924
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1139
|
+
plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
925
1140
|
if (checkSlotRelocate) {
|
|
926
1141
|
relocateSlotContent(rootVnode.$elm$);
|
|
927
1142
|
let relocateData;
|
|
@@ -979,7 +1194,7 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
979
1194
|
}
|
|
980
1195
|
else {
|
|
981
1196
|
// this node doesn't have a slot home to go to, so let's hide it
|
|
982
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1197
|
+
if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
|
|
983
1198
|
nodeToRelocate.hidden = true;
|
|
984
1199
|
}
|
|
985
1200
|
}
|
|
@@ -990,37 +1205,11 @@ const renderVdom = (hostRef, renderFnResults) => {
|
|
|
990
1205
|
}
|
|
991
1206
|
// done moving nodes around
|
|
992
1207
|
// allow the disconnect callback to work again
|
|
993
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1208
|
+
plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
|
|
994
1209
|
// always reset
|
|
995
1210
|
relocateNodes.length = 0;
|
|
996
1211
|
}
|
|
997
1212
|
};
|
|
998
|
-
const getElement = (ref) => (getHostRef(ref).$hostElement$ );
|
|
999
|
-
const createEvent = (ref, name, flags) => {
|
|
1000
|
-
const elm = getElement(ref);
|
|
1001
|
-
return {
|
|
1002
|
-
emit: (detail) => {
|
|
1003
|
-
return emitEvent(elm, name, {
|
|
1004
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
1005
|
-
composed: !!(flags & 2 /* Composed */),
|
|
1006
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
1007
|
-
detail,
|
|
1008
|
-
});
|
|
1009
|
-
},
|
|
1010
|
-
};
|
|
1011
|
-
};
|
|
1012
|
-
/**
|
|
1013
|
-
* Helper function to create & dispatch a custom Event on a provided target
|
|
1014
|
-
* @param elm the target of the Event
|
|
1015
|
-
* @param name the name to give the custom Event
|
|
1016
|
-
* @param opts options for configuring a custom Event
|
|
1017
|
-
* @returns the custom Event
|
|
1018
|
-
*/
|
|
1019
|
-
const emitEvent = (elm, name, opts) => {
|
|
1020
|
-
const ev = plt.ce(name, opts);
|
|
1021
|
-
elm.dispatchEvent(ev);
|
|
1022
|
-
return ev;
|
|
1023
|
-
};
|
|
1024
1213
|
const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1025
1214
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
|
1026
1215
|
ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
|
|
@@ -1028,10 +1217,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
1028
1217
|
};
|
|
1029
1218
|
const scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1030
1219
|
{
|
|
1031
|
-
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1220
|
+
hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1032
1221
|
}
|
|
1033
|
-
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1034
|
-
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1222
|
+
if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
|
|
1223
|
+
hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
|
|
1035
1224
|
return;
|
|
1036
1225
|
}
|
|
1037
1226
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
@@ -1047,7 +1236,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1047
1236
|
let promise;
|
|
1048
1237
|
if (isInitialLoad) {
|
|
1049
1238
|
{
|
|
1050
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1239
|
+
hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
|
|
1051
1240
|
if (hostRef.$queuedListeners$) {
|
|
1052
1241
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
1053
1242
|
hostRef.$queuedListeners$ = null;
|
|
@@ -1095,7 +1284,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1095
1284
|
}
|
|
1096
1285
|
else {
|
|
1097
1286
|
Promise.all(childrenPromises).then(postUpdate);
|
|
1098
|
-
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1287
|
+
hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
|
|
1099
1288
|
childrenPromises.length = 0;
|
|
1100
1289
|
}
|
|
1101
1290
|
}
|
|
@@ -1104,10 +1293,10 @@ const callRender = (hostRef, instance, elm) => {
|
|
|
1104
1293
|
try {
|
|
1105
1294
|
instance = instance.render() ;
|
|
1106
1295
|
{
|
|
1107
|
-
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
1296
|
+
hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
|
|
1108
1297
|
}
|
|
1109
1298
|
{
|
|
1110
|
-
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1299
|
+
hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
|
|
1111
1300
|
}
|
|
1112
1301
|
{
|
|
1113
1302
|
{
|
|
@@ -1134,8 +1323,8 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1134
1323
|
{
|
|
1135
1324
|
safeCall(instance, 'componentDidRender');
|
|
1136
1325
|
}
|
|
1137
|
-
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1138
|
-
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1326
|
+
if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
|
|
1327
|
+
hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
|
|
1139
1328
|
{
|
|
1140
1329
|
// DOM WRITE!
|
|
1141
1330
|
addHydratedFlag(elm);
|
|
@@ -1167,10 +1356,10 @@ const postUpdateComponent = (hostRef) => {
|
|
|
1167
1356
|
hostRef.$onRenderResolve$();
|
|
1168
1357
|
hostRef.$onRenderResolve$ = undefined;
|
|
1169
1358
|
}
|
|
1170
|
-
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1359
|
+
if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
|
|
1171
1360
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1172
1361
|
}
|
|
1173
|
-
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
|
1362
|
+
hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
|
|
1174
1363
|
}
|
|
1175
1364
|
// ( •_•)
|
|
1176
1365
|
// ( •_•)>⌐■-■
|
|
@@ -1200,30 +1389,6 @@ const then = (promise, thenFn) => {
|
|
|
1200
1389
|
};
|
|
1201
1390
|
const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
1202
1391
|
;
|
|
1203
|
-
const parsePropertyValue = (propValue, propType) => {
|
|
1204
|
-
// ensure this value is of the correct prop type
|
|
1205
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
1206
|
-
if (propType & 4 /* Boolean */) {
|
|
1207
|
-
// per the HTML spec, any string value means it is a boolean true value
|
|
1208
|
-
// but we'll cheat here and say that the string "false" is the boolean false
|
|
1209
|
-
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
1210
|
-
}
|
|
1211
|
-
if (propType & 2 /* Number */) {
|
|
1212
|
-
// force it to be a number
|
|
1213
|
-
return parseFloat(propValue);
|
|
1214
|
-
}
|
|
1215
|
-
if (propType & 1 /* String */) {
|
|
1216
|
-
// could have been passed as a number or boolean
|
|
1217
|
-
// but we still want it as a string
|
|
1218
|
-
return String(propValue);
|
|
1219
|
-
}
|
|
1220
|
-
// redundant return here for better minification
|
|
1221
|
-
return propValue;
|
|
1222
|
-
}
|
|
1223
|
-
// not sure exactly what type we want
|
|
1224
|
-
// so no need to change to a different type
|
|
1225
|
-
return propValue;
|
|
1226
|
-
};
|
|
1227
1392
|
const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1228
1393
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1229
1394
|
// check our new property value against our internal value
|
|
@@ -1233,13 +1398,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1233
1398
|
const flags = hostRef.$flags$;
|
|
1234
1399
|
const instance = hostRef.$lazyInstance$ ;
|
|
1235
1400
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1236
|
-
|
|
1401
|
+
// explicitly check for NaN on both sides, as `NaN === NaN` is always false
|
|
1402
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1403
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1404
|
+
if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
|
|
1237
1405
|
// gadzooks! the property's value has changed!!
|
|
1238
1406
|
// set our new value!
|
|
1239
1407
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1240
1408
|
if (instance) {
|
|
1241
1409
|
// get an array of method names of watch functions to call
|
|
1242
|
-
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1410
|
+
if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
|
|
1243
1411
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1244
1412
|
if (watchMethods) {
|
|
1245
1413
|
// this instance is watching for when this property changed
|
|
@@ -1254,7 +1422,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1254
1422
|
});
|
|
1255
1423
|
}
|
|
1256
1424
|
}
|
|
1257
|
-
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1425
|
+
if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
|
|
1258
1426
|
// looks like this value actually changed, so we've got work to do!
|
|
1259
1427
|
// but only if we've already rendered, otherwise just chill out
|
|
1260
1428
|
// queue that we need to do an update, but don't worry about queuing
|
|
@@ -1264,6 +1432,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1264
1432
|
}
|
|
1265
1433
|
}
|
|
1266
1434
|
};
|
|
1435
|
+
/**
|
|
1436
|
+
* Attach a series of runtime constructs to a compiled Stencil component
|
|
1437
|
+
* constructor, including getters and setters for the `@Prop` and `@State`
|
|
1438
|
+
* decorators, callbacks for when attributes change, and so on.
|
|
1439
|
+
*
|
|
1440
|
+
* @param Cstr the constructor for a component that we need to process
|
|
1441
|
+
* @param cmpMeta metadata collected previously about the component
|
|
1442
|
+
* @param flags a number used to store a series of bit flags
|
|
1443
|
+
* @returns a reference to the same constructor passed in (but now mutated)
|
|
1444
|
+
*/
|
|
1267
1445
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1268
1446
|
if (cmpMeta.$members$) {
|
|
1269
1447
|
if (Cstr.watchers) {
|
|
@@ -1273,8 +1451,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1273
1451
|
const members = Object.entries(cmpMeta.$members$);
|
|
1274
1452
|
const prototype = Cstr.prototype;
|
|
1275
1453
|
members.map(([memberName, [memberFlags]]) => {
|
|
1276
|
-
if ((memberFlags & 31 /* Prop */ ||
|
|
1277
|
-
((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
|
|
1454
|
+
if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
|
|
1455
|
+
((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
|
|
1278
1456
|
// proxyComponent - prop
|
|
1279
1457
|
Object.defineProperty(prototype, memberName, {
|
|
1280
1458
|
get() {
|
|
@@ -1289,8 +1467,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1289
1467
|
enumerable: true,
|
|
1290
1468
|
});
|
|
1291
1469
|
}
|
|
1292
|
-
else if (flags & 1 /* isElementConstructor */ &&
|
|
1293
|
-
memberFlags & 64 /* Method */) {
|
|
1470
|
+
else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
|
|
1471
|
+
memberFlags & 64 /* MEMBER_FLAGS.Method */) {
|
|
1294
1472
|
// proxyComponent - method
|
|
1295
1473
|
Object.defineProperty(prototype, memberName, {
|
|
1296
1474
|
value(...args) {
|
|
@@ -1300,7 +1478,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1300
1478
|
});
|
|
1301
1479
|
}
|
|
1302
1480
|
});
|
|
1303
|
-
if ((flags & 1 /* isElementConstructor */)) {
|
|
1481
|
+
if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
|
|
1304
1482
|
const attrNameToPropName = new Map();
|
|
1305
1483
|
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
|
1306
1484
|
plt.jmp(() => {
|
|
@@ -1356,10 +1534,13 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1356
1534
|
// create an array of attributes to observe
|
|
1357
1535
|
// and also create a map of html attribute name to js property name
|
|
1358
1536
|
Cstr.observedAttributes = members
|
|
1359
|
-
.filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
|
|
1537
|
+
.filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
|
|
1360
1538
|
.map(([propName, m]) => {
|
|
1361
1539
|
const attrName = m[1] || propName;
|
|
1362
1540
|
attrNameToPropName.set(attrName, propName);
|
|
1541
|
+
if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
|
|
1542
|
+
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
1543
|
+
}
|
|
1363
1544
|
return attrName;
|
|
1364
1545
|
});
|
|
1365
1546
|
}
|
|
@@ -1368,10 +1549,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1368
1549
|
};
|
|
1369
1550
|
const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
|
|
1370
1551
|
// initializeComponent
|
|
1371
|
-
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1552
|
+
if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
|
|
1372
1553
|
{
|
|
1373
1554
|
// we haven't initialized this element yet
|
|
1374
|
-
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1555
|
+
hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
|
|
1375
1556
|
// lazy loaded components
|
|
1376
1557
|
// request the component's implementation to be
|
|
1377
1558
|
// wired up with the host element
|
|
@@ -1389,7 +1570,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1389
1570
|
{
|
|
1390
1571
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1391
1572
|
}
|
|
1392
|
-
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1573
|
+
proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
|
|
1393
1574
|
Cstr.isProxied = true;
|
|
1394
1575
|
}
|
|
1395
1576
|
const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
|
|
@@ -1397,7 +1578,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1397
1578
|
// but let's keep track of when we start and stop
|
|
1398
1579
|
// so that the getters/setters don't incorrectly step on data
|
|
1399
1580
|
{
|
|
1400
|
-
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1581
|
+
hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1401
1582
|
}
|
|
1402
1583
|
// construct the lazy-loaded component implementation
|
|
1403
1584
|
// passing the hostRef is very important during
|
|
@@ -1410,10 +1591,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1410
1591
|
consoleError(e);
|
|
1411
1592
|
}
|
|
1412
1593
|
{
|
|
1413
|
-
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1594
|
+
hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
|
|
1414
1595
|
}
|
|
1415
1596
|
{
|
|
1416
|
-
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1597
|
+
hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
|
|
1417
1598
|
}
|
|
1418
1599
|
endNewInstance();
|
|
1419
1600
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
@@ -1424,7 +1605,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1424
1605
|
const scopeId = getScopeId(cmpMeta);
|
|
1425
1606
|
if (!styles.has(scopeId)) {
|
|
1426
1607
|
const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
|
|
1427
|
-
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1608
|
+
registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
|
|
1428
1609
|
endRegisterStyles();
|
|
1429
1610
|
}
|
|
1430
1611
|
}
|
|
@@ -1451,19 +1632,19 @@ const fireConnectedCallback = (instance) => {
|
|
|
1451
1632
|
}
|
|
1452
1633
|
};
|
|
1453
1634
|
const connectedCallback = (elm) => {
|
|
1454
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1635
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1455
1636
|
const hostRef = getHostRef(elm);
|
|
1456
1637
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1457
1638
|
const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
|
|
1458
|
-
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1639
|
+
if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
|
|
1459
1640
|
// first time this component has connected
|
|
1460
|
-
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1641
|
+
hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
|
|
1461
1642
|
{
|
|
1462
1643
|
// initUpdate
|
|
1463
1644
|
// if the slot polyfill is required we'll need to put some nodes
|
|
1464
1645
|
// in here to act as original content anchors as we move nodes around
|
|
1465
1646
|
// host element has been connected to the DOM
|
|
1466
|
-
if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
|
|
1647
|
+
if ((cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
|
|
1467
1648
|
setContentReference(elm);
|
|
1468
1649
|
}
|
|
1469
1650
|
}
|
|
@@ -1486,7 +1667,7 @@ const connectedCallback = (elm) => {
|
|
|
1486
1667
|
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
1487
1668
|
if (cmpMeta.$members$) {
|
|
1488
1669
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1489
|
-
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1670
|
+
if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
|
|
1490
1671
|
const value = elm[memberName];
|
|
1491
1672
|
delete elm[memberName];
|
|
1492
1673
|
elm[memberName] = value;
|
|
@@ -1520,7 +1701,7 @@ const setContentReference = (elm) => {
|
|
|
1520
1701
|
elm.insertBefore(contentRefElm, elm.firstChild);
|
|
1521
1702
|
};
|
|
1522
1703
|
const disconnectedCallback = (elm) => {
|
|
1523
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1704
|
+
if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
|
|
1524
1705
|
const hostRef = getHostRef(elm);
|
|
1525
1706
|
const instance = hostRef.$lazyInstance$ ;
|
|
1526
1707
|
{
|
|
@@ -1561,6 +1742,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1561
1742
|
{
|
|
1562
1743
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1563
1744
|
}
|
|
1745
|
+
{
|
|
1746
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1747
|
+
}
|
|
1564
1748
|
{
|
|
1565
1749
|
cmpMeta.$watchers$ = {};
|
|
1566
1750
|
}
|
|
@@ -1596,7 +1780,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1596
1780
|
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
1597
1781
|
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
|
1598
1782
|
cmpTags.push(tagName);
|
|
1599
|
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
1783
|
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
|
|
1600
1784
|
}
|
|
1601
1785
|
});
|
|
1602
1786
|
});
|
|
@@ -1618,7 +1802,41 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1618
1802
|
// Fallback appLoad event
|
|
1619
1803
|
endBootstrap();
|
|
1620
1804
|
};
|
|
1621
|
-
const
|
|
1805
|
+
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1806
|
+
if (listeners) {
|
|
1807
|
+
listeners.map(([flags, name, method]) => {
|
|
1808
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
1809
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1810
|
+
const opts = hostListenerOpts(flags);
|
|
1811
|
+
plt.ael(target, name, handler, opts);
|
|
1812
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1817
|
+
try {
|
|
1818
|
+
{
|
|
1819
|
+
if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
|
|
1820
|
+
// instance is ready, let's call it's member method for this event
|
|
1821
|
+
hostRef.$lazyInstance$[methodName](ev);
|
|
1822
|
+
}
|
|
1823
|
+
else {
|
|
1824
|
+
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
catch (e) {
|
|
1829
|
+
consoleError(e);
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
1833
|
+
if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
|
|
1834
|
+
return doc;
|
|
1835
|
+
return elm;
|
|
1836
|
+
};
|
|
1837
|
+
// prettier-ignore
|
|
1838
|
+
const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
|
|
1839
|
+
const hostRefs = /*@__PURE__*/ new WeakMap();
|
|
1622
1840
|
const getHostRef = (ref) => hostRefs.get(ref);
|
|
1623
1841
|
const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
|
|
1624
1842
|
const registerHost = (elm, cmpMeta) => {
|
|
@@ -1650,7 +1868,9 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1650
1868
|
if (module) {
|
|
1651
1869
|
return module[exportName];
|
|
1652
1870
|
}
|
|
1871
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
1653
1872
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
1873
|
+
/* @vite-ignore */
|
|
1654
1874
|
/* webpackInclude: /\.entry\.js$/ */
|
|
1655
1875
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
1656
1876
|
/* webpackMode: "lazy" */
|
|
@@ -1661,14 +1881,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1661
1881
|
return importedModule[exportName];
|
|
1662
1882
|
}, consoleError);
|
|
1663
1883
|
};
|
|
1664
|
-
const styles = new Map();
|
|
1884
|
+
const styles = /*@__PURE__*/ new Map();
|
|
1885
|
+
const win = typeof window !== 'undefined' ? window : {};
|
|
1886
|
+
const doc = win.document || { head: {} };
|
|
1887
|
+
const plt = {
|
|
1888
|
+
$flags$: 0,
|
|
1889
|
+
$resourcesUrl$: '',
|
|
1890
|
+
jmp: (h) => h(),
|
|
1891
|
+
raf: (h) => requestAnimationFrame(h),
|
|
1892
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
1893
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
1894
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts),
|
|
1895
|
+
};
|
|
1896
|
+
const promiseResolve = (v) => Promise.resolve(v);
|
|
1897
|
+
const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
|
|
1898
|
+
try {
|
|
1899
|
+
new CSSStyleSheet();
|
|
1900
|
+
return typeof new CSSStyleSheet().replaceSync === 'function';
|
|
1901
|
+
}
|
|
1902
|
+
catch (e) { }
|
|
1903
|
+
return false;
|
|
1904
|
+
})()
|
|
1905
|
+
;
|
|
1665
1906
|
const queueDomReads = [];
|
|
1666
1907
|
const queueDomWrites = [];
|
|
1667
1908
|
const queueTask = (queue, write) => (cb) => {
|
|
1668
1909
|
queue.push(cb);
|
|
1669
1910
|
if (!queuePending) {
|
|
1670
1911
|
queuePending = true;
|
|
1671
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
1912
|
+
if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
|
|
1672
1913
|
nextTick(flush);
|
|
1673
1914
|
}
|
|
1674
1915
|
else {
|
|
@@ -1712,3 +1953,5 @@ exports.getElement = getElement;
|
|
|
1712
1953
|
exports.h = h;
|
|
1713
1954
|
exports.promiseResolve = promiseResolve;
|
|
1714
1955
|
exports.registerInstance = registerInstance;
|
|
1956
|
+
|
|
1957
|
+
//# sourceMappingURL=index-9174e0b1.js.map
|