@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,165 @@
|
|
|
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 { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, createElementVNode } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { p as pxCheck } from "./pxCheck.js";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
|
+
import "../locale/lang";
|
|
11
|
+
const { componentName, create } = createComponent("inputnumber");
|
|
12
|
+
const _sfc_main = create({
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: [Number, String],
|
|
16
|
+
default: 0
|
|
17
|
+
},
|
|
18
|
+
inputWidth: {
|
|
19
|
+
type: [Number, String],
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
buttonSize: {
|
|
23
|
+
type: [Number, String],
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
min: {
|
|
27
|
+
type: [Number, String],
|
|
28
|
+
default: 1
|
|
29
|
+
},
|
|
30
|
+
max: {
|
|
31
|
+
type: [Number, String],
|
|
32
|
+
default: 9999
|
|
33
|
+
},
|
|
34
|
+
step: {
|
|
35
|
+
type: [Number, String],
|
|
36
|
+
default: 1
|
|
37
|
+
},
|
|
38
|
+
decimalPlaces: {
|
|
39
|
+
type: [Number, String],
|
|
40
|
+
default: 0
|
|
41
|
+
},
|
|
42
|
+
disabled: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
readonly: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
emits: ["update:modelValue", "change", "blur", "focus", "reduce", "add", "overlimit"],
|
|
52
|
+
setup(props, { emit }) {
|
|
53
|
+
const classes = computed(() => {
|
|
54
|
+
const prefixCls = componentName;
|
|
55
|
+
return {
|
|
56
|
+
[prefixCls]: true,
|
|
57
|
+
[`${prefixCls}--disabled`]: props.disabled
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
const fixedDecimalPlaces = (v) => {
|
|
61
|
+
return Number(v).toFixed(Number(props.decimalPlaces));
|
|
62
|
+
};
|
|
63
|
+
const change = (event) => {
|
|
64
|
+
const input = event.target;
|
|
65
|
+
emit("update:modelValue", input.valueAsNumber, event);
|
|
66
|
+
};
|
|
67
|
+
const emitChange = (value, event) => {
|
|
68
|
+
let output_value = fixedDecimalPlaces(value);
|
|
69
|
+
emit("update:modelValue", output_value, event);
|
|
70
|
+
emit("change", output_value, event);
|
|
71
|
+
};
|
|
72
|
+
const addAllow = (value = Number(props.modelValue)) => {
|
|
73
|
+
return value < Number(props.max) && !props.disabled;
|
|
74
|
+
};
|
|
75
|
+
const reduceAllow = (value = Number(props.modelValue)) => {
|
|
76
|
+
return value > Number(props.min) && !props.disabled;
|
|
77
|
+
};
|
|
78
|
+
const reduce = (event) => {
|
|
79
|
+
emit("reduce", event);
|
|
80
|
+
if (reduceAllow()) {
|
|
81
|
+
let output_value = Number(props.modelValue) - Number(props.step);
|
|
82
|
+
emitChange(output_value, event);
|
|
83
|
+
} else {
|
|
84
|
+
emit("overlimit", event, "reduce");
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const add = (event) => {
|
|
88
|
+
emit("add", event);
|
|
89
|
+
if (addAllow()) {
|
|
90
|
+
let output_value = Number(props.modelValue) + Number(props.step);
|
|
91
|
+
emitChange(output_value, event);
|
|
92
|
+
} else {
|
|
93
|
+
emit("overlimit", event, "add");
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const focus = (event) => {
|
|
97
|
+
if (props.disabled)
|
|
98
|
+
return;
|
|
99
|
+
if (props.readonly)
|
|
100
|
+
return;
|
|
101
|
+
emit("focus", event);
|
|
102
|
+
};
|
|
103
|
+
const blur = (event) => {
|
|
104
|
+
if (props.disabled)
|
|
105
|
+
return;
|
|
106
|
+
if (props.readonly)
|
|
107
|
+
return;
|
|
108
|
+
const input = event.target;
|
|
109
|
+
let value = input.valueAsNumber;
|
|
110
|
+
if (value < Number(props.min)) {
|
|
111
|
+
value = Number(props.min);
|
|
112
|
+
} else if (value > Number(props.max)) {
|
|
113
|
+
value = Number(props.max);
|
|
114
|
+
}
|
|
115
|
+
emitChange(value, event);
|
|
116
|
+
emit("blur", event);
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
classes,
|
|
120
|
+
change,
|
|
121
|
+
blur,
|
|
122
|
+
focus,
|
|
123
|
+
add,
|
|
124
|
+
addAllow,
|
|
125
|
+
reduce,
|
|
126
|
+
reduceAllow,
|
|
127
|
+
pxCheck
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
const _hoisted_1 = ["min", "max", "disabled", "readonly", "value"];
|
|
132
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
133
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
134
|
+
return openBlock(), createElementBlock("view", {
|
|
135
|
+
class: normalizeClass(_ctx.classes),
|
|
136
|
+
style: normalizeStyle({ height: _ctx.pxCheck(_ctx.buttonSize) })
|
|
137
|
+
}, [
|
|
138
|
+
createVNode(_component_nut_icon, {
|
|
139
|
+
name: "minus",
|
|
140
|
+
class: normalizeClass(["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !_ctx.reduceAllow() }]),
|
|
141
|
+
size: _ctx.buttonSize,
|
|
142
|
+
onClick: _ctx.reduce
|
|
143
|
+
}, null, 8, ["class", "size", "onClick"]),
|
|
144
|
+
createElementVNode("input", {
|
|
145
|
+
type: "number",
|
|
146
|
+
min: _ctx.min,
|
|
147
|
+
max: _ctx.max,
|
|
148
|
+
style: normalizeStyle({ width: _ctx.pxCheck(_ctx.inputWidth) }),
|
|
149
|
+
disabled: _ctx.disabled,
|
|
150
|
+
readonly: _ctx.readonly,
|
|
151
|
+
value: _ctx.modelValue,
|
|
152
|
+
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
153
|
+
onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.blur && _ctx.blur(...args)),
|
|
154
|
+
onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args))
|
|
155
|
+
}, null, 44, _hoisted_1),
|
|
156
|
+
createVNode(_component_nut_icon, {
|
|
157
|
+
name: "plus",
|
|
158
|
+
class: normalizeClass(["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !_ctx.addAllow() }]),
|
|
159
|
+
size: _ctx.buttonSize,
|
|
160
|
+
onClick: _ctx.add
|
|
161
|
+
}, null, 8, ["class", "size", "onClick"])
|
|
162
|
+
], 6);
|
|
163
|
+
}
|
|
164
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
165
|
+
export { index as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
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 { c as createComponent } from "./component.js";
|
|
7
|
+
import "vue";
|
|
8
|
+
import "../locale/lang";
|
|
9
|
+
const { create } = createComponent("layout");
|
|
10
|
+
const _sfc_main = create({});
|
|
11
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,111 @@
|
|
|
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, watch, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, renderSlot } 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 } = createComponent("list");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
height: {
|
|
14
|
+
type: [Number],
|
|
15
|
+
default: 50
|
|
16
|
+
},
|
|
17
|
+
listData: {
|
|
18
|
+
type: Array,
|
|
19
|
+
default: () => {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
containerHeight: {
|
|
24
|
+
type: [Number],
|
|
25
|
+
default: document.documentElement.clientHeight || document.body.clientHeight || 667
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
emits: ["scroll", "scroll-bottom"],
|
|
29
|
+
setup(props, { emit }) {
|
|
30
|
+
const list = ref(null);
|
|
31
|
+
const state = reactive({
|
|
32
|
+
startOffset: 0,
|
|
33
|
+
start: 0,
|
|
34
|
+
list: props.listData.slice()
|
|
35
|
+
});
|
|
36
|
+
const visibleCount = computed(() => {
|
|
37
|
+
return Math.ceil(props.containerHeight / props.height);
|
|
38
|
+
});
|
|
39
|
+
const end = computed(() => {
|
|
40
|
+
return state.start + visibleCount.value;
|
|
41
|
+
});
|
|
42
|
+
const getTransform = computed(() => {
|
|
43
|
+
return `translate3d(0, ${state.startOffset}px, 0)`;
|
|
44
|
+
});
|
|
45
|
+
const classes = computed(() => {
|
|
46
|
+
const prefixCls = componentName;
|
|
47
|
+
return {
|
|
48
|
+
[prefixCls]: true
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
const listHeight = computed(() => {
|
|
52
|
+
return state.list.length * props.height;
|
|
53
|
+
});
|
|
54
|
+
const visibleData = computed(() => {
|
|
55
|
+
return state.list.slice(state.start, Math.min(end.value, state.list.length));
|
|
56
|
+
});
|
|
57
|
+
const handleScrollEvent = () => {
|
|
58
|
+
var _a;
|
|
59
|
+
const scrollTop = (_a = list.value) == null ? void 0 : _a.scrollTop;
|
|
60
|
+
state.start = Math.floor(scrollTop / props.height);
|
|
61
|
+
if (end.value > state.list.length) {
|
|
62
|
+
emit("scroll");
|
|
63
|
+
emit("scroll-bottom");
|
|
64
|
+
}
|
|
65
|
+
state.startOffset = scrollTop - scrollTop % props.height;
|
|
66
|
+
};
|
|
67
|
+
watch(() => props.listData, () => {
|
|
68
|
+
state.list = props.listData.slice();
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
...toRefs(state),
|
|
72
|
+
list,
|
|
73
|
+
getTransform,
|
|
74
|
+
listHeight,
|
|
75
|
+
visibleData,
|
|
76
|
+
classes,
|
|
77
|
+
handleScrollEvent
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
82
|
+
return openBlock(), createElementBlock("view", {
|
|
83
|
+
class: normalizeClass(_ctx.classes),
|
|
84
|
+
onScrollPassive: _cache[0] || (_cache[0] = (...args) => _ctx.handleScrollEvent && _ctx.handleScrollEvent(...args)),
|
|
85
|
+
ref: "list"
|
|
86
|
+
}, [
|
|
87
|
+
createElementVNode("div", {
|
|
88
|
+
class: "nut-list-phantom",
|
|
89
|
+
style: normalizeStyle({ height: _ctx.listHeight + "px" })
|
|
90
|
+
}, null, 4),
|
|
91
|
+
createElementVNode("div", {
|
|
92
|
+
class: "nut-list-container",
|
|
93
|
+
style: normalizeStyle({ transform: _ctx.getTransform })
|
|
94
|
+
}, [
|
|
95
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.visibleData, (item, index2) => {
|
|
96
|
+
return openBlock(), createElementBlock("div", {
|
|
97
|
+
class: "nut-list-item",
|
|
98
|
+
style: normalizeStyle({ height: _ctx.height + "px" }),
|
|
99
|
+
key: item
|
|
100
|
+
}, [
|
|
101
|
+
renderSlot(_ctx.$slots, "default", {
|
|
102
|
+
item,
|
|
103
|
+
index: index2
|
|
104
|
+
})
|
|
105
|
+
], 4);
|
|
106
|
+
}), 128))
|
|
107
|
+
], 4)
|
|
108
|
+
], 34);
|
|
109
|
+
}
|
|
110
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
111
|
+
export { index as default };
|
|
@@ -0,0 +1,175 @@
|
|
|
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, computed, onMounted, onUnmounted, reactive, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, normalizeStyle, toDisplayString, createVNode, renderSlot, provide } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { u as useRect } from "./index2.js";
|
|
9
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
|
+
import "../locale/lang";
|
|
11
|
+
const { componentName, create } = createComponent("menu");
|
|
12
|
+
const _sfc_main = create({
|
|
13
|
+
props: {
|
|
14
|
+
activeColor: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
overlay: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true
|
|
21
|
+
},
|
|
22
|
+
lockScroll: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
duration: {
|
|
27
|
+
type: [Number, String],
|
|
28
|
+
default: 0
|
|
29
|
+
},
|
|
30
|
+
closeOnClickOverlay: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
direction: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "down"
|
|
37
|
+
},
|
|
38
|
+
scrollFixed: {
|
|
39
|
+
type: [Boolean, String, Number],
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
titleClass: [String]
|
|
43
|
+
},
|
|
44
|
+
setup(props, { emit, slots }) {
|
|
45
|
+
const barRef = ref();
|
|
46
|
+
const offset = ref(0);
|
|
47
|
+
const isScrollFixed = ref(false);
|
|
48
|
+
const useChildren = () => {
|
|
49
|
+
const publicChildren = reactive([]);
|
|
50
|
+
const internalChildren = reactive([]);
|
|
51
|
+
const linkChildren2 = (value) => {
|
|
52
|
+
const link = (child) => {
|
|
53
|
+
if (child.proxy) {
|
|
54
|
+
internalChildren.push(child);
|
|
55
|
+
publicChildren.push(child.proxy);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
provide("menuParent", Object.assign({
|
|
59
|
+
link,
|
|
60
|
+
children: publicChildren,
|
|
61
|
+
internalChildren
|
|
62
|
+
}, value));
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
children: publicChildren,
|
|
66
|
+
linkChildren: linkChildren2
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
const { children, linkChildren } = useChildren();
|
|
70
|
+
const opened = computed(() => children.some((item) => item.state.showWrapper));
|
|
71
|
+
const classes = computed(() => {
|
|
72
|
+
const prefixCls = componentName;
|
|
73
|
+
return {
|
|
74
|
+
[prefixCls]: true,
|
|
75
|
+
"scroll-fixed": isScrollFixed.value
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
const updateOffset = () => {
|
|
79
|
+
if (barRef.value) {
|
|
80
|
+
const rect = useRect(barRef);
|
|
81
|
+
if (props.direction === "down") {
|
|
82
|
+
offset.value = rect.bottom;
|
|
83
|
+
} else {
|
|
84
|
+
offset.value = window.innerHeight - rect.top;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
linkChildren({ props, offset });
|
|
89
|
+
const toggleItem = (active) => {
|
|
90
|
+
children.forEach((item, index2) => {
|
|
91
|
+
if (index2 === active) {
|
|
92
|
+
updateOffset();
|
|
93
|
+
item.toggle();
|
|
94
|
+
} else if (item.state.showPopup) {
|
|
95
|
+
item.toggle(false, { immediate: true });
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
const getScrollTop = (el) => {
|
|
100
|
+
return Math.max(0, "scrollTop" in el ? el.scrollTop : el.pageYOffset);
|
|
101
|
+
};
|
|
102
|
+
const onScroll = () => {
|
|
103
|
+
const { scrollFixed } = props;
|
|
104
|
+
const scrollTop = getScrollTop(window);
|
|
105
|
+
isScrollFixed.value = scrollTop > (typeof scrollFixed === "boolean" ? 30 : Number(scrollFixed));
|
|
106
|
+
};
|
|
107
|
+
const getClasses = (showPopup) => {
|
|
108
|
+
let str = "";
|
|
109
|
+
const { titleClass } = props;
|
|
110
|
+
if (showPopup) {
|
|
111
|
+
str += "active";
|
|
112
|
+
}
|
|
113
|
+
if (titleClass) {
|
|
114
|
+
str += ` ${titleClass}`;
|
|
115
|
+
}
|
|
116
|
+
return str;
|
|
117
|
+
};
|
|
118
|
+
onMounted(() => {
|
|
119
|
+
const { scrollFixed } = props;
|
|
120
|
+
if (scrollFixed) {
|
|
121
|
+
window.addEventListener("scroll", onScroll);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
onUnmounted(() => {
|
|
125
|
+
const { scrollFixed } = props;
|
|
126
|
+
if (scrollFixed) {
|
|
127
|
+
window.removeEventListener("scroll", onScroll);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
131
|
+
toggleItem,
|
|
132
|
+
children,
|
|
133
|
+
opened,
|
|
134
|
+
classes,
|
|
135
|
+
barRef,
|
|
136
|
+
getClasses
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
const _hoisted_1 = ["onClick"];
|
|
141
|
+
const _hoisted_2 = { class: "nut-menu__title-text" };
|
|
142
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
143
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
144
|
+
return openBlock(), createElementBlock("view", {
|
|
145
|
+
class: normalizeClass(_ctx.classes)
|
|
146
|
+
}, [
|
|
147
|
+
createElementVNode("view", {
|
|
148
|
+
class: normalizeClass(["nut-menu__bar", { opened: _ctx.opened }]),
|
|
149
|
+
ref: "barRef"
|
|
150
|
+
}, [
|
|
151
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.children, (item, index2) => {
|
|
152
|
+
return openBlock(), createElementBlock("view", {
|
|
153
|
+
key: index2,
|
|
154
|
+
class: normalizeClass(["nut-menu__item", { disabled: item.disabled, active: item.state.showPopup }]),
|
|
155
|
+
onClick: ($event) => !item.disabled && _ctx.toggleItem(index2),
|
|
156
|
+
style: normalizeStyle({ color: item.state.showPopup ? _ctx.activeColor : "" })
|
|
157
|
+
}, [
|
|
158
|
+
createElementVNode("view", {
|
|
159
|
+
class: normalizeClass(["nut-menu__title", _ctx.getClasses(item.state.showPopup)])
|
|
160
|
+
}, [
|
|
161
|
+
createElementVNode("view", _hoisted_2, toDisplayString(item.renderTitle()), 1),
|
|
162
|
+
createVNode(_component_nut_icon, {
|
|
163
|
+
name: item.titleIcon || (_ctx.direction === "up" ? "arrow-up" : "down-arrow"),
|
|
164
|
+
size: "10",
|
|
165
|
+
class: "nut-menu__title-icon"
|
|
166
|
+
}, null, 8, ["name"])
|
|
167
|
+
], 2)
|
|
168
|
+
], 14, _hoisted_1);
|
|
169
|
+
}), 128))
|
|
170
|
+
], 2),
|
|
171
|
+
renderSlot(_ctx.$slots, "default")
|
|
172
|
+
], 2);
|
|
173
|
+
}
|
|
174
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
175
|
+
export { index as default };
|
|
@@ -0,0 +1,181 @@
|
|
|
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 { reactive, computed, inject, getCurrentInstance, resolveComponent, withDirectives, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, vShow, createVNode, mergeProps, withCtx, Fragment, renderList, createBlock, createCommentVNode, toDisplayString, renderSlot } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import _sfc_main$1 from "./Icon.js";
|
|
9
|
+
import Popup from "./Popup.js";
|
|
10
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
|
+
import "../locale/lang";
|
|
12
|
+
import "./pxCheck.js";
|
|
13
|
+
import "./OverLay.js";
|
|
14
|
+
const { componentName, create } = createComponent("menu-item");
|
|
15
|
+
const _sfc_main = create({
|
|
16
|
+
props: {
|
|
17
|
+
title: String,
|
|
18
|
+
options: {
|
|
19
|
+
type: Array,
|
|
20
|
+
default: []
|
|
21
|
+
},
|
|
22
|
+
disabled: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
modelValue: null,
|
|
27
|
+
cols: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 1
|
|
30
|
+
},
|
|
31
|
+
titleIcon: String,
|
|
32
|
+
optionIcon: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "Check"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
components: {
|
|
38
|
+
[_sfc_main$1.name]: _sfc_main$1,
|
|
39
|
+
[Popup.name]: Popup
|
|
40
|
+
},
|
|
41
|
+
emits: ["update:modelValue", "change"],
|
|
42
|
+
setup(props, { emit, slots }) {
|
|
43
|
+
const state = reactive({
|
|
44
|
+
showPopup: false,
|
|
45
|
+
transition: true,
|
|
46
|
+
showWrapper: false,
|
|
47
|
+
isShowPlaceholderElement: false
|
|
48
|
+
});
|
|
49
|
+
const useParent = () => {
|
|
50
|
+
const parent2 = inject("menuParent", null);
|
|
51
|
+
if (parent2) {
|
|
52
|
+
const instance = getCurrentInstance();
|
|
53
|
+
const { link } = parent2;
|
|
54
|
+
link(instance);
|
|
55
|
+
return {
|
|
56
|
+
parent: parent2
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const { parent } = useParent();
|
|
61
|
+
const classes = computed(() => {
|
|
62
|
+
const prefixCls = componentName;
|
|
63
|
+
return {
|
|
64
|
+
[prefixCls]: true
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
const placeholderElementStyle = computed(() => {
|
|
68
|
+
const heightStyle = { height: parent.offset.value + "px" };
|
|
69
|
+
if (parent.props.direction === "down") {
|
|
70
|
+
return heightStyle;
|
|
71
|
+
} else {
|
|
72
|
+
return { ...heightStyle, top: "auto" };
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const toggle = (show = !state.showPopup, options = {}) => {
|
|
76
|
+
if (show === state.showPopup) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
state.showPopup = show;
|
|
80
|
+
state.isShowPlaceholderElement = show;
|
|
81
|
+
if (show) {
|
|
82
|
+
state.showWrapper = true;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const renderTitle = () => {
|
|
86
|
+
var _a;
|
|
87
|
+
if (props.title) {
|
|
88
|
+
return props.title;
|
|
89
|
+
}
|
|
90
|
+
const match = (_a = props.options) == null ? void 0 : _a.find((option) => option.value === props.modelValue);
|
|
91
|
+
return match ? match.text : "";
|
|
92
|
+
};
|
|
93
|
+
const onClick = (option) => {
|
|
94
|
+
state.showPopup = false;
|
|
95
|
+
state.isShowPlaceholderElement = false;
|
|
96
|
+
if (option.value !== props.modelValue) {
|
|
97
|
+
emit("update:modelValue", option.value);
|
|
98
|
+
emit("change", option.value);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const handleClose = () => {
|
|
102
|
+
state.showWrapper = false;
|
|
103
|
+
state.isShowPlaceholderElement = false;
|
|
104
|
+
};
|
|
105
|
+
const handleClickOutside = () => {
|
|
106
|
+
state.showPopup = false;
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
classes,
|
|
110
|
+
placeholderElementStyle,
|
|
111
|
+
renderTitle,
|
|
112
|
+
state,
|
|
113
|
+
parent,
|
|
114
|
+
toggle,
|
|
115
|
+
onClick,
|
|
116
|
+
handleClose,
|
|
117
|
+
handleClickOutside
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
const _hoisted_1 = { class: "nut-menu-item__content" };
|
|
122
|
+
const _hoisted_2 = ["onClick"];
|
|
123
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
124
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
125
|
+
const _component_nut_popup = resolveComponent("nut-popup");
|
|
126
|
+
return withDirectives((openBlock(), createElementBlock("view", {
|
|
127
|
+
class: normalizeClass(_ctx.classes)
|
|
128
|
+
}, [
|
|
129
|
+
withDirectives(createElementVNode("div", {
|
|
130
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClickOutside && _ctx.handleClickOutside(...args)),
|
|
131
|
+
class: normalizeClass(["placeholder-element", { up: _ctx.parent.props.direction === "up" }]),
|
|
132
|
+
style: normalizeStyle(_ctx.placeholderElementStyle)
|
|
133
|
+
}, null, 6), [
|
|
134
|
+
[vShow, _ctx.state.isShowPlaceholderElement]
|
|
135
|
+
]),
|
|
136
|
+
createVNode(_component_nut_popup, mergeProps({
|
|
137
|
+
style: _ctx.parent.props.direction === "down" ? { top: _ctx.parent.offset.value + "px" } : { bottom: _ctx.parent.offset.value + "px" },
|
|
138
|
+
overlayStyle: _ctx.parent.props.direction === "down" ? { top: _ctx.parent.offset.value + "px" } : { bottom: _ctx.parent.offset.value + "px" }
|
|
139
|
+
}, _ctx.$attrs, {
|
|
140
|
+
visible: _ctx.state.showPopup,
|
|
141
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.state.showPopup = $event),
|
|
142
|
+
position: _ctx.parent.props.direction === "down" ? "top" : "bottom",
|
|
143
|
+
duration: _ctx.parent.props.duration,
|
|
144
|
+
"pop-class": "nut-menu__pop",
|
|
145
|
+
overlayClass: "nut-menu__overlay",
|
|
146
|
+
overlay: _ctx.parent.props.overlay,
|
|
147
|
+
onClosed: _ctx.handleClose,
|
|
148
|
+
lockScroll: _ctx.parent.props.lockScroll,
|
|
149
|
+
isWrapTeleport: false,
|
|
150
|
+
"close-on-click-overlay": _ctx.parent.props.closeOnClickOverlay
|
|
151
|
+
}), {
|
|
152
|
+
default: withCtx(() => [
|
|
153
|
+
createElementVNode("view", _hoisted_1, [
|
|
154
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index2) => {
|
|
155
|
+
return openBlock(), createElementBlock("view", {
|
|
156
|
+
key: index2,
|
|
157
|
+
class: normalizeClass(["nut-menu-item__option", { active: option.value === _ctx.modelValue }]),
|
|
158
|
+
style: normalizeStyle({ "flex-basis": 100 / _ctx.cols + "%" }),
|
|
159
|
+
onClick: ($event) => _ctx.onClick(option)
|
|
160
|
+
}, [
|
|
161
|
+
option.value === _ctx.modelValue ? (openBlock(), createBlock(_component_nut_icon, {
|
|
162
|
+
key: 0,
|
|
163
|
+
name: _ctx.optionIcon,
|
|
164
|
+
color: _ctx.parent.props.activeColor
|
|
165
|
+
}, null, 8, ["name", "color"])) : createCommentVNode("", true),
|
|
166
|
+
createElementVNode("view", {
|
|
167
|
+
style: normalizeStyle({ color: option.value === _ctx.modelValue ? _ctx.parent.props.activeColor : "" })
|
|
168
|
+
}, toDisplayString(option.text), 5)
|
|
169
|
+
], 14, _hoisted_2);
|
|
170
|
+
}), 128)),
|
|
171
|
+
renderSlot(_ctx.$slots, "default")
|
|
172
|
+
])
|
|
173
|
+
]),
|
|
174
|
+
_: 3
|
|
175
|
+
}, 16, ["style", "overlayStyle", "visible", "position", "duration", "overlay", "onClosed", "lockScroll", "close-on-click-overlay"])
|
|
176
|
+
], 2)), [
|
|
177
|
+
[vShow, _ctx.state.showWrapper]
|
|
178
|
+
]);
|
|
179
|
+
}
|
|
180
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
181
|
+
export { index as default };
|