@nutui/nutui 3.1.21-beta.0 → 3.1.21-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nutui.es.js +18294 -0
- package/dist/nutui.umd.js +18398 -0
- package/dist/packages/_es/ActionSheet.js +175 -0
- package/dist/packages/_es/Address.js +568 -0
- package/dist/packages/_es/AddressList.js +616 -0
- package/dist/packages/_es/Audio.js +290 -0
- package/dist/packages/_es/AudioOperate.js +126 -0
- package/dist/packages/_es/Avatar.js +183 -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 +119 -0
- package/dist/packages/_es/Button.js +134 -0
- package/dist/packages/_es/Calendar.js +243 -0
- package/dist/packages/_es/CalendarItem.js +11 -0
- package/dist/packages/_es/Card.js +112 -0
- package/dist/packages/_es/Cascader.js +546 -0
- package/dist/packages/_es/Category.js +63 -0
- package/dist/packages/_es/CategoryPane.js +116 -0
- package/dist/packages/_es/Cell.js +103 -0
- package/dist/packages/_es/CellGroup.js +49 -0
- package/dist/packages/_es/Checkbox.js +120 -0
- package/dist/packages/_es/CheckboxGroup.js +63 -0
- package/dist/packages/_es/CircleProgress.js +156 -0
- package/dist/packages/_es/Col.js +61 -0
- package/dist/packages/_es/Collapse.js +90 -0
- package/dist/packages/_es/CollapseItem.js +279 -0
- package/dist/packages/_es/Comment.js +440 -0
- package/dist/packages/_es/CountDown.js +264 -0
- package/dist/packages/_es/CountUp.js +568 -0
- package/dist/packages/_es/DatePicker.js +343 -0
- package/dist/packages/_es/Dialog.js +286 -0
- package/dist/packages/_es/Divider.js +50 -0
- package/dist/packages/_es/Drag.js +204 -0
- package/dist/packages/_es/Ecard.js +164 -0
- package/dist/packages/_es/Elevator.js +215 -0
- package/dist/packages/_es/Empty.js +76 -0
- package/dist/packages/_es/FixedNav.js +127 -0
- package/dist/packages/_es/Form.js +153 -0
- package/dist/packages/_es/FormItem.js +115 -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/ImagePreview.js +326 -0
- package/dist/packages/_es/Indicator.js +67 -0
- package/dist/packages/_es/InfiniteLoading.js +275 -0
- package/dist/packages/_es/Input.js +420 -0
- package/dist/packages/_es/InputNumber.js +165 -0
- package/dist/packages/_es/Layout.js +11 -0
- package/dist/packages/_es/List.js +128 -0
- package/dist/packages/_es/Menu.js +120 -0
- package/dist/packages/_es/MenuItem.js +169 -0
- package/dist/packages/_es/Navbar.js +100 -0
- package/dist/packages/_es/NoticeBar.js +404 -0
- package/dist/packages/_es/Notify.js +255 -0
- package/dist/packages/_es/NumberKeyboard.js +268 -0
- package/dist/packages/_es/OldPicker.js +485 -0
- package/dist/packages/_es/OverLay.js +119 -0
- package/dist/packages/_es/Pagination.js +165 -0
- package/dist/packages/_es/Picker.js +477 -0
- package/dist/packages/_es/Popover.js +208 -0
- package/dist/packages/_es/Popup.js +317 -0
- package/dist/packages/_es/Price.js +123 -0
- package/dist/packages/_es/Progress.js +151 -0
- package/dist/packages/_es/PullRefresh.js +364 -0
- package/dist/packages/_es/Radio.js +96 -0
- package/dist/packages/_es/RadioGroup.js +42 -0
- package/dist/packages/_es/Range.js +433 -0
- package/dist/packages/_es/Rate.js +144 -0
- package/dist/packages/_es/Row.js +69 -0
- package/dist/packages/_es/SearchBar.js +196 -0
- package/dist/packages/_es/ShortPassword.js +231 -0
- package/dist/packages/_es/SideNavBar.js +105 -0
- package/dist/packages/_es/SideNavBarItem.js +51 -0
- package/dist/packages/_es/Signature.js +185 -0
- package/dist/packages/_es/Skeleton.js +141 -0
- package/dist/packages/_es/Sku.js +517 -0
- package/dist/packages/_es/Step.js +138 -0
- package/dist/packages/_es/Steps.js +58 -0
- package/dist/packages/_es/Sticky.js +144 -0
- package/dist/packages/_es/SubSideNavBar.js +105 -0
- package/dist/packages/_es/Swipe.js +207 -0
- package/dist/packages/_es/Swiper.js +430 -0
- package/dist/packages/_es/SwiperItem.js +55 -0
- package/dist/packages/_es/Switch.js +121 -0
- package/dist/packages/_es/TabPane.js +40 -0
- package/dist/packages/_es/Tabbar.js +78 -0
- package/dist/packages/_es/TabbarItem.js +158 -0
- package/dist/packages/_es/Table.js +201 -0
- package/dist/packages/_es/Tabs.js +221 -0
- package/dist/packages/_es/Tag.js +102 -0
- package/dist/packages/_es/TextArea.js +166 -0
- package/dist/packages/_es/TimeDetail.js +103 -0
- package/dist/packages/_es/TimePannel.js +71 -0
- package/dist/packages/_es/TimeSelect.js +108 -0
- package/dist/packages/_es/Toast.js +335 -0
- package/dist/packages/_es/Uploader.js +494 -0
- package/dist/packages/_es/Video.js +357 -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 +64 -0
- package/dist/packages/_es/index5.js +692 -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 +73 -0
- package/dist/packages/address/index.scss +155 -0
- package/dist/packages/addresslist/index.scss +144 -0
- package/dist/packages/audio/index.scss +66 -0
- package/dist/packages/audiooperate/index.scss +13 -0
- package/dist/packages/avatar/index.scss +53 -0
- package/dist/packages/avatargroup/index.scss +14 -0
- package/dist/packages/backtop/index.scss +20 -0
- package/dist/packages/badge/index.scss +33 -0
- package/dist/packages/barrage/index.scss +48 -0
- package/dist/packages/button/index.scss +169 -0
- package/dist/packages/calendar/index.scss +212 -0
- package/dist/packages/calendaritem/index.scss +0 -0
- package/dist/packages/card/index.scss +97 -0
- package/dist/packages/cascader/index.scss +81 -0
- package/dist/packages/category/index.scss +38 -0
- package/dist/packages/categorypane/index.scss +124 -0
- package/dist/packages/cell/index.scss +76 -0
- package/dist/packages/cellgroup/index.scss +38 -0
- package/dist/packages/checkbox/index.scss +31 -0
- package/dist/packages/checkboxgroup/index.scss +0 -0
- package/dist/packages/circleprogress/index.scss +24 -0
- package/dist/packages/col/index.scss +24 -0
- package/dist/packages/collapse/index.scss +0 -0
- package/dist/packages/collapseitem/index.scss +143 -0
- package/dist/packages/comment/index.scss +353 -0
- package/dist/packages/countdown/index.scss +5 -0
- package/dist/packages/countup/index.scss +67 -0
- package/dist/packages/datepicker/index.scss +2 -0
- package/dist/packages/dialog/index.scss +65 -0
- package/dist/packages/divider/index.scss +54 -0
- package/dist/packages/drag/index.scss +18 -0
- package/dist/packages/ecard/index.scss +83 -0
- package/dist/packages/elevator/index.scss +73 -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 +70 -0
- package/dist/packages/grid/index.scss +10 -0
- package/dist/packages/griditem/index.scss +92 -0
- package/dist/packages/icon/index.scss +131 -0
- package/dist/packages/imagepreview/index.scss +49 -0
- package/dist/packages/indicator/index.scss +48 -0
- package/dist/packages/infiniteloading/index.scss +47 -0
- package/dist/packages/input/index.scss +126 -0
- package/dist/packages/inputnumber/index.scss +38 -0
- package/dist/packages/layout/index.scss +0 -0
- package/dist/packages/list/index.scss +24 -0
- package/dist/packages/locale/index.d.ts +3 -0
- package/dist/packages/locale/index.scss +1 -0
- package/dist/packages/locale/lang/baseLang.js +8 -0
- package/dist/packages/locale/lang/en-US.js +96 -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.js +96 -0
- package/dist/packages/locale/lang/zh-TW.js +96 -0
- package/dist/packages/locale/locale/index.d.ts +8 -0
- package/dist/packages/locale/locale/lang/baseLang.d.ts +87 -0
- package/dist/packages/locale/locale/lang/en-US.d.ts +88 -0
- package/dist/packages/locale/locale/lang/zh-CN.d.ts +88 -0
- package/dist/packages/locale/locale/lang/zh-TW.d.ts +88 -0
- package/dist/packages/menu/index.scss +49 -0
- package/dist/packages/menuitem/index.scss +47 -0
- package/dist/packages/navbar/index.scss +124 -0
- package/dist/packages/noticebar/index.scss +114 -0
- package/dist/packages/notify/index.scss +62 -0
- package/dist/packages/numberkeyboard/index.scss +109 -0
- package/dist/packages/oldpicker/index.scss +131 -0
- package/dist/packages/overlay/index.scss +22 -0
- package/dist/packages/pagination/index.scss +50 -0
- package/dist/packages/picker/index.scss +128 -0
- package/dist/packages/popover/index.scss +133 -0
- package/dist/packages/popup/index.scss +132 -0
- package/dist/packages/price/index.scss +59 -0
- package/dist/packages/progress/index.scss +104 -0
- package/dist/packages/pullrefresh/index.scss +71 -0
- package/dist/packages/radio/index.scss +59 -0
- package/dist/packages/radiogroup/index.scss +22 -0
- package/dist/packages/range/index.scss +202 -0
- package/dist/packages/rate/index.scss +35 -0
- package/dist/packages/row/index.scss +54 -0
- package/dist/packages/searchbar/index.scss +98 -0
- package/dist/packages/shortpassword/index.scss +169 -0
- 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 +190 -0
- package/dist/packages/steps/index.scss +7 -0
- 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 +45 -0
- package/dist/packages/swiperitem/index.scss +3 -0
- package/dist/packages/switch/index.scss +60 -0
- package/dist/packages/tabbar/index.scss +27 -0
- package/dist/packages/tabbaritem/index.scss +79 -0
- package/dist/packages/table/index.scss +81 -0
- package/dist/packages/tabpane/index.scss +12 -0
- package/dist/packages/tabs/index.scss +166 -0
- package/dist/packages/tag/index.scss +48 -0
- package/dist/packages/textarea/index.scss +40 -0
- package/dist/packages/timedetail/index.scss +38 -0
- package/dist/packages/timepannel/index.scss +16 -0
- package/dist/packages/timeselect/index.scss +37 -0
- package/dist/packages/toast/index.scss +98 -0
- package/dist/packages/uploader/index.scss +157 -0
- package/dist/packages/video/index.scss +205 -0
- package/dist/smartips/attributes.json +2546 -0
- package/dist/smartips/tags.json +956 -0
- package/dist/style.css +1 -0
- package/dist/style.es.js +2 -0
- package/dist/styles/animation/drop.scss +24 -0
- package/dist/styles/animation/ease.scss +23 -0
- package/dist/styles/animation/fade.scss +20 -0
- package/dist/styles/animation/icon.scss +245 -0
- package/dist/styles/animation/index.scss +7 -0
- package/dist/styles/animation/rotate.scss +10 -0
- package/dist/styles/animation/zoom.scss +26 -0
- package/dist/styles/font/config.json +167 -0
- package/dist/styles/font/demo.css +539 -0
- package/dist/styles/font/demo_index.html +2879 -0
- package/dist/styles/font/iconfont.css +483 -0
- package/dist/styles/font/iconfont.eot +0 -0
- package/dist/styles/font/iconfont.js +63 -0
- package/dist/styles/font/iconfont.json +828 -0
- package/dist/styles/font/iconfont.svg +356 -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/mixins/index.scss +2 -0
- package/dist/styles/mixins/make-animation.scss +24 -0
- package/dist/styles/mixins/text-ellipsis.scss +20 -0
- package/dist/styles/themes/default.scss +97 -0
- package/dist/styles/themes/jdb.scss +97 -0
- package/dist/styles/themes/jdt.scss +97 -0
- package/dist/styles/variables-jdb.scss +844 -0
- package/dist/styles/variables-jdt.scss +750 -0
- package/dist/styles/variables.scss +774 -0
- package/dist/types/__VUE/actionsheet/index.d.ts +280 -0
- package/dist/types/__VUE/address/index.d.ts +396 -0
- package/dist/types/__VUE/addresslist/components/GeneralShell.d.ts +35 -0
- package/dist/types/__VUE/addresslist/components/ItemContents.d.ts +42 -0
- package/dist/types/__VUE/addresslist/components/LongPressShell.d.ts +47 -0
- package/dist/types/__VUE/addresslist/components/SwipeShell.d.ts +37 -0
- package/dist/types/__VUE/addresslist/index.d.ts +81 -0
- package/dist/types/__VUE/audio/index.d.ts +92 -0
- package/dist/types/__VUE/audiooperate/index.d.ts +68 -0
- package/dist/types/__VUE/avatar/index.d.ts +110 -0
- package/dist/types/__VUE/avatargroup/index.d.ts +93 -0
- package/dist/types/__VUE/backtop/index.d.ts +105 -0
- package/dist/types/__VUE/badge/index.d.ts +94 -0
- package/dist/types/__VUE/barrage/index.d.ts +80 -0
- package/dist/types/__VUE/button/index.d.ts +116 -0
- package/dist/types/__VUE/calendar/index.d.ts +155 -0
- package/dist/types/__VUE/calendaritem/index.d.ts +195 -0
- package/dist/types/__VUE/card/index.d.ts +90 -0
- package/dist/types/__VUE/cascader/cascader-item.d.ts +76 -0
- package/dist/types/__VUE/cascader/helper.d.ts +8 -0
- package/dist/types/__VUE/cascader/index.d.ts +240 -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.d.ts +38 -0
- package/dist/types/__VUE/categorypane/index.d.ts +45 -0
- package/dist/types/__VUE/cell/index.d.ts +109 -0
- package/dist/types/__VUE/cellgroup/index.d.ts +38 -0
- package/dist/types/__VUE/checkbox/index.d.ts +102 -0
- package/dist/types/__VUE/checkboxgroup/index.d.ts +39 -0
- package/dist/types/__VUE/circleprogress/index.d.ts +94 -0
- package/dist/types/__VUE/col/index.d.ts +45 -0
- package/dist/types/__VUE/collapse/index.d.ts +104 -0
- package/dist/types/__VUE/collapseitem/index.d.ts +83 -0
- package/dist/types/__VUE/comment/components/CmtBottom.d.ts +52 -0
- package/dist/types/__VUE/comment/components/CmtHeader.d.ts +47 -0
- package/dist/types/__VUE/comment/components/CmtImages.d.ts +51 -0
- package/dist/types/__VUE/comment/index.d.ts +110 -0
- package/dist/types/__VUE/countdown/index.d.ts +105 -0
- package/dist/types/__VUE/countdown/util.d.ts +6 -0
- package/dist/types/__VUE/countup/index.d.ts +216 -0
- package/dist/types/__VUE/datepicker/index.d.ts +356 -0
- package/dist/types/__VUE/datepicker/utils.d.ts +5 -0
- package/dist/types/__VUE/dialog/index.d.ts +306 -0
- package/dist/types/__VUE/divider/index.d.ts +47 -0
- package/dist/types/__VUE/drag/index.d.ts +61 -0
- package/dist/types/__VUE/ecard/index.d.ts +124 -0
- package/dist/types/__VUE/elevator/index.d.ts +71 -0
- package/dist/types/__VUE/empty/index.d.ts +47 -0
- package/dist/types/__VUE/fixednav/index.d.ts +96 -0
- package/dist/types/__VUE/form/common.d.ts +20 -0
- package/dist/types/__VUE/form/index.d.ts +32 -0
- package/dist/types/__VUE/form/types.d.ts +13 -0
- package/dist/types/__VUE/formitem/index.d.ts +120 -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.d.ts +100 -0
- package/dist/types/__VUE/griditem/index.d.ts +80 -0
- package/dist/types/__VUE/icon/index.d.ts +74 -0
- package/dist/types/__VUE/imagepreview/index.d.ts +125 -0
- package/dist/types/__VUE/indicator/index.d.ts +70 -0
- package/dist/types/__VUE/infiniteloading/index.d.ts +144 -0
- package/dist/types/__VUE/input/index.d.ts +337 -0
- package/dist/types/__VUE/input/util.d.ts +5 -0
- package/dist/types/__VUE/inputnumber/index.d.ts +117 -0
- package/dist/types/__VUE/layout/index.d.ts +13 -0
- package/dist/types/__VUE/list/index.d.ts +56 -0
- package/dist/types/__VUE/menu/index.d.ts +51 -0
- package/dist/types/__VUE/menuitem/index.d.ts +77 -0
- package/dist/types/__VUE/navbar/index.d.ts +83 -0
- package/dist/types/__VUE/noticebar/index.d.ts +209 -0
- package/dist/types/__VUE/notify/index.d.ts +113 -0
- package/dist/types/__VUE/numberkeyboard/index.d.ts +124 -0
- package/dist/types/__VUE/oldpicker/Column.d.ts +96 -0
- package/dist/types/__VUE/oldpicker/commonProps.d.ts +22 -0
- package/dist/types/__VUE/oldpicker/index.d.ts +369 -0
- package/dist/types/__VUE/oldpicker/types.d.ts +24 -0
- package/dist/types/__VUE/overlay/index.d.ts +1614 -0
- package/dist/types/__VUE/pagination/index.d.ts +112 -0
- package/dist/types/__VUE/picker/Column.d.ts +90 -0
- package/dist/types/__VUE/picker/index.d.ts +352 -0
- package/dist/types/__VUE/picker/types.d.ts +26 -0
- package/dist/types/__VUE/popover/index.d.ts +242 -0
- package/dist/types/__VUE/popup/index.d.ts +1743 -0
- package/dist/types/__VUE/popup/use-lock-scroll.d.ts +5 -0
- package/dist/types/__VUE/price/index.d.ts +87 -0
- package/dist/types/__VUE/progress/index.d.ts +138 -0
- package/dist/types/__VUE/pullrefresh/index.d.ts +128 -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.d.ts +90 -0
- package/dist/types/__VUE/radiogroup/index.d.ts +48 -0
- package/dist/types/__VUE/range/index.d.ts +156 -0
- package/dist/types/__VUE/rate/index.d.ts +142 -0
- package/dist/types/__VUE/row/index.d.ts +66 -0
- package/dist/types/__VUE/searchbar/index.d.ts +100 -0
- package/dist/types/__VUE/shortpassword/index.d.ts +137 -0
- package/dist/types/__VUE/sidenavbar/index.d.ts +36 -0
- package/dist/types/__VUE/sidenavbaritem/index.d.ts +41 -0
- package/dist/types/__VUE/signature/index.d.ts +74 -0
- package/dist/types/__VUE/skeleton/common.d.ts +63 -0
- package/dist/types/__VUE/skeleton/index.d.ts +117 -0
- package/dist/types/__VUE/sku/components/SkuHeader.d.ts +28 -0
- package/dist/types/__VUE/sku/components/SkuOperate.d.ts +70 -0
- package/dist/types/__VUE/sku/components/SkuSelect.d.ts +30 -0
- package/dist/types/__VUE/sku/components/SkuStepper.d.ts +67 -0
- package/dist/types/__VUE/sku/index.d.ts +310 -0
- package/dist/types/__VUE/step/index.d.ts +70 -0
- package/dist/types/__VUE/steps/index.d.ts +47 -0
- package/dist/types/__VUE/sticky/index.d.ts +63 -0
- package/dist/types/__VUE/subsidenavbar/index.d.ts +54 -0
- package/dist/types/__VUE/swipe/index.d.ts +69 -0
- package/dist/types/__VUE/swiper/index.d.ts +163 -0
- package/dist/types/__VUE/swiper/use-touch.d.ts +20 -0
- package/dist/types/__VUE/swiperitem/index.d.ts +18 -0
- package/dist/types/__VUE/switch/index.d.ts +136 -0
- package/dist/types/__VUE/tabbar/index.d.ts +84 -0
- package/dist/types/__VUE/tabbaritem/index.d.ts +108 -0
- package/dist/types/__VUE/table/common.d.ts +56 -0
- package/dist/types/__VUE/table/index.d.ts +76 -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.d.ts +47 -0
- package/dist/types/__VUE/tabs/common.d.ts +78 -0
- package/dist/types/__VUE/tabs/index.d.ts +126 -0
- package/dist/types/__VUE/tag/index.d.ts +89 -0
- package/dist/types/__VUE/textarea/index.d.ts +121 -0
- package/dist/types/__VUE/timedetail/index.d.ts +48 -0
- package/dist/types/__VUE/timepannel/index.d.ts +43 -0
- package/dist/types/__VUE/timeselect/index.d.ts +83 -0
- package/dist/types/__VUE/toast/index.d.ts +149 -0
- package/dist/types/__VUE/uploader/index.d.ts +258 -0
- package/dist/types/__VUE/uploader/uploader.d.ts +25 -0
- package/dist/types/__VUE/video/index.d.ts +123 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/nutui.d.ts +99 -0
- package/package.json +1 -1
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
/*!
|
|
21
|
+
* @nutui/nutui v3.1.21-beta.3 Wed May 18 2022 18:19:57 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
23
|
+
* Released under the MIT License.
|
|
24
|
+
*/
|
|
25
|
+
import { h, ref, reactive, computed, watch, onMounted, onActivated, onDeactivated, onUnmounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, normalizeStyle, renderSlot, createBlock, createCommentVNode, createElementVNode, createTextVNode, toDisplayString, withModifiers, createVNode, vShow, Fragment, renderList } from "vue";
|
|
26
|
+
import { c as createComponent } from "./component.js";
|
|
27
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
|
+
import "../locale/lang";
|
|
29
|
+
const { componentName, create } = createComponent("noticebar");
|
|
30
|
+
const _sfc_main = create({
|
|
31
|
+
props: {
|
|
32
|
+
direction: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "across"
|
|
35
|
+
},
|
|
36
|
+
list: {
|
|
37
|
+
type: Array,
|
|
38
|
+
default: () => {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
standTime: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 1e3
|
|
45
|
+
},
|
|
46
|
+
complexAm: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
height: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 40
|
|
53
|
+
},
|
|
54
|
+
text: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ""
|
|
57
|
+
},
|
|
58
|
+
closeMode: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
wrapable: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false
|
|
65
|
+
},
|
|
66
|
+
leftIcon: { type: String, default: "" },
|
|
67
|
+
rightIcon: { type: String, default: "" },
|
|
68
|
+
color: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: ""
|
|
71
|
+
},
|
|
72
|
+
background: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: ""
|
|
75
|
+
},
|
|
76
|
+
delay: {
|
|
77
|
+
type: [String, Number],
|
|
78
|
+
default: 1
|
|
79
|
+
},
|
|
80
|
+
scrollable: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: null
|
|
83
|
+
},
|
|
84
|
+
speed: {
|
|
85
|
+
type: Number,
|
|
86
|
+
default: 50
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
components: {
|
|
90
|
+
ScrollItem: function(props) {
|
|
91
|
+
props.item.props.style = props.style;
|
|
92
|
+
props.item.key = props.key;
|
|
93
|
+
return h(props.item);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
emits: ["click", "close"],
|
|
97
|
+
setup(props, { emit, slots }) {
|
|
98
|
+
const wrap = ref(null);
|
|
99
|
+
const content = ref(null);
|
|
100
|
+
const state = reactive({
|
|
101
|
+
wrapWidth: 0,
|
|
102
|
+
firstRound: true,
|
|
103
|
+
duration: 0,
|
|
104
|
+
offsetWidth: 0,
|
|
105
|
+
showNoticeBar: true,
|
|
106
|
+
animationClass: "",
|
|
107
|
+
animate: false,
|
|
108
|
+
scrollList: [],
|
|
109
|
+
distance: 0,
|
|
110
|
+
timer: null,
|
|
111
|
+
keepAlive: false,
|
|
112
|
+
isCanScroll: null
|
|
113
|
+
});
|
|
114
|
+
const classes = computed(() => {
|
|
115
|
+
const prefixCls = componentName;
|
|
116
|
+
return {
|
|
117
|
+
[prefixCls]: true
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
const isEllipsis = computed(() => {
|
|
121
|
+
if (state.isCanScroll == null) {
|
|
122
|
+
return props.wrapable;
|
|
123
|
+
} else {
|
|
124
|
+
return !state.isCanScroll && !props.wrapable;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const iconShow = computed(() => {
|
|
128
|
+
if (props.leftIcon == "close") {
|
|
129
|
+
return false;
|
|
130
|
+
} else {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
const barStyle = computed(() => {
|
|
135
|
+
let style = {};
|
|
136
|
+
props.color && (style.color = props.color);
|
|
137
|
+
props.background && (style.background = props.background);
|
|
138
|
+
if (props.direction == "vertical") {
|
|
139
|
+
style.height = `${props.height}px`;
|
|
140
|
+
}
|
|
141
|
+
return style;
|
|
142
|
+
});
|
|
143
|
+
const contentStyle = computed(() => {
|
|
144
|
+
return {
|
|
145
|
+
animationDelay: (state.firstRound ? props.delay : 0) + "s",
|
|
146
|
+
animationDuration: state.duration + "s",
|
|
147
|
+
transform: `translateX(${state.firstRound ? 0 : state.wrapWidth + "px"})`
|
|
148
|
+
};
|
|
149
|
+
});
|
|
150
|
+
const iconBg = computed(() => {
|
|
151
|
+
let iconBg2 = "";
|
|
152
|
+
if (props.leftIcon) {
|
|
153
|
+
iconBg2 = props.leftIcon;
|
|
154
|
+
}
|
|
155
|
+
return iconBg2;
|
|
156
|
+
});
|
|
157
|
+
const horseLampStyle = computed(() => {
|
|
158
|
+
let styles = {};
|
|
159
|
+
if (props.complexAm) {
|
|
160
|
+
styles = {
|
|
161
|
+
transform: `translateY(${state.distance}px)`
|
|
162
|
+
};
|
|
163
|
+
} else {
|
|
164
|
+
if (state.animate) {
|
|
165
|
+
let a = ~~(props.height / props.speed / 4);
|
|
166
|
+
styles = {
|
|
167
|
+
transition: `all ${a == 0 ? ~~(props.height / props.speed) : a}s`,
|
|
168
|
+
"margin-top": `-${props.height}px`
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return styles;
|
|
173
|
+
});
|
|
174
|
+
watch(() => props.text, (value) => {
|
|
175
|
+
initScrollWrap(value);
|
|
176
|
+
});
|
|
177
|
+
watch(() => props.list, (value) => {
|
|
178
|
+
state.scrollList = [].concat(value);
|
|
179
|
+
});
|
|
180
|
+
const initScrollWrap = (value) => {
|
|
181
|
+
if (state.showNoticeBar == false) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
setTimeout(() => {
|
|
185
|
+
if (!wrap.value || !content.value) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const wrapWidth = wrap.value.getBoundingClientRect().width;
|
|
189
|
+
const offsetWidth = content.value.getBoundingClientRect().width;
|
|
190
|
+
state.isCanScroll = props.scrollable == null ? offsetWidth > wrapWidth : props.scrollable;
|
|
191
|
+
console.log(111, state.isCanScroll);
|
|
192
|
+
if (state.isCanScroll) {
|
|
193
|
+
state.wrapWidth = wrapWidth;
|
|
194
|
+
state.offsetWidth = offsetWidth;
|
|
195
|
+
state.duration = offsetWidth / props.speed;
|
|
196
|
+
state.animationClass = "play";
|
|
197
|
+
} else {
|
|
198
|
+
state.animationClass = "";
|
|
199
|
+
}
|
|
200
|
+
}, 0);
|
|
201
|
+
};
|
|
202
|
+
const handleClick = (event) => {
|
|
203
|
+
emit("click", event);
|
|
204
|
+
};
|
|
205
|
+
const onClickIcon = (event) => {
|
|
206
|
+
if (props.closeMode) {
|
|
207
|
+
state.showNoticeBar = !props.closeMode;
|
|
208
|
+
}
|
|
209
|
+
emit("close", event);
|
|
210
|
+
};
|
|
211
|
+
const onAnimationEnd = () => {
|
|
212
|
+
state.firstRound = false;
|
|
213
|
+
setTimeout(() => {
|
|
214
|
+
state.duration = (state.offsetWidth + state.wrapWidth) / props.speed;
|
|
215
|
+
state.animationClass = "play-infinite";
|
|
216
|
+
}, 0);
|
|
217
|
+
};
|
|
218
|
+
const startRollEasy = () => {
|
|
219
|
+
showhorseLamp();
|
|
220
|
+
state.timer = setInterval(showhorseLamp, ~~(props.height / props.speed / 4 * 1e3) + props.standTime);
|
|
221
|
+
};
|
|
222
|
+
const showhorseLamp = () => {
|
|
223
|
+
state.animate = true;
|
|
224
|
+
setTimeout(() => {
|
|
225
|
+
state.scrollList.push(state.scrollList[0]);
|
|
226
|
+
state.scrollList.shift();
|
|
227
|
+
state.animate = false;
|
|
228
|
+
}, ~~(props.height / props.speed / 4 * 1e3));
|
|
229
|
+
};
|
|
230
|
+
const startRoll = () => {
|
|
231
|
+
state.timer = setInterval(() => {
|
|
232
|
+
let chunk = 100;
|
|
233
|
+
for (let i = 0; i < chunk; i++) {
|
|
234
|
+
scroll(i, i < chunk - 1 ? false : true);
|
|
235
|
+
}
|
|
236
|
+
}, props.standTime + 100 * props.speed);
|
|
237
|
+
};
|
|
238
|
+
const scroll = (n, last) => {
|
|
239
|
+
setTimeout(() => {
|
|
240
|
+
state.distance -= props.height / 100;
|
|
241
|
+
if (last) {
|
|
242
|
+
state.scrollList.push(state.scrollList[0]);
|
|
243
|
+
state.scrollList.shift();
|
|
244
|
+
state.distance = 0;
|
|
245
|
+
}
|
|
246
|
+
}, n * props.speed);
|
|
247
|
+
};
|
|
248
|
+
const go = (item) => {
|
|
249
|
+
emit("click", item);
|
|
250
|
+
};
|
|
251
|
+
const handleClickIcon = () => {
|
|
252
|
+
emit("close", state.scrollList[0]);
|
|
253
|
+
};
|
|
254
|
+
onMounted(() => {
|
|
255
|
+
if (props.direction == "vertical") {
|
|
256
|
+
if (slots.default) {
|
|
257
|
+
state.scrollList = [].concat(slots.default()[0].children);
|
|
258
|
+
} else {
|
|
259
|
+
state.scrollList = [].concat(props.list);
|
|
260
|
+
}
|
|
261
|
+
setTimeout(() => {
|
|
262
|
+
props.complexAm ? startRoll() : startRollEasy();
|
|
263
|
+
}, props.standTime);
|
|
264
|
+
} else {
|
|
265
|
+
initScrollWrap(props.text);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
onActivated(() => {
|
|
269
|
+
if (state.keepAlive) {
|
|
270
|
+
state.keepAlive = false;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
onDeactivated(() => {
|
|
274
|
+
state.keepAlive = true;
|
|
275
|
+
clearInterval(state.timer);
|
|
276
|
+
});
|
|
277
|
+
onUnmounted(() => {
|
|
278
|
+
clearInterval(state.timer);
|
|
279
|
+
});
|
|
280
|
+
return __spreadProps(__spreadValues(__spreadValues({}, toRefs(props)), toRefs(state)), {
|
|
281
|
+
isEllipsis,
|
|
282
|
+
classes,
|
|
283
|
+
iconShow,
|
|
284
|
+
barStyle,
|
|
285
|
+
contentStyle,
|
|
286
|
+
iconBg,
|
|
287
|
+
horseLampStyle,
|
|
288
|
+
wrap,
|
|
289
|
+
content,
|
|
290
|
+
handleClick,
|
|
291
|
+
onClickIcon,
|
|
292
|
+
onAnimationEnd,
|
|
293
|
+
go,
|
|
294
|
+
handleClickIcon,
|
|
295
|
+
slots
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
const _hoisted_1 = {
|
|
300
|
+
ref: "wrap",
|
|
301
|
+
class: "wrap"
|
|
302
|
+
};
|
|
303
|
+
const _hoisted_2 = ["onClick"];
|
|
304
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
305
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
306
|
+
const _component_ScrollItem = resolveComponent("ScrollItem");
|
|
307
|
+
return openBlock(), createElementBlock("view", {
|
|
308
|
+
class: normalizeClass(_ctx.classes)
|
|
309
|
+
}, [
|
|
310
|
+
_ctx.direction == "across" ? withDirectives((openBlock(), createElementBlock("view", {
|
|
311
|
+
key: 0,
|
|
312
|
+
class: normalizeClass(["nut-noticebar-page", { withicon: _ctx.closeMode, close: _ctx.closeMode, wrapable: _ctx.wrapable }]),
|
|
313
|
+
style: normalizeStyle(_ctx.barStyle),
|
|
314
|
+
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
315
|
+
}, [
|
|
316
|
+
_ctx.iconShow ? (openBlock(), createElementBlock("view", {
|
|
317
|
+
key: 0,
|
|
318
|
+
class: "left-icon",
|
|
319
|
+
style: normalizeStyle({ "background-image": `url(${_ctx.iconBg})` })
|
|
320
|
+
}, [
|
|
321
|
+
renderSlot(_ctx.$slots, "left-icon", {}, () => [
|
|
322
|
+
!_ctx.iconBg ? (openBlock(), createBlock(_component_nut_icon, {
|
|
323
|
+
key: 0,
|
|
324
|
+
name: "notice",
|
|
325
|
+
size: "16",
|
|
326
|
+
color: _ctx.color
|
|
327
|
+
}, null, 8, ["color"])) : createCommentVNode("", true)
|
|
328
|
+
])
|
|
329
|
+
], 4)) : createCommentVNode("", true),
|
|
330
|
+
createElementVNode("view", _hoisted_1, [
|
|
331
|
+
createElementVNode("view", {
|
|
332
|
+
ref: "content",
|
|
333
|
+
class: normalizeClass(["content", _ctx.animationClass, { "nut-ellipsis": _ctx.isEllipsis }]),
|
|
334
|
+
style: normalizeStyle(_ctx.contentStyle),
|
|
335
|
+
onAnimationend: _cache[0] || (_cache[0] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args)),
|
|
336
|
+
onWebkitAnimationEnd: _cache[1] || (_cache[1] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args))
|
|
337
|
+
}, [
|
|
338
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
339
|
+
createTextVNode(toDisplayString(_ctx.text), 1)
|
|
340
|
+
])
|
|
341
|
+
], 38)
|
|
342
|
+
], 512),
|
|
343
|
+
_ctx.closeMode || _ctx.rightIcon ? (openBlock(), createElementBlock("view", {
|
|
344
|
+
key: 1,
|
|
345
|
+
class: "right-icon",
|
|
346
|
+
onClick: _cache[2] || (_cache[2] = withModifiers((...args) => _ctx.onClickIcon && _ctx.onClickIcon(...args), ["stop"]))
|
|
347
|
+
}, [
|
|
348
|
+
renderSlot(_ctx.$slots, "right-icon", {}, () => [
|
|
349
|
+
createVNode(_component_nut_icon, {
|
|
350
|
+
name: _ctx.rightIcon ? _ctx.rightIcon : "close",
|
|
351
|
+
color: _ctx.color
|
|
352
|
+
}, null, 8, ["name", "color"])
|
|
353
|
+
])
|
|
354
|
+
])) : createCommentVNode("", true)
|
|
355
|
+
], 6)), [
|
|
356
|
+
[vShow, _ctx.showNoticeBar]
|
|
357
|
+
]) : createCommentVNode("", true),
|
|
358
|
+
_ctx.scrollList.length > 0 && _ctx.direction == "vertical" ? (openBlock(), createElementBlock("view", {
|
|
359
|
+
key: 1,
|
|
360
|
+
class: "nut-noticebar-vertical",
|
|
361
|
+
style: normalizeStyle(_ctx.barStyle)
|
|
362
|
+
}, [
|
|
363
|
+
_ctx.slots.default ? (openBlock(), createElementBlock("view", {
|
|
364
|
+
key: 0,
|
|
365
|
+
class: "horseLamp_list",
|
|
366
|
+
style: normalizeStyle(_ctx.horseLampStyle)
|
|
367
|
+
}, [
|
|
368
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
|
|
369
|
+
return openBlock(), createBlock(_component_ScrollItem, {
|
|
370
|
+
key: index2,
|
|
371
|
+
style: normalizeStyle({ height: _ctx.height + "px", "line-height": _ctx.height + "px" }),
|
|
372
|
+
item
|
|
373
|
+
}, null, 8, ["style", "item"]);
|
|
374
|
+
}), 128))
|
|
375
|
+
], 4)) : (openBlock(), createElementBlock("ul", {
|
|
376
|
+
key: 1,
|
|
377
|
+
class: "horseLamp_list",
|
|
378
|
+
style: normalizeStyle(_ctx.horseLampStyle)
|
|
379
|
+
}, [
|
|
380
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
|
|
381
|
+
return openBlock(), createElementBlock("li", {
|
|
382
|
+
class: "horseLamp_list_item",
|
|
383
|
+
key: index2,
|
|
384
|
+
style: normalizeStyle({ height: _ctx.height }),
|
|
385
|
+
onClick: ($event) => _ctx.go(item)
|
|
386
|
+
}, toDisplayString(item), 13, _hoisted_2);
|
|
387
|
+
}), 128))
|
|
388
|
+
], 4)),
|
|
389
|
+
createElementVNode("view", {
|
|
390
|
+
class: "go",
|
|
391
|
+
onClick: _cache[4] || (_cache[4] = ($event) => !_ctx.slots.rightIcon && _ctx.handleClickIcon())
|
|
392
|
+
}, [
|
|
393
|
+
_ctx.slots.rightIcon ? renderSlot(_ctx.$slots, "rightIcon", { key: 0 }) : _ctx.closeMode ? (openBlock(), createBlock(_component_nut_icon, {
|
|
394
|
+
key: 1,
|
|
395
|
+
type: "cross",
|
|
396
|
+
color: _ctx.color,
|
|
397
|
+
size: "11px"
|
|
398
|
+
}, null, 8, ["color"])) : createCommentVNode("", true)
|
|
399
|
+
])
|
|
400
|
+
], 4)) : createCommentVNode("", true)
|
|
401
|
+
], 2);
|
|
402
|
+
}
|
|
403
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
404
|
+
export { index as default };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
/*!
|
|
21
|
+
* @nutui/nutui v3.1.21-beta.3 Wed May 18 2022 18:19:57 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
23
|
+
* Released under the MIT License.
|
|
24
|
+
*/
|
|
25
|
+
import { reactive, onMounted, ref, watch, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, createVNode, render, h } from "vue";
|
|
26
|
+
import { c as createComponent } from "./component.js";
|
|
27
|
+
import Popup from "./Popup.js";
|
|
28
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
29
|
+
import "../locale/lang";
|
|
30
|
+
import "./OverLay.js";
|
|
31
|
+
import "./Icon.js";
|
|
32
|
+
import "./pxCheck.js";
|
|
33
|
+
const { componentName, create } = createComponent("notify");
|
|
34
|
+
const _sfc_main = create({
|
|
35
|
+
components: {
|
|
36
|
+
[Popup.name]: Popup
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
id: String,
|
|
40
|
+
color: { type: String, default: "" },
|
|
41
|
+
msg: { type: String, default: "" },
|
|
42
|
+
duration: { type: Number, default: 3e3 },
|
|
43
|
+
className: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ""
|
|
46
|
+
},
|
|
47
|
+
background: { type: String, default: "" },
|
|
48
|
+
type: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "danger"
|
|
51
|
+
},
|
|
52
|
+
showPopup: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
position: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "top"
|
|
59
|
+
},
|
|
60
|
+
isWrapTeleport: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true
|
|
63
|
+
},
|
|
64
|
+
onClose: Function,
|
|
65
|
+
onClick: Function,
|
|
66
|
+
unmount: Function
|
|
67
|
+
},
|
|
68
|
+
setup(props, { slots }) {
|
|
69
|
+
let timer = null;
|
|
70
|
+
const state = reactive({
|
|
71
|
+
mounted: false
|
|
72
|
+
});
|
|
73
|
+
onMounted(() => {
|
|
74
|
+
});
|
|
75
|
+
const visible = ref(false);
|
|
76
|
+
const clickCover = () => {
|
|
77
|
+
props.onClick && props.onClick();
|
|
78
|
+
};
|
|
79
|
+
const clearTimer = () => {
|
|
80
|
+
if (timer) {
|
|
81
|
+
clearTimeout(timer);
|
|
82
|
+
timer = null;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const hide = () => {
|
|
86
|
+
state.mounted = false;
|
|
87
|
+
};
|
|
88
|
+
const show = () => {
|
|
89
|
+
clearTimer();
|
|
90
|
+
if (props.duration) {
|
|
91
|
+
timer = setTimeout(() => {
|
|
92
|
+
hide();
|
|
93
|
+
}, props.duration);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
if (props.duration) {
|
|
97
|
+
show();
|
|
98
|
+
}
|
|
99
|
+
watch(() => props.duration, (val) => {
|
|
100
|
+
if (val) {
|
|
101
|
+
show();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
const onAfterLeave = () => {
|
|
105
|
+
clearTimer();
|
|
106
|
+
props.unmount && props.unmount(props.id);
|
|
107
|
+
props.onClose && props.onClose();
|
|
108
|
+
};
|
|
109
|
+
return { state, hide, onAfterLeave, clickCover, visible };
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
113
|
+
const _component_nut_popup = resolveComponent("nut-popup");
|
|
114
|
+
return openBlock(), createBlock(_component_nut_popup, {
|
|
115
|
+
visible: _ctx.showPopup,
|
|
116
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPopup = $event),
|
|
117
|
+
position: _ctx.position,
|
|
118
|
+
overlay: false,
|
|
119
|
+
isWrapTeleport: _ctx.isWrapTeleport
|
|
120
|
+
}, {
|
|
121
|
+
default: withCtx(() => [
|
|
122
|
+
createElementVNode("div", {
|
|
123
|
+
class: normalizeClass(["nut-notify", `nut-notify--${_ctx.type}`, _ctx.className]),
|
|
124
|
+
style: normalizeStyle({ color: _ctx.color, background: _ctx.background }),
|
|
125
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
|
|
126
|
+
}, [
|
|
127
|
+
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
128
|
+
createTextVNode(toDisplayString(_ctx.msg), 1)
|
|
129
|
+
], 64))
|
|
130
|
+
], 6)
|
|
131
|
+
]),
|
|
132
|
+
_: 3
|
|
133
|
+
}, 8, ["visible", "position", "isWrapTeleport"]);
|
|
134
|
+
}
|
|
135
|
+
var Notify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
136
|
+
const defaultOptions = {
|
|
137
|
+
type: "base",
|
|
138
|
+
showPopup: true,
|
|
139
|
+
visible: true,
|
|
140
|
+
msg: "",
|
|
141
|
+
color: void 0,
|
|
142
|
+
background: void 0,
|
|
143
|
+
duration: 3e3,
|
|
144
|
+
className: "",
|
|
145
|
+
onClosed: null,
|
|
146
|
+
onClick: null,
|
|
147
|
+
onOpened: null,
|
|
148
|
+
textTimer: null,
|
|
149
|
+
unmount: null
|
|
150
|
+
};
|
|
151
|
+
let idsMap = [];
|
|
152
|
+
let optsMap = [];
|
|
153
|
+
const clearNotify = (id) => {
|
|
154
|
+
if (id) {
|
|
155
|
+
const container = document.getElementById(id);
|
|
156
|
+
optsMap = optsMap.filter((item) => item.id !== id);
|
|
157
|
+
idsMap = idsMap.filter((item) => item !== id);
|
|
158
|
+
if (container) {
|
|
159
|
+
document.body.removeChild(container);
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
idsMap.forEach((item) => {
|
|
163
|
+
const container = document.getElementById(item);
|
|
164
|
+
if (container) {
|
|
165
|
+
document.body.removeChild(container);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
optsMap = [];
|
|
169
|
+
idsMap = [];
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const updateNotify = (opts) => {
|
|
173
|
+
const container = document.getElementById(opts.id);
|
|
174
|
+
if (container) {
|
|
175
|
+
const currentOpt = optsMap.find((item) => item.id === opts.id);
|
|
176
|
+
if (currentOpt) {
|
|
177
|
+
opts = __spreadValues(__spreadValues(__spreadValues({}, defaultOptions), currentOpt), opts);
|
|
178
|
+
} else {
|
|
179
|
+
opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
|
|
180
|
+
}
|
|
181
|
+
const instance = createVNode(Notify, opts);
|
|
182
|
+
render(instance, container);
|
|
183
|
+
return instance.component.ctx;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const mountNotify = (opts) => {
|
|
187
|
+
opts.unmount = clearNotify;
|
|
188
|
+
let _id;
|
|
189
|
+
if (opts.id) {
|
|
190
|
+
_id = opts.id;
|
|
191
|
+
if (idsMap.find((item) => item === opts.id)) {
|
|
192
|
+
return updateNotify(opts);
|
|
193
|
+
}
|
|
194
|
+
} else {
|
|
195
|
+
_id = new Date().getTime() + "";
|
|
196
|
+
}
|
|
197
|
+
opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
|
|
198
|
+
opts.id = _id;
|
|
199
|
+
idsMap.push(opts.id);
|
|
200
|
+
optsMap.push(opts);
|
|
201
|
+
const root = document.createElement("view");
|
|
202
|
+
root.id = "notify-" + opts.id;
|
|
203
|
+
const Wrapper = {
|
|
204
|
+
setup() {
|
|
205
|
+
opts.teleport = `#notify-${opts.id}`;
|
|
206
|
+
onMounted(() => {
|
|
207
|
+
setTimeout(() => {
|
|
208
|
+
document.body.removeChild(root);
|
|
209
|
+
}, opts.duration);
|
|
210
|
+
});
|
|
211
|
+
return () => {
|
|
212
|
+
return h(Notify, opts);
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const instance = createVNode(Wrapper);
|
|
217
|
+
document.body.appendChild(root);
|
|
218
|
+
render(instance, root);
|
|
219
|
+
};
|
|
220
|
+
const errorMsg = (msg) => {
|
|
221
|
+
if (!msg) {
|
|
222
|
+
console.warn("[NutUI Notify]: msg\u4E0D\u80FD\u4E3A\u7A7A");
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
const NotifyFunction = {
|
|
227
|
+
text(msg, obj = {}) {
|
|
228
|
+
errorMsg(msg);
|
|
229
|
+
return mountNotify(__spreadProps(__spreadValues({}, obj), { msg }));
|
|
230
|
+
},
|
|
231
|
+
primary(msg, obj = {}) {
|
|
232
|
+
errorMsg(msg);
|
|
233
|
+
return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "primary" }));
|
|
234
|
+
},
|
|
235
|
+
success(msg, obj = {}) {
|
|
236
|
+
errorMsg(msg);
|
|
237
|
+
return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "success" }));
|
|
238
|
+
},
|
|
239
|
+
danger(msg, obj = {}) {
|
|
240
|
+
errorMsg(msg);
|
|
241
|
+
return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "danger" }));
|
|
242
|
+
},
|
|
243
|
+
warn(msg, obj = {}) {
|
|
244
|
+
errorMsg(msg);
|
|
245
|
+
return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "warning" }));
|
|
246
|
+
},
|
|
247
|
+
hide() {
|
|
248
|
+
clearNotify();
|
|
249
|
+
},
|
|
250
|
+
install(app) {
|
|
251
|
+
app.use(Notify);
|
|
252
|
+
app.config.globalProperties.$notify = NotifyFunction;
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
export { Notify, NotifyFunction, NotifyFunction as default };
|