@nutui/nutui 3.1.0 → 3.1.2-3.beta-4
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 +505 -0
- package/LICENSE +1 -1
- package/README.md +155 -36
- package/dist/nutui.es.js +20777 -4
- package/dist/nutui.umd.js +20886 -4
- package/dist/packages/_es/ActionSheet.js +162 -0
- package/dist/packages/_es/Address.js +551 -0
- package/dist/packages/_es/AddressList.js +620 -0
- package/dist/packages/_es/Animate.js +64 -0
- package/dist/packages/_es/Audio.js +263 -0
- package/dist/packages/_es/AudioOperate.js +105 -0
- package/dist/packages/_es/Avatar.js +168 -0
- package/dist/packages/_es/AvatarGroup.js +78 -0
- package/dist/packages/_es/BackTop.js +163 -0
- package/dist/packages/_es/Badge.js +91 -0
- package/dist/packages/_es/Barrage.js +126 -0
- package/dist/packages/_es/Button.js +134 -0
- package/dist/packages/_es/Calendar.js +252 -0
- package/dist/packages/_es/CalendarItem.js +12 -0
- package/dist/packages/_es/Card.js +115 -0
- package/dist/packages/_es/Cascader.js +519 -0
- package/dist/packages/_es/Category.js +63 -0
- package/dist/packages/_es/CategoryPane.js +118 -0
- package/dist/packages/_es/Cell.js +113 -0
- package/dist/packages/_es/CellGroup.js +49 -0
- package/dist/packages/_es/Checkbox.js +152 -0
- package/dist/packages/_es/CheckboxGroup.js +84 -0
- package/dist/packages/_es/CircleProgress.js +155 -0
- package/dist/packages/_es/Col.js +61 -0
- package/dist/packages/_es/Collapse.js +115 -0
- package/dist/packages/_es/CollapseItem.js +260 -0
- package/dist/packages/_es/Comment.js +441 -0
- package/dist/packages/_es/ConfigProvider.js +25 -0
- package/dist/packages/_es/CountDown.js +246 -0
- package/dist/packages/_es/CountUp.js +549 -0
- package/dist/packages/_es/DatePicker.js +332 -0
- package/dist/packages/_es/Dialog.js +306 -0
- package/dist/packages/_es/Divider.js +70 -0
- package/dist/packages/_es/Drag.js +204 -0
- package/dist/packages/_es/Ecard.js +164 -0
- package/dist/packages/_es/Elevator.js +262 -0
- package/dist/packages/_es/Ellipsis.js +206 -0
- package/dist/packages/_es/Empty.js +76 -0
- package/dist/packages/_es/FixedNav.js +127 -0
- package/dist/packages/_es/Form.js +158 -0
- package/dist/packages/_es/FormItem.js +119 -0
- package/dist/packages/_es/Grid.js +13 -0
- package/dist/packages/_es/GridItem.js +150 -0
- package/dist/packages/_es/Icon.js +45 -0
- package/dist/packages/_es/Image.js +142 -0
- package/dist/packages/_es/ImagePreview.js +565 -0
- package/dist/packages/_es/Indicator.js +67 -0
- package/dist/packages/_es/InfiniteLoading.js +256 -0
- package/dist/packages/_es/Input.js +440 -0
- package/dist/packages/_es/InputNumber.js +165 -0
- package/dist/packages/_es/Layout.js +11 -0
- package/dist/packages/_es/List.js +111 -0
- package/dist/packages/_es/Menu.js +175 -0
- package/dist/packages/_es/MenuItem.js +181 -0
- package/dist/packages/_es/Navbar.js +198 -0
- package/dist/packages/_es/NoticeBar.js +387 -0
- package/dist/packages/_es/Notify.js +236 -0
- package/dist/packages/_es/NumberKeyboard.js +278 -0
- package/dist/packages/_es/OldPicker.js +469 -0
- package/dist/packages/_es/OverLay.js +104 -0
- package/dist/packages/_es/Pagination.js +165 -0
- package/dist/packages/_es/Picker.js +508 -0
- package/dist/packages/_es/Popover.js +987 -0
- package/dist/packages/_es/Popup.js +302 -0
- package/dist/packages/_es/Price.js +123 -0
- package/dist/packages/_es/Progress.js +151 -0
- package/dist/packages/_es/PullRefresh.js +349 -0
- package/dist/packages/_es/Radio.js +96 -0
- package/dist/packages/_es/RadioGroup.js +42 -0
- package/dist/packages/_es/Range.js +414 -0
- package/dist/packages/_es/Rate.js +198 -0
- package/dist/packages/_es/Row.js +69 -0
- package/dist/packages/_es/SearchBar.js +243 -0
- package/dist/packages/_es/ShortPassword.js +231 -0
- package/dist/packages/_es/SideNavBar.js +87 -0
- package/dist/packages/_es/SideNavBarItem.js +51 -0
- package/dist/packages/_es/Signature.js +166 -0
- package/dist/packages/_es/Skeleton.js +141 -0
- package/dist/packages/_es/Sku.js +499 -0
- package/dist/packages/_es/Step.js +120 -0
- package/dist/packages/_es/Steps.js +58 -0
- package/dist/packages/_es/Sticky.js +144 -0
- package/dist/packages/_es/SubSideNavBar.js +87 -0
- package/dist/packages/_es/Swipe.js +188 -0
- package/dist/packages/_es/Swiper.js +460 -0
- package/dist/packages/_es/SwiperItem.js +58 -0
- package/dist/packages/_es/Switch.js +129 -0
- package/dist/packages/_es/TabPane.js +44 -0
- package/dist/packages/_es/Tabbar.js +78 -0
- package/dist/packages/_es/TabbarItem.js +179 -0
- package/dist/packages/_es/Table.js +183 -0
- package/dist/packages/_es/Tabs.js +211 -0
- package/dist/packages/_es/Tag.js +102 -0
- package/dist/packages/_es/TextArea.js +166 -0
- package/dist/packages/_es/TimeDetail.js +84 -0
- package/dist/packages/_es/TimePannel.js +53 -0
- package/dist/packages/_es/TimeSelect.js +117 -0
- package/dist/packages/_es/Toast.js +316 -0
- package/dist/packages/_es/Uploader.js +489 -0
- package/dist/packages/_es/Video.js +339 -0
- package/dist/packages/_es/WaterMark.js +187 -0
- package/dist/packages/_es/common.js +136 -0
- package/dist/packages/_es/component.js +102 -0
- package/dist/packages/_es/index.js +11 -0
- package/dist/packages/_es/index2.js +36 -0
- package/dist/packages/_es/index3.js +13 -0
- package/dist/packages/_es/index4.js +70 -0
- package/dist/packages/_es/index5.js +791 -0
- package/dist/packages/_es/plugin-vue_export-helper.js +13 -0
- package/dist/packages/_es/pxCheck.js +9 -0
- package/dist/packages/_es/raf.js +19 -0
- package/dist/packages/_es/style.css +111 -0
- package/dist/packages/actionsheet/index.scss +12 -7
- package/dist/packages/address/index.scss +18 -1
- package/dist/packages/addresslist/index.scss +144 -0
- package/dist/packages/animate/index.scss +299 -0
- package/dist/packages/audio/index.scss +66 -0
- package/dist/packages/audiooperate/index.scss +13 -0
- package/dist/packages/avatar/index.scss +11 -6
- package/dist/packages/avatargroup/index.scss +14 -0
- package/dist/packages/badge/index.scss +33 -0
- package/dist/packages/barrage/index.scss +48 -0
- package/dist/packages/button/index.scss +18 -4
- package/dist/packages/calendar/index.scss +67 -46
- package/dist/packages/calendaritem/index.scss +0 -195
- package/dist/packages/card/index.scss +97 -0
- package/dist/packages/cascader/index.scss +94 -0
- package/dist/packages/category/index.scss +38 -0
- package/dist/packages/categorypane/index.scss +124 -0
- package/dist/packages/cell/index.scss +33 -11
- package/dist/packages/cellgroup/index.scss +10 -1
- package/dist/packages/checkbox/index.scss +31 -3
- package/dist/packages/circleprogress/index.scss +24 -0
- package/dist/packages/col/index.scss +2 -4
- package/dist/packages/collapseitem/index.scss +33 -13
- package/dist/packages/comment/index.scss +353 -0
- package/dist/packages/configprovider/index.scss +2 -0
- package/dist/packages/countdown/index.scss +5 -0
- package/dist/packages/countup/index.scss +67 -0
- package/dist/packages/dialog/index.scss +18 -1
- package/dist/packages/divider/index.scss +63 -0
- package/dist/packages/drag/index.scss +11 -0
- package/dist/packages/ecard/index.scss +83 -0
- package/dist/packages/elevator/index.scss +94 -0
- package/dist/packages/ellipsis/index.scss +12 -0
- package/dist/packages/empty/index.scss +33 -0
- package/dist/packages/fixednav/index.scss +134 -0
- package/dist/packages/form/index.scss +2 -0
- package/dist/packages/formitem/index.scss +83 -0
- package/dist/packages/grid/index.scss +10 -0
- package/dist/packages/griditem/index.scss +103 -0
- package/dist/packages/icon/index.scss +103 -12
- package/dist/packages/image/index.scss +39 -0
- package/dist/packages/imagepreview/index.scss +72 -0
- package/dist/packages/indicator/index.scss +48 -0
- package/dist/packages/infiniteloading/index.scss +1 -1
- package/dist/packages/input/index.scss +122 -20
- package/dist/packages/inputnumber/index.scss +25 -2
- package/dist/packages/layout/index.scss +0 -0
- package/dist/packages/list/index.scss +24 -0
- package/dist/packages/locale/index.d.ts +8 -0
- package/dist/packages/locale/index.scss +1 -0
- package/dist/packages/locale/lang/baseLang.d.ts +88 -0
- package/dist/packages/locale/lang/baseLang.js +8 -0
- package/dist/packages/locale/lang/en-US.d.ts +104 -0
- package/dist/packages/locale/lang/en-US.js +112 -0
- package/dist/packages/locale/lang/id-ID.d.ts +104 -0
- package/dist/packages/locale/lang/id-ID.js +112 -0
- package/dist/packages/locale/lang/index.js +48 -0
- package/dist/packages/locale/lang/index.scss +1 -0
- package/dist/packages/locale/lang/zh-CN.d.ts +104 -0
- package/dist/packages/locale/lang/zh-CN.js +112 -0
- package/dist/packages/locale/lang/zh-TW.d.ts +104 -0
- package/dist/packages/locale/lang/zh-TW.js +112 -0
- package/dist/packages/menu/index.scss +56 -5
- package/dist/packages/menuitem/index.scss +40 -99
- package/dist/packages/navbar/index.scss +54 -42
- package/dist/packages/noticebar/index.scss +114 -0
- package/dist/packages/notify/index.scss +12 -0
- package/dist/packages/numberkeyboard/index.scss +109 -0
- package/dist/packages/oldpicker/index.scss +131 -0
- package/dist/packages/overlay/index.scss +5 -1
- package/dist/packages/pagination/index.scss +69 -0
- package/dist/packages/picker/index.scss +118 -37
- package/dist/packages/popover/index.scss +454 -0
- package/dist/packages/popup/index.scss +7 -0
- package/dist/packages/price/index.scss +40 -3
- package/dist/packages/progress/index.scss +104 -0
- package/dist/packages/radio/index.scss +64 -5
- package/dist/packages/radiogroup/index.scss +20 -0
- package/dist/packages/range/index.scss +136 -10
- package/dist/packages/rate/index.scss +2 -1
- package/dist/packages/row/index.scss +3 -0
- package/dist/packages/searchbar/index.scss +123 -0
- package/dist/packages/shortpassword/index.scss +52 -13
- package/dist/packages/sidenavbar/index.scss +14 -0
- package/dist/packages/sidenavbaritem/index.scss +10 -0
- package/dist/packages/signature/index.scss +14 -0
- package/dist/packages/skeleton/index.scss +57 -0
- package/dist/packages/sku/index.scss +147 -0
- package/dist/packages/step/index.scss +29 -29
- package/dist/packages/sticky/index.scss +5 -0
- package/dist/packages/subsidenavbar/index.scss +41 -0
- package/dist/packages/swipe/index.scss +22 -0
- package/dist/packages/swiper/index.scss +4 -4
- package/dist/packages/switch/index.scss +10 -9
- package/dist/packages/tabbar/index.scss +15 -3
- package/dist/packages/tabbaritem/index.scss +26 -3
- package/dist/packages/table/index.scss +114 -0
- package/dist/packages/tabpane/index.scss +20 -0
- package/dist/packages/tabs/index.scss +191 -0
- package/dist/packages/tag/index.scss +48 -0
- package/dist/packages/textarea/index.scss +10 -1
- package/dist/packages/timedetail/index.scss +54 -0
- package/dist/packages/timepannel/index.scss +26 -0
- package/dist/packages/timeselect/index.scss +56 -0
- package/dist/packages/toast/index.scss +13 -6
- package/dist/packages/uploader/index.scss +109 -13
- package/dist/packages/watermark/index.scss +13 -0
- package/dist/smartips/attributes.json +2894 -0
- package/dist/smartips/tags.json +1064 -0
- package/dist/smartips/web-types.json +7123 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +2 -0
- package/dist/styles/animation/icon.scss +245 -0
- package/dist/styles/animation/index.scss +1 -0
- package/dist/styles/font/config.json +169 -0
- package/dist/styles/font/demo_index.html +210 -3
- package/dist/styles/font/iconfont.css +39 -3
- package/dist/styles/font/iconfont.js +32 -32
- package/dist/styles/font/iconfont.json +63 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +88 -35
- package/dist/styles/themes/jdb.scss +102 -0
- package/dist/styles/themes/jdt.scss +102 -0
- package/dist/styles/variables-jdb.scss +875 -0
- package/dist/styles/variables-jdt.scss +781 -0
- package/dist/styles/variables.scss +700 -164
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +235 -0
- package/dist/types/__VUE/address/index.vue.d.ts +326 -0
- package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +34 -0
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +40 -0
- package/dist/types/__VUE/addresslist/components/LongPressShell.vue.d.ts +46 -0
- package/dist/types/__VUE/addresslist/components/SwipeShell.vue.d.ts +36 -0
- package/dist/types/__VUE/addresslist/index.vue.d.ts +72 -0
- package/dist/types/__VUE/animate/index.vue.d.ts +48 -0
- package/dist/types/__VUE/animate/type.d.ts +6 -0
- package/dist/types/__VUE/audio/index.vue.d.ts +102 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +88 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +97 -0
- package/dist/types/__VUE/avatargroup/index.vue.d.ts +78 -0
- package/dist/types/__VUE/backtop/index.vue.d.ts +89 -0
- package/dist/types/__VUE/badge/index.vue.d.ts +81 -0
- package/dist/types/__VUE/barrage/index.vue.d.ts +69 -0
- package/dist/types/__VUE/button/index.vue.d.ts +99 -0
- package/dist/types/__VUE/button/type.d.ts +7 -0
- package/dist/types/__VUE/calendar/index.vue.d.ts +130 -0
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +178 -0
- package/dist/types/__VUE/card/index.vue.d.ts +75 -0
- package/dist/types/__VUE/cascader/cascader-item.vue.d.ts +75 -0
- package/dist/types/__VUE/cascader/helper.d.ts +8 -0
- package/dist/types/__VUE/cascader/index.vue.d.ts +204 -0
- package/dist/types/__VUE/cascader/tree.d.ts +16 -0
- package/dist/types/__VUE/cascader/types.d.ts +30 -0
- package/dist/types/__VUE/category/index.vue.d.ts +35 -0
- package/dist/types/__VUE/categorypane/index.vue.d.ts +40 -0
- package/dist/types/__VUE/cell/index.vue.d.ts +108 -0
- package/dist/types/__VUE/cellgroup/index.vue.d.ts +35 -0
- package/dist/types/__VUE/checkbox/common.d.ts +59 -0
- package/dist/types/__VUE/checkbox/index.vue.d.ts +98 -0
- package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +43 -0
- package/dist/types/__VUE/circleprogress/index.vue.d.ts +81 -0
- package/dist/types/__VUE/col/index.vue.d.ts +42 -0
- package/dist/types/__VUE/collapse/index.vue.d.ts +90 -0
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +75 -0
- package/dist/types/__VUE/comment/components/CmtBottom.vue.d.ts +47 -0
- package/dist/types/__VUE/comment/components/CmtHeader.vue.d.ts +42 -0
- package/dist/types/__VUE/comment/components/CmtImages.vue.d.ts +46 -0
- package/dist/types/__VUE/comment/index.vue.d.ts +93 -0
- package/dist/types/__VUE/configprovider/common.d.ts +20 -0
- package/dist/types/__VUE/configprovider/index.vue.d.ts +33 -0
- package/dist/types/__VUE/countdown/index.vue.d.ts +91 -0
- package/dist/types/__VUE/countdown/util.d.ts +6 -0
- package/dist/types/__VUE/countup/index.vue.d.ts +183 -0
- package/dist/types/__VUE/datepicker/index.vue.d.ts +309 -0
- package/dist/types/__VUE/datepicker/type.d.ts +6 -0
- package/dist/types/__VUE/datepicker/utils.d.ts +5 -0
- package/dist/types/__VUE/dialog/index.d.ts +48 -0
- package/dist/types/__VUE/dialog/index.vue.d.ts +263 -0
- package/dist/types/__VUE/divider/index.vue.d.ts +47 -0
- package/dist/types/__VUE/drag/index.vue.d.ts +51 -0
- package/dist/types/__VUE/ecard/index.vue.d.ts +105 -0
- package/dist/types/__VUE/elevator/index.vue.d.ts +96 -0
- package/dist/types/__VUE/ellipsis/index.vue.d.ts +72 -0
- package/dist/types/__VUE/empty/index.vue.d.ts +42 -0
- package/dist/types/__VUE/fixednav/index.vue.d.ts +80 -0
- package/dist/types/__VUE/form/common.d.ts +20 -0
- package/dist/types/__VUE/form/index.vue.d.ts +31 -0
- package/dist/types/__VUE/form/types.d.ts +13 -0
- package/dist/types/__VUE/formitem/index.vue.d.ts +94 -0
- package/dist/types/__VUE/formitem/types.d.ts +10 -0
- package/dist/types/__VUE/grid/common.d.ts +91 -0
- package/dist/types/__VUE/grid/index.vue.d.ts +84 -0
- package/dist/types/__VUE/griditem/index.vue.d.ts +73 -0
- package/dist/types/__VUE/icon/index.vue.d.ts +63 -0
- package/dist/types/__VUE/image/index.vue.d.ts +105 -0
- package/dist/types/__VUE/image/type.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +95 -0
- package/dist/types/__VUE/imagepreview/index.d.ts +24 -0
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +140 -0
- package/dist/types/__VUE/indicator/index.vue.d.ts +59 -0
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +123 -0
- package/dist/types/__VUE/input/index.vue.d.ts +274 -0
- package/dist/types/__VUE/input/type.d.ts +13 -0
- package/dist/types/__VUE/input/util.d.ts +5 -0
- package/dist/types/__VUE/inputnumber/index.vue.d.ts +100 -0
- package/dist/types/__VUE/layout/index.vue.d.ts +13 -0
- package/dist/types/__VUE/list/index.vue.d.ts +52 -0
- package/dist/types/__VUE/menu/index.vue.d.ts +80 -0
- package/dist/types/__VUE/menuitem/index.vue.d.ts +82 -0
- package/dist/types/__VUE/menuitem/type.d.ts +8 -0
- package/dist/types/__VUE/navbar/index.vue.d.ts +105 -0
- package/dist/types/__VUE/noticebar/index.vue.d.ts +180 -0
- package/dist/types/__VUE/notify/index.d.ts +16 -0
- package/dist/types/__VUE/notify/index.vue.d.ts +101 -0
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +122 -0
- package/dist/types/__VUE/oldpicker/Column.vue.d.ts +91 -0
- package/dist/types/__VUE/oldpicker/commonProps.d.ts +22 -0
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +316 -0
- package/dist/types/__VUE/oldpicker/types.d.ts +24 -0
- package/dist/types/__VUE/overlay/index.vue.d.ts +1603 -0
- package/dist/types/__VUE/pagination/index.vue.d.ts +95 -0
- package/dist/types/__VUE/picker/Column.vue.d.ts +96 -0
- package/dist/types/__VUE/picker/index.vue.d.ts +317 -0
- package/dist/types/__VUE/picker/types.d.ts +26 -0
- package/dist/types/__VUE/popover/index.vue.d.ts +218 -0
- package/dist/types/__VUE/popover/type.d.ts +6 -0
- package/dist/types/__VUE/popup/index.vue.d.ts +1708 -0
- package/dist/types/__VUE/popup/use-lock-scroll.d.ts +5 -0
- package/dist/types/__VUE/price/index.vue.d.ts +74 -0
- package/dist/types/__VUE/progress/index.vue.d.ts +114 -0
- package/dist/types/__VUE/pullrefresh/index.vue.d.ts +100 -0
- package/dist/types/__VUE/pullrefresh/use-touch.d.ts +20 -0
- package/dist/types/__VUE/pullrefresh/util.d.ts +6 -0
- package/dist/types/__VUE/radio/index.vue.d.ts +75 -0
- package/dist/types/__VUE/radiogroup/index.vue.d.ts +43 -0
- package/dist/types/__VUE/range/index.vue.d.ts +144 -0
- package/dist/types/__VUE/range/type.d.ts +5 -0
- package/dist/types/__VUE/rate/common.d.ts +149 -0
- package/dist/types/__VUE/rate/index.vue.d.ts +127 -0
- package/dist/types/__VUE/row/index.vue.d.ts +57 -0
- package/dist/types/__VUE/searchbar/index.vue.d.ts +130 -0
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +118 -0
- package/dist/types/__VUE/sidenavbar/index.vue.d.ts +35 -0
- package/dist/types/__VUE/sidenavbaritem/index.vue.d.ts +38 -0
- package/dist/types/__VUE/signature/index.vue.d.ts +65 -0
- package/dist/types/__VUE/skeleton/common.d.ts +61 -0
- package/dist/types/__VUE/skeleton/index.vue.d.ts +98 -0
- package/dist/types/__VUE/sku/components/SkuHeader.vue.d.ts +27 -0
- package/dist/types/__VUE/sku/components/SkuOperate.vue.d.ts +61 -0
- package/dist/types/__VUE/sku/components/SkuSelect.vue.d.ts +29 -0
- package/dist/types/__VUE/sku/components/SkuStepper.vue.d.ts +60 -0
- package/dist/types/__VUE/sku/index.vue.d.ts +252 -0
- package/dist/types/__VUE/step/index.vue.d.ts +61 -0
- package/dist/types/__VUE/steps/index.vue.d.ts +42 -0
- package/dist/types/__VUE/sticky/index.vue.d.ts +56 -0
- package/dist/types/__VUE/subsidenavbar/index.vue.d.ts +49 -0
- package/dist/types/__VUE/swipe/index.vue.d.ts +62 -0
- package/dist/types/__VUE/swiper/index.vue.d.ts +150 -0
- package/dist/types/__VUE/swiper/use-touch.d.ts +20 -0
- package/dist/types/__VUE/swiperitem/index.vue.d.ts +18 -0
- package/dist/types/__VUE/switch/index.vue.d.ts +113 -0
- package/dist/types/__VUE/tabbar/index.vue.d.ts +71 -0
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +99 -0
- package/dist/types/__VUE/table/common.d.ts +56 -0
- package/dist/types/__VUE/table/index.vue.d.ts +67 -0
- package/dist/types/__VUE/table/renderColumn.d.ts +15 -0
- package/dist/types/__VUE/table/types.d.ts +19 -0
- package/dist/types/__VUE/tabpane/index.vue.d.ts +43 -0
- package/dist/types/__VUE/tabs/common.d.ts +82 -0
- package/dist/types/__VUE/tabs/index.vue.d.ts +114 -0
- package/dist/types/__VUE/tag/index.vue.d.ts +76 -0
- package/dist/types/__VUE/tag/type.d.ts +5 -0
- package/dist/types/__VUE/textarea/index.vue.d.ts +102 -0
- package/dist/types/__VUE/timedetail/index.vue.d.ts +45 -0
- package/dist/types/__VUE/timepannel/index.vue.d.ts +40 -0
- package/dist/types/__VUE/timeselect/index.vue.d.ts +80 -0
- package/dist/types/__VUE/toast/index.d.ts +16 -0
- package/dist/types/__VUE/toast/index.vue.d.ts +134 -0
- package/dist/types/__VUE/uploader/index.vue.d.ts +211 -0
- package/dist/types/__VUE/uploader/type.d.ts +18 -0
- package/dist/types/__VUE/uploader/uploader.d.ts +27 -0
- package/dist/types/__VUE/video/index.vue.d.ts +106 -0
- package/dist/types/__VUE/watermark/index.vue.d.ts +143 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/nutui.d.ts +104 -0
- package/package.json +56 -28
- package/dist/index.d.ts +0 -3
- package/dist/nutui.d.ts +0 -50
- package/dist/packages/tab/index.scss +0 -102
- package/dist/styles/font/config.js +0 -111
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.23.beta-4 Mon Jul 25 2022 22:38:45 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { ref, reactive, computed, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { r as requestAniFrame } from "./raf.js";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
|
+
import "../locale/lang";
|
|
11
|
+
const { componentName, create } = createComponent("drag");
|
|
12
|
+
const _sfc_main = create({
|
|
13
|
+
props: {
|
|
14
|
+
attract: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
direction: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "all"
|
|
21
|
+
},
|
|
22
|
+
boundary: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => {
|
|
25
|
+
return {
|
|
26
|
+
top: 0,
|
|
27
|
+
left: 0,
|
|
28
|
+
right: 0,
|
|
29
|
+
bottom: 0
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
setup(props, { emit }) {
|
|
35
|
+
const myDrag = ref();
|
|
36
|
+
const state = reactive({
|
|
37
|
+
keepAlive: false,
|
|
38
|
+
elWidth: 0,
|
|
39
|
+
elHeight: 0,
|
|
40
|
+
screenWidth: 0,
|
|
41
|
+
screenHeight: 0,
|
|
42
|
+
startTop: 0,
|
|
43
|
+
startLeft: 0,
|
|
44
|
+
nx: 0,
|
|
45
|
+
ny: 0,
|
|
46
|
+
xPum: 0,
|
|
47
|
+
yPum: 0,
|
|
48
|
+
position: { x: 0, y: 0 },
|
|
49
|
+
boundary: {
|
|
50
|
+
top: 0,
|
|
51
|
+
left: 0,
|
|
52
|
+
right: 0,
|
|
53
|
+
bottom: 0
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const classes = computed(() => {
|
|
57
|
+
const prefixCls = componentName;
|
|
58
|
+
return {
|
|
59
|
+
[prefixCls]: true
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
function getInfo() {
|
|
63
|
+
const domElem = document.documentElement;
|
|
64
|
+
state.elWidth = myDrag.value.offsetWidth;
|
|
65
|
+
state.elHeight = myDrag.value.offsetHeight;
|
|
66
|
+
state.screenWidth = domElem.clientWidth || 375;
|
|
67
|
+
state.screenHeight = domElem.clientHeight || 667;
|
|
68
|
+
}
|
|
69
|
+
function goLeft(target) {
|
|
70
|
+
if (state.boundary.left) {
|
|
71
|
+
if (+target.style.left.split("px")[0] > state.boundary.left) {
|
|
72
|
+
target.style.left = +target.style.left.split("px")[0] - 10 + "px";
|
|
73
|
+
requestAniFrame(() => {
|
|
74
|
+
goLeft(target);
|
|
75
|
+
});
|
|
76
|
+
} else {
|
|
77
|
+
target.style.left = `${state.boundary.left}px`;
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
if (+target.style.left.split("px")[0] > 10) {
|
|
81
|
+
target.style.left = +target.style.left.split("px")[0] - 10 + "px";
|
|
82
|
+
requestAniFrame(() => {
|
|
83
|
+
goLeft(target);
|
|
84
|
+
});
|
|
85
|
+
} else {
|
|
86
|
+
target.style.left = "0px";
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function goRight(target, rightLocation) {
|
|
91
|
+
if (rightLocation - parseInt(target.style.left.split("px")[0]) > 10) {
|
|
92
|
+
target.style.left = parseInt(target.style.left.split("px")[0]) + 10 + "px";
|
|
93
|
+
requestAniFrame(() => {
|
|
94
|
+
goRight(target, rightLocation);
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
target.style.left = rightLocation + "px";
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function touchMove(e) {
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
const target = e.currentTarget;
|
|
103
|
+
if (e.targetTouches.length === 1) {
|
|
104
|
+
const touch = e.targetTouches[0];
|
|
105
|
+
state.nx = touch.clientX - state.position.x;
|
|
106
|
+
state.ny = touch.clientY - state.position.y;
|
|
107
|
+
state.xPum = state.startLeft + state.nx;
|
|
108
|
+
state.yPum = state.startTop + state.ny;
|
|
109
|
+
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
110
|
+
if (Math.abs(state.xPum) > rightLocation) {
|
|
111
|
+
state.xPum = rightLocation;
|
|
112
|
+
} else if (state.xPum <= state.boundary.left) {
|
|
113
|
+
state.xPum = state.boundary.left;
|
|
114
|
+
}
|
|
115
|
+
if (state.yPum < state.boundary.top) {
|
|
116
|
+
state.yPum = state.boundary.top;
|
|
117
|
+
} else if (state.yPum > state.screenHeight - state.elHeight - state.boundary.bottom) {
|
|
118
|
+
state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom;
|
|
119
|
+
}
|
|
120
|
+
if (props.direction != "y") {
|
|
121
|
+
target.style.left = state.xPum + "px";
|
|
122
|
+
}
|
|
123
|
+
if (props.direction != "x") {
|
|
124
|
+
target.style.top = state.yPum + "px";
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function touchEnd(e) {
|
|
129
|
+
const target = e.currentTarget;
|
|
130
|
+
const touch = e.changedTouches[0];
|
|
131
|
+
let currX = touch.clientX;
|
|
132
|
+
const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
|
|
133
|
+
if (currX > rightLocation) {
|
|
134
|
+
currX = rightLocation;
|
|
135
|
+
} else if (currX < state.boundary.left) {
|
|
136
|
+
currX = state.boundary.left;
|
|
137
|
+
} else {
|
|
138
|
+
currX = currX < state.screenWidth / 2 ? state.boundary.left : rightLocation;
|
|
139
|
+
}
|
|
140
|
+
if (props.direction != "y" && props.attract) {
|
|
141
|
+
if (currX < state.screenWidth / 2) {
|
|
142
|
+
requestAniFrame(() => {
|
|
143
|
+
goLeft(target);
|
|
144
|
+
});
|
|
145
|
+
} else {
|
|
146
|
+
requestAniFrame(() => {
|
|
147
|
+
goRight(target, rightLocation);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (props.direction != "x") {
|
|
152
|
+
target.style.top = state.yPum + "px";
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function touchStart(e) {
|
|
156
|
+
const target = e.currentTarget;
|
|
157
|
+
const touches = e.touches[0];
|
|
158
|
+
const touch = e.targetTouches[0];
|
|
159
|
+
state.startTop = target.offsetTop;
|
|
160
|
+
state.startLeft = target.offsetLeft;
|
|
161
|
+
state.position.x = touches.clientX;
|
|
162
|
+
state.position.y = touches.clientY;
|
|
163
|
+
state.nx = touch.clientX - state.position.x;
|
|
164
|
+
state.ny = touch.clientY - state.position.y;
|
|
165
|
+
state.xPum = state.startLeft + state.nx;
|
|
166
|
+
state.yPum = state.startTop + state.ny;
|
|
167
|
+
}
|
|
168
|
+
onMounted(() => {
|
|
169
|
+
getInfo();
|
|
170
|
+
state.boundary = props.boundary;
|
|
171
|
+
});
|
|
172
|
+
onActivated(() => {
|
|
173
|
+
if (state.keepAlive) {
|
|
174
|
+
state.keepAlive = false;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
onDeactivated(() => {
|
|
178
|
+
state.keepAlive = true;
|
|
179
|
+
myDrag.removeEventListener("touchstart", touchStart);
|
|
180
|
+
myDrag.removeEventListener("touchmove", touchMove);
|
|
181
|
+
myDrag.removeEventListener("touchend", touchEnd);
|
|
182
|
+
});
|
|
183
|
+
return {
|
|
184
|
+
classes,
|
|
185
|
+
myDrag,
|
|
186
|
+
touchStart,
|
|
187
|
+
touchMove,
|
|
188
|
+
touchEnd
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
193
|
+
return openBlock(), createElementBlock("view", {
|
|
194
|
+
class: normalizeClass(_ctx.classes),
|
|
195
|
+
ref: "myDrag",
|
|
196
|
+
onTouchstart: _cache[0] || (_cache[0] = ($event) => _ctx.touchStart($event)),
|
|
197
|
+
onTouchmove: _cache[1] || (_cache[1] = ($event) => _ctx.touchMove($event)),
|
|
198
|
+
onTouchend: _cache[2] || (_cache[2] = ($event) => _ctx.touchEnd($event))
|
|
199
|
+
}, [
|
|
200
|
+
renderSlot(_ctx.$slots, "default")
|
|
201
|
+
], 34);
|
|
202
|
+
}
|
|
203
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
204
|
+
export { index as default };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.23.beta-4 Mon Jul 25 2022 22:38:45 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, withDirectives, vModelText, createTextVNode, createVNode } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
+
import "../locale/lang";
|
|
10
|
+
const { componentName, create, translate } = createComponent("ecard");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
chooseText: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
otherValueText: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
dataList: {
|
|
22
|
+
type: [Object, Array],
|
|
23
|
+
default: () => {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
cardAmountMin: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 1
|
|
30
|
+
},
|
|
31
|
+
cardAmountMax: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: 9999
|
|
34
|
+
},
|
|
35
|
+
cardBuyMin: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 1
|
|
38
|
+
},
|
|
39
|
+
cardBuyMax: {
|
|
40
|
+
type: Number,
|
|
41
|
+
default: 9999
|
|
42
|
+
},
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: [Number, String],
|
|
45
|
+
default: 0
|
|
46
|
+
},
|
|
47
|
+
placeholder: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: ""
|
|
50
|
+
},
|
|
51
|
+
suffix: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "\xA5"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
emits: ["inputChange", "changeStep", "inputClick", "change", "update:modelValue"],
|
|
57
|
+
setup(props, { emit }) {
|
|
58
|
+
const currentIndex = ref(null);
|
|
59
|
+
const currentValue = ref(null);
|
|
60
|
+
const inputValue = ref("");
|
|
61
|
+
const stepValue = ref(props.cardAmountMin);
|
|
62
|
+
const money = ref(props.modelValue);
|
|
63
|
+
const handleClick = (item, index2) => {
|
|
64
|
+
currentIndex.value = index2;
|
|
65
|
+
stepValue.value = props.cardAmountMin;
|
|
66
|
+
currentValue.value = item.price;
|
|
67
|
+
emit("change", item);
|
|
68
|
+
emit("update:modelValue", item.price);
|
|
69
|
+
};
|
|
70
|
+
const change = (event) => {
|
|
71
|
+
let input = event.target;
|
|
72
|
+
let val = input.value.replace(/[^\d]/g, "");
|
|
73
|
+
inputValue.value = val;
|
|
74
|
+
currentValue.value = val;
|
|
75
|
+
if (Number(val) > props.cardAmountMax) {
|
|
76
|
+
inputValue.value = props.cardAmountMax;
|
|
77
|
+
currentValue.value = props.cardAmountMax;
|
|
78
|
+
}
|
|
79
|
+
if (Number(val) < props.cardAmountMin) {
|
|
80
|
+
inputValue.value = props.cardAmountMin;
|
|
81
|
+
currentValue.value = props.cardAmountMin;
|
|
82
|
+
}
|
|
83
|
+
emit("inputChange", Number(inputValue.value));
|
|
84
|
+
emit("update:modelValue", Number(inputValue.value));
|
|
85
|
+
};
|
|
86
|
+
const inputClick = () => {
|
|
87
|
+
currentIndex.value = "input";
|
|
88
|
+
stepValue.value = props.cardAmountMin;
|
|
89
|
+
currentValue.value = inputValue.value;
|
|
90
|
+
emit("update:modelValue", inputValue.value);
|
|
91
|
+
emit("inputClick");
|
|
92
|
+
};
|
|
93
|
+
const changeStep = (value) => {
|
|
94
|
+
stepValue.value = value;
|
|
95
|
+
emit("changeStep", stepValue.value, currentValue.value);
|
|
96
|
+
};
|
|
97
|
+
watch(() => props.modelValue, (value) => {
|
|
98
|
+
money.value = value;
|
|
99
|
+
});
|
|
100
|
+
return {
|
|
101
|
+
handleClick,
|
|
102
|
+
changeStep,
|
|
103
|
+
change,
|
|
104
|
+
inputClick,
|
|
105
|
+
stepValue,
|
|
106
|
+
currentIndex,
|
|
107
|
+
inputValue,
|
|
108
|
+
money,
|
|
109
|
+
translate
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
const _hoisted_1 = { class: "nut-ecard" };
|
|
114
|
+
const _hoisted_2 = { class: "nut-ecard__title" };
|
|
115
|
+
const _hoisted_3 = { class: "nut-ecard__list" };
|
|
116
|
+
const _hoisted_4 = ["onClick"];
|
|
117
|
+
const _hoisted_5 = { class: "nut-ecard__list__input--con" };
|
|
118
|
+
const _hoisted_6 = ["placeholder"];
|
|
119
|
+
const _hoisted_7 = { class: "nut-ecard__list__step" };
|
|
120
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
121
|
+
const _component_nut_inputnumber = resolveComponent("nut-inputnumber");
|
|
122
|
+
return openBlock(), createElementBlock("view", _hoisted_1, [
|
|
123
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.chooseText || _ctx.translate("chooseText")), 1),
|
|
124
|
+
createElementVNode("view", _hoisted_3, [
|
|
125
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dataList, (item, index2) => {
|
|
126
|
+
return openBlock(), createElementBlock("view", {
|
|
127
|
+
key: index2,
|
|
128
|
+
class: normalizeClass(["nut-ecard__list__item", _ctx.currentIndex == index2 ? "active" : ""]),
|
|
129
|
+
onClick: ($event) => _ctx.handleClick(item, index2)
|
|
130
|
+
}, toDisplayString(item.price), 11, _hoisted_4);
|
|
131
|
+
}), 128)),
|
|
132
|
+
createElementVNode("view", {
|
|
133
|
+
class: normalizeClass(["nut-ecard__list__input", _ctx.currentIndex == "input" ? "active" : ""]),
|
|
134
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.inputClick && _ctx.inputClick(...args))
|
|
135
|
+
}, [
|
|
136
|
+
createElementVNode("view", null, toDisplayString(_ctx.otherValueText || _ctx.translate("otherValueText")), 1),
|
|
137
|
+
createElementVNode("view", _hoisted_5, [
|
|
138
|
+
withDirectives(createElementVNode("input", {
|
|
139
|
+
class: "nut-ecard__list__input--input",
|
|
140
|
+
type: "text",
|
|
141
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.inputValue = $event),
|
|
142
|
+
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
143
|
+
placeholder: _ctx.placeholder || _ctx.translate("placeholder")
|
|
144
|
+
}, null, 40, _hoisted_6), [
|
|
145
|
+
[vModelText, _ctx.inputValue]
|
|
146
|
+
]),
|
|
147
|
+
createTextVNode(" " + toDisplayString(_ctx.suffix), 1)
|
|
148
|
+
])
|
|
149
|
+
], 2),
|
|
150
|
+
createElementVNode("view", _hoisted_7, [
|
|
151
|
+
createElementVNode("view", null, toDisplayString(_ctx.suffix) + toDisplayString(_ctx.money), 1),
|
|
152
|
+
createVNode(_component_nut_inputnumber, {
|
|
153
|
+
modelValue: _ctx.stepValue,
|
|
154
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.stepValue = $event),
|
|
155
|
+
min: _ctx.cardBuyMin,
|
|
156
|
+
max: _ctx.cardBuyMax,
|
|
157
|
+
onChange: _ctx.changeStep
|
|
158
|
+
}, null, 8, ["modelValue", "min", "max", "onChange"])
|
|
159
|
+
])
|
|
160
|
+
])
|
|
161
|
+
]);
|
|
162
|
+
}
|
|
163
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
164
|
+
export { index as default };
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.23.beta-4 Mon Jul 25 2022 22:38:45 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { ref, reactive, computed, onMounted, watch, nextTick, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, toDisplayString, renderSlot, withDirectives, vShow, createCommentVNode, withModifiers } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { u as useExpose } from "./index3.js";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
|
+
import "../locale/lang";
|
|
11
|
+
const { componentName, create } = createComponent("elevator");
|
|
12
|
+
const _sfc_main = create({
|
|
13
|
+
props: {
|
|
14
|
+
height: {
|
|
15
|
+
type: [Number, String],
|
|
16
|
+
default: "200px"
|
|
17
|
+
},
|
|
18
|
+
acceptKey: {
|
|
19
|
+
type: [String],
|
|
20
|
+
default: "title"
|
|
21
|
+
},
|
|
22
|
+
indexList: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
isSticky: {
|
|
29
|
+
type: [Boolean],
|
|
30
|
+
default: false
|
|
31
|
+
},
|
|
32
|
+
spaceHeight: {
|
|
33
|
+
type: [Number],
|
|
34
|
+
default: 23
|
|
35
|
+
},
|
|
36
|
+
titleHeight: {
|
|
37
|
+
type: [Number],
|
|
38
|
+
default: 35
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
emits: ["click-item", "click-index"],
|
|
42
|
+
setup(props, context) {
|
|
43
|
+
const listview = ref(null);
|
|
44
|
+
const state = reactive({
|
|
45
|
+
anchorIndex: 0,
|
|
46
|
+
codeIndex: 0,
|
|
47
|
+
listHeight: [],
|
|
48
|
+
listGroup: [],
|
|
49
|
+
touchState: {
|
|
50
|
+
y1: 0,
|
|
51
|
+
y2: 0
|
|
52
|
+
},
|
|
53
|
+
scrollStart: false,
|
|
54
|
+
currentIndex: 0,
|
|
55
|
+
currentData: {},
|
|
56
|
+
currentKey: "",
|
|
57
|
+
scrollY: 0,
|
|
58
|
+
diff: -1,
|
|
59
|
+
fixedTop: 0
|
|
60
|
+
});
|
|
61
|
+
const classes = computed(() => {
|
|
62
|
+
const prefixCls = componentName;
|
|
63
|
+
return {
|
|
64
|
+
[prefixCls]: true
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
const fixedStyle = computed(() => {
|
|
68
|
+
return {
|
|
69
|
+
transform: `translate3d(0, ${state.scrollY + state.fixedTop}px, 0)`
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
const clientHeight = computed(() => {
|
|
73
|
+
return listview.value.clientHeight;
|
|
74
|
+
});
|
|
75
|
+
const getData = (el, name) => {
|
|
76
|
+
const prefix = "data-";
|
|
77
|
+
return el.getAttribute(prefix + name);
|
|
78
|
+
};
|
|
79
|
+
const setListGroup = (el) => {
|
|
80
|
+
nextTick(() => {
|
|
81
|
+
if (!state.listGroup.includes(el) && el != null) {
|
|
82
|
+
state.listGroup.push(el);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const calculateHeight = () => {
|
|
87
|
+
let height = 0;
|
|
88
|
+
state.listHeight.push(height);
|
|
89
|
+
for (let i = 0; i < state.listGroup.length; i++) {
|
|
90
|
+
let item = state.listGroup[i];
|
|
91
|
+
height += item.clientHeight;
|
|
92
|
+
state.listHeight.push(height);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const scrollTo = (index2) => {
|
|
96
|
+
if (!index2 && index2 !== 0) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (index2 < 0)
|
|
100
|
+
index2 = 0;
|
|
101
|
+
if (index2 > state.listHeight.length - 2)
|
|
102
|
+
index2 = state.listHeight.length - 2;
|
|
103
|
+
state.codeIndex = index2;
|
|
104
|
+
listview.value.scrollTo(0, state.listHeight[index2]);
|
|
105
|
+
};
|
|
106
|
+
const touchStart = (e) => {
|
|
107
|
+
state.scrollStart = true;
|
|
108
|
+
let index2 = getData(e.target, "index");
|
|
109
|
+
let firstTouch = e.touches[0];
|
|
110
|
+
state.touchState.y1 = firstTouch.pageY;
|
|
111
|
+
state.anchorIndex = +index2;
|
|
112
|
+
state.codeIndex = +index2;
|
|
113
|
+
scrollTo(+index2);
|
|
114
|
+
};
|
|
115
|
+
const touchMove = (e) => {
|
|
116
|
+
let firstTouch = e.touches[0];
|
|
117
|
+
state.touchState.y2 = firstTouch.pageY;
|
|
118
|
+
let delta = (state.touchState.y2 - state.touchState.y1) / props.spaceHeight | 0;
|
|
119
|
+
state.codeIndex = state.anchorIndex + delta;
|
|
120
|
+
scrollTo(state.codeIndex);
|
|
121
|
+
};
|
|
122
|
+
const touchEnd = () => {
|
|
123
|
+
state.scrollStart = false;
|
|
124
|
+
};
|
|
125
|
+
const handleClickItem = (key, item) => {
|
|
126
|
+
context.emit("click-item", key, item);
|
|
127
|
+
state.currentData = item;
|
|
128
|
+
state.currentKey = key;
|
|
129
|
+
};
|
|
130
|
+
const handleClickIndex = (key) => {
|
|
131
|
+
context.emit("click-index", key);
|
|
132
|
+
};
|
|
133
|
+
const listViewScroll = (e) => {
|
|
134
|
+
let target = e.target;
|
|
135
|
+
let scrollTop = target.scrollTop;
|
|
136
|
+
const listHeight = state.listHeight;
|
|
137
|
+
state.scrollY = scrollTop;
|
|
138
|
+
for (let i = 0; i < listHeight.length - 1; i++) {
|
|
139
|
+
let height1 = listHeight[i];
|
|
140
|
+
let height2 = listHeight[i + 1];
|
|
141
|
+
if (state.scrollY >= height1 && state.scrollY < height2) {
|
|
142
|
+
state.currentIndex = i;
|
|
143
|
+
state.diff = height2 - state.scrollY;
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
state.currentIndex = listHeight.length - 2;
|
|
148
|
+
};
|
|
149
|
+
onMounted(() => {
|
|
150
|
+
listview.value.addEventListener("scroll", listViewScroll);
|
|
151
|
+
});
|
|
152
|
+
useExpose({
|
|
153
|
+
scrollTo
|
|
154
|
+
});
|
|
155
|
+
watch(() => state.listGroup.length, () => {
|
|
156
|
+
state.listHeight = [];
|
|
157
|
+
nextTick(calculateHeight);
|
|
158
|
+
});
|
|
159
|
+
watch(() => state.diff, (newVal) => {
|
|
160
|
+
const listHeight = state.listHeight;
|
|
161
|
+
let fixedTop = newVal > 0 && newVal < props.titleHeight ? newVal - props.titleHeight : 0;
|
|
162
|
+
if (state.scrollY + clientHeight.value === listHeight[listHeight.length - 1]) {
|
|
163
|
+
if (fixedTop !== 0)
|
|
164
|
+
fixedTop = 0;
|
|
165
|
+
}
|
|
166
|
+
if (state.fixedTop === fixedTop)
|
|
167
|
+
return;
|
|
168
|
+
state.fixedTop = fixedTop;
|
|
169
|
+
});
|
|
170
|
+
return {
|
|
171
|
+
classes,
|
|
172
|
+
...toRefs(state),
|
|
173
|
+
fixedStyle,
|
|
174
|
+
clientHeight,
|
|
175
|
+
setListGroup,
|
|
176
|
+
listview,
|
|
177
|
+
touchStart,
|
|
178
|
+
touchMove,
|
|
179
|
+
touchEnd,
|
|
180
|
+
handleClickItem,
|
|
181
|
+
handleClickIndex
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
const _hoisted_1 = { class: "nut-elevator__list__item__code" };
|
|
186
|
+
const _hoisted_2 = ["onClick"];
|
|
187
|
+
const _hoisted_3 = ["innerHTML"];
|
|
188
|
+
const _hoisted_4 = { class: "fixed-title" };
|
|
189
|
+
const _hoisted_5 = { class: "nut-elevator__bars__inner" };
|
|
190
|
+
const _hoisted_6 = ["data-index", "onClick"];
|
|
191
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
192
|
+
return openBlock(), createElementBlock("view", {
|
|
193
|
+
class: normalizeClass(_ctx.classes)
|
|
194
|
+
}, [
|
|
195
|
+
createElementVNode("view", {
|
|
196
|
+
class: "nut-elevator__list",
|
|
197
|
+
ref: "listview",
|
|
198
|
+
style: normalizeStyle({ height: isNaN(+_ctx.height) ? _ctx.height : `${_ctx.height}px` })
|
|
199
|
+
}, [
|
|
200
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item) => {
|
|
201
|
+
return openBlock(), createElementBlock("view", {
|
|
202
|
+
class: "nut-elevator__list__item",
|
|
203
|
+
key: item[_ctx.acceptKey],
|
|
204
|
+
ref: _ctx.setListGroup
|
|
205
|
+
}, [
|
|
206
|
+
createElementVNode("view", _hoisted_1, toDisplayString(item[_ctx.acceptKey]), 1),
|
|
207
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (subitem) => {
|
|
208
|
+
return openBlock(), createElementBlock("view", {
|
|
209
|
+
class: normalizeClass(["nut-elevator__list__item__name", {
|
|
210
|
+
"nut-elevator__list__item__name--highcolor": _ctx.currentData.id === subitem.id && _ctx.currentKey === item[_ctx.acceptKey]
|
|
211
|
+
}]),
|
|
212
|
+
key: subitem["id"],
|
|
213
|
+
onClick: ($event) => _ctx.handleClickItem(item[_ctx.acceptKey], subitem)
|
|
214
|
+
}, [
|
|
215
|
+
!_ctx.$slots.default ? (openBlock(), createElementBlock("span", {
|
|
216
|
+
key: 0,
|
|
217
|
+
innerHTML: subitem.name
|
|
218
|
+
}, null, 8, _hoisted_3)) : renderSlot(_ctx.$slots, "default", {
|
|
219
|
+
key: 1,
|
|
220
|
+
item: subitem
|
|
221
|
+
})
|
|
222
|
+
], 10, _hoisted_2);
|
|
223
|
+
}), 128))
|
|
224
|
+
], 512);
|
|
225
|
+
}), 128)),
|
|
226
|
+
_ctx.isSticky ? withDirectives((openBlock(), createElementBlock("view", {
|
|
227
|
+
key: 0,
|
|
228
|
+
class: "nut-elevator__list__fixed",
|
|
229
|
+
style: normalizeStyle(_ctx.fixedStyle)
|
|
230
|
+
}, [
|
|
231
|
+
createElementVNode("span", _hoisted_4, toDisplayString(_ctx.indexList[_ctx.currentIndex][_ctx.acceptKey]), 1)
|
|
232
|
+
], 4)), [
|
|
233
|
+
[vShow, _ctx.scrollY > 0]
|
|
234
|
+
]) : createCommentVNode("", true)
|
|
235
|
+
], 4),
|
|
236
|
+
_ctx.indexList.length ? withDirectives((openBlock(), createElementBlock("view", {
|
|
237
|
+
key: 0,
|
|
238
|
+
class: "nut-elevator__code--current"
|
|
239
|
+
}, toDisplayString(_ctx.indexList[_ctx.codeIndex][_ctx.acceptKey]), 513)), [
|
|
240
|
+
[vShow, _ctx.scrollStart]
|
|
241
|
+
]) : createCommentVNode("", true),
|
|
242
|
+
createElementVNode("view", {
|
|
243
|
+
class: "nut-elevator__bars",
|
|
244
|
+
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
|
|
245
|
+
onTouchmove: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.touchMove && _ctx.touchMove(...args), ["stop", "prevent"])),
|
|
246
|
+
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
247
|
+
}, [
|
|
248
|
+
createElementVNode("view", _hoisted_5, [
|
|
249
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.indexList, (item, index2) => {
|
|
250
|
+
return openBlock(), createElementBlock("view", {
|
|
251
|
+
class: normalizeClass(["nut-elevator__bars__inner__item", { active: item[_ctx.acceptKey] === _ctx.indexList[_ctx.currentIndex][_ctx.acceptKey] }]),
|
|
252
|
+
"data-index": index2,
|
|
253
|
+
key: item[_ctx.acceptKey],
|
|
254
|
+
onClick: ($event) => _ctx.handleClickIndex(item[_ctx.acceptKey])
|
|
255
|
+
}, toDisplayString(item[_ctx.acceptKey]), 11, _hoisted_6);
|
|
256
|
+
}), 128))
|
|
257
|
+
])
|
|
258
|
+
], 32)
|
|
259
|
+
], 2);
|
|
260
|
+
}
|
|
261
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
262
|
+
export { index as default };
|