@nutui/nutui 4.3.14 → 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/CHANGELOG.md +19 -0
- package/README.md +2 -2
- package/dist/nutui.es.js +2 -14
- 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 -96
- package/dist/packages/dialog/index.mjs +1 -2
- package/dist/packages/divider/Divider.js +1 -1
- package/dist/packages/drag/Drag.js +95 -58
- 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 +380 -770
- package/dist/style.css +1 -1
- package/dist/styles/base-jda.css +1 -0
- package/dist/styles/themes/default.scss +0 -1
- package/dist/styles/themes/jda.scss +106 -0
- 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/styles/variables-jda.scss +945 -0
- 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 +1 -1
- package/dist/nutui.js +0 -15854
- 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 -44
- 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
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { ref, reactive, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, renderSlot } from "vue";
|
|
1
|
+
import { ref, reactive, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeStyle, withModifiers, renderSlot } from "vue";
|
|
2
2
|
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
3
|
-
import { r as requestAniFrame } from "../raf-
|
|
3
|
+
import { r as requestAniFrame } from "../raf-CzJhCkQo.js";
|
|
4
|
+
import { u as useTaroRect } from "../index-m0Wcof-q.js";
|
|
5
|
+
import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
4
6
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
5
7
|
const { create } = createComponent("drag");
|
|
6
8
|
const _sfc_main = create({
|
|
@@ -27,6 +29,7 @@ const _sfc_main = create({
|
|
|
27
29
|
},
|
|
28
30
|
setup(props) {
|
|
29
31
|
const myDrag = ref();
|
|
32
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
30
33
|
const state = reactive({
|
|
31
34
|
keepAlive: false,
|
|
32
35
|
elWidth: 0,
|
|
@@ -35,10 +38,14 @@ const _sfc_main = create({
|
|
|
35
38
|
screenHeight: 0,
|
|
36
39
|
startTop: 0,
|
|
37
40
|
startLeft: 0,
|
|
41
|
+
initTop: 0,
|
|
42
|
+
initLeft: 0,
|
|
38
43
|
nx: 0,
|
|
39
44
|
ny: 0,
|
|
40
45
|
xPum: 0,
|
|
41
46
|
yPum: 0,
|
|
47
|
+
top: 0,
|
|
48
|
+
left: 0,
|
|
42
49
|
position: { x: 0, y: 0 },
|
|
43
50
|
boundary: {
|
|
44
51
|
top: 0,
|
|
@@ -47,74 +54,80 @@ const _sfc_main = create({
|
|
|
47
54
|
bottom: 0
|
|
48
55
|
}
|
|
49
56
|
});
|
|
57
|
+
const domElem = Taro.getSystemInfoSync();
|
|
50
58
|
function getInfo() {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
useTaroRect(myDrag).then(
|
|
60
|
+
(rec) => {
|
|
61
|
+
state.elWidth = rec.width;
|
|
62
|
+
state.elHeight = rec.height;
|
|
63
|
+
state.initTop = rec.top;
|
|
64
|
+
state.initLeft = rec.left;
|
|
65
|
+
state.screenWidth = domElem.screenWidth;
|
|
66
|
+
state.screenHeight = domElem.screenHeight;
|
|
67
|
+
},
|
|
68
|
+
() => {
|
|
69
|
+
}
|
|
70
|
+
);
|
|
56
71
|
}
|
|
57
|
-
function goLeft(
|
|
72
|
+
function goLeft() {
|
|
58
73
|
if (state.boundary.left) {
|
|
59
|
-
if (+
|
|
60
|
-
|
|
74
|
+
if (+state.left.split("px")[0] > state.boundary.left) {
|
|
75
|
+
state.left = +state.left.split("px")[0] - 10 + "px";
|
|
61
76
|
requestAniFrame(() => {
|
|
62
|
-
goLeft(
|
|
77
|
+
goLeft();
|
|
63
78
|
});
|
|
64
79
|
} else {
|
|
65
|
-
|
|
80
|
+
state.left = `${state.boundary.left}px`;
|
|
66
81
|
}
|
|
67
82
|
} else {
|
|
68
|
-
if (+
|
|
69
|
-
|
|
83
|
+
if (+state.left.split("px")[0] > 10) {
|
|
84
|
+
state.left = +state.left.split("px")[0] - 10 + "px";
|
|
70
85
|
requestAniFrame(() => {
|
|
71
|
-
goLeft(
|
|
86
|
+
goLeft();
|
|
72
87
|
});
|
|
73
88
|
} else {
|
|
74
|
-
|
|
89
|
+
state.left = "0px";
|
|
75
90
|
}
|
|
76
91
|
}
|
|
77
92
|
}
|
|
78
|
-
function goRight(
|
|
79
|
-
if (rightLocation - parseInt(
|
|
80
|
-
|
|
93
|
+
function goRight(rightLocation) {
|
|
94
|
+
if (rightLocation - parseInt(state.left.split("px")[0]) > 10) {
|
|
95
|
+
state.left = parseInt(state.left.split("px")[0]) + 10 + "px";
|
|
81
96
|
requestAniFrame(() => {
|
|
82
|
-
goRight(
|
|
97
|
+
goRight(rightLocation);
|
|
83
98
|
});
|
|
84
99
|
} else {
|
|
85
|
-
|
|
100
|
+
state.left = rightLocation + "px";
|
|
86
101
|
}
|
|
87
102
|
}
|
|
88
103
|
function touchMove(e) {
|
|
89
104
|
e.preventDefault();
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const touch = e.targetTouches[0];
|
|
105
|
+
if (e.touches.length === 1) {
|
|
106
|
+
const touch = e.touches[0];
|
|
93
107
|
state.nx = touch.clientX - state.position.x;
|
|
94
108
|
state.ny = touch.clientY - state.position.y;
|
|
95
109
|
state.xPum = state.startLeft + state.nx;
|
|
96
110
|
state.yPum = state.startTop + state.ny;
|
|
97
111
|
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
98
|
-
if (Math.abs(state.xPum) > rightLocation) {
|
|
99
|
-
state.xPum = rightLocation;
|
|
100
|
-
} else if (state.xPum <= state.boundary.left) {
|
|
101
|
-
state.xPum = state.boundary.left;
|
|
112
|
+
if (Math.abs(state.xPum + state.initLeft) > rightLocation) {
|
|
113
|
+
state.xPum = rightLocation - state.initLeft;
|
|
114
|
+
} else if (state.xPum + state.initLeft <= state.boundary.left) {
|
|
115
|
+
state.xPum = state.boundary.left - state.initLeft;
|
|
102
116
|
}
|
|
103
|
-
if (state.yPum < state.boundary.top) {
|
|
104
|
-
state.yPum = state.boundary.top;
|
|
105
|
-
} else if (state.yPum > state.screenHeight - state.elHeight - state.boundary.bottom) {
|
|
106
|
-
state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom;
|
|
117
|
+
if (state.yPum + state.initTop < state.boundary.top) {
|
|
118
|
+
state.yPum = state.boundary.top - state.initTop;
|
|
119
|
+
} else if (state.yPum + state.initTop > state.screenHeight - state.elHeight - state.boundary.bottom) {
|
|
120
|
+
state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom - state.initTop;
|
|
107
121
|
}
|
|
108
122
|
if (props.direction != "y") {
|
|
109
|
-
|
|
123
|
+
state.left = state.xPum;
|
|
110
124
|
}
|
|
111
125
|
if (props.direction != "x") {
|
|
112
|
-
|
|
126
|
+
state.top = state.yPum;
|
|
113
127
|
}
|
|
114
128
|
}
|
|
115
129
|
}
|
|
116
130
|
function touchEnd(e) {
|
|
117
|
-
const target = e.currentTarget;
|
|
118
131
|
const touch = e.changedTouches[0];
|
|
119
132
|
let currX = touch.clientX;
|
|
120
133
|
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
@@ -128,33 +141,47 @@ const _sfc_main = create({
|
|
|
128
141
|
if (props.direction != "y" && props.attract) {
|
|
129
142
|
if (currX < state.screenWidth / 2) {
|
|
130
143
|
requestAniFrame(() => {
|
|
131
|
-
goLeft(
|
|
144
|
+
goLeft();
|
|
132
145
|
});
|
|
133
146
|
} else {
|
|
134
147
|
requestAniFrame(() => {
|
|
135
|
-
goRight(
|
|
148
|
+
goRight(rightLocation);
|
|
136
149
|
});
|
|
137
150
|
}
|
|
138
151
|
}
|
|
139
|
-
if (props.direction
|
|
140
|
-
|
|
152
|
+
if (props.direction !== "x") {
|
|
153
|
+
state.top = state.yPum;
|
|
141
154
|
}
|
|
142
155
|
}
|
|
143
156
|
function touchStart(e) {
|
|
144
|
-
|
|
157
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
158
|
+
const query = Taro.createSelectorQuery();
|
|
159
|
+
let id = (_a = e == null ? void 0 : e.mpEvent) == null ? void 0 : _a.currentTarget.id;
|
|
160
|
+
let offsetTop = (_b = e == null ? void 0 : e.currentTarget) == null ? void 0 : _b.offsetTop;
|
|
161
|
+
let offsetLeft = (_c = e == null ? void 0 : e.currentTarget) == null ? void 0 : _c.offsetLeft;
|
|
145
162
|
const touches = e.touches[0];
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
163
|
+
const mobileTop = (_f = (_e = (_d = e.touches[0]) == null ? void 0 : _d.target) == null ? void 0 : _e.parentNode) == null ? void 0 : _f.style.top;
|
|
164
|
+
const mobileLeft = (_i = (_h = (_g = e.touches[0]) == null ? void 0 : _g.target) == null ? void 0 : _h.parentNode) == null ? void 0 : _i.style.left;
|
|
165
|
+
query.selectAll(".myDrag").boundingClientRect((rec) => {
|
|
166
|
+
rec.forEach((element) => {
|
|
167
|
+
if (id && id == element.id) {
|
|
168
|
+
state.startTop = element.top - offsetTop;
|
|
169
|
+
state.startLeft = element.left - offsetLeft;
|
|
170
|
+
} else if (mobileTop) {
|
|
171
|
+
state.startTop = Number(mobileTop.slice(0, -2));
|
|
172
|
+
state.startLeft = Number(mobileLeft.slice(0, -2));
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}).exec();
|
|
149
176
|
state.position.x = touches.clientX;
|
|
150
177
|
state.position.y = touches.clientY;
|
|
151
|
-
state.nx = touch.clientX - state.position.x;
|
|
152
|
-
state.ny = touch.clientY - state.position.y;
|
|
153
|
-
state.xPum = state.startLeft + state.nx;
|
|
154
|
-
state.yPum = state.startTop + state.ny;
|
|
155
178
|
}
|
|
156
179
|
onMounted(() => {
|
|
157
|
-
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
getInfo();
|
|
182
|
+
}, 200);
|
|
183
|
+
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
184
|
+
});
|
|
158
185
|
state.boundary = props.boundary;
|
|
159
186
|
});
|
|
160
187
|
onActivated(() => {
|
|
@@ -163,31 +190,41 @@ const _sfc_main = create({
|
|
|
163
190
|
}
|
|
164
191
|
});
|
|
165
192
|
onDeactivated(() => {
|
|
193
|
+
var _a, _b, _c;
|
|
166
194
|
state.keepAlive = true;
|
|
167
|
-
myDrag.value.removeEventListener("touchstart", touchStart);
|
|
168
|
-
myDrag.value.removeEventListener("touchmove", touchMove);
|
|
169
|
-
myDrag.value.removeEventListener("touchend", touchEnd);
|
|
195
|
+
(_a = myDrag.value) == null ? void 0 : _a.removeEventListener("touchstart", touchStart);
|
|
196
|
+
(_b = myDrag.value) == null ? void 0 : _b.removeEventListener("touchmove", touchMove);
|
|
197
|
+
(_c = myDrag.value) == null ? void 0 : _c.removeEventListener("touchend", touchEnd);
|
|
170
198
|
});
|
|
171
199
|
return {
|
|
172
200
|
myDrag,
|
|
173
201
|
touchStart,
|
|
174
202
|
touchMove,
|
|
175
|
-
touchEnd
|
|
203
|
+
touchEnd,
|
|
204
|
+
state,
|
|
205
|
+
refRandomId
|
|
176
206
|
};
|
|
177
207
|
}
|
|
178
208
|
});
|
|
209
|
+
const _hoisted_1 = ["id"];
|
|
179
210
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
180
211
|
return openBlock(), createElementBlock("view", {
|
|
212
|
+
id: "myDrag" + _ctx.refRandomId,
|
|
181
213
|
ref: "myDrag",
|
|
182
|
-
class: "nut-drag",
|
|
214
|
+
class: "nut-taro-drag myDrag",
|
|
215
|
+
catchtouchmove: "true",
|
|
216
|
+
style: normalizeStyle({
|
|
217
|
+
transform: ` translate(${_ctx.state.left + "px"}, ${_ctx.state.top + "px"})`,
|
|
218
|
+
top: _ctx.state.top + "px",
|
|
219
|
+
left: _ctx.state.left + "px"
|
|
220
|
+
}),
|
|
183
221
|
onTouchstart: _cache[0] || (_cache[0] = ($event) => _ctx.touchStart($event)),
|
|
184
|
-
onTouchmove: _cache[1] || (_cache[1] = ($event) => _ctx.touchMove($event))
|
|
185
|
-
onTouchend: _cache[2] || (_cache[2] = ($event) => _ctx.touchEnd($event))
|
|
222
|
+
onTouchmove: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.touchMove($event), ["prevent"]))
|
|
186
223
|
}, [
|
|
187
224
|
renderSlot(_ctx.$slots, "default")
|
|
188
|
-
],
|
|
225
|
+
], 44, _hoisted_1);
|
|
189
226
|
}
|
|
190
|
-
const
|
|
227
|
+
const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
191
228
|
export {
|
|
192
|
-
|
|
229
|
+
index_taro as default
|
|
193
230
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, withDirectives, vModelText,
|
|
1
|
+
import { ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createTextVNode, Fragment, renderList, normalizeClass, withDirectives, vModelText, createVNode } from "vue";
|
|
2
2
|
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
3
3
|
import { InputNumber as _sfc_main$1 } from "../inputnumber/InputNumber.js";
|
|
4
|
-
import { u as useLocale } from "../index-
|
|
4
|
+
import { u as useLocale } from "../index-IxPZmHlb.js";
|
|
5
5
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
6
6
|
const { create } = createComponent("ecard");
|
|
7
7
|
const cN = "NutEcard";
|
|
@@ -56,15 +56,15 @@ const _sfc_main = create({
|
|
|
56
56
|
const translate = useLocale(cN);
|
|
57
57
|
const currentIndex = ref(null);
|
|
58
58
|
const currentValue = ref(null);
|
|
59
|
-
const inputValue = ref(
|
|
59
|
+
const inputValue = ref();
|
|
60
60
|
const stepValue = ref(props.cardAmountMin);
|
|
61
61
|
const money = ref(props.modelValue);
|
|
62
|
-
const handleClick = (item,
|
|
63
|
-
currentIndex.value =
|
|
62
|
+
const handleClick = (item, index) => {
|
|
63
|
+
currentIndex.value = index;
|
|
64
|
+
inputValue.value = "";
|
|
64
65
|
stepValue.value = props.cardAmountMin;
|
|
65
66
|
currentValue.value = item.price;
|
|
66
67
|
emit("change", item);
|
|
67
|
-
emit("update:modelValue", item.price);
|
|
68
68
|
};
|
|
69
69
|
const change = (event) => {
|
|
70
70
|
let input = event.target;
|
|
@@ -80,13 +80,11 @@ const _sfc_main = create({
|
|
|
80
80
|
currentValue.value = props.cardAmountMin;
|
|
81
81
|
}
|
|
82
82
|
emit("inputChange", Number(inputValue.value));
|
|
83
|
-
emit("update:modelValue", Number(inputValue.value));
|
|
84
83
|
};
|
|
85
84
|
const inputClick = () => {
|
|
86
85
|
currentIndex.value = "input";
|
|
87
86
|
stepValue.value = props.cardAmountMin;
|
|
88
|
-
|
|
89
|
-
emit("update:modelValue", inputValue.value);
|
|
87
|
+
emit("update:modelValue", 0);
|
|
90
88
|
emit("inputClick");
|
|
91
89
|
};
|
|
92
90
|
const changeStep = (value) => {
|
|
@@ -123,24 +121,27 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
123
121
|
const _component_nut_input_number = resolveComponent("nut-input-number");
|
|
124
122
|
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
125
123
|
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.chooseText || _ctx.translate("chooseText")), 1),
|
|
124
|
+
_cache[8] || (_cache[8] = createTextVNode()),
|
|
126
125
|
createElementVNode("view", _hoisted_3, [
|
|
127
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dataList, (item,
|
|
126
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dataList, (item, index) => {
|
|
128
127
|
return openBlock(), createElementBlock("view", {
|
|
129
|
-
key:
|
|
130
|
-
class: normalizeClass(["nut-ecard__list__item", _ctx.currentIndex ==
|
|
131
|
-
onClick: ($event) => _ctx.handleClick(item,
|
|
128
|
+
key: index,
|
|
129
|
+
class: normalizeClass(["nut-ecard__list__item", _ctx.currentIndex == index ? "active" : ""]),
|
|
130
|
+
onClick: ($event) => _ctx.handleClick(item, index)
|
|
132
131
|
}, toDisplayString(item.price), 11, _hoisted_4);
|
|
133
132
|
}), 128)),
|
|
133
|
+
_cache[6] || (_cache[6] = createTextVNode()),
|
|
134
134
|
createElementVNode("view", {
|
|
135
135
|
class: normalizeClass(["nut-ecard__list__input", _ctx.currentIndex == "input" ? "active" : ""]),
|
|
136
136
|
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.inputClick && _ctx.inputClick(...args))
|
|
137
137
|
}, [
|
|
138
138
|
createElementVNode("view", null, toDisplayString(_ctx.otherValueText || _ctx.translate("otherValueText")), 1),
|
|
139
|
+
_cache[4] || (_cache[4] = createTextVNode()),
|
|
139
140
|
createElementVNode("view", _hoisted_5, [
|
|
140
141
|
withDirectives(createElementVNode("input", {
|
|
141
142
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.inputValue = $event),
|
|
142
|
-
class: "nut-ecard__list__input--input",
|
|
143
143
|
type: "text",
|
|
144
|
+
class: "nut-ecard-input",
|
|
144
145
|
placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
|
|
145
146
|
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.change && _ctx.change(...args))
|
|
146
147
|
}, null, 40, _hoisted_6), [
|
|
@@ -149,8 +150,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
149
150
|
createTextVNode(" " + toDisplayString(_ctx.suffix), 1)
|
|
150
151
|
])
|
|
151
152
|
], 2),
|
|
153
|
+
_cache[7] || (_cache[7] = createTextVNode()),
|
|
152
154
|
createElementVNode("view", _hoisted_7, [
|
|
153
155
|
createElementVNode("view", null, toDisplayString(_ctx.suffix) + toDisplayString(_ctx.money), 1),
|
|
156
|
+
_cache[5] || (_cache[5] = createTextVNode()),
|
|
154
157
|
createVNode(_component_nut_input_number, {
|
|
155
158
|
modelValue: _ctx.stepValue,
|
|
156
159
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.stepValue = $event),
|
|
@@ -162,7 +165,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
162
165
|
])
|
|
163
166
|
]);
|
|
164
167
|
}
|
|
165
|
-
const
|
|
168
|
+
const index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
166
169
|
export {
|
|
167
|
-
|
|
170
|
+
index_taro as default
|
|
168
171
|
};
|
|
@@ -17,11 +17,16 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { ref, reactive, computed,
|
|
20
|
+
import { ref, reactive, computed, watch, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, createVNode, normalizeStyle, withCtx, Fragment, renderList, normalizeClass, createElementVNode, toDisplayString, createTextVNode, renderSlot, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
|
|
21
21
|
import { c as createComponent } from "../component-DQf3CENX.js";
|
|
22
|
+
import Taro from "@tarojs/taro";
|
|
23
|
+
import { _ as _sfc_main$1 } from "../index.taro.vue_vue_type_script_setup_true_lang-JJ7hr71Y.js";
|
|
22
24
|
import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
|
|
23
25
|
const { create } = createComponent("elevator");
|
|
24
26
|
const _sfc_main = create({
|
|
27
|
+
components: {
|
|
28
|
+
NutScrollView: _sfc_main$1
|
|
29
|
+
},
|
|
25
30
|
props: {
|
|
26
31
|
height: {
|
|
27
32
|
type: [Number, String],
|
|
@@ -33,7 +38,9 @@ const _sfc_main = create({
|
|
|
33
38
|
},
|
|
34
39
|
indexList: {
|
|
35
40
|
type: Array,
|
|
36
|
-
default: () =>
|
|
41
|
+
default: () => {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
37
44
|
},
|
|
38
45
|
isSticky: {
|
|
39
46
|
type: [Boolean],
|
|
@@ -50,7 +57,8 @@ const _sfc_main = create({
|
|
|
50
57
|
},
|
|
51
58
|
emits: ["clickItem", "clickIndex", "change"],
|
|
52
59
|
setup(props, { emit, expose }) {
|
|
53
|
-
const
|
|
60
|
+
const spaceHeight = 23;
|
|
61
|
+
const listview = ref();
|
|
54
62
|
const state = reactive({
|
|
55
63
|
anchorIndex: 0,
|
|
56
64
|
codeIndex: 0,
|
|
@@ -62,18 +70,25 @@ const _sfc_main = create({
|
|
|
62
70
|
},
|
|
63
71
|
scrollStart: false,
|
|
64
72
|
currentIndex: 0,
|
|
73
|
+
query: Taro.createSelectorQuery(),
|
|
74
|
+
scrollTop: 0,
|
|
65
75
|
currentData: {},
|
|
66
76
|
currentKey: "",
|
|
67
|
-
scrollY: 0
|
|
68
|
-
diff: -1,
|
|
69
|
-
fixedTop: 0
|
|
77
|
+
scrollY: 0
|
|
70
78
|
});
|
|
71
79
|
const clientHeight = computed(() => {
|
|
72
80
|
return listview.value.clientHeight;
|
|
73
81
|
});
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
const fixedStyle = computed(() => {
|
|
83
|
+
return {
|
|
84
|
+
height: `${state.listHeight[state.listGroup.length - 1]}px`
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
const getData = (el) => {
|
|
88
|
+
if (!el.dataset.index) {
|
|
89
|
+
return "0";
|
|
90
|
+
}
|
|
91
|
+
return el.dataset.index;
|
|
77
92
|
};
|
|
78
93
|
const setListGroup = (el) => {
|
|
79
94
|
nextTick(() => {
|
|
@@ -83,12 +98,15 @@ const _sfc_main = create({
|
|
|
83
98
|
});
|
|
84
99
|
};
|
|
85
100
|
const calculateHeight = () => {
|
|
101
|
+
state.listHeight = [];
|
|
86
102
|
let height = 0;
|
|
87
103
|
state.listHeight.push(height);
|
|
88
104
|
for (let i = 0; i < state.listGroup.length; i++) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
105
|
+
state.query.selectAll(`.elevator__item__${i}`).boundingClientRect();
|
|
106
|
+
state.query.exec((res) => {
|
|
107
|
+
height += Math.floor(res[i][0].height);
|
|
108
|
+
state.listHeight.push(height);
|
|
109
|
+
});
|
|
92
110
|
}
|
|
93
111
|
};
|
|
94
112
|
const scrollTo = (index) => {
|
|
@@ -98,11 +116,11 @@ const _sfc_main = create({
|
|
|
98
116
|
if (index < 0) index = 0;
|
|
99
117
|
if (index > state.listHeight.length - 2) index = state.listHeight.length - 2;
|
|
100
118
|
state.codeIndex = index;
|
|
101
|
-
|
|
119
|
+
state.scrollTop = state.listHeight[index];
|
|
102
120
|
};
|
|
103
121
|
const touchStart = (e) => {
|
|
104
122
|
state.scrollStart = true;
|
|
105
|
-
let index = getData(e.target
|
|
123
|
+
let index = getData(e.target);
|
|
106
124
|
let firstTouch = e.touches[0];
|
|
107
125
|
state.touchState.y1 = firstTouch.pageY;
|
|
108
126
|
state.anchorIndex = +index;
|
|
@@ -112,9 +130,9 @@ const _sfc_main = create({
|
|
|
112
130
|
const touchMove = (e) => {
|
|
113
131
|
let firstTouch = e.touches[0];
|
|
114
132
|
state.touchState.y2 = firstTouch.pageY;
|
|
115
|
-
let delta = (state.touchState.y2 - state.touchState.y1) /
|
|
133
|
+
let delta = (state.touchState.y2 - state.touchState.y1) / spaceHeight | 0;
|
|
116
134
|
state.codeIndex = state.anchorIndex + delta;
|
|
117
|
-
scrollTo(state.
|
|
135
|
+
scrollTo(state.currentIndex);
|
|
118
136
|
};
|
|
119
137
|
const touchEnd = () => {
|
|
120
138
|
state.scrollStart = false;
|
|
@@ -131,43 +149,23 @@ const _sfc_main = create({
|
|
|
131
149
|
let target = e.target;
|
|
132
150
|
let scrollTop = target.scrollTop;
|
|
133
151
|
const listHeight = state.listHeight;
|
|
134
|
-
state.scrollY = scrollTop;
|
|
152
|
+
state.scrollY = Math.floor(scrollTop);
|
|
135
153
|
for (let i = 0; i < listHeight.length - 1; i++) {
|
|
136
154
|
let height1 = listHeight[i];
|
|
137
155
|
let height2 = listHeight[i + 1];
|
|
138
156
|
if (state.scrollY >= height1 && state.scrollY < height2) {
|
|
139
157
|
state.currentIndex = i;
|
|
140
|
-
state.diff = height2 - state.scrollY;
|
|
141
158
|
return;
|
|
142
159
|
}
|
|
143
160
|
}
|
|
144
|
-
state.currentIndex = listHeight.length - 2;
|
|
145
161
|
};
|
|
146
|
-
onMounted(() => {
|
|
147
|
-
if (listview.value) {
|
|
148
|
-
listview.value.addEventListener("scroll", listViewScroll);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
162
|
expose({
|
|
152
163
|
scrollTo
|
|
153
164
|
});
|
|
154
165
|
watch(
|
|
155
166
|
() => state.listGroup.length,
|
|
156
167
|
() => {
|
|
157
|
-
|
|
158
|
-
nextTick(calculateHeight);
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
watch(
|
|
162
|
-
() => state.diff,
|
|
163
|
-
(newVal) => {
|
|
164
|
-
const listHeight = state.listHeight;
|
|
165
|
-
let fixedTop = newVal > 0 && newVal < props.titleHeight ? newVal - props.titleHeight : 0;
|
|
166
|
-
if (state.scrollY + clientHeight.value === listHeight[listHeight.length - 1]) {
|
|
167
|
-
if (fixedTop !== 0) fixedTop = 0;
|
|
168
|
-
}
|
|
169
|
-
if (state.fixedTop === fixedTop) return;
|
|
170
|
-
state.fixedTop = fixedTop;
|
|
168
|
+
Taro.nextTick(calculateHeight);
|
|
171
169
|
}
|
|
172
170
|
);
|
|
173
171
|
watch(
|
|
@@ -178,13 +176,15 @@ const _sfc_main = create({
|
|
|
178
176
|
);
|
|
179
177
|
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
180
178
|
clientHeight,
|
|
179
|
+
fixedStyle,
|
|
181
180
|
setListGroup,
|
|
182
181
|
listview,
|
|
183
182
|
touchStart,
|
|
184
183
|
touchMove,
|
|
185
184
|
touchEnd,
|
|
186
185
|
handleClickItem,
|
|
187
|
-
handleClickIndex
|
|
186
|
+
handleClickIndex,
|
|
187
|
+
listViewScroll
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
});
|
|
@@ -198,51 +198,64 @@ const _hoisted_7 = { class: "nut-elevator__bars__inner" };
|
|
|
198
198
|
const _hoisted_8 = ["data-index", "onClick"];
|
|
199
199
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
200
200
|
var _a, _b, _c, _d;
|
|
201
|
+
const _component_nut_scroll_view = resolveComponent("nut-scroll-view");
|
|
201
202
|
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
202
|
-
|
|
203
|
+
createVNode(_component_nut_scroll_view, {
|
|
203
204
|
ref: "listview",
|
|
204
|
-
class: "nut-elevator__list",
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
key:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
205
|
+
class: "nut-elevator__list nut-elevator__list--mini",
|
|
206
|
+
"scroll-top": _ctx.scrollTop,
|
|
207
|
+
"scroll-y": true,
|
|
208
|
+
"scroll-with-animation": true,
|
|
209
|
+
"scroll-anchoring": true,
|
|
210
|
+
style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` }),
|
|
211
|
+
onScroll: _ctx.listViewScroll
|
|
212
|
+
}, {
|
|
213
|
+
default: withCtx(() => [
|
|
214
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index) => {
|
|
215
|
+
return openBlock(), createElementBlock("view", {
|
|
216
|
+
key: item[_ctx.acceptKey],
|
|
217
|
+
ref_for: true,
|
|
218
|
+
ref: _ctx.setListGroup,
|
|
219
|
+
class: normalizeClass(["nut-elevator__list__item", `elevator__item__${index}`])
|
|
220
|
+
}, [
|
|
221
|
+
createElementVNode("view", _hoisted_2, toDisplayString(item[_ctx.acceptKey]), 1),
|
|
222
|
+
_cache[3] || (_cache[3] = createTextVNode()),
|
|
223
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
|
|
224
|
+
return openBlock(), createElementBlock("view", {
|
|
225
|
+
key: subitem["id"],
|
|
226
|
+
class: normalizeClass(["nut-elevator__list__item__name", {
|
|
227
|
+
"nut-elevator__list__item__name--highcolor": _ctx.currentData.id === subitem.id && _ctx.currentKey === item[_ctx.acceptKey]
|
|
228
|
+
}]),
|
|
229
|
+
onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem)
|
|
230
|
+
}, [
|
|
231
|
+
!_ctx.$slots.default ? (openBlock(), createElementBlock("span", {
|
|
232
|
+
key: 0,
|
|
233
|
+
innerHTML: subitem.name
|
|
234
|
+
}, null, 8, _hoisted_4)) : renderSlot(_ctx.$slots, "default", {
|
|
235
|
+
key: 1,
|
|
236
|
+
item: subitem
|
|
237
|
+
})
|
|
238
|
+
], 10, _hoisted_3);
|
|
239
|
+
}), 128))
|
|
240
|
+
], 2);
|
|
241
|
+
}), 128))
|
|
242
|
+
]),
|
|
243
|
+
_: 3
|
|
244
|
+
}, 8, ["scroll-top", "style", "onScroll"]),
|
|
245
|
+
_cache[4] || (_cache[4] = createTextVNode()),
|
|
235
246
|
withDirectives(createElementVNode("view", _hoisted_5, [
|
|
236
247
|
createElementVNode("view", _hoisted_6, toDisplayString((_b = (_a = _ctx.indexList) == null ? void 0 : _a[_ctx.currentIndex]) == null ? void 0 : _b[_ctx.acceptKey]), 1)
|
|
237
248
|
], 512), [
|
|
238
|
-
[vShow, _ctx.scrollY >
|
|
249
|
+
[vShow, _ctx.scrollY > 2 && _ctx.isSticky]
|
|
239
250
|
]),
|
|
240
|
-
|
|
251
|
+
_cache[5] || (_cache[5] = createTextVNode()),
|
|
252
|
+
_ctx.indexList.length > 0 ? withDirectives((openBlock(), createElementBlock("view", {
|
|
241
253
|
key: 0,
|
|
242
254
|
class: "nut-elevator__code--current"
|
|
243
255
|
}, toDisplayString((_d = (_c = _ctx.indexList) == null ? void 0 : _c[_ctx.codeIndex]) == null ? void 0 : _d[_ctx.acceptKey]), 513)), [
|
|
244
256
|
[vShow, _ctx.scrollStart]
|
|
245
257
|
]) : createCommentVNode("", true),
|
|
258
|
+
_cache[6] || (_cache[6] = createTextVNode()),
|
|
246
259
|
createElementVNode("view", {
|
|
247
260
|
class: "nut-elevator__bars",
|
|
248
261
|
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
|