@nutui/nutui 3.2.5-beta.1 → 3.2.6-beta.1
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 +12 -0
- package/dist/nutui.es.js +4214 -4444
- package/dist/nutui.umd.js +4213 -4543
- package/dist/packages/_es/ActionSheet.js +18 -19
- package/dist/packages/_es/Address.js +94 -85
- package/dist/packages/_es/AddressList.js +25 -12
- package/dist/packages/_es/Animate.js +3 -3
- package/dist/packages/_es/Audio.js +9 -2
- package/dist/packages/_es/AudioOperate.js +5 -1
- package/dist/packages/_es/Avatar.js +10 -10
- package/dist/packages/_es/AvatarGroup.js +5 -5
- package/dist/packages/_es/BackTop.js +55 -108
- package/dist/packages/_es/Badge.js +6 -4
- package/dist/packages/_es/Barrage.js +79 -103
- package/dist/packages/_es/Button.js +5 -3
- package/dist/packages/_es/Calendar.js +36 -23
- package/dist/packages/_es/CalendarItem.js +4 -3
- package/dist/packages/_es/Card.js +15 -5
- package/dist/packages/_es/Cascader.js +12 -11
- package/dist/packages/_es/Category.js +13 -12
- package/dist/packages/_es/CategoryPane.js +17 -13
- package/dist/packages/_es/Cell.js +9 -12
- package/dist/packages/_es/CellGroup.js +4 -2
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +98 -82
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +65 -34
- package/dist/packages/_es/CollapseItem.js +93 -60
- package/dist/packages/_es/Comment.js +43 -19
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +3 -3
- package/dist/packages/_es/CountUp.js +47 -52
- package/dist/packages/_es/DatePicker.js +37 -54
- package/dist/packages/_es/Dialog.js +9 -88
- package/dist/packages/_es/Divider.js +3 -3
- package/dist/packages/_es/Drag.js +75 -49
- package/dist/packages/_es/Ecard.js +20 -18
- package/dist/packages/_es/Elevator.js +101 -76
- package/dist/packages/_es/Ellipsis.js +140 -100
- package/dist/packages/_es/Empty.js +6 -4
- package/dist/packages/_es/FixedNav.js +11 -6
- package/dist/packages/_es/Form.js +4 -4
- package/dist/packages/_es/FormItem.js +3 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +10 -27
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +13 -114
- package/dist/packages/_es/ImagePreview.js +154 -400
- package/dist/packages/_es/Indicator.js +3 -3
- package/dist/packages/_es/InfiniteLoading.js +103 -115
- package/dist/packages/_es/Input.js +54 -26
- package/dist/packages/_es/InputNumber.js +25 -16
- package/dist/packages/_es/Invoice.js +6 -5
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +47 -34
- package/dist/packages/_es/Menu.js +35 -35
- package/dist/packages/_es/MenuItem.js +56 -29
- package/dist/packages/_es/Navbar.js +49 -39
- package/dist/packages/_es/NoticeBar.js +52 -41
- package/dist/packages/_es/Notify.js +37 -166
- package/dist/packages/_es/NumberKeyboard.js +15 -20
- package/dist/packages/_es/OldPicker.js +130 -116
- package/dist/packages/_es/OverLay.js +5 -28
- package/dist/packages/_es/Pagination.js +8 -5
- package/dist/packages/_es/Picker.js +196 -65
- package/dist/packages/_es/Popover.js +201 -881
- package/dist/packages/_es/Popup.js +28 -84
- package/dist/packages/_es/Price.js +22 -6
- package/dist/packages/_es/Progress.js +18 -11
- package/dist/packages/_es/PullRefresh.js +4 -2
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +48 -34
- package/dist/packages/_es/Rate.js +15 -14
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +39 -36
- package/dist/packages/_es/ShortPassword.js +97 -66
- package/dist/packages/_es/SideNavBar.js +7 -18
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +113 -80
- package/dist/packages/_es/Skeleton.js +12 -11
- package/dist/packages/_es/Sku.js +63 -38
- package/dist/packages/_es/Step.js +7 -2
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +33 -23
- package/dist/packages/_es/SubSideNavBar.js +4 -2
- package/dist/packages/_es/Swipe.js +41 -26
- package/dist/packages/_es/Swiper.js +38 -21
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +8 -8
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +40 -9
- package/dist/packages/_es/TabbarItem.js +24 -30
- package/dist/packages/_es/Table.js +22 -17
- package/dist/packages/_es/Tabs.js +49 -16
- package/dist/packages/_es/Tag.js +6 -5
- package/dist/packages/_es/TextArea.js +114 -49
- package/dist/packages/_es/TimeDetail.js +4 -3
- package/dist/packages/_es/TimePannel.js +3 -3
- package/dist/packages/_es/TimeSelect.js +12 -10
- package/dist/packages/_es/Toast.js +53 -164
- package/dist/packages/_es/TrendArrow.js +6 -4
- package/dist/packages/_es/Uploader.js +141 -140
- package/dist/packages/_es/Video.js +72 -5
- package/dist/packages/_es/WaterMark.js +22 -14
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +44 -6
- package/dist/packages/_es/{index5.js → index.taro.js} +167 -154
- package/dist/packages/_es/index2.js +8 -31
- package/dist/packages/_es/index3.js +64 -7
- package/dist/packages/_es/index4.js +424 -62
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/style.css +21 -3
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/locale/lang/baseLang.js +1 -1
- package/dist/packages/locale/lang/en-US.js +1 -1
- package/dist/packages/locale/lang/id-ID.js +1 -1
- package/dist/packages/locale/lang/index.js +1 -1
- package/dist/packages/locale/lang/zh-CN.js +1 -1
- package/dist/packages/locale/lang/zh-TW.js +1 -1
- package/dist/packages/signature/index.scss +4 -1
- package/dist/packages/swiperitem/index.scss +1 -1
- package/dist/smartips/attributes.json +4 -0
- package/dist/smartips/tags.json +2 -1
- package/dist/smartips/web-types.json +10 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +44 -44
- package/dist/styles/themes/jdb.scss +44 -44
- package/dist/styles/themes/jddkh.scss +44 -44
- package/dist/styles/themes/jdt.scss +44 -44
- package/dist/types/__VUE/actionsheet/{index.vue.d.ts → index.taro.vue.d.ts} +9 -9
- package/dist/types/__VUE/address/{index.vue.d.ts → index.taro.vue.d.ts} +73 -33
- package/dist/types/__VUE/addresslist/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/animate/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/avatar/{index.vue.d.ts → index.taro.vue.d.ts} +6 -6
- package/dist/types/__VUE/avatargroup/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/backtop/{index.vue.d.ts → index.taro.vue.d.ts} +15 -37
- package/dist/types/__VUE/badge/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/barrage/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
- package/dist/types/__VUE/button/index.taro.vue.d.ts +116 -0
- package/dist/types/__VUE/button/index.vue.d.ts +1 -1
- package/dist/types/__VUE/calendar/{index.vue.d.ts → index.taro.vue.d.ts} +13 -1
- package/dist/types/__VUE/calendaritem/{index.vue.d.ts → index.taro.vue.d.ts} +17 -17
- package/dist/types/__VUE/card/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/cascader/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/category/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/categorypane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/cell/{index.vue.d.ts → index.taro.vue.d.ts} +13 -6
- package/dist/types/__VUE/checkbox/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/circleprogress/{index.vue.d.ts → index.taro.vue.d.ts} +14 -15
- package/dist/types/__VUE/collapse/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/collapseitem/{index.vue.d.ts → index.taro.vue.d.ts} +2 -10
- package/dist/types/__VUE/comment/{index.vue.d.ts → index.taro.vue.d.ts} +1 -2
- package/dist/types/__VUE/configprovider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/countdown/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/countup/{index.vue.d.ts → index.taro.vue.d.ts} +5 -7
- package/dist/types/__VUE/datepicker/{index.vue.d.ts → index.taro.vue.d.ts} +5 -5
- package/dist/types/__VUE/dialog/{index.vue.d.ts → index.taro.vue.d.ts} +9 -12
- package/dist/types/__VUE/divider/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/drag/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
- package/dist/types/__VUE/ecard/{index.vue.d.ts → index.taro.vue.d.ts} +3 -3
- package/dist/types/__VUE/elevator/{index.vue.d.ts → index.taro.vue.d.ts} +11 -2
- package/dist/types/__VUE/ellipsis/{index.vue.d.ts → index.taro.vue.d.ts} +4 -0
- package/dist/types/__VUE/empty/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/fixednav/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/form/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/grid/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/griditem/{index.vue.d.ts → index.taro.vue.d.ts} +2 -27
- package/dist/types/__VUE/icon/index.taro.vue.d.ts +74 -0
- package/dist/types/__VUE/image/index.taro.vue.d.ts +33 -0
- package/dist/types/__VUE/imagepreview/{index.vue.d.ts → index.taro.vue.d.ts} +40 -42
- package/dist/types/__VUE/indicator/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/infiniteloading/{index.vue.d.ts → index.taro.vue.d.ts} +15 -8
- package/dist/types/__VUE/input/{index.vue.d.ts → index.taro.vue.d.ts} +34 -16
- package/dist/types/__VUE/inputnumber/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
- package/dist/types/__VUE/invoice/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/layout/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/list/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
- package/dist/types/__VUE/menu/{index.vue.d.ts → index.taro.vue.d.ts} +1 -0
- package/dist/types/__VUE/menuitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/navbar/{index.vue.d.ts → index.taro.vue.d.ts} +1 -2
- package/dist/types/__VUE/noticebar/{index.vue.d.ts → index.taro.vue.d.ts} +4 -3
- package/dist/types/__VUE/notify/{index.vue.d.ts → index.taro.vue.d.ts} +10 -25
- package/dist/types/__VUE/numberkeyboard/{index.vue.d.ts → index.taro.vue.d.ts} +5 -29
- package/dist/types/__VUE/oldpicker/{Column.vue.d.ts → ColumnTaro.vue.d.ts} +28 -17
- package/dist/types/__VUE/oldpicker/{index.vue.d.ts → index.taro.vue.d.ts} +64 -44
- package/dist/types/__VUE/overlay/index.taro.vue.d.ts +85 -0
- package/dist/types/__VUE/pagination/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/picker/{Column.vue.d.ts → ColumnTaro.vue.d.ts} +16 -4
- package/dist/types/__VUE/picker/{index.vue.d.ts → index.taro.vue.d.ts} +53 -28
- package/dist/types/__VUE/popover/{index.vue.d.ts → index.taro.vue.d.ts} +15 -13
- package/dist/types/__VUE/popup/index.taro.vue.d.ts +1728 -0
- package/dist/types/__VUE/popup/index.vue.d.ts +1 -1
- package/dist/types/__VUE/price/{index.vue.d.ts → index.taro.vue.d.ts} +1 -0
- package/dist/types/__VUE/progress/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/__VUE/radio/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/range/{index.vue.d.ts → index.taro.vue.d.ts} +8 -7
- package/dist/types/__VUE/rate/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/searchbar/{index.vue.d.ts → index.taro.vue.d.ts} +19 -19
- package/dist/types/__VUE/shortpassword/{index.vue.d.ts → index.taro.vue.d.ts} +6 -21
- package/dist/types/__VUE/sidenavbar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -5
- package/dist/types/__VUE/signature/{index.vue.d.ts → index.taro.vue.d.ts} +8 -5
- package/dist/types/__VUE/skeleton/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/sku/{index.vue.d.ts → index.taro.vue.d.ts} +54 -182
- package/dist/types/__VUE/step/index.vue.d.ts +1 -1
- package/dist/types/__VUE/steps/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/sticky/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/swipe/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
- package/dist/types/__VUE/swiper/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
- package/dist/types/__VUE/swiperitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/switch/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabbar/{index.vue.d.ts → index.taro.vue.d.ts} +10 -0
- package/dist/types/__VUE/tabbaritem/{index.vue.d.ts → index.taro.vue.d.ts} +9 -9
- package/dist/types/__VUE/table/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabs/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/tag/{index.vue.d.ts → index.taro.vue.d.ts} +4 -4
- package/dist/types/__VUE/textarea/{index.vue.d.ts → index.taro.vue.d.ts} +5 -3
- package/dist/types/__VUE/timedetail/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/timepannel/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/timeselect/{index.vue.d.ts → index.taro.vue.d.ts} +7 -8
- package/dist/types/__VUE/toast/{index.vue.d.ts → index.taro.vue.d.ts} +44 -22
- package/dist/types/__VUE/trendarrow/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
- package/dist/types/__VUE/uploader/{index.vue.d.ts → index.taro.vue.d.ts} +22 -13
- package/dist/types/__VUE/video/index.vue.d.ts +3 -1
- package/dist/types/__VUE/watermark/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +89 -89
- package/package.json +1 -1
- package/dist/types/__VUE/dialog/index.d.ts +0 -48
- package/dist/types/__VUE/image/index.vue.d.ts +0 -117
- package/dist/types/__VUE/image/type.d.ts +0 -6
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +0 -108
- package/dist/types/__VUE/imagepreview/index.d.ts +0 -25
- package/dist/types/__VUE/notify/index.d.ts +0 -26
- package/dist/types/__VUE/tag/type.d.ts +0 -5
- package/dist/types/__VUE/toast/index.d.ts +0 -16
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive, computed, onMounted,
|
|
6
|
+
import { reactive, computed, onMounted, toRefs, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementVNode, normalizeStyle, createVNode, mergeProps, createTextVNode, toDisplayString, renderSlot, createElementBlock, createCommentVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import _sfc_main$1 from "./Icon.js";
|
|
9
|
+
import Taro from "@tarojs/taro";
|
|
8
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
11
|
import "../locale/lang";
|
|
12
|
+
import "./pxCheck.js";
|
|
10
13
|
const { componentName, create, translate } = createComponent("infiniteloading");
|
|
11
14
|
const _sfc_main = create({
|
|
12
15
|
props: {
|
|
@@ -18,6 +21,10 @@ const _sfc_main = create({
|
|
|
18
21
|
type: Number,
|
|
19
22
|
default: 200
|
|
20
23
|
},
|
|
24
|
+
upperThreshold: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 40
|
|
27
|
+
},
|
|
21
28
|
pullIcon: {
|
|
22
29
|
type: String,
|
|
23
30
|
default: "https://img10.360buyimg.com/imagetools/jfs/t1/169863/6/4565/6306/60125948E7e92774e/40b3a0cf42852bcb.png"
|
|
@@ -56,14 +63,16 @@ const _sfc_main = create({
|
|
|
56
63
|
}
|
|
57
64
|
},
|
|
58
65
|
emits: ["scroll-change", "load-more", "refresh"],
|
|
66
|
+
components: {
|
|
67
|
+
"nut-icon": _sfc_main$1
|
|
68
|
+
},
|
|
59
69
|
setup(props, { emit, slots }) {
|
|
60
70
|
const state = reactive({
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
refreshTop: null,
|
|
64
|
-
beforeScrollTop: 0,
|
|
65
|
-
isTouching: false,
|
|
71
|
+
scrollHeight: 0,
|
|
72
|
+
scrollTop: 0,
|
|
66
73
|
isInfiniting: false,
|
|
74
|
+
direction: "down",
|
|
75
|
+
isTouching: false,
|
|
67
76
|
refreshMaxH: 0,
|
|
68
77
|
y: 0,
|
|
69
78
|
x: 0,
|
|
@@ -81,67 +90,44 @@ const _sfc_main = create({
|
|
|
81
90
|
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
91
|
};
|
|
83
92
|
});
|
|
84
|
-
const
|
|
85
|
-
return
|
|
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;
|
|
93
|
+
const getParentElement = (el) => {
|
|
94
|
+
return Taro.createSelectorQuery().select(!!props.containerId ? `#${props.containerId} #${el}` : `#${el}`);
|
|
91
95
|
};
|
|
92
|
-
const
|
|
93
|
-
|
|
96
|
+
const getScrollHeight = () => {
|
|
97
|
+
const parentElement = getParentElement("scroller");
|
|
98
|
+
parentElement.boundingClientRect((rect) => {
|
|
99
|
+
state.scrollHeight = rect.height;
|
|
100
|
+
}).exec();
|
|
94
101
|
};
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
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;
|
|
102
|
+
const lower = () => {
|
|
103
|
+
if (state.direction == "up" || !props.hasMore || state.isInfiniting) {
|
|
104
|
+
return false;
|
|
105
105
|
} else {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
resScrollTop = scrollTop;
|
|
106
|
+
state.isInfiniting = true;
|
|
107
|
+
emit("load-more", infiniteDone);
|
|
109
108
|
}
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
};
|
|
110
|
+
const scroll = (e) => {
|
|
111
|
+
if (e.detail.scrollTop <= 0) {
|
|
112
|
+
e.detail.scrollTop = 0;
|
|
113
|
+
} else if (e.detail.scrollTop >= state.scrollHeight) {
|
|
114
|
+
e.detail.scrollTop = state.scrollHeight;
|
|
115
|
+
}
|
|
116
|
+
if (e.detail.scrollTop > state.scrollTop || e.detail.scrollTop >= state.scrollHeight) {
|
|
117
|
+
state.direction = "down";
|
|
112
118
|
} else {
|
|
113
|
-
direction = "
|
|
119
|
+
state.direction = "up";
|
|
114
120
|
}
|
|
115
|
-
state.
|
|
116
|
-
emit("scroll-change",
|
|
117
|
-
return offsetDistance <= props.threshold && direction == "down";
|
|
121
|
+
state.scrollTop = e.detail.scrollTop;
|
|
122
|
+
emit("scroll-change", e.detail.scrollTop);
|
|
118
123
|
};
|
|
119
124
|
const infiniteDone = () => {
|
|
120
125
|
state.isInfiniting = false;
|
|
121
126
|
};
|
|
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
127
|
const touchStart = (event) => {
|
|
140
|
-
if (state.
|
|
128
|
+
if (state.scrollTop == 0 && !state.isTouching && props.isOpenRefresh) {
|
|
141
129
|
state.y = event.touches[0].pageY;
|
|
142
130
|
state.isTouching = true;
|
|
143
|
-
const childHeight = state.refreshTop.firstElementChild.offsetHeight;
|
|
144
|
-
state.refreshMaxH = Math.floor(childHeight * 1 + 10);
|
|
145
131
|
}
|
|
146
132
|
};
|
|
147
133
|
const touchMove = (event) => {
|
|
@@ -156,50 +142,39 @@ const _sfc_main = create({
|
|
|
156
142
|
}
|
|
157
143
|
};
|
|
158
144
|
const touchEnd = () => {
|
|
159
|
-
if (state.distance) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
emit("refresh", refreshDone);
|
|
164
|
-
}
|
|
145
|
+
if (state.distance < state.refreshMaxH) {
|
|
146
|
+
state.distance = 0;
|
|
147
|
+
} else {
|
|
148
|
+
emit("refresh", refreshDone);
|
|
165
149
|
}
|
|
166
150
|
};
|
|
167
|
-
const
|
|
168
|
-
|
|
151
|
+
const refreshDone = () => {
|
|
152
|
+
state.distance = 0;
|
|
153
|
+
state.isTouching = false;
|
|
169
154
|
};
|
|
170
155
|
onMounted(() => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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);
|
|
156
|
+
state.refreshMaxH = props.upperThreshold;
|
|
157
|
+
setTimeout(() => {
|
|
158
|
+
getScrollHeight();
|
|
159
|
+
}, 200);
|
|
189
160
|
});
|
|
190
161
|
return {
|
|
191
162
|
classes,
|
|
192
163
|
...toRefs(state),
|
|
164
|
+
lower,
|
|
165
|
+
scroll,
|
|
193
166
|
touchStart,
|
|
194
167
|
touchMove,
|
|
195
168
|
touchEnd,
|
|
196
169
|
getStyle,
|
|
197
|
-
translate
|
|
198
|
-
slots
|
|
170
|
+
translate
|
|
199
171
|
};
|
|
200
172
|
}
|
|
201
173
|
});
|
|
202
|
-
const _hoisted_1 = {
|
|
174
|
+
const _hoisted_1 = {
|
|
175
|
+
class: "top-box",
|
|
176
|
+
id: "refreshTop"
|
|
177
|
+
};
|
|
203
178
|
const _hoisted_2 = { class: "top-text" };
|
|
204
179
|
const _hoisted_3 = { class: "nut-infinite-container" };
|
|
205
180
|
const _hoisted_4 = { class: "nut-infinite-bottom" };
|
|
@@ -209,42 +184,55 @@ const _hoisted_5 = {
|
|
|
209
184
|
};
|
|
210
185
|
const _hoisted_6 = { class: "bottom-text" };
|
|
211
186
|
const _hoisted_7 = {
|
|
212
|
-
key:
|
|
187
|
+
key: 1,
|
|
213
188
|
class: "tips"
|
|
214
189
|
};
|
|
215
190
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
216
191
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
217
|
-
|
|
192
|
+
const _component_scroll_view = resolveComponent(function() {
|
|
193
|
+
if (process.env.TARO_ENV === "h5") {
|
|
194
|
+
return "taro-scroll-view";
|
|
195
|
+
} else {
|
|
196
|
+
return "scroll-view";
|
|
197
|
+
}
|
|
198
|
+
}());
|
|
199
|
+
return openBlock(), createBlock(_component_scroll_view, {
|
|
218
200
|
class: normalizeClass(_ctx.classes),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
createElementVNode("view",
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
201
|
+
scrollY: "true",
|
|
202
|
+
style: { "height": "100%" },
|
|
203
|
+
id: "scroller",
|
|
204
|
+
onScrolltolower: _ctx.lower,
|
|
205
|
+
onScroll: _ctx.scroll,
|
|
206
|
+
onTouchstart: _ctx.touchStart,
|
|
207
|
+
onTouchmove: _ctx.touchMove,
|
|
208
|
+
onTouchend: _ctx.touchEnd
|
|
209
|
+
}, {
|
|
210
|
+
default: withCtx(() => [
|
|
211
|
+
createElementVNode("view", {
|
|
212
|
+
class: "nut-infinite-top",
|
|
213
|
+
style: normalizeStyle(_ctx.getStyle)
|
|
214
|
+
}, [
|
|
215
|
+
createElementVNode("view", _hoisted_1, [
|
|
216
|
+
createVNode(_component_nut_icon, mergeProps({ class: "top-img" }, _ctx.$attrs, { name: _ctx.pullIcon }), null, 16, ["name"]),
|
|
217
|
+
createTextVNode(),
|
|
218
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.pullTxt || _ctx.translate("pullTxt")), 1)
|
|
219
|
+
])
|
|
220
|
+
], 4),
|
|
221
|
+
createTextVNode(),
|
|
222
|
+
createElementVNode("view", _hoisted_3, [
|
|
223
|
+
renderSlot(_ctx.$slots, "default")
|
|
224
|
+
]),
|
|
225
|
+
createTextVNode(),
|
|
226
|
+
createElementVNode("view", _hoisted_4, [
|
|
227
|
+
_ctx.isInfiniting ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
240
228
|
createVNode(_component_nut_icon, mergeProps({ class: "bottom-img" }, _ctx.$attrs, { name: _ctx.loadIcon }), null, 16, ["name"]),
|
|
229
|
+
createTextVNode(),
|
|
241
230
|
createElementVNode("view", _hoisted_6, toDisplayString(_ctx.loadTxt || _ctx.translate("loading")), 1)
|
|
242
|
-
]
|
|
243
|
-
])
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
], 34);
|
|
231
|
+
])) : !_ctx.hasMore ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.loadMoreTxt || _ctx.translate("loadMoreTxt")), 1)) : createCommentVNode("", true)
|
|
232
|
+
])
|
|
233
|
+
]),
|
|
234
|
+
_: 3
|
|
235
|
+
}, 8, ["class", "onScrolltolower", "onScroll", "onTouchstart", "onTouchmove", "onTouchend"]);
|
|
248
236
|
}
|
|
249
|
-
var
|
|
250
|
-
export {
|
|
237
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
238
|
+
export { index_taro as default };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, reactive, computed, watch, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, normalizeStyle, createElementVNode, toDisplayString, createCommentVNode, renderSlot, createVNode, mergeProps, withDirectives, createBlock, vShow
|
|
6
|
+
import { ref, reactive, computed, watch, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, normalizeStyle, createElementVNode, toDisplayString, createCommentVNode, createTextVNode, renderSlot, createVNode, mergeProps, withDirectives, createBlock, vShow } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
10
|
function trimExtraChar(value, char, regExp) {
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
11
|
+
const index = value.indexOf(char);
|
|
12
|
+
if (index === -1) {
|
|
13
13
|
return value;
|
|
14
14
|
}
|
|
15
|
-
if (char === "-" &&
|
|
16
|
-
return value.slice(0,
|
|
15
|
+
if (char === "-" && index !== 0) {
|
|
16
|
+
return value.slice(0, index);
|
|
17
17
|
}
|
|
18
|
-
return value.slice(0,
|
|
18
|
+
return value.slice(0, index + 1) + value.slice(index).replace(regExp, "");
|
|
19
19
|
}
|
|
20
20
|
function formatNumber(value, allowDot = true, allowMinus = true) {
|
|
21
21
|
if (allowDot) {
|
|
@@ -98,14 +98,14 @@ const _sfc_main = create({
|
|
|
98
98
|
type: [String, Number],
|
|
99
99
|
default: "9999"
|
|
100
100
|
},
|
|
101
|
-
leftIcon: {
|
|
102
|
-
type: String,
|
|
103
|
-
default: ""
|
|
104
|
-
},
|
|
105
101
|
leftIconSize: {
|
|
106
102
|
type: [String, Number],
|
|
107
103
|
default: ""
|
|
108
104
|
},
|
|
105
|
+
leftIcon: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: ""
|
|
108
|
+
},
|
|
109
109
|
rightIcon: {
|
|
110
110
|
type: String,
|
|
111
111
|
default: ""
|
|
@@ -161,6 +161,14 @@ const _sfc_main = create({
|
|
|
161
161
|
autofocus: {
|
|
162
162
|
type: Boolean,
|
|
163
163
|
default: false
|
|
164
|
+
},
|
|
165
|
+
confirmType: {
|
|
166
|
+
type: String,
|
|
167
|
+
default: "done"
|
|
168
|
+
},
|
|
169
|
+
adjustPosition: {
|
|
170
|
+
type: Boolean,
|
|
171
|
+
default: true
|
|
164
172
|
}
|
|
165
173
|
},
|
|
166
174
|
emits: [
|
|
@@ -176,8 +184,7 @@ const _sfc_main = create({
|
|
|
176
184
|
],
|
|
177
185
|
setup(props, { emit, slots }) {
|
|
178
186
|
const active = ref(false);
|
|
179
|
-
const inputRef = ref();
|
|
180
|
-
ref();
|
|
187
|
+
const inputRef = ref(null);
|
|
181
188
|
const getModelValue = () => {
|
|
182
189
|
var _a;
|
|
183
190
|
return String((_a = props.modelValue) != null ? _a : "");
|
|
@@ -225,9 +232,10 @@ const _sfc_main = create({
|
|
|
225
232
|
value = value.slice(0, Number(props.maxLength));
|
|
226
233
|
}
|
|
227
234
|
updateValue(value);
|
|
235
|
+
emit("update:modelValue", value, event);
|
|
236
|
+
emit("change", value, event);
|
|
228
237
|
};
|
|
229
238
|
const updateValue = (value, trigger = "onChange") => {
|
|
230
|
-
var _a;
|
|
231
239
|
if (props.type === "digit") {
|
|
232
240
|
value = formatNumber(value, false, false);
|
|
233
241
|
}
|
|
@@ -237,8 +245,8 @@ const _sfc_main = create({
|
|
|
237
245
|
if (props.formatter && trigger === props.formatTrigger) {
|
|
238
246
|
value = props.formatter(value);
|
|
239
247
|
}
|
|
240
|
-
if (
|
|
241
|
-
inputRef.value
|
|
248
|
+
if (inputRef && inputRef.value && inputRef.value !== value) {
|
|
249
|
+
inputRef.value = value;
|
|
242
250
|
}
|
|
243
251
|
if (value !== props.modelValue) {
|
|
244
252
|
emit("update:modelValue", value);
|
|
@@ -302,7 +310,7 @@ const _sfc_main = create({
|
|
|
302
310
|
};
|
|
303
311
|
const onClick = (e) => {
|
|
304
312
|
if (props.disabled) {
|
|
305
|
-
e.
|
|
313
|
+
e.stopPropagation();
|
|
306
314
|
return;
|
|
307
315
|
}
|
|
308
316
|
};
|
|
@@ -314,6 +322,9 @@ const _sfc_main = create({
|
|
|
314
322
|
}
|
|
315
323
|
);
|
|
316
324
|
onMounted(() => {
|
|
325
|
+
if (props.autofocus) {
|
|
326
|
+
inputRef.value.focus();
|
|
327
|
+
}
|
|
317
328
|
updateValue(getModelValue(), props.formatTrigger);
|
|
318
329
|
});
|
|
319
330
|
return {
|
|
@@ -340,8 +351,8 @@ const _hoisted_3 = { class: "label-string" };
|
|
|
340
351
|
const _hoisted_4 = { class: "nut-input-value" };
|
|
341
352
|
const _hoisted_5 = { class: "nut-input-inner" };
|
|
342
353
|
const _hoisted_6 = { class: "nut-input-box" };
|
|
343
|
-
const _hoisted_7 = ["maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "
|
|
344
|
-
const _hoisted_8 = ["type", "maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "
|
|
354
|
+
const _hoisted_7 = ["maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "adjust-position"];
|
|
355
|
+
const _hoisted_8 = ["type", "maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "confirm-type", "adjust-position"];
|
|
345
356
|
const _hoisted_9 = { class: "nut-input-clear-box" };
|
|
346
357
|
const _hoisted_10 = {
|
|
347
358
|
key: 0,
|
|
@@ -352,7 +363,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
352
363
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
353
364
|
return openBlock(), createElementBlock("view", {
|
|
354
365
|
class: normalizeClass(_ctx.classes),
|
|
355
|
-
onClick: _cache[
|
|
366
|
+
onClick: _cache[12] || (_cache[12] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
356
367
|
}, [
|
|
357
368
|
_ctx.$slots.input ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
358
369
|
_ctx.label ? (openBlock(), createElementBlock("view", {
|
|
@@ -365,6 +376,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
365
376
|
}, [
|
|
366
377
|
createElementVNode("view", _hoisted_1, toDisplayString(_ctx.label) + " " + toDisplayString(_ctx.colon ? ":" : ""), 1)
|
|
367
378
|
], 6)) : createCommentVNode("", true),
|
|
379
|
+
createTextVNode(),
|
|
368
380
|
createElementVNode("view", _hoisted_2, [
|
|
369
381
|
createElementVNode("view", {
|
|
370
382
|
class: "nut-input-inner",
|
|
@@ -381,6 +393,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
381
393
|
}, [
|
|
382
394
|
createVNode(_component_nut_icon, mergeProps({ name: _ctx.leftIcon }, _ctx.$attrs, { size: _ctx.leftIconSize }), null, 16, ["name", "size"])
|
|
383
395
|
])) : createCommentVNode("", true),
|
|
396
|
+
createTextVNode(),
|
|
384
397
|
_ctx.label ? (openBlock(), createElementBlock("view", {
|
|
385
398
|
key: 1,
|
|
386
399
|
class: normalizeClass(["nut-input-label", _ctx.labelClass]),
|
|
@@ -391,6 +404,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
391
404
|
}, [
|
|
392
405
|
createElementVNode("view", _hoisted_3, toDisplayString(_ctx.label) + " " + toDisplayString(_ctx.colon ? ":" : ""), 1)
|
|
393
406
|
], 6)) : createCommentVNode("", true),
|
|
407
|
+
createTextVNode(),
|
|
394
408
|
createElementVNode("view", _hoisted_4, [
|
|
395
409
|
createElementVNode("view", _hoisted_5, [
|
|
396
410
|
createElementVNode("view", _hoisted_6, [
|
|
@@ -401,11 +415,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
401
415
|
style: normalizeStyle(_ctx.stylesTextarea),
|
|
402
416
|
maxlength: _ctx.maxLength,
|
|
403
417
|
placeholder: _ctx.placeholder,
|
|
418
|
+
"placeholder-class": "nut-placeholder",
|
|
404
419
|
disabled: _ctx.disabled,
|
|
405
420
|
readonly: _ctx.readonly,
|
|
406
421
|
value: _ctx.modelValue,
|
|
407
422
|
formatTrigger: _ctx.formatTrigger,
|
|
408
|
-
|
|
423
|
+
"adjust-position": _ctx.adjustPosition,
|
|
409
424
|
onInput: _cache[2] || (_cache[2] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
410
425
|
onFocus: _cache[3] || (_cache[3] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
411
426
|
onBlur: _cache[4] || (_cache[4] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
|
|
@@ -418,17 +433,26 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
418
433
|
type: _ctx.inputType(_ctx.type),
|
|
419
434
|
maxlength: _ctx.maxLength,
|
|
420
435
|
placeholder: _ctx.placeholder,
|
|
436
|
+
"placeholder-class": "nut-placeholder",
|
|
421
437
|
disabled: _ctx.disabled,
|
|
422
438
|
readonly: _ctx.readonly,
|
|
423
439
|
value: _ctx.modelValue,
|
|
424
440
|
formatTrigger: _ctx.formatTrigger,
|
|
425
|
-
|
|
441
|
+
"confirm-type": _ctx.confirmType,
|
|
442
|
+
"adjust-position": _ctx.adjustPosition,
|
|
426
443
|
onInput: _cache[6] || (_cache[6] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
427
444
|
onFocus: _cache[7] || (_cache[7] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
428
445
|
onBlur: _cache[8] || (_cache[8] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
|
|
429
446
|
onClick: _cache[9] || (_cache[9] = (...args) => _ctx.onClickInput && _ctx.onClickInput(...args))
|
|
430
|
-
}, null, 44, _hoisted_8))
|
|
447
|
+
}, null, 44, _hoisted_8)),
|
|
448
|
+
createTextVNode(),
|
|
449
|
+
_ctx.readonly ? (openBlock(), createElementBlock("view", {
|
|
450
|
+
key: 2,
|
|
451
|
+
class: "nut-input-disabled-mask",
|
|
452
|
+
onClick: _cache[10] || (_cache[10] = (...args) => _ctx.onClickInput && _ctx.onClickInput(...args))
|
|
453
|
+
})) : createCommentVNode("", true)
|
|
431
454
|
]),
|
|
455
|
+
createTextVNode(),
|
|
432
456
|
createElementVNode("view", _hoisted_9, [
|
|
433
457
|
_ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createBlock(_component_nut_icon, mergeProps({
|
|
434
458
|
key: 0,
|
|
@@ -441,22 +465,26 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
441
465
|
[vShow, _ctx.active && _ctx.modelValue.length > 0]
|
|
442
466
|
]) : createCommentVNode("", true)
|
|
443
467
|
]),
|
|
468
|
+
createTextVNode(),
|
|
444
469
|
_ctx.rightIcon && _ctx.rightIcon.length > 0 ? (openBlock(), createElementBlock("view", {
|
|
445
470
|
key: 0,
|
|
446
471
|
class: "nut-input-right-icon",
|
|
447
|
-
onClick: _cache[
|
|
472
|
+
onClick: _cache[11] || (_cache[11] = (...args) => _ctx.onClickRightIcon && _ctx.onClickRightIcon(...args))
|
|
448
473
|
}, [
|
|
449
474
|
createVNode(_component_nut_icon, mergeProps({ name: _ctx.rightIcon }, _ctx.$attrs, { size: _ctx.rightIconSize }), null, 16, ["name", "size"])
|
|
450
475
|
])) : createCommentVNode("", true),
|
|
476
|
+
createTextVNode(),
|
|
451
477
|
_ctx.$slots.button ? renderSlot(_ctx.$slots, "button", {
|
|
452
478
|
key: 1,
|
|
453
479
|
class: "nut-input-button"
|
|
454
480
|
}) : createCommentVNode("", true)
|
|
455
481
|
]),
|
|
482
|
+
createTextVNode(),
|
|
456
483
|
_ctx.showWordLimit && _ctx.maxLength ? (openBlock(), createElementBlock("view", _hoisted_10, [
|
|
457
484
|
createElementVNode("span", _hoisted_11, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0), 1),
|
|
458
485
|
createTextVNode("/" + toDisplayString(_ctx.maxLength), 1)
|
|
459
486
|
])) : createCommentVNode("", true),
|
|
487
|
+
createTextVNode(),
|
|
460
488
|
_ctx.errorMessage ? (openBlock(), createElementBlock("view", {
|
|
461
489
|
key: 1,
|
|
462
490
|
class: "nut-input-error-message",
|
|
@@ -468,5 +496,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
468
496
|
], 64))
|
|
469
497
|
], 2);
|
|
470
498
|
}
|
|
471
|
-
var
|
|
472
|
-
export {
|
|
499
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
500
|
+
export { index_taro as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, mergeProps,
|
|
6
|
+
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createVNode, mergeProps, createTextVNode, toDisplayString } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { p as pxCheck } from "./pxCheck.js";
|
|
9
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
@@ -70,7 +70,7 @@ const _sfc_main = create({
|
|
|
70
70
|
};
|
|
71
71
|
const change = (event) => {
|
|
72
72
|
const input = event.target;
|
|
73
|
-
emit("update:modelValue", input.
|
|
73
|
+
emit("update:modelValue", input.value, event);
|
|
74
74
|
};
|
|
75
75
|
const emitChange = (value, event) => {
|
|
76
76
|
let output_value = fixedDecimalPlaces(value);
|
|
@@ -101,20 +101,13 @@ const _sfc_main = create({
|
|
|
101
101
|
emit("overlimit", event, "add");
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
|
-
const focus = (event) => {
|
|
105
|
-
if (props.disabled)
|
|
106
|
-
return;
|
|
107
|
-
if (props.readonly)
|
|
108
|
-
return;
|
|
109
|
-
emit("focus", event);
|
|
110
|
-
};
|
|
111
104
|
const blur = (event) => {
|
|
112
105
|
if (props.disabled)
|
|
113
106
|
return;
|
|
114
107
|
if (props.readonly)
|
|
115
108
|
return;
|
|
116
109
|
const input = event.target;
|
|
117
|
-
let value = input.
|
|
110
|
+
let value = +input.value;
|
|
118
111
|
if (value < Number(props.min)) {
|
|
119
112
|
value = Number(props.min);
|
|
120
113
|
} else if (value > Number(props.max)) {
|
|
@@ -123,6 +116,15 @@ const _sfc_main = create({
|
|
|
123
116
|
emitChange(value, event);
|
|
124
117
|
emit("blur", event);
|
|
125
118
|
};
|
|
119
|
+
const focus = (event) => {
|
|
120
|
+
if (props.disabled)
|
|
121
|
+
return;
|
|
122
|
+
if (props.readonly) {
|
|
123
|
+
blur(event);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
emit("focus", event);
|
|
127
|
+
};
|
|
126
128
|
return {
|
|
127
129
|
classes,
|
|
128
130
|
change,
|
|
@@ -136,7 +138,11 @@ const _sfc_main = create({
|
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
140
|
});
|
|
139
|
-
const _hoisted_1 =
|
|
141
|
+
const _hoisted_1 = {
|
|
142
|
+
key: 0,
|
|
143
|
+
class: "nut-inputnumber__text--readonly"
|
|
144
|
+
};
|
|
145
|
+
const _hoisted_2 = ["min", "max", "disabled", "readonly", "value"];
|
|
140
146
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
141
147
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
142
148
|
return openBlock(), createElementBlock("view", {
|
|
@@ -148,7 +154,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
148
154
|
class: ["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !_ctx.reduceAllow() }],
|
|
149
155
|
size: _ctx.buttonSize
|
|
150
156
|
}, _ctx.$attrs, { onClick: _ctx.reduce }), null, 16, ["name", "class", "size", "onClick"]),
|
|
151
|
-
|
|
157
|
+
createTextVNode(),
|
|
158
|
+
_ctx.readonly ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.modelValue), 1)) : (openBlock(), createElementBlock("input", {
|
|
159
|
+
key: 1,
|
|
152
160
|
type: "number",
|
|
153
161
|
min: _ctx.min,
|
|
154
162
|
max: _ctx.max,
|
|
@@ -159,7 +167,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
159
167
|
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args)),
|
|
160
168
|
onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.blur && _ctx.blur(...args)),
|
|
161
169
|
onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args))
|
|
162
|
-
}, null, 44,
|
|
170
|
+
}, null, 44, _hoisted_2)),
|
|
171
|
+
createTextVNode(),
|
|
163
172
|
createVNode(_component_nut_icon, mergeProps({
|
|
164
173
|
name: _ctx.iconRight,
|
|
165
174
|
class: ["nut-inputnumber__icon", { "nut-inputnumber__icon--disabled": !_ctx.addAllow() }],
|
|
@@ -167,5 +176,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
167
176
|
}, _ctx.$attrs, { onClick: _ctx.add }), null, 16, ["name", "class", "size", "onClick"])
|
|
168
177
|
], 6);
|
|
169
178
|
}
|
|
170
|
-
var
|
|
171
|
-
export {
|
|
179
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
180
|
+
export { index_taro as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -78,9 +78,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
78
78
|
ref: "formRef"
|
|
79
79
|
}, {
|
|
80
80
|
default: withCtx(() => [
|
|
81
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item,
|
|
81
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index) => {
|
|
82
82
|
return openBlock(), createBlock(_component_nut_form_item, {
|
|
83
|
-
key:
|
|
83
|
+
key: index,
|
|
84
84
|
label: item.label,
|
|
85
85
|
required: item.required,
|
|
86
86
|
rules: item.rules,
|
|
@@ -123,6 +123,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
123
123
|
]),
|
|
124
124
|
_: 1
|
|
125
125
|
}, 8, ["model-value"]),
|
|
126
|
+
createTextVNode(),
|
|
126
127
|
_ctx.submit ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
127
128
|
createVNode(_component_nut_button, {
|
|
128
129
|
type: "primary",
|
|
@@ -137,5 +138,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
137
138
|
])) : createCommentVNode("", true)
|
|
138
139
|
], 2);
|
|
139
140
|
}
|
|
140
|
-
var
|
|
141
|
-
export {
|
|
141
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
142
|
+
export { index_taro as default };
|