@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,256 @@
|
|
|
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, onMounted, onUnmounted, ref, onActivated, onDeactivated, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, toDisplayString, renderSlot, Fragment, createCommentVNode } 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("infiniteloading");
|
|
11
|
+
const _sfc_main = create({
|
|
12
|
+
props: {
|
|
13
|
+
hasMore: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: true
|
|
16
|
+
},
|
|
17
|
+
threshold: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 200
|
|
20
|
+
},
|
|
21
|
+
pullIcon: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png"
|
|
24
|
+
},
|
|
25
|
+
pullTxt: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
loadIcon: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png"
|
|
32
|
+
},
|
|
33
|
+
loadTxt: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: ""
|
|
36
|
+
},
|
|
37
|
+
loadMoreTxt: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: ""
|
|
40
|
+
},
|
|
41
|
+
useWindow: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true
|
|
44
|
+
},
|
|
45
|
+
containerId: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
useCapture: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
},
|
|
53
|
+
isOpenRefresh: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
emits: ["scroll-change", "load-more", "refresh"],
|
|
59
|
+
setup(props, { emit, slots }) {
|
|
60
|
+
const state = reactive({
|
|
61
|
+
scrollEl: window,
|
|
62
|
+
scroller: null,
|
|
63
|
+
refreshTop: null,
|
|
64
|
+
beforeScrollTop: 0,
|
|
65
|
+
isTouching: false,
|
|
66
|
+
isInfiniting: false,
|
|
67
|
+
refreshMaxH: 0,
|
|
68
|
+
y: 0,
|
|
69
|
+
x: 0,
|
|
70
|
+
distance: 0
|
|
71
|
+
});
|
|
72
|
+
const classes = computed(() => {
|
|
73
|
+
const prefixCls = componentName;
|
|
74
|
+
return {
|
|
75
|
+
[prefixCls]: true
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
const getStyle = computed(() => {
|
|
79
|
+
return {
|
|
80
|
+
height: state.distance < 0 ? `0px` : `${state.distance}px`,
|
|
81
|
+
transition: state.isTouching ? `height 0s cubic-bezier(0.25,0.1,0.25,1)` : `height 0.2s cubic-bezier(0.25,0.1,0.25,1)`
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
const requestAniFrame = () => {
|
|
85
|
+
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
|
|
86
|
+
window.setTimeout(callback, 1e3 / 60);
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const getWindowScrollTop = () => {
|
|
90
|
+
return window.pageYOffset !== void 0 ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
|
|
91
|
+
};
|
|
92
|
+
const calculateTopPosition = (el) => {
|
|
93
|
+
return !el ? 0 : el.offsetTop + calculateTopPosition(el.offsetParent);
|
|
94
|
+
};
|
|
95
|
+
const isScrollAtBottom = () => {
|
|
96
|
+
let offsetDistance = 0;
|
|
97
|
+
let resScrollTop = 0;
|
|
98
|
+
let direction = "down";
|
|
99
|
+
const windowScrollTop = getWindowScrollTop();
|
|
100
|
+
if (props.useWindow) {
|
|
101
|
+
if (state.scroller) {
|
|
102
|
+
offsetDistance = calculateTopPosition(state.scroller) + state.scroller.offsetHeight - windowScrollTop - window.innerHeight;
|
|
103
|
+
}
|
|
104
|
+
resScrollTop = windowScrollTop;
|
|
105
|
+
} else {
|
|
106
|
+
const { scrollHeight, clientHeight, scrollTop } = state.scrollEl;
|
|
107
|
+
offsetDistance = scrollHeight - clientHeight - scrollTop;
|
|
108
|
+
resScrollTop = scrollTop;
|
|
109
|
+
}
|
|
110
|
+
if (state.beforeScrollTop > resScrollTop) {
|
|
111
|
+
direction = "up";
|
|
112
|
+
} else {
|
|
113
|
+
direction = "down";
|
|
114
|
+
}
|
|
115
|
+
state.beforeScrollTop = resScrollTop;
|
|
116
|
+
emit("scroll-change", resScrollTop);
|
|
117
|
+
return offsetDistance <= props.threshold && direction == "down";
|
|
118
|
+
};
|
|
119
|
+
const infiniteDone = () => {
|
|
120
|
+
state.isInfiniting = false;
|
|
121
|
+
};
|
|
122
|
+
const handleScroll = () => {
|
|
123
|
+
requestAniFrame()(() => {
|
|
124
|
+
if (!isScrollAtBottom() || !props.hasMore || state.isInfiniting) {
|
|
125
|
+
return false;
|
|
126
|
+
} else {
|
|
127
|
+
state.isInfiniting = true;
|
|
128
|
+
emit("load-more", infiniteDone);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
const scrollListener = () => {
|
|
133
|
+
state.scrollEl.addEventListener("scroll", handleScroll, props.useCapture);
|
|
134
|
+
};
|
|
135
|
+
const refreshDone = () => {
|
|
136
|
+
state.distance = 0;
|
|
137
|
+
state.isTouching = false;
|
|
138
|
+
};
|
|
139
|
+
const touchStart = (event) => {
|
|
140
|
+
if (state.beforeScrollTop == 0 && !state.isTouching && props.isOpenRefresh) {
|
|
141
|
+
state.y = event.touches[0].pageY;
|
|
142
|
+
state.isTouching = true;
|
|
143
|
+
const childHeight = state.refreshTop.firstElementChild.offsetHeight;
|
|
144
|
+
state.refreshMaxH = Math.floor(childHeight * 1 + 10);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const touchMove = (event) => {
|
|
148
|
+
state.distance = event.touches[0].pageY - state.y;
|
|
149
|
+
if (state.distance > 0 && state.isTouching) {
|
|
150
|
+
event.preventDefault();
|
|
151
|
+
if (state.distance >= state.refreshMaxH)
|
|
152
|
+
state.distance = state.refreshMaxH;
|
|
153
|
+
} else {
|
|
154
|
+
state.distance = 0;
|
|
155
|
+
state.isTouching = false;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const touchEnd = () => {
|
|
159
|
+
if (state.distance) {
|
|
160
|
+
if (state.distance < state.refreshMaxH) {
|
|
161
|
+
state.distance = 0;
|
|
162
|
+
} else {
|
|
163
|
+
emit("refresh", refreshDone);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
const getParentElement = (el) => {
|
|
168
|
+
return !!props.containerId ? document.querySelector(`#${props.containerId}`) : el && el.parentNode;
|
|
169
|
+
};
|
|
170
|
+
onMounted(() => {
|
|
171
|
+
const parentElement = getParentElement(state.scroller);
|
|
172
|
+
state.scrollEl = props.useWindow ? window : parentElement;
|
|
173
|
+
scrollListener();
|
|
174
|
+
console.log(slots);
|
|
175
|
+
});
|
|
176
|
+
onUnmounted(() => {
|
|
177
|
+
state.scrollEl.removeEventListener("scroll", handleScroll, props.useCapture);
|
|
178
|
+
});
|
|
179
|
+
const isKeepAlive = ref(false);
|
|
180
|
+
onActivated(() => {
|
|
181
|
+
if (isKeepAlive.value) {
|
|
182
|
+
isKeepAlive.value = false;
|
|
183
|
+
scrollListener();
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
onDeactivated(() => {
|
|
187
|
+
isKeepAlive.value = true;
|
|
188
|
+
state.scrollEl.removeEventListener("scroll", handleScroll, props.useCapture);
|
|
189
|
+
});
|
|
190
|
+
return {
|
|
191
|
+
classes,
|
|
192
|
+
...toRefs(state),
|
|
193
|
+
touchStart,
|
|
194
|
+
touchMove,
|
|
195
|
+
touchEnd,
|
|
196
|
+
getStyle,
|
|
197
|
+
translate,
|
|
198
|
+
slots
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
const _hoisted_1 = { class: "top-box" };
|
|
203
|
+
const _hoisted_2 = { class: "top-text" };
|
|
204
|
+
const _hoisted_3 = { class: "nut-infinite-container" };
|
|
205
|
+
const _hoisted_4 = { class: "nut-infinite-bottom" };
|
|
206
|
+
const _hoisted_5 = {
|
|
207
|
+
key: 0,
|
|
208
|
+
class: "bottom-box"
|
|
209
|
+
};
|
|
210
|
+
const _hoisted_6 = { class: "bottom-text" };
|
|
211
|
+
const _hoisted_7 = {
|
|
212
|
+
key: 0,
|
|
213
|
+
class: "tips"
|
|
214
|
+
};
|
|
215
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
216
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
217
|
+
return openBlock(), createElementBlock("view", {
|
|
218
|
+
class: normalizeClass(_ctx.classes),
|
|
219
|
+
ref: "scroller",
|
|
220
|
+
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.touchStart && _ctx.touchStart(...args)),
|
|
221
|
+
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.touchMove && _ctx.touchMove(...args)),
|
|
222
|
+
onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.touchEnd && _ctx.touchEnd(...args))
|
|
223
|
+
}, [
|
|
224
|
+
createElementVNode("view", {
|
|
225
|
+
class: "nut-infinite-top",
|
|
226
|
+
ref: "refreshTop",
|
|
227
|
+
style: normalizeStyle(_ctx.getStyle)
|
|
228
|
+
}, [
|
|
229
|
+
createElementVNode("view", _hoisted_1, [
|
|
230
|
+
createVNode(_component_nut_icon, {
|
|
231
|
+
class: "top-img",
|
|
232
|
+
name: _ctx.pullIcon
|
|
233
|
+
}, null, 8, ["name"]),
|
|
234
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.pullTxt || _ctx.translate("pullTxt")), 1)
|
|
235
|
+
])
|
|
236
|
+
], 4),
|
|
237
|
+
createElementVNode("view", _hoisted_3, [
|
|
238
|
+
renderSlot(_ctx.$slots, "default")
|
|
239
|
+
]),
|
|
240
|
+
createElementVNode("view", _hoisted_4, [
|
|
241
|
+
_ctx.isInfiniting ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
242
|
+
!_ctx.slots.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
243
|
+
createVNode(_component_nut_icon, {
|
|
244
|
+
class: "bottom-img",
|
|
245
|
+
name: _ctx.loadIcon
|
|
246
|
+
}, null, 8, ["name"]),
|
|
247
|
+
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.loadTxt || _ctx.translate("loading")), 1)
|
|
248
|
+
], 64)) : renderSlot(_ctx.$slots, "loading", { key: 1 })
|
|
249
|
+
])) : !_ctx.hasMore ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
250
|
+
!_ctx.slots.finished ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.loadMoreTxt || _ctx.translate("loadMoreTxt")), 1)) : renderSlot(_ctx.$slots, "finished", { key: 1 })
|
|
251
|
+
], 64)) : createCommentVNode("", true)
|
|
252
|
+
])
|
|
253
|
+
], 34);
|
|
254
|
+
}
|
|
255
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
256
|
+
export { index as default };
|
|
@@ -0,0 +1,440 @@
|
|
|
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, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, normalizeStyle, createElementVNode, toDisplayString, createCommentVNode, renderSlot, createVNode, withDirectives, createBlock, vShow, createTextVNode } 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
|
+
function trimExtraChar(value, char, regExp) {
|
|
11
|
+
const index2 = value.indexOf(char);
|
|
12
|
+
if (index2 === -1) {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
if (char === "-" && index2 !== 0) {
|
|
16
|
+
return value.slice(0, index2);
|
|
17
|
+
}
|
|
18
|
+
return value.slice(0, index2 + 1) + value.slice(index2).replace(regExp, "");
|
|
19
|
+
}
|
|
20
|
+
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
21
|
+
if (allowDot) {
|
|
22
|
+
value = trimExtraChar(value, ".", /\./g);
|
|
23
|
+
} else {
|
|
24
|
+
value = value.split(".")[0];
|
|
25
|
+
}
|
|
26
|
+
if (allowMinus) {
|
|
27
|
+
value = trimExtraChar(value, "-", /-/g);
|
|
28
|
+
} else {
|
|
29
|
+
value = value.replace(/-/, "");
|
|
30
|
+
}
|
|
31
|
+
const regExp = allowDot ? /[^-0-9.]/g : /[^-0-9]/g;
|
|
32
|
+
return value.replace(regExp, "");
|
|
33
|
+
}
|
|
34
|
+
const { componentName, create, translate } = createComponent("input");
|
|
35
|
+
const _sfc_main = create({
|
|
36
|
+
props: {
|
|
37
|
+
ref: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: ""
|
|
40
|
+
},
|
|
41
|
+
type: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "text"
|
|
44
|
+
},
|
|
45
|
+
modelValue: {
|
|
46
|
+
type: [String, Number],
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
placeholder: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ""
|
|
52
|
+
},
|
|
53
|
+
label: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: ""
|
|
56
|
+
},
|
|
57
|
+
labelClass: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: ""
|
|
60
|
+
},
|
|
61
|
+
labelWidth: {
|
|
62
|
+
type: [String, Number],
|
|
63
|
+
default: "80"
|
|
64
|
+
},
|
|
65
|
+
labelAlign: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "left"
|
|
68
|
+
},
|
|
69
|
+
colon: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
72
|
+
},
|
|
73
|
+
inputAlign: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: "left"
|
|
76
|
+
},
|
|
77
|
+
center: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: false
|
|
80
|
+
},
|
|
81
|
+
required: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
85
|
+
disabled: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false
|
|
88
|
+
},
|
|
89
|
+
readonly: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false
|
|
92
|
+
},
|
|
93
|
+
error: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
97
|
+
maxLength: {
|
|
98
|
+
type: [String, Number],
|
|
99
|
+
default: "9999"
|
|
100
|
+
},
|
|
101
|
+
leftIcon: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: ""
|
|
104
|
+
},
|
|
105
|
+
leftIconSize: {
|
|
106
|
+
type: [String, Number],
|
|
107
|
+
default: ""
|
|
108
|
+
},
|
|
109
|
+
rightIcon: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: ""
|
|
112
|
+
},
|
|
113
|
+
rightIconSize: {
|
|
114
|
+
type: [String, Number],
|
|
115
|
+
default: ""
|
|
116
|
+
},
|
|
117
|
+
clearable: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: false
|
|
120
|
+
},
|
|
121
|
+
clearIcon: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: "mask-close"
|
|
124
|
+
},
|
|
125
|
+
clearSize: {
|
|
126
|
+
type: [String, Number],
|
|
127
|
+
default: "14"
|
|
128
|
+
},
|
|
129
|
+
border: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: true
|
|
132
|
+
},
|
|
133
|
+
formatTrigger: {
|
|
134
|
+
type: String,
|
|
135
|
+
default: "onChange"
|
|
136
|
+
},
|
|
137
|
+
formatter: {
|
|
138
|
+
type: Function,
|
|
139
|
+
default: null
|
|
140
|
+
},
|
|
141
|
+
rules: {
|
|
142
|
+
type: Array,
|
|
143
|
+
default: []
|
|
144
|
+
},
|
|
145
|
+
errorMessage: {
|
|
146
|
+
type: String,
|
|
147
|
+
default: ""
|
|
148
|
+
},
|
|
149
|
+
errorMessageAlign: {
|
|
150
|
+
type: String,
|
|
151
|
+
default: ""
|
|
152
|
+
},
|
|
153
|
+
rows: {
|
|
154
|
+
type: [String, Number],
|
|
155
|
+
default: null
|
|
156
|
+
},
|
|
157
|
+
showWordLimit: {
|
|
158
|
+
type: Boolean,
|
|
159
|
+
default: false
|
|
160
|
+
},
|
|
161
|
+
autofocus: {
|
|
162
|
+
type: Boolean,
|
|
163
|
+
default: false
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
emits: [
|
|
167
|
+
"update:modelValue",
|
|
168
|
+
"change",
|
|
169
|
+
"blur",
|
|
170
|
+
"focus",
|
|
171
|
+
"clear",
|
|
172
|
+
"keypress",
|
|
173
|
+
"click-input",
|
|
174
|
+
"click-left-icon",
|
|
175
|
+
"click-right-icon"
|
|
176
|
+
],
|
|
177
|
+
setup(props, { emit, slots }) {
|
|
178
|
+
const active = ref(false);
|
|
179
|
+
const inputRef = ref();
|
|
180
|
+
ref();
|
|
181
|
+
const getModelValue = () => {
|
|
182
|
+
var _a;
|
|
183
|
+
return String((_a = props.modelValue) != null ? _a : "");
|
|
184
|
+
};
|
|
185
|
+
const state = reactive({
|
|
186
|
+
focused: false,
|
|
187
|
+
validateFailed: false,
|
|
188
|
+
validateMessage: ""
|
|
189
|
+
});
|
|
190
|
+
const classes = computed(() => {
|
|
191
|
+
const prefixCls = componentName;
|
|
192
|
+
return {
|
|
193
|
+
[prefixCls]: true,
|
|
194
|
+
center: props.center,
|
|
195
|
+
[`${prefixCls}-disabled`]: props.disabled,
|
|
196
|
+
[`${prefixCls}-required`]: props.required,
|
|
197
|
+
[`${prefixCls}-error`]: props.error,
|
|
198
|
+
[`${prefixCls}-border`]: props.border
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
const styles = computed(() => {
|
|
202
|
+
return {
|
|
203
|
+
textAlign: props.inputAlign
|
|
204
|
+
};
|
|
205
|
+
});
|
|
206
|
+
const stylesTextarea = computed(() => {
|
|
207
|
+
return {
|
|
208
|
+
textAlign: props.inputAlign,
|
|
209
|
+
height: Number(props.rows) * 24 + "px"
|
|
210
|
+
};
|
|
211
|
+
});
|
|
212
|
+
const inputType = (type) => {
|
|
213
|
+
if (type === "number") {
|
|
214
|
+
return "text";
|
|
215
|
+
} else if (type === "digit") {
|
|
216
|
+
return "tel";
|
|
217
|
+
} else {
|
|
218
|
+
return type;
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
const onInput = (event) => {
|
|
222
|
+
const input = event.target;
|
|
223
|
+
let value = input.value;
|
|
224
|
+
if (props.maxLength && value.length > Number(props.maxLength)) {
|
|
225
|
+
value = value.slice(0, Number(props.maxLength));
|
|
226
|
+
}
|
|
227
|
+
updateValue(value);
|
|
228
|
+
};
|
|
229
|
+
const updateValue = (value, trigger = "onChange") => {
|
|
230
|
+
var _a;
|
|
231
|
+
if (props.type === "digit") {
|
|
232
|
+
value = formatNumber(value, false, false);
|
|
233
|
+
}
|
|
234
|
+
if (props.type === "number") {
|
|
235
|
+
value = formatNumber(value, true, true);
|
|
236
|
+
}
|
|
237
|
+
if (props.formatter && trigger === props.formatTrigger) {
|
|
238
|
+
value = props.formatter(value);
|
|
239
|
+
}
|
|
240
|
+
if (((_a = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _a.value) !== value) {
|
|
241
|
+
inputRef.value.value = value;
|
|
242
|
+
}
|
|
243
|
+
if (value !== props.modelValue) {
|
|
244
|
+
emit("update:modelValue", value);
|
|
245
|
+
emit("change", value);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
const onFocus = (event) => {
|
|
249
|
+
const input = event.target;
|
|
250
|
+
let value = input.value;
|
|
251
|
+
active.value = true;
|
|
252
|
+
emit("focus", value, event);
|
|
253
|
+
};
|
|
254
|
+
const onBlur = (event) => {
|
|
255
|
+
setTimeout(() => {
|
|
256
|
+
active.value = false;
|
|
257
|
+
}, 200);
|
|
258
|
+
const input = event.target;
|
|
259
|
+
let value = input.value;
|
|
260
|
+
if (props.maxLength && value.length > Number(props.maxLength)) {
|
|
261
|
+
value = value.slice(0, Number(props.maxLength));
|
|
262
|
+
}
|
|
263
|
+
updateValue(getModelValue(), "onBlur");
|
|
264
|
+
emit("blur", value, event);
|
|
265
|
+
};
|
|
266
|
+
const clear = (event) => {
|
|
267
|
+
emit("update:modelValue", "", event);
|
|
268
|
+
emit("change", "", event);
|
|
269
|
+
emit("clear", "", event);
|
|
270
|
+
};
|
|
271
|
+
const resetValidation = () => {
|
|
272
|
+
if (state.validateFailed) {
|
|
273
|
+
state.validateFailed = false;
|
|
274
|
+
state.validateMessage = "";
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
const onClickInput = (event) => {
|
|
278
|
+
emit("click-input", event);
|
|
279
|
+
};
|
|
280
|
+
const onClickLeftIcon = (event) => emit("click-left-icon", event);
|
|
281
|
+
const onClickRightIcon = (event) => emit("click-right-icon", event);
|
|
282
|
+
watch(() => props.modelValue, () => {
|
|
283
|
+
updateValue(getModelValue());
|
|
284
|
+
resetValidation();
|
|
285
|
+
});
|
|
286
|
+
onMounted(() => {
|
|
287
|
+
updateValue(getModelValue(), props.formatTrigger);
|
|
288
|
+
});
|
|
289
|
+
return {
|
|
290
|
+
inputRef,
|
|
291
|
+
active,
|
|
292
|
+
classes,
|
|
293
|
+
styles,
|
|
294
|
+
stylesTextarea,
|
|
295
|
+
inputType,
|
|
296
|
+
onInput,
|
|
297
|
+
onFocus,
|
|
298
|
+
onBlur,
|
|
299
|
+
clear,
|
|
300
|
+
onClickInput,
|
|
301
|
+
onClickLeftIcon,
|
|
302
|
+
onClickRightIcon,
|
|
303
|
+
translate
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
const _hoisted_1 = { class: "label-string" };
|
|
308
|
+
const _hoisted_2 = { class: "nut-input-value" };
|
|
309
|
+
const _hoisted_3 = { class: "label-string" };
|
|
310
|
+
const _hoisted_4 = { class: "nut-input-value" };
|
|
311
|
+
const _hoisted_5 = ["maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "autofocus"];
|
|
312
|
+
const _hoisted_6 = ["type", "maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "autofocus"];
|
|
313
|
+
const _hoisted_7 = {
|
|
314
|
+
key: 0,
|
|
315
|
+
class: "nut-input-word-limit"
|
|
316
|
+
};
|
|
317
|
+
const _hoisted_8 = { class: "nut-input-word-num" };
|
|
318
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
319
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
320
|
+
return openBlock(), createElementBlock("view", {
|
|
321
|
+
class: normalizeClass(_ctx.classes)
|
|
322
|
+
}, [
|
|
323
|
+
_ctx.$slots.input ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
324
|
+
_ctx.label ? (openBlock(), createElementBlock("view", {
|
|
325
|
+
key: 0,
|
|
326
|
+
class: normalizeClass(["nut-input-label", _ctx.labelClass]),
|
|
327
|
+
style: normalizeStyle({
|
|
328
|
+
width: `${_ctx.labelWidth}px`,
|
|
329
|
+
textAlign: _ctx.labelAlign
|
|
330
|
+
})
|
|
331
|
+
}, [
|
|
332
|
+
createElementVNode("view", _hoisted_1, toDisplayString(_ctx.label) + " " + toDisplayString(_ctx.colon ? ":" : ""), 1)
|
|
333
|
+
], 6)) : createCommentVNode("", true),
|
|
334
|
+
createElementVNode("view", _hoisted_2, [
|
|
335
|
+
createElementVNode("view", {
|
|
336
|
+
class: "nut-input-inner",
|
|
337
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClickInput && _ctx.onClickInput(...args))
|
|
338
|
+
}, [
|
|
339
|
+
renderSlot(_ctx.$slots, "input")
|
|
340
|
+
])
|
|
341
|
+
])
|
|
342
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
343
|
+
_ctx.leftIcon && _ctx.leftIcon.length > 0 ? (openBlock(), createElementBlock("view", {
|
|
344
|
+
key: 0,
|
|
345
|
+
class: "nut-input-left-icon",
|
|
346
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClickLeftIcon && _ctx.onClickLeftIcon(...args))
|
|
347
|
+
}, [
|
|
348
|
+
createVNode(_component_nut_icon, {
|
|
349
|
+
name: _ctx.leftIcon,
|
|
350
|
+
size: _ctx.leftIconSize
|
|
351
|
+
}, null, 8, ["name", "size"])
|
|
352
|
+
])) : createCommentVNode("", true),
|
|
353
|
+
_ctx.label ? (openBlock(), createElementBlock("view", {
|
|
354
|
+
key: 1,
|
|
355
|
+
class: normalizeClass(["nut-input-label", _ctx.labelClass]),
|
|
356
|
+
style: normalizeStyle({
|
|
357
|
+
width: `${_ctx.labelWidth}px`,
|
|
358
|
+
textAlign: _ctx.labelAlign
|
|
359
|
+
})
|
|
360
|
+
}, [
|
|
361
|
+
createElementVNode("view", _hoisted_3, toDisplayString(_ctx.label) + " " + toDisplayString(_ctx.colon ? ":" : ""), 1)
|
|
362
|
+
], 6)) : createCommentVNode("", true),
|
|
363
|
+
createElementVNode("view", _hoisted_4, [
|
|
364
|
+
createElementVNode("view", {
|
|
365
|
+
class: "nut-input-inner",
|
|
366
|
+
onClick: _cache[9] || (_cache[9] = (...args) => _ctx.onClickInput && _ctx.onClickInput(...args))
|
|
367
|
+
}, [
|
|
368
|
+
_ctx.type == "textarea" ? (openBlock(), createElementBlock("textarea", {
|
|
369
|
+
key: 0,
|
|
370
|
+
class: "input-text",
|
|
371
|
+
ref: "inputRef",
|
|
372
|
+
style: normalizeStyle(_ctx.stylesTextarea),
|
|
373
|
+
maxlength: _ctx.maxLength,
|
|
374
|
+
placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
|
|
375
|
+
disabled: _ctx.disabled,
|
|
376
|
+
readonly: _ctx.readonly,
|
|
377
|
+
value: _ctx.modelValue,
|
|
378
|
+
formatTrigger: _ctx.formatTrigger,
|
|
379
|
+
autofocus: _ctx.autofocus,
|
|
380
|
+
onInput: _cache[2] || (_cache[2] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
381
|
+
onFocus: _cache[3] || (_cache[3] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
382
|
+
onBlur: _cache[4] || (_cache[4] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
383
|
+
}, null, 44, _hoisted_5)) : (openBlock(), createElementBlock("input", {
|
|
384
|
+
key: 1,
|
|
385
|
+
class: "input-text",
|
|
386
|
+
ref: "inputRef",
|
|
387
|
+
style: normalizeStyle(_ctx.styles),
|
|
388
|
+
type: _ctx.inputType(_ctx.type),
|
|
389
|
+
maxlength: _ctx.maxLength,
|
|
390
|
+
placeholder: _ctx.placeholder || _ctx.translate("placeholder"),
|
|
391
|
+
disabled: _ctx.disabled,
|
|
392
|
+
readonly: _ctx.readonly,
|
|
393
|
+
value: _ctx.modelValue,
|
|
394
|
+
formatTrigger: _ctx.formatTrigger,
|
|
395
|
+
autofocus: _ctx.autofocus,
|
|
396
|
+
onInput: _cache[5] || (_cache[5] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
397
|
+
onFocus: _cache[6] || (_cache[6] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
398
|
+
onBlur: _cache[7] || (_cache[7] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
399
|
+
}, null, 44, _hoisted_6)),
|
|
400
|
+
_ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createBlock(_component_nut_icon, {
|
|
401
|
+
key: 2,
|
|
402
|
+
class: "nut-input-clear",
|
|
403
|
+
name: _ctx.clearIcon,
|
|
404
|
+
size: _ctx.clearSize,
|
|
405
|
+
onClick: _ctx.clear
|
|
406
|
+
}, null, 8, ["name", "size", "onClick"])), [
|
|
407
|
+
[vShow, _ctx.active && _ctx.modelValue.length > 0]
|
|
408
|
+
]) : createCommentVNode("", true),
|
|
409
|
+
_ctx.rightIcon && _ctx.rightIcon.length > 0 ? (openBlock(), createElementBlock("view", {
|
|
410
|
+
key: 3,
|
|
411
|
+
class: "nut-input-right-icon",
|
|
412
|
+
onClick: _cache[8] || (_cache[8] = (...args) => _ctx.onClickRightIcon && _ctx.onClickRightIcon(...args))
|
|
413
|
+
}, [
|
|
414
|
+
createVNode(_component_nut_icon, {
|
|
415
|
+
name: _ctx.rightIcon,
|
|
416
|
+
size: _ctx.rightIconSize
|
|
417
|
+
}, null, 8, ["name", "size"])
|
|
418
|
+
])) : createCommentVNode("", true),
|
|
419
|
+
_ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {
|
|
420
|
+
key: 4,
|
|
421
|
+
class: "nut-input-button"
|
|
422
|
+
}) : createCommentVNode("", true)
|
|
423
|
+
]),
|
|
424
|
+
_ctx.showWordLimit && _ctx.maxLength ? (openBlock(), createElementBlock("view", _hoisted_7, [
|
|
425
|
+
createElementVNode("span", _hoisted_8, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0), 1),
|
|
426
|
+
createTextVNode("/" + toDisplayString(_ctx.maxLength), 1)
|
|
427
|
+
])) : createCommentVNode("", true),
|
|
428
|
+
_ctx.errorMessage ? (openBlock(), createElementBlock("view", {
|
|
429
|
+
key: 1,
|
|
430
|
+
class: "nut-input-error-message",
|
|
431
|
+
style: normalizeStyle({
|
|
432
|
+
textAlign: _ctx.errorMessageAlign
|
|
433
|
+
})
|
|
434
|
+
}, toDisplayString(_ctx.errorMessage), 5)) : createCommentVNode("", true)
|
|
435
|
+
])
|
|
436
|
+
], 64))
|
|
437
|
+
], 2);
|
|
438
|
+
}
|
|
439
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
440
|
+
export { index as default };
|