@nutui/nutui 4.3.15-beta.1 → 4.3.15-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nutui.es.js +1 -13
- package/dist/nutui.umd.js +19829 -1
- package/dist/packages/{Interceptor-CBzqGJrl.js → Interceptor-aNUpilAP.js} +1 -1
- package/dist/packages/actionsheet/ActionSheet.js +17 -11
- package/dist/packages/address/Address.js +139 -121
- package/dist/packages/addresslist/AddressList.js +22 -11
- package/dist/packages/animate/Animate.js +1 -1
- package/dist/packages/avatar/Avatar.js +1 -1
- package/dist/packages/avatarcropper/AvatarCropper.js +329 -126
- package/dist/packages/avatargroup/AvatarGroup.js +17 -10
- package/dist/packages/backtop/Backtop.js +42 -88
- package/dist/packages/badge/Badge.js +4 -2
- package/dist/packages/barrage/Barrage.js +76 -130
- package/dist/packages/button/Button.js +15 -8
- package/dist/packages/calendar/Calendar.js +173 -152
- package/dist/packages/calendarcard/CalendarCard.js +33 -61
- package/dist/packages/card/Card.js +12 -4
- package/dist/packages/cascader/Cascader.js +49 -37
- package/dist/packages/category/Category.js +13 -12
- package/dist/packages/categorypane/CategoryPane.js +13 -8
- package/dist/packages/cell/Cell.js +10 -16
- package/dist/packages/cellgroup/CellGroup.js +4 -2
- package/dist/packages/checkbox/Checkbox.js +1 -1
- package/dist/packages/circleprogress/CircleProgress.js +53 -69
- package/dist/packages/col/Col.js +1 -1
- package/dist/packages/collapse/Collapse.js +1 -1
- package/dist/packages/collapseitem/CollapseItem.js +74 -39
- package/dist/packages/comment/Comment.js +46 -24
- package/dist/packages/configprovider/ConfigProvider.js +1 -1
- package/dist/packages/countdown/Countdown.js +2 -2
- package/dist/packages/countup/Countup.js +53 -66
- package/dist/packages/datepicker/DatePicker.js +12 -7
- package/dist/packages/dialog/Dialog.js +27 -97
- package/dist/packages/dialog/index.mjs +1 -2
- package/dist/packages/divider/Divider.js +1 -1
- package/dist/packages/drag/Drag.js +91 -55
- package/dist/packages/ecard/Ecard.js +19 -16
- package/dist/packages/elevator/Elevator.js +86 -73
- package/dist/packages/ellipsis/Ellipsis.js +223 -121
- package/dist/packages/empty/Empty.js +5 -3
- package/dist/packages/fixednav/FixedNav.js +12 -7
- package/dist/packages/form/Form.js +2 -2
- package/dist/packages/formitem/FormItem.js +3 -1
- package/dist/packages/grid/Grid.js +1 -1
- package/dist/packages/griditem/GridItem.js +5 -15
- package/dist/packages/imagepreview/ImagePreview.js +192 -400
- package/dist/packages/imagepreview/index.mjs +1 -2
- package/dist/packages/{index-BOB4ytqZ.js → index-IxPZmHlb.js} +2 -2
- package/dist/packages/index-m0Wcof-q.js +69 -0
- package/dist/packages/{index-wLaOjIn1.js → index.taro-CNxLoYer.js} +6 -7
- package/dist/packages/index.taro.vue_vue_type_script_setup_true_lang-JJ7hr71Y.js +17 -0
- package/dist/packages/indicator/Indicator.js +2 -2
- package/dist/packages/input/Input.js +87 -70
- package/dist/packages/inputnumber/InputNumber.js +22 -14
- package/dist/packages/invoice/Invoice.js +3 -2
- package/dist/packages/list/List.js +114 -56
- package/dist/packages/menu/Menu.js +45 -40
- package/dist/packages/menuitem/MenuItem.js +53 -47
- package/dist/packages/navbar/Navbar.js +31 -17
- package/dist/packages/noticebar/Noticebar.js +68 -43
- package/dist/packages/notify/Notify.js +10 -157
- package/dist/packages/notify/index.mjs +1 -2
- package/dist/packages/numberkeyboard/NumberKeyboard.js +103 -109
- package/dist/packages/overlay/Overlay.js +6 -34
- package/dist/packages/pagination/Pagination.js +8 -5
- package/dist/packages/picker/Picker.js +113 -26
- package/dist/packages/popover/Popover.js +158 -88
- package/dist/packages/popup/Popup.js +1 -1
- package/dist/packages/price/Price.js +16 -3
- package/dist/packages/progress/Progress.js +7 -4
- package/dist/packages/radio/Radio.js +11 -12
- package/dist/packages/radiogroup/RadioGroup.js +2 -2
- package/dist/packages/{raf-c01wDYCo.js → raf-CzJhCkQo.js} +0 -9
- package/dist/packages/range/Range.js +139 -71
- package/dist/packages/rate/Rate.js +15 -49
- package/dist/packages/row/Row.js +1 -1
- package/dist/packages/searchbar/Searchbar.js +35 -27
- package/dist/packages/shortpassword/ShortPassword.js +51 -43
- package/dist/packages/sidenavbar/SideNavbar.js +3 -14
- package/dist/packages/sidenavbaritem/SideNavbarItem.js +2 -2
- package/dist/packages/signature/Signature.js +148 -106
- package/dist/packages/skeleton/Skeleton.js +6 -3
- package/dist/packages/sku/Sku.js +66 -42
- package/dist/packages/space/Space.js +2 -2
- package/dist/packages/step/Step.js +5 -2
- package/dist/packages/steps/Steps.js +1 -1
- package/dist/packages/sticky/Sticky.js +32 -71
- package/dist/packages/subsidenavbar/SubSideNavbar.js +13 -5
- package/dist/packages/swipe/Swipe.js +37 -14
- package/dist/packages/swipegroup/SwipeGroup.js +2 -2
- package/dist/packages/swiper/Swiper.js +73 -24
- package/dist/packages/switch/Switch.js +6 -4
- package/dist/packages/tabbar/Tabbar.js +23 -24
- package/dist/packages/tabbaritem/TabbarItem.js +8 -3
- package/dist/packages/table/Table.js +10 -6
- package/dist/packages/tabs/Tabs.js +146 -150
- package/dist/packages/tag/Tag.js +5 -5
- package/dist/packages/textarea/Textarea.js +144 -69
- package/dist/packages/timedetail/TimeDetail.js +2 -2
- package/dist/packages/timepannel/TimePannel.js +2 -2
- package/dist/packages/timeselect/TimeSelect.js +9 -11
- package/dist/packages/toast/Toast.js +50 -186
- package/dist/packages/toast/index.mjs +1 -2
- package/dist/packages/tour/Tour.js +145 -99
- package/dist/packages/trendarrow/TrendArrow.js +7 -4
- package/dist/packages/uploader/Uploader.js +263 -106
- package/dist/packages/{util-D1pvnUYu.js → util-2G3mRQeF.js} +5 -17
- package/dist/packages/watermark/Watermark.js +95 -35
- package/dist/smartips/web-types.json +376 -775
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +0 -1
- package/dist/styles/themes/jda.scss +0 -1
- package/dist/styles/themes/jdb.scss +0 -1
- package/dist/styles/themes/jddkh.scss +0 -1
- package/dist/styles/themes/jdt.scss +0 -1
- package/dist/types/__VUE/actionsheet/{index.vue.d.ts → index.taro.vue.d.ts} +5 -112
- package/dist/types/__VUE/address/{index.vue.d.ts → index.taro.vue.d.ts} +139 -412
- package/dist/types/__VUE/addresslist/components/{GeneralShell.vue.d.ts → GeneralShell.taro.vue.d.ts} +45 -134
- package/dist/types/__VUE/addresslist/components/ItemContents.taro.vue.d.ts +27 -0
- package/dist/types/__VUE/addresslist/{index.vue.d.ts → index.taro.vue.d.ts} +85 -155
- package/dist/types/__VUE/animate/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/avatarcropper/{index.vue.d.ts → index.taro.vue.d.ts} +90 -147
- package/dist/types/__VUE/backtop/{backtop.vue.d.ts → backtop.taro.vue.d.ts} +8 -19
- package/dist/types/__VUE/backtop/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/badge/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/barrage/{index.vue.d.ts → index.taro.vue.d.ts} +10 -5
- package/dist/types/__VUE/button/{button.vue.d.ts → button.taro.vue.d.ts} +7 -1
- package/dist/types/__VUE/button/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/calendar/{index.vue.d.ts → index.taro.vue.d.ts} +59 -94
- package/dist/types/__VUE/calendarcard/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/calendaritem/{index.vue.d.ts → index.taro.vue.d.ts} +22 -4
- package/dist/types/__VUE/card/{index.vue.d.ts → index.taro.vue.d.ts} +13 -13
- package/dist/types/__VUE/cascader/{cascader-item.vue.d.ts → cascader-item.taro.vue.d.ts} +47 -229
- package/dist/types/__VUE/cascader/{index.vue.d.ts → index.taro.vue.d.ts} +50 -287
- package/dist/types/__VUE/category/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
- package/dist/types/__VUE/cell/{cell.vue.d.ts → cell.taro.vue.d.ts} +0 -15
- package/dist/types/__VUE/cell/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/cellgroup/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/circleprogress/{circle-progress.vue.d.ts → circle-progress.taro.vue.d.ts} +0 -4
- package/dist/types/__VUE/circleprogress/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/col/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/collapse/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/collapseitem/collapse-item.taro.vue.d.ts +94 -0
- package/dist/types/__VUE/collapseitem/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/comment/components/CmtBottom.taro.vue.d.ts +47 -0
- package/dist/types/__VUE/comment/components/CmtHeader.taro.vue.d.ts +122 -0
- package/dist/types/__VUE/comment/components/{CmtImages.vue.d.ts → CmtImages.taro.vue.d.ts} +2 -55
- package/dist/types/__VUE/comment/index.taro.vue.d.ts +333 -0
- package/dist/types/__VUE/countdown/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/countup/{index.vue.d.ts → index.taro.vue.d.ts} +5 -7
- package/dist/types/__VUE/datepicker/{index.vue.d.ts → index.taro.vue.d.ts} +31 -2
- package/dist/types/__VUE/dialog/{index.vue.d.ts → index.taro.vue.d.ts} +52 -85
- package/dist/types/__VUE/divider/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/drag/{index.vue.d.ts → index.taro.vue.d.ts} +2 -0
- package/dist/types/__VUE/elevator/{index.vue.d.ts → index.taro.vue.d.ts} +40 -5
- package/dist/types/__VUE/ellipsis/{index.vue.d.ts → index.taro.vue.d.ts} +11 -6
- package/dist/types/__VUE/empty/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/fixednav/{index.vue.d.ts → index.taro.vue.d.ts} +2 -55
- package/dist/types/__VUE/form/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/formitem/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/grid/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/griditem/{grid-item.vue.d.ts → grid-item.taro.vue.d.ts} +3 -21
- package/dist/types/__VUE/griditem/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/imagepreview/index.taro.vue.d.ts +732 -0
- package/dist/types/__VUE/indicator/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/input/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/input/{input.vue.d.ts → input.taro.vue.d.ts} +14 -6
- package/dist/types/__VUE/inputnumber/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/invoice/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/layout/{index.d.ts → index.taro.d.ts} +1 -1
- package/dist/types/__VUE/list/{index.vue.d.ts → index.taro.vue.d.ts} +32 -4
- package/dist/types/__VUE/menu/index.taro.vue.d.ts +104 -0
- package/dist/types/__VUE/menuitem/{index.vue.d.ts → index.taro.vue.d.ts} +22 -114
- package/dist/types/__VUE/navbar/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/noticebar/{index.vue.d.ts → index.taro.vue.d.ts} +9 -116
- package/dist/types/__VUE/notify/{index.vue.d.ts → index.taro.vue.d.ts} +2 -66
- package/dist/types/__VUE/numberkeyboard/{index.vue.d.ts → index.taro.vue.d.ts} +14 -60
- package/dist/types/__VUE/overlay/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/picker/{index.vue.d.ts → index.taro.vue.d.ts} +31 -2
- package/dist/types/__VUE/popover/{index.vue.d.ts → index.taro.vue.d.ts} +4 -56
- package/dist/types/__VUE/popup/{index.vue.d.ts → index.taro.vue.d.ts} +3 -56
- package/dist/types/__VUE/price/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/progress/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/radio/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/radiogroup/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/range/{index.vue.d.ts → index.taro.vue.d.ts} +3 -2
- package/dist/types/__VUE/rate/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/rate/rate.taro.vue.d.ts +95 -0
- package/dist/types/__VUE/row/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/scroll-view/index.taro.vue.d.ts +9 -0
- package/dist/types/__VUE/searchbar/{index.vue.d.ts → index.taro.vue.d.ts} +23 -121
- package/dist/types/__VUE/shortpassword/{index.vue.d.ts → index.taro.vue.d.ts} +5 -112
- package/dist/types/__VUE/sidenavbar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -9
- package/dist/types/__VUE/signature/{index.vue.d.ts → index.taro.vue.d.ts} +53 -31
- package/dist/types/__VUE/skeleton/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/sku/components/{SkuHeader.vue.d.ts → SkuHeader.taro.vue.d.ts} +6 -6
- package/dist/types/__VUE/sku/{index.vue.d.ts → index.taro.vue.d.ts} +25 -62
- package/dist/types/__VUE/step/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/steps/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/sticky/{index.vue.d.ts → index.taro.vue.d.ts} +7 -26
- package/dist/types/__VUE/subsidenavbar/index.taro.vue.d.ts +45 -0
- package/dist/types/__VUE/swipe/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/swipegroup/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/swiper/{index.vue.d.ts → index.taro.vue.d.ts} +6 -5
- package/dist/types/__VUE/switch/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/tabbar/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/tabbaritem/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/table/{index.vue.d.ts → index.taro.vue.d.ts} +2 -55
- package/dist/types/__VUE/tabs/{index.vue.d.ts → index.taro.vue.d.ts} +27 -118
- package/dist/types/__VUE/tag/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/textarea/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/textarea/{textarea.vue.d.ts → textarea.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/timeselect/{index.vue.d.ts → index.taro.vue.d.ts} +3 -66
- package/dist/types/__VUE/toast/{index.vue.d.ts → index.taro.vue.d.ts} +16 -12
- package/dist/types/__VUE/tour/{index.vue.d.ts → index.taro.vue.d.ts} +13 -121
- package/dist/types/__VUE/trendarrow/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/__VUE/uploader/{index.vue.d.ts → index.taro.vue.d.ts} +268 -286
- package/dist/types/__VUE/watermark/{index.d.ts → index.taro.d.ts} +2 -2
- package/dist/types/index.d.ts +145 -155
- package/package.json +19 -96
- package/dist/nutui.js +0 -15856
- package/dist/packages/audio/Audio.js +0 -271
- package/dist/packages/audio/index.mjs +0 -2
- package/dist/packages/audiooperate/AudioOperate.js +0 -125
- package/dist/packages/audiooperate/index.mjs +0 -2
- package/dist/packages/image/Image.js +0 -167
- package/dist/packages/image/index.mjs +0 -2
- package/dist/packages/index-B1qsj2XR.js +0 -33
- package/dist/packages/index-BvmDLUYP.js +0 -31
- package/dist/packages/index-aiGQ-EiA.js +0 -8
- package/dist/packages/infiniteloading/InfiniteLoading.js +0 -184
- package/dist/packages/infiniteloading/index.mjs +0 -2
- package/dist/packages/mountComponent-CLi4Nz91.js +0 -39
- package/dist/packages/pullrefresh/PullRefresh.js +0 -240
- package/dist/packages/pullrefresh/index.mjs +0 -2
- package/dist/packages/types-BMA1Y94E.js +0 -4
- package/dist/packages/video/Video.js +0 -449
- package/dist/packages/video/index.mjs +0 -2
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +0 -134
- package/dist/types/__VUE/audio/index.vue.d.ts +0 -323
- package/dist/types/__VUE/audio/types.d.ts +0 -3
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +0 -229
- package/dist/types/__VUE/collapseitem/collapse-item.vue.d.ts +0 -201
- package/dist/types/__VUE/comment/components/CmtBottom.vue.d.ts +0 -208
- package/dist/types/__VUE/comment/components/CmtHeader.vue.d.ts +0 -248
- package/dist/types/__VUE/comment/index.vue.d.ts +0 -728
- package/dist/types/__VUE/dialog/index.d.ts +0 -45
- package/dist/types/__VUE/image/image.vue.d.ts +0 -111
- package/dist/types/__VUE/image/index.d.ts +0 -6
- package/dist/types/__VUE/image/types.d.ts +0 -2
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +0 -267
- package/dist/types/__VUE/imagepreview/index.d.ts +0 -36
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +0 -1088
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +0 -140
- package/dist/types/__VUE/menu/index.vue.d.ts +0 -210
- package/dist/types/__VUE/notify/index.d.ts +0 -22
- package/dist/types/__VUE/pullrefresh/index.vue.d.ts +0 -200
- package/dist/types/__VUE/rate/rate.vue.d.ts +0 -208
- package/dist/types/__VUE/subsidenavbar/index.vue.d.ts +0 -152
- package/dist/types/__VUE/toast/index.d.ts +0 -12
- package/dist/types/__VUE/video/index.vue.d.ts +0 -149
- package/dist/packages/{index-Do4_KY74.js → index.taro-Do4_KY74.js} +0 -0
- package/dist/types/__VUE/animate/{animate.vue.d.ts → animate.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/avatar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/avatargroup/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/badge/{badge.vue.d.ts → badge.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/calendarcard/{calendar-card.vue.d.ts → calendar-card.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/calendarcard/{icon.d.ts → icon.taro.d.ts} +0 -0
- package/dist/types/__VUE/categorypane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/cellgroup/{cell-group.vue.d.ts → cell-group.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/checkbox/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/checkboxgroup/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/col/{col.vue.d.ts → col.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/collapse/{collapse.vue.d.ts → collapse.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/configprovider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/countdown/{countdown.vue.d.ts → countdown.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/divider/{divider.vue.d.ts → divider.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/ecard/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/empty/{empty.vue.d.ts → empty.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/form/{form.vue.d.ts → form.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/formitem/{form-item.vue.d.ts → form-item.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/grid/{grid.vue.d.ts → grid.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/indicator/{indicator.vue.d.ts → indicator.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/inputnumber/{input-number.vue.d.ts → input-number.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/invoice/{invoice.vue.d.ts → invoice.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/layout/{layout.vue.d.ts → layout.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/navbar/{navbar.vue.d.ts → navbar.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/overlay/{overlay.vue.d.ts → overlay.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/pagination/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/price/{price.vue.d.ts → price.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/progress/{progress.vue.d.ts → progress.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/radio/{radio.vue.d.ts → radio.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/radiogroup/{radio-group.vue.d.ts → radio-group.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/row/{row.vue.d.ts → row.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/sidenavbaritem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/skeleton/{skeleton.vue.d.ts → skeleton.taro.vue.d.ts} +2 -2
- package/dist/types/__VUE/sku/components/{SkuStepper.vue.d.ts → SkuStepper.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/space/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/step/{step.vue.d.ts → step.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/steps/{steps.vue.d.ts → steps.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/swipe/{swipe.vue.d.ts → swipe.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/swipegroup/{swipe-group.vue.d.ts → swipe-group.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/swiperitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/switch/{switch.vue.d.ts → switch.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabbar/{tabbar.vue.d.ts → tabbar.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabbaritem/{tabbar-item.vue.d.ts → tabbar-item.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabpane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/tag/{tag.vue.d.ts → tag.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/timedetail/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/timepannel/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/trendarrow/{trend-arrow.vue.d.ts → trend-arrow.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/watermark/{watermark.vue.d.ts → watermark.taro.vue.d.ts} +2 -2
|
@@ -4,7 +4,6 @@ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __pow = Math.pow;
|
|
8
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
8
|
var __spreadValues = (a, b) => {
|
|
10
9
|
for (var prop in b || (b = {}))
|
|
@@ -18,293 +17,50 @@ var __spreadValues = (a, b) => {
|
|
|
18
17
|
return a;
|
|
19
18
|
};
|
|
20
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
|
|
22
|
-
import
|
|
20
|
+
import { reactive, computed, watch, onMounted, toRefs, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, withModifiers, createCommentVNode, createTextVNode, toDisplayString, normalizeStyle, createVNode } from "vue";
|
|
21
|
+
import Taro from "@tarojs/taro";
|
|
22
|
+
import { CircleClose } from "@nutui/icons-vue-taro";
|
|
23
23
|
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import NutVideo from "../video/Video.js";
|
|
24
|
+
import { f as funInterceptor } from "../Interceptor-aNUpilAP.js";
|
|
25
|
+
import { N as NutPopup } from "../index.taro-CNxLoYer.js";
|
|
26
|
+
import NutSwiper from "../swiper/Swiper.js";
|
|
28
27
|
import NutSwiperItem from "../swiperitem/SwiperItem.js";
|
|
29
28
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const baseProps = {
|
|
37
|
-
show: { type: Boolean, default: false },
|
|
38
|
-
initNo: { type: Number, default: 0 },
|
|
39
|
-
showIndex: { type: Boolean, default: true },
|
|
40
|
-
minZoom: { type: Number, default: 1 / 3 },
|
|
41
|
-
maxZoom: { type: Number, default: 3 }
|
|
42
|
-
};
|
|
43
|
-
const { create: create$1 } = createComponent("image-preview-item");
|
|
44
|
-
const _sfc_main$1 = create$1({
|
|
45
|
-
props: __spreadProps(__spreadValues({}, baseProps), {
|
|
46
|
-
image: {
|
|
47
|
-
type: Object,
|
|
48
|
-
default: () => ({})
|
|
29
|
+
const { create } = createComponent("image-preview");
|
|
30
|
+
const _sfc_main = create({
|
|
31
|
+
props: {
|
|
32
|
+
show: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
49
35
|
},
|
|
50
|
-
|
|
51
|
-
type:
|
|
52
|
-
default: () =>
|
|
36
|
+
images: {
|
|
37
|
+
type: Array,
|
|
38
|
+
default: () => []
|
|
53
39
|
},
|
|
54
|
-
|
|
55
|
-
type:
|
|
56
|
-
default:
|
|
40
|
+
contentClose: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true
|
|
57
43
|
},
|
|
58
|
-
|
|
44
|
+
initNo: {
|
|
59
45
|
type: Number,
|
|
60
46
|
default: 0
|
|
61
47
|
},
|
|
62
|
-
|
|
48
|
+
paginationVisible: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
paginationColor: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "#fff"
|
|
55
|
+
},
|
|
56
|
+
autoplay: {
|
|
57
|
+
type: [Number, String],
|
|
58
|
+
default: 3e3
|
|
59
|
+
},
|
|
60
|
+
showIndex: {
|
|
63
61
|
type: Boolean,
|
|
64
62
|
default: true
|
|
65
|
-
}
|
|
66
|
-
}),
|
|
67
|
-
emits: ["close", "scale"],
|
|
68
|
-
components: {
|
|
69
|
-
NutVideo,
|
|
70
|
-
NutSwiperItem
|
|
71
|
-
},
|
|
72
|
-
setup(props, { emit }) {
|
|
73
|
-
const state = reactive({
|
|
74
|
-
scale: 1,
|
|
75
|
-
moveX: 0,
|
|
76
|
-
moveY: 0,
|
|
77
|
-
moving: false,
|
|
78
|
-
zooming: false,
|
|
79
|
-
imageRatio: 0,
|
|
80
|
-
displayWidth: 0,
|
|
81
|
-
displayHeight: 0
|
|
82
|
-
});
|
|
83
|
-
const touch = useTouch();
|
|
84
|
-
const vertical = computed(() => {
|
|
85
|
-
const { rootWidth, rootHeight } = props;
|
|
86
|
-
const rootRatio = rootHeight / rootWidth;
|
|
87
|
-
return state.imageRatio > rootRatio;
|
|
88
|
-
});
|
|
89
|
-
const imageStyle = computed(() => {
|
|
90
|
-
const images = props.image;
|
|
91
|
-
if (images && images.src) {
|
|
92
|
-
const { scale, moveX, moveY, moving, zooming } = state;
|
|
93
|
-
const style = {
|
|
94
|
-
transitionDuration: zooming || moving ? "0s" : ".3s"
|
|
95
|
-
};
|
|
96
|
-
if (scale !== 1) {
|
|
97
|
-
const offsetX = moveX / scale;
|
|
98
|
-
const offsetY = moveY / scale;
|
|
99
|
-
style.transform = `scale(${scale}, ${scale}) translate(${offsetX}px, ${offsetY}px)`;
|
|
100
|
-
}
|
|
101
|
-
return style;
|
|
102
|
-
}
|
|
103
|
-
return {};
|
|
104
|
-
});
|
|
105
|
-
const maxMoveX = computed(() => {
|
|
106
|
-
if (state.imageRatio) {
|
|
107
|
-
const { rootWidth, rootHeight } = props;
|
|
108
|
-
const displayWidth = vertical.value ? rootHeight / state.imageRatio : rootWidth;
|
|
109
|
-
return Math.max(0, (state.scale * displayWidth - rootWidth) / 2);
|
|
110
|
-
}
|
|
111
|
-
return 0;
|
|
112
|
-
});
|
|
113
|
-
const maxMoveY = computed(() => {
|
|
114
|
-
if (state.imageRatio) {
|
|
115
|
-
const { rootWidth, rootHeight } = props;
|
|
116
|
-
const displayHeight = vertical.value ? rootHeight : rootWidth * state.imageRatio;
|
|
117
|
-
return Math.max(0, (state.scale * displayHeight - rootHeight) / 2);
|
|
118
|
-
}
|
|
119
|
-
return 0;
|
|
120
|
-
});
|
|
121
|
-
const imageLoad = (event) => {
|
|
122
|
-
const { naturalWidth, naturalHeight } = event.target;
|
|
123
|
-
state.imageRatio = naturalHeight / naturalWidth;
|
|
124
|
-
};
|
|
125
|
-
const resetScale = () => {
|
|
126
|
-
setScale(1);
|
|
127
|
-
state.moveX = 0;
|
|
128
|
-
state.moveY = 0;
|
|
129
|
-
};
|
|
130
|
-
const setScale = (scale) => {
|
|
131
|
-
scale = clamp(scale, +props.minZoom, +props.maxZoom + 1);
|
|
132
|
-
if (scale !== state.scale) {
|
|
133
|
-
state.scale = scale;
|
|
134
|
-
emit("scale", {
|
|
135
|
-
scale,
|
|
136
|
-
index: props.initNo
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
const toggleScale = () => {
|
|
141
|
-
const scale = state.scale > 1 ? 1 : 2;
|
|
142
|
-
setScale(scale);
|
|
143
|
-
state.moveX = 0;
|
|
144
|
-
state.moveY = 0;
|
|
145
|
-
};
|
|
146
|
-
const getDistance = (touches) => Math.sqrt(__pow(touches[0].clientX - touches[1].clientX, 2) + __pow(touches[0].clientY - touches[1].clientY, 2));
|
|
147
|
-
let startMoveX;
|
|
148
|
-
let startMoveY;
|
|
149
|
-
let startScale;
|
|
150
|
-
let startDistance;
|
|
151
|
-
let doubleTapTimer;
|
|
152
|
-
let touchStartTime;
|
|
153
|
-
let fingerNum;
|
|
154
|
-
const onTouchStart = (event) => {
|
|
155
|
-
const { touches } = event;
|
|
156
|
-
const { offsetX } = touch;
|
|
157
|
-
touch.start(event);
|
|
158
|
-
fingerNum = touches.length;
|
|
159
|
-
startMoveX = state.moveX;
|
|
160
|
-
startMoveY = state.moveY;
|
|
161
|
-
touchStartTime = Date.now();
|
|
162
|
-
state.moving = fingerNum === 1 && state.scale !== 1;
|
|
163
|
-
state.zooming = fingerNum === 2 && !offsetX.value;
|
|
164
|
-
if (state.zooming) {
|
|
165
|
-
startScale = state.scale;
|
|
166
|
-
startDistance = getDistance(event.touches);
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
const onTouchMove = (event) => {
|
|
170
|
-
const { touches } = event;
|
|
171
|
-
touch.move(event);
|
|
172
|
-
if (state.moving || state.zooming) {
|
|
173
|
-
preventDefault(event, true);
|
|
174
|
-
}
|
|
175
|
-
if (state.moving) {
|
|
176
|
-
const { deltaX, deltaY } = touch;
|
|
177
|
-
const moveX = deltaX.value + startMoveX;
|
|
178
|
-
const moveY = deltaY.value + startMoveY;
|
|
179
|
-
state.moveX = clamp(moveX, -maxMoveX.value, maxMoveX.value);
|
|
180
|
-
state.moveY = clamp(moveY, -maxMoveY.value, maxMoveY.value);
|
|
181
|
-
}
|
|
182
|
-
if (state.zooming && touches.length === 2) {
|
|
183
|
-
const distance = getDistance(touches);
|
|
184
|
-
const scale = startScale * distance / startDistance;
|
|
185
|
-
setScale(scale);
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
const checkTap = () => {
|
|
189
|
-
if (fingerNum == 1 && props.video && props.video.source) {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
if (fingerNum > 1) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
const { offsetX, offsetY } = touch;
|
|
196
|
-
const deltaTime = Date.now() - touchStartTime;
|
|
197
|
-
const TAP_TIME = 250;
|
|
198
|
-
const TAP_OFFSET = 5;
|
|
199
|
-
if (offsetX.value < TAP_OFFSET && offsetY.value < TAP_OFFSET && deltaTime < TAP_TIME) {
|
|
200
|
-
if (doubleTapTimer) {
|
|
201
|
-
clearTimeout(doubleTapTimer);
|
|
202
|
-
doubleTapTimer = null;
|
|
203
|
-
toggleScale();
|
|
204
|
-
} else {
|
|
205
|
-
doubleTapTimer = setTimeout(() => {
|
|
206
|
-
if (props.contentClose) {
|
|
207
|
-
emit("close");
|
|
208
|
-
}
|
|
209
|
-
doubleTapTimer = null;
|
|
210
|
-
}, TAP_TIME);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
const onTouchEnd = (event) => {
|
|
215
|
-
let stopPropagation = false;
|
|
216
|
-
if (state.moving || state.zooming) {
|
|
217
|
-
stopPropagation = true;
|
|
218
|
-
if (state.moving && startMoveX === state.moveX && startMoveY === state.moveY) {
|
|
219
|
-
stopPropagation = false;
|
|
220
|
-
}
|
|
221
|
-
if (!event.touches.length) {
|
|
222
|
-
if (state.zooming) {
|
|
223
|
-
state.moveX = clamp(state.moveX, -maxMoveX.value, maxMoveX.value);
|
|
224
|
-
state.moveY = clamp(state.moveY, -maxMoveY.value, maxMoveY.value);
|
|
225
|
-
state.zooming = false;
|
|
226
|
-
}
|
|
227
|
-
state.moving = false;
|
|
228
|
-
startMoveX = 0;
|
|
229
|
-
startMoveY = 0;
|
|
230
|
-
startScale = 1;
|
|
231
|
-
if (state.scale < 1) {
|
|
232
|
-
resetScale();
|
|
233
|
-
}
|
|
234
|
-
if (state.scale > props.maxZoom) {
|
|
235
|
-
state.scale = +props.maxZoom;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
preventDefault(event, stopPropagation);
|
|
240
|
-
checkTap();
|
|
241
|
-
touch.reset();
|
|
242
|
-
};
|
|
243
|
-
const closeSwiper = () => {
|
|
244
|
-
emit("close");
|
|
245
|
-
};
|
|
246
|
-
watch(() => props.initNo, resetScale);
|
|
247
|
-
watch(
|
|
248
|
-
() => props.show,
|
|
249
|
-
(value) => {
|
|
250
|
-
if (!value) {
|
|
251
|
-
resetScale();
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
);
|
|
255
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
256
|
-
onTouchStart,
|
|
257
|
-
onTouchMove,
|
|
258
|
-
onTouchEnd,
|
|
259
|
-
getDistance,
|
|
260
|
-
imageStyle,
|
|
261
|
-
imageLoad,
|
|
262
|
-
closeSwiper
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
const _hoisted_1$1 = ["src"];
|
|
267
|
-
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
268
|
-
const _component_nut_video = resolveComponent("nut-video");
|
|
269
|
-
const _component_nut_swiper_item = resolveComponent("nut-swiper-item");
|
|
270
|
-
return openBlock(), createBlock(_component_nut_swiper_item, { onClick: _ctx.closeSwiper }, {
|
|
271
|
-
default: withCtx(() => [
|
|
272
|
-
createElementVNode("view", {
|
|
273
|
-
style: normalizeStyle(_ctx.imageStyle),
|
|
274
|
-
class: "nut-image-preview-box",
|
|
275
|
-
onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
|
|
276
|
-
onTouchmove: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
|
|
277
|
-
onTouchend: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
|
|
278
|
-
onTouchcancel: _cache[4] || (_cache[4] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
279
|
-
}, [
|
|
280
|
-
_ctx.image && _ctx.image.src ? (openBlock(), createElementBlock("img", {
|
|
281
|
-
key: 0,
|
|
282
|
-
src: _ctx.image.src,
|
|
283
|
-
class: "nut-image-preview-img",
|
|
284
|
-
onLoad: _cache[0] || (_cache[0] = (...args) => _ctx.imageLoad && _ctx.imageLoad(...args))
|
|
285
|
-
}, null, 40, _hoisted_1$1)) : createCommentVNode("", true),
|
|
286
|
-
_ctx.video && _ctx.video.source ? (openBlock(), createBlock(_component_nut_video, {
|
|
287
|
-
key: 1,
|
|
288
|
-
source: _ctx.video.source,
|
|
289
|
-
options: _ctx.video.options
|
|
290
|
-
}, null, 8, ["source", "options"])) : createCommentVNode("", true)
|
|
291
|
-
], 36)
|
|
292
|
-
]),
|
|
293
|
-
_: 1
|
|
294
|
-
}, 8, ["onClick"]);
|
|
295
|
-
}
|
|
296
|
-
const ImagePreviewItem = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
297
|
-
const { create } = createComponent("image-preview");
|
|
298
|
-
const _sfc_main = create({
|
|
299
|
-
props: __spreadProps(__spreadValues({}, baseProps), {
|
|
300
|
-
images: { type: Array, default: () => [] },
|
|
301
|
-
videos: { type: Array, default: () => [] },
|
|
302
|
-
contentClose: { type: Boolean, default: true },
|
|
303
|
-
paginationVisible: { type: Boolean, default: false },
|
|
304
|
-
paginationColor: { type: String, default: "#fff" },
|
|
305
|
-
autoplay: { type: [Number, String], default: 0 },
|
|
306
|
-
teleport: { type: [String, Element], default: "body" },
|
|
307
|
-
teleportDisable: { ype: Boolean, default: false },
|
|
63
|
+
},
|
|
308
64
|
closeable: {
|
|
309
65
|
type: Boolean,
|
|
310
66
|
default: false
|
|
@@ -319,32 +75,42 @@ const _sfc_main = create({
|
|
|
319
75
|
type: Boolean,
|
|
320
76
|
default: true
|
|
321
77
|
}
|
|
322
|
-
}
|
|
323
|
-
emits: ["close", "change"],
|
|
78
|
+
},
|
|
79
|
+
emits: ["close", "change", "longPress"],
|
|
324
80
|
components: {
|
|
325
|
-
ImagePreviewItem,
|
|
326
|
-
CircleClose,
|
|
327
81
|
NutPopup,
|
|
328
|
-
NutSwiper
|
|
82
|
+
NutSwiper,
|
|
83
|
+
NutSwiperItem,
|
|
84
|
+
CircleClose
|
|
329
85
|
},
|
|
330
86
|
setup(props, { emit }) {
|
|
331
|
-
const swipeRef = ref();
|
|
332
87
|
const state = reactive({
|
|
333
|
-
showPop:
|
|
88
|
+
showPop: false,
|
|
334
89
|
active: 0,
|
|
335
|
-
|
|
336
|
-
|
|
90
|
+
options: {
|
|
91
|
+
muted: true,
|
|
92
|
+
controls: true
|
|
93
|
+
},
|
|
94
|
+
eleImg: null,
|
|
95
|
+
store: {
|
|
96
|
+
scale: 1,
|
|
97
|
+
moveable: false,
|
|
98
|
+
originScale: 1,
|
|
99
|
+
oriDistance: 1
|
|
100
|
+
},
|
|
101
|
+
lastTouchEndTime: 0,
|
|
102
|
+
// 用来辅助监听双击
|
|
103
|
+
ENV: Taro.getEnv(),
|
|
104
|
+
ENV_TYPE: Taro.ENV_TYPE
|
|
337
105
|
});
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
if (isArray(props.videos)) {
|
|
345
|
-
return [].concat(props.videos).concat(props.images);
|
|
106
|
+
const styles = computed(() => {
|
|
107
|
+
let style = {};
|
|
108
|
+
if (props.closeIconPosition == "top-right") {
|
|
109
|
+
style.right = "10px";
|
|
110
|
+
} else {
|
|
111
|
+
style.left = "10px";
|
|
346
112
|
}
|
|
347
|
-
return
|
|
113
|
+
return style;
|
|
348
114
|
});
|
|
349
115
|
const setActive = (active) => {
|
|
350
116
|
if (active !== state.active) {
|
|
@@ -352,6 +118,11 @@ const _sfc_main = create({
|
|
|
352
118
|
emit("change", state.active);
|
|
353
119
|
}
|
|
354
120
|
};
|
|
121
|
+
const closeOnImg = () => {
|
|
122
|
+
if (props.contentClose) {
|
|
123
|
+
onClose();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
355
126
|
const onClose = () => {
|
|
356
127
|
funInterceptor(props.beforeClose, {
|
|
357
128
|
args: [state.active],
|
|
@@ -360,24 +131,97 @@ const _sfc_main = create({
|
|
|
360
131
|
};
|
|
361
132
|
const closeDone = () => {
|
|
362
133
|
state.showPop = false;
|
|
134
|
+
state.store.scale = 1;
|
|
135
|
+
scaleNow();
|
|
363
136
|
emit("close");
|
|
364
137
|
};
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
138
|
+
const getDistance = (first, second) => {
|
|
139
|
+
return Math.hypot(Math.abs(second.x - first.x), Math.abs(second.y - first.y));
|
|
140
|
+
};
|
|
141
|
+
const scaleNow = () => {
|
|
142
|
+
if (state.eleImg != null) {
|
|
143
|
+
state.eleImg.style.transform = "scale(" + state.store.scale + ")";
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const onTouchStart = (event) => {
|
|
147
|
+
const curTouchTime = (/* @__PURE__ */ new Date()).getTime();
|
|
148
|
+
const touches = event.touches;
|
|
149
|
+
const events = touches[0];
|
|
150
|
+
const events2 = touches[1];
|
|
151
|
+
const store = state.store;
|
|
152
|
+
if (curTouchTime - state.lastTouchEndTime < 300) {
|
|
153
|
+
if (store.scale > 1) {
|
|
154
|
+
store.scale = 1;
|
|
155
|
+
} else if (store.scale == 1) {
|
|
156
|
+
store.scale = 2;
|
|
157
|
+
}
|
|
158
|
+
scaleNow();
|
|
159
|
+
}
|
|
160
|
+
store.moveable = true;
|
|
161
|
+
if (events2) {
|
|
162
|
+
store.oriDistance = getDistance(
|
|
163
|
+
{
|
|
164
|
+
x: events.pageX,
|
|
165
|
+
y: events.pageY
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
x: events2.pageX,
|
|
169
|
+
y: events2.pageY
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
store.originScale = store.scale || 1;
|
|
174
|
+
};
|
|
175
|
+
const onTouchMove = (event) => {
|
|
176
|
+
if (!state.store.moveable) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const store = state.store;
|
|
180
|
+
const touches = event.touches;
|
|
181
|
+
const events = touches[0];
|
|
182
|
+
const events2 = touches[1];
|
|
183
|
+
if (events2) {
|
|
184
|
+
const curDistance = getDistance(
|
|
185
|
+
{
|
|
186
|
+
x: events.pageX,
|
|
187
|
+
y: events.pageY
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
x: events2.pageX,
|
|
191
|
+
y: events2.pageY
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
const curScale = curDistance / store.oriDistance;
|
|
195
|
+
store.scale = store.originScale * curScale;
|
|
196
|
+
state.store.scale = Math.min(state.store.scale, 3);
|
|
197
|
+
scaleNow();
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
const onTouchEnd = () => {
|
|
201
|
+
state.lastTouchEndTime = (/* @__PURE__ */ new Date()).getTime();
|
|
202
|
+
const store = state.store;
|
|
203
|
+
store.moveable = false;
|
|
204
|
+
if (store.scale < 1.1 && store.scale > 1 || store.scale < 1) {
|
|
205
|
+
store.scale = 1;
|
|
206
|
+
scaleNow();
|
|
370
207
|
}
|
|
371
208
|
};
|
|
209
|
+
const longPress = (image) => {
|
|
210
|
+
emit("longPress", image);
|
|
211
|
+
};
|
|
212
|
+
const init = () => {
|
|
213
|
+
state.eleImg = document.querySelector(".nut-image-preview");
|
|
214
|
+
document.addEventListener("touchmove", onTouchMove);
|
|
215
|
+
document.addEventListener("touchend", onTouchEnd);
|
|
216
|
+
document.addEventListener("touchcancel", onTouchEnd);
|
|
217
|
+
};
|
|
372
218
|
watch(
|
|
373
219
|
() => props.show,
|
|
374
220
|
(val) => {
|
|
375
221
|
state.showPop = val;
|
|
376
222
|
if (val) {
|
|
377
223
|
setActive(props.initNo);
|
|
378
|
-
|
|
379
|
-
init();
|
|
380
|
-
});
|
|
224
|
+
init();
|
|
381
225
|
}
|
|
382
226
|
}
|
|
383
227
|
);
|
|
@@ -390,40 +234,40 @@ const _sfc_main = create({
|
|
|
390
234
|
onMounted(() => {
|
|
391
235
|
setActive(props.initNo);
|
|
392
236
|
});
|
|
393
|
-
return __spreadProps(__spreadValues({
|
|
394
|
-
swipeRef
|
|
395
|
-
}, toRefs(state)), {
|
|
396
|
-
onClose,
|
|
397
|
-
mergeImages,
|
|
237
|
+
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
398
238
|
setActive,
|
|
399
|
-
|
|
239
|
+
onClose,
|
|
240
|
+
closeOnImg,
|
|
241
|
+
onTouchStart,
|
|
242
|
+
onTouchMove,
|
|
243
|
+
onTouchEnd,
|
|
244
|
+
getDistance,
|
|
245
|
+
scaleNow,
|
|
246
|
+
longPress,
|
|
247
|
+
styles
|
|
400
248
|
});
|
|
401
249
|
}
|
|
402
250
|
});
|
|
403
|
-
const _hoisted_1 =
|
|
404
|
-
ref: "swipeRef",
|
|
405
|
-
class: "nut-image-preview"
|
|
406
|
-
};
|
|
251
|
+
const _hoisted_1 = ["src", "on:longPress", "on:longTap"];
|
|
407
252
|
const _hoisted_2 = {
|
|
408
253
|
key: 0,
|
|
409
254
|
class: "nut-image-preview-index"
|
|
410
255
|
};
|
|
411
256
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
412
|
-
const
|
|
257
|
+
const _component_nut_swiper_item = resolveComponent("nut-swiper-item");
|
|
413
258
|
const _component_nut_swiper = resolveComponent("nut-swiper");
|
|
414
259
|
const _component_CircleClose = resolveComponent("CircleClose");
|
|
415
260
|
const _component_nut_popup = resolveComponent("nut-popup");
|
|
416
261
|
return openBlock(), createBlock(_component_nut_popup, {
|
|
417
262
|
visible: _ctx.showPop,
|
|
418
|
-
"onUpdate:visible": _cache[
|
|
419
|
-
"pop-class": "nut-image-preview-custom-pop"
|
|
420
|
-
"teleport-disable": _ctx.teleportDisable,
|
|
421
|
-
teleport: _ctx.teleport,
|
|
422
|
-
"lock-scroll": "",
|
|
423
|
-
onClosed: _ctx.onClose
|
|
263
|
+
"onUpdate:visible": _cache[3] || (_cache[3] = ($event) => _ctx.showPop = $event),
|
|
264
|
+
"pop-class": "nut-image-preview-custom-pop"
|
|
424
265
|
}, {
|
|
425
266
|
default: withCtx(() => [
|
|
426
|
-
createElementVNode("view",
|
|
267
|
+
createElementVNode("view", {
|
|
268
|
+
class: "nut-image-preview",
|
|
269
|
+
onTouchstartCapture: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args))
|
|
270
|
+
}, [
|
|
427
271
|
_ctx.showPop ? (openBlock(), createBlock(_component_nut_swiper, {
|
|
428
272
|
key: 0,
|
|
429
273
|
"auto-play": _ctx.autoplay,
|
|
@@ -437,93 +281,41 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
437
281
|
onChange: _ctx.setActive
|
|
438
282
|
}, {
|
|
439
283
|
default: withCtx(() => [
|
|
440
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.
|
|
441
|
-
return openBlock(), createBlock(
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
},
|
|
284
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.images, (item, index) => {
|
|
285
|
+
return openBlock(), createBlock(_component_nut_swiper_item, { key: index }, {
|
|
286
|
+
default: withCtx(() => [
|
|
287
|
+
createElementVNode("img", {
|
|
288
|
+
src: item.src,
|
|
289
|
+
mode: "aspectFit",
|
|
290
|
+
class: "nut-image-preview-img",
|
|
291
|
+
"on:longPress": ($event) => _ctx.longPress(item),
|
|
292
|
+
"on:longTap": ($event) => _ctx.longPress(item),
|
|
293
|
+
onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.closeOnImg && _ctx.closeOnImg(...args), ["stop"]))
|
|
294
|
+
}, null, 40, _hoisted_1)
|
|
295
|
+
]),
|
|
296
|
+
_: 2
|
|
297
|
+
}, 1024);
|
|
454
298
|
}), 128))
|
|
455
299
|
]),
|
|
456
300
|
_: 1
|
|
457
301
|
}, 8, ["auto-play", "loop", "init-page", "pagination-visible", "pagination-color", "onChange"])) : createCommentVNode("", true)
|
|
458
|
-
],
|
|
459
|
-
|
|
302
|
+
], 32),
|
|
303
|
+
_cache[4] || (_cache[4] = createTextVNode()),
|
|
304
|
+
_ctx.showIndex ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.active + 1) + " / " + toDisplayString(_ctx.images.length), 1)) : createCommentVNode("", true),
|
|
305
|
+
_cache[5] || (_cache[5] = createTextVNode()),
|
|
460
306
|
_ctx.closeable ? (openBlock(), createElementBlock("view", {
|
|
461
307
|
key: 1,
|
|
462
|
-
class:
|
|
463
|
-
|
|
308
|
+
class: "nut-image-preview-close-icon",
|
|
309
|
+
style: normalizeStyle(_ctx.styles),
|
|
310
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onClose && _ctx.onClose(...args))
|
|
464
311
|
}, [
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
])
|
|
468
|
-
], 2)) : createCommentVNode("", true)
|
|
312
|
+
createVNode(_component_CircleClose, { color: "#ffffff" })
|
|
313
|
+
], 4)) : createCommentVNode("", true)
|
|
469
314
|
]),
|
|
470
|
-
_:
|
|
471
|
-
}, 8, ["visible"
|
|
472
|
-
}
|
|
473
|
-
const ImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
474
|
-
class ImagePreviewOptions {
|
|
475
|
-
constructor() {
|
|
476
|
-
__publicField(this, "show", false);
|
|
477
|
-
__publicField(this, "images", []);
|
|
478
|
-
__publicField(this, "videos", []);
|
|
479
|
-
__publicField(this, "contentClose", true);
|
|
480
|
-
__publicField(this, "initNo", 0);
|
|
481
|
-
__publicField(this, "paginationVisible", false);
|
|
482
|
-
__publicField(this, "paginationColor", "");
|
|
483
|
-
__publicField(this, "autoplay", 0);
|
|
484
|
-
__publicField(this, "isWrapTeleport", false);
|
|
485
|
-
__publicField(this, "showIndex", true);
|
|
486
|
-
__publicField(this, "closeable", false);
|
|
487
|
-
__publicField(this, "closeIcon", "circle-close");
|
|
488
|
-
__publicField(this, "closeIconPosition", "top-right");
|
|
489
|
-
__publicField(this, "beforeClose");
|
|
490
|
-
__publicField(this, "maxZoom", 3);
|
|
491
|
-
__publicField(this, "minZoom", 1 / 3);
|
|
492
|
-
__publicField(this, "isLoop", true);
|
|
493
|
-
__publicField(this, "teleport", "body");
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
class ImagePreviewFunction {
|
|
497
|
-
constructor(_options) {
|
|
498
|
-
__publicField(this, "options", new ImagePreviewOptions());
|
|
499
|
-
const options = Object.assign(this.options, _options);
|
|
500
|
-
const { unmount } = CreateComponent(options, {
|
|
501
|
-
name: "image-preview",
|
|
502
|
-
components: [NutPopup, NutVideo, NutSwiper, NutSwiperItem, _sfc_main$2],
|
|
503
|
-
wrapper: () => {
|
|
504
|
-
return {
|
|
505
|
-
setup() {
|
|
506
|
-
return () => {
|
|
507
|
-
options.onClose = () => {
|
|
508
|
-
options.show = false;
|
|
509
|
-
nextTick(() => {
|
|
510
|
-
unmount();
|
|
511
|
-
});
|
|
512
|
-
};
|
|
513
|
-
return h(ImagePreview, options);
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
};
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
}
|
|
315
|
+
_: 1
|
|
316
|
+
}, 8, ["visible"]);
|
|
520
317
|
}
|
|
521
|
-
const
|
|
522
|
-
showImagePreview.install = (app) => {
|
|
523
|
-
app.use(ImagePreview);
|
|
524
|
-
};
|
|
318
|
+
const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
525
319
|
export {
|
|
526
|
-
|
|
527
|
-
ImagePreview as default,
|
|
528
|
-
showImagePreview
|
|
320
|
+
index_taro as default
|
|
529
321
|
};
|