@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.
Files changed (240) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/nutui.es.js +4214 -4444
  3. package/dist/nutui.umd.js +4213 -4543
  4. package/dist/packages/_es/ActionSheet.js +18 -19
  5. package/dist/packages/_es/Address.js +94 -85
  6. package/dist/packages/_es/AddressList.js +25 -12
  7. package/dist/packages/_es/Animate.js +3 -3
  8. package/dist/packages/_es/Audio.js +9 -2
  9. package/dist/packages/_es/AudioOperate.js +5 -1
  10. package/dist/packages/_es/Avatar.js +10 -10
  11. package/dist/packages/_es/AvatarGroup.js +5 -5
  12. package/dist/packages/_es/BackTop.js +55 -108
  13. package/dist/packages/_es/Badge.js +6 -4
  14. package/dist/packages/_es/Barrage.js +79 -103
  15. package/dist/packages/_es/Button.js +5 -3
  16. package/dist/packages/_es/Calendar.js +36 -23
  17. package/dist/packages/_es/CalendarItem.js +4 -3
  18. package/dist/packages/_es/Card.js +15 -5
  19. package/dist/packages/_es/Cascader.js +12 -11
  20. package/dist/packages/_es/Category.js +13 -12
  21. package/dist/packages/_es/CategoryPane.js +17 -13
  22. package/dist/packages/_es/Cell.js +9 -12
  23. package/dist/packages/_es/CellGroup.js +4 -2
  24. package/dist/packages/_es/Checkbox.js +1 -1
  25. package/dist/packages/_es/CheckboxGroup.js +2 -2
  26. package/dist/packages/_es/CircleProgress.js +98 -82
  27. package/dist/packages/_es/Col.js +1 -1
  28. package/dist/packages/_es/Collapse.js +65 -34
  29. package/dist/packages/_es/CollapseItem.js +93 -60
  30. package/dist/packages/_es/Comment.js +43 -19
  31. package/dist/packages/_es/ConfigProvider.js +1 -1
  32. package/dist/packages/_es/CountDown.js +3 -3
  33. package/dist/packages/_es/CountUp.js +47 -52
  34. package/dist/packages/_es/DatePicker.js +37 -54
  35. package/dist/packages/_es/Dialog.js +9 -88
  36. package/dist/packages/_es/Divider.js +3 -3
  37. package/dist/packages/_es/Drag.js +75 -49
  38. package/dist/packages/_es/Ecard.js +20 -18
  39. package/dist/packages/_es/Elevator.js +101 -76
  40. package/dist/packages/_es/Ellipsis.js +140 -100
  41. package/dist/packages/_es/Empty.js +6 -4
  42. package/dist/packages/_es/FixedNav.js +11 -6
  43. package/dist/packages/_es/Form.js +4 -4
  44. package/dist/packages/_es/FormItem.js +3 -1
  45. package/dist/packages/_es/Grid.js +1 -1
  46. package/dist/packages/_es/GridItem.js +10 -27
  47. package/dist/packages/_es/Icon.js +1 -1
  48. package/dist/packages/_es/Image.js +13 -114
  49. package/dist/packages/_es/ImagePreview.js +154 -400
  50. package/dist/packages/_es/Indicator.js +3 -3
  51. package/dist/packages/_es/InfiniteLoading.js +103 -115
  52. package/dist/packages/_es/Input.js +54 -26
  53. package/dist/packages/_es/InputNumber.js +25 -16
  54. package/dist/packages/_es/Invoice.js +6 -5
  55. package/dist/packages/_es/Layout.js +1 -1
  56. package/dist/packages/_es/List.js +47 -34
  57. package/dist/packages/_es/Menu.js +35 -35
  58. package/dist/packages/_es/MenuItem.js +56 -29
  59. package/dist/packages/_es/Navbar.js +49 -39
  60. package/dist/packages/_es/NoticeBar.js +52 -41
  61. package/dist/packages/_es/Notify.js +37 -166
  62. package/dist/packages/_es/NumberKeyboard.js +15 -20
  63. package/dist/packages/_es/OldPicker.js +130 -116
  64. package/dist/packages/_es/OverLay.js +5 -28
  65. package/dist/packages/_es/Pagination.js +8 -5
  66. package/dist/packages/_es/Picker.js +196 -65
  67. package/dist/packages/_es/Popover.js +201 -881
  68. package/dist/packages/_es/Popup.js +28 -84
  69. package/dist/packages/_es/Price.js +22 -6
  70. package/dist/packages/_es/Progress.js +18 -11
  71. package/dist/packages/_es/PullRefresh.js +4 -2
  72. package/dist/packages/_es/Radio.js +3 -3
  73. package/dist/packages/_es/RadioGroup.js +1 -1
  74. package/dist/packages/_es/Range.js +48 -34
  75. package/dist/packages/_es/Rate.js +15 -14
  76. package/dist/packages/_es/Row.js +1 -1
  77. package/dist/packages/_es/SearchBar.js +39 -36
  78. package/dist/packages/_es/ShortPassword.js +97 -66
  79. package/dist/packages/_es/SideNavBar.js +7 -18
  80. package/dist/packages/_es/SideNavBarItem.js +1 -1
  81. package/dist/packages/_es/Signature.js +113 -80
  82. package/dist/packages/_es/Skeleton.js +12 -11
  83. package/dist/packages/_es/Sku.js +63 -38
  84. package/dist/packages/_es/Step.js +7 -2
  85. package/dist/packages/_es/Steps.js +1 -1
  86. package/dist/packages/_es/Sticky.js +33 -23
  87. package/dist/packages/_es/SubSideNavBar.js +4 -2
  88. package/dist/packages/_es/Swipe.js +41 -26
  89. package/dist/packages/_es/Swiper.js +38 -21
  90. package/dist/packages/_es/SwiperItem.js +2 -2
  91. package/dist/packages/_es/Switch.js +8 -8
  92. package/dist/packages/_es/TabPane.js +1 -1
  93. package/dist/packages/_es/Tabbar.js +40 -9
  94. package/dist/packages/_es/TabbarItem.js +24 -30
  95. package/dist/packages/_es/Table.js +22 -17
  96. package/dist/packages/_es/Tabs.js +49 -16
  97. package/dist/packages/_es/Tag.js +6 -5
  98. package/dist/packages/_es/TextArea.js +114 -49
  99. package/dist/packages/_es/TimeDetail.js +4 -3
  100. package/dist/packages/_es/TimePannel.js +3 -3
  101. package/dist/packages/_es/TimeSelect.js +12 -10
  102. package/dist/packages/_es/Toast.js +53 -164
  103. package/dist/packages/_es/TrendArrow.js +6 -4
  104. package/dist/packages/_es/Uploader.js +141 -140
  105. package/dist/packages/_es/Video.js +72 -5
  106. package/dist/packages/_es/WaterMark.js +22 -14
  107. package/dist/packages/_es/common.js +1 -1
  108. package/dist/packages/_es/component.js +1 -1
  109. package/dist/packages/_es/index.js +44 -6
  110. package/dist/packages/_es/{index5.js → index.taro.js} +167 -154
  111. package/dist/packages/_es/index2.js +8 -31
  112. package/dist/packages/_es/index3.js +64 -7
  113. package/dist/packages/_es/index4.js +424 -62
  114. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  115. package/dist/packages/_es/pxCheck.js +1 -1
  116. package/dist/packages/_es/raf.js +1 -1
  117. package/dist/packages/_es/style.css +21 -3
  118. package/dist/packages/_es/use-lock-scroll.js +23 -0
  119. package/dist/packages/locale/lang/baseLang.js +1 -1
  120. package/dist/packages/locale/lang/en-US.js +1 -1
  121. package/dist/packages/locale/lang/id-ID.js +1 -1
  122. package/dist/packages/locale/lang/index.js +1 -1
  123. package/dist/packages/locale/lang/zh-CN.js +1 -1
  124. package/dist/packages/locale/lang/zh-TW.js +1 -1
  125. package/dist/packages/signature/index.scss +4 -1
  126. package/dist/packages/swiperitem/index.scss +1 -1
  127. package/dist/smartips/attributes.json +4 -0
  128. package/dist/smartips/tags.json +2 -1
  129. package/dist/smartips/web-types.json +10 -1
  130. package/dist/style.css +1 -1
  131. package/dist/styles/themes/default.scss +44 -44
  132. package/dist/styles/themes/jdb.scss +44 -44
  133. package/dist/styles/themes/jddkh.scss +44 -44
  134. package/dist/styles/themes/jdt.scss +44 -44
  135. package/dist/types/__VUE/actionsheet/{index.vue.d.ts → index.taro.vue.d.ts} +9 -9
  136. package/dist/types/__VUE/address/{index.vue.d.ts → index.taro.vue.d.ts} +73 -33
  137. package/dist/types/__VUE/addresslist/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  138. package/dist/types/__VUE/animate/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  139. package/dist/types/__VUE/avatar/{index.vue.d.ts → index.taro.vue.d.ts} +6 -6
  140. package/dist/types/__VUE/avatargroup/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  141. package/dist/types/__VUE/backtop/{index.vue.d.ts → index.taro.vue.d.ts} +15 -37
  142. package/dist/types/__VUE/badge/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  143. package/dist/types/__VUE/barrage/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  144. package/dist/types/__VUE/button/index.taro.vue.d.ts +116 -0
  145. package/dist/types/__VUE/button/index.vue.d.ts +1 -1
  146. package/dist/types/__VUE/calendar/{index.vue.d.ts → index.taro.vue.d.ts} +13 -1
  147. package/dist/types/__VUE/calendaritem/{index.vue.d.ts → index.taro.vue.d.ts} +17 -17
  148. package/dist/types/__VUE/card/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  149. package/dist/types/__VUE/cascader/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  150. package/dist/types/__VUE/category/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  151. package/dist/types/__VUE/categorypane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  152. package/dist/types/__VUE/cell/{index.vue.d.ts → index.taro.vue.d.ts} +13 -6
  153. package/dist/types/__VUE/checkbox/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  154. package/dist/types/__VUE/circleprogress/{index.vue.d.ts → index.taro.vue.d.ts} +14 -15
  155. package/dist/types/__VUE/collapse/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  156. package/dist/types/__VUE/collapseitem/{index.vue.d.ts → index.taro.vue.d.ts} +2 -10
  157. package/dist/types/__VUE/comment/{index.vue.d.ts → index.taro.vue.d.ts} +1 -2
  158. package/dist/types/__VUE/configprovider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  159. package/dist/types/__VUE/countdown/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  160. package/dist/types/__VUE/countup/{index.vue.d.ts → index.taro.vue.d.ts} +5 -7
  161. package/dist/types/__VUE/datepicker/{index.vue.d.ts → index.taro.vue.d.ts} +5 -5
  162. package/dist/types/__VUE/dialog/{index.vue.d.ts → index.taro.vue.d.ts} +9 -12
  163. package/dist/types/__VUE/divider/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  164. package/dist/types/__VUE/drag/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
  165. package/dist/types/__VUE/ecard/{index.vue.d.ts → index.taro.vue.d.ts} +3 -3
  166. package/dist/types/__VUE/elevator/{index.vue.d.ts → index.taro.vue.d.ts} +11 -2
  167. package/dist/types/__VUE/ellipsis/{index.vue.d.ts → index.taro.vue.d.ts} +4 -0
  168. package/dist/types/__VUE/empty/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  169. package/dist/types/__VUE/fixednav/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  170. package/dist/types/__VUE/form/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  171. package/dist/types/__VUE/grid/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  172. package/dist/types/__VUE/griditem/{index.vue.d.ts → index.taro.vue.d.ts} +2 -27
  173. package/dist/types/__VUE/icon/index.taro.vue.d.ts +74 -0
  174. package/dist/types/__VUE/image/index.taro.vue.d.ts +33 -0
  175. package/dist/types/__VUE/imagepreview/{index.vue.d.ts → index.taro.vue.d.ts} +40 -42
  176. package/dist/types/__VUE/indicator/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  177. package/dist/types/__VUE/infiniteloading/{index.vue.d.ts → index.taro.vue.d.ts} +15 -8
  178. package/dist/types/__VUE/input/{index.vue.d.ts → index.taro.vue.d.ts} +34 -16
  179. package/dist/types/__VUE/inputnumber/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  180. package/dist/types/__VUE/invoice/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  181. package/dist/types/__VUE/layout/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  182. package/dist/types/__VUE/list/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  183. package/dist/types/__VUE/menu/{index.vue.d.ts → index.taro.vue.d.ts} +1 -0
  184. package/dist/types/__VUE/menuitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  185. package/dist/types/__VUE/navbar/{index.vue.d.ts → index.taro.vue.d.ts} +1 -2
  186. package/dist/types/__VUE/noticebar/{index.vue.d.ts → index.taro.vue.d.ts} +4 -3
  187. package/dist/types/__VUE/notify/{index.vue.d.ts → index.taro.vue.d.ts} +10 -25
  188. package/dist/types/__VUE/numberkeyboard/{index.vue.d.ts → index.taro.vue.d.ts} +5 -29
  189. package/dist/types/__VUE/oldpicker/{Column.vue.d.ts → ColumnTaro.vue.d.ts} +28 -17
  190. package/dist/types/__VUE/oldpicker/{index.vue.d.ts → index.taro.vue.d.ts} +64 -44
  191. package/dist/types/__VUE/overlay/index.taro.vue.d.ts +85 -0
  192. package/dist/types/__VUE/pagination/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  193. package/dist/types/__VUE/picker/{Column.vue.d.ts → ColumnTaro.vue.d.ts} +16 -4
  194. package/dist/types/__VUE/picker/{index.vue.d.ts → index.taro.vue.d.ts} +53 -28
  195. package/dist/types/__VUE/popover/{index.vue.d.ts → index.taro.vue.d.ts} +15 -13
  196. package/dist/types/__VUE/popup/index.taro.vue.d.ts +1728 -0
  197. package/dist/types/__VUE/popup/index.vue.d.ts +1 -1
  198. package/dist/types/__VUE/price/{index.vue.d.ts → index.taro.vue.d.ts} +1 -0
  199. package/dist/types/__VUE/progress/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  200. package/dist/types/__VUE/radio/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  201. package/dist/types/__VUE/range/{index.vue.d.ts → index.taro.vue.d.ts} +8 -7
  202. package/dist/types/__VUE/rate/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  203. package/dist/types/__VUE/searchbar/{index.vue.d.ts → index.taro.vue.d.ts} +19 -19
  204. package/dist/types/__VUE/shortpassword/{index.vue.d.ts → index.taro.vue.d.ts} +6 -21
  205. package/dist/types/__VUE/sidenavbar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -5
  206. package/dist/types/__VUE/signature/{index.vue.d.ts → index.taro.vue.d.ts} +8 -5
  207. package/dist/types/__VUE/skeleton/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  208. package/dist/types/__VUE/sku/{index.vue.d.ts → index.taro.vue.d.ts} +54 -182
  209. package/dist/types/__VUE/step/index.vue.d.ts +1 -1
  210. package/dist/types/__VUE/steps/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  211. package/dist/types/__VUE/sticky/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  212. package/dist/types/__VUE/swipe/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
  213. package/dist/types/__VUE/swiper/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
  214. package/dist/types/__VUE/swiperitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  215. package/dist/types/__VUE/switch/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  216. package/dist/types/__VUE/tabbar/{index.vue.d.ts → index.taro.vue.d.ts} +10 -0
  217. package/dist/types/__VUE/tabbaritem/{index.vue.d.ts → index.taro.vue.d.ts} +9 -9
  218. package/dist/types/__VUE/table/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  219. package/dist/types/__VUE/tabs/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  220. package/dist/types/__VUE/tag/{index.vue.d.ts → index.taro.vue.d.ts} +4 -4
  221. package/dist/types/__VUE/textarea/{index.vue.d.ts → index.taro.vue.d.ts} +5 -3
  222. package/dist/types/__VUE/timedetail/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  223. package/dist/types/__VUE/timepannel/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  224. package/dist/types/__VUE/timeselect/{index.vue.d.ts → index.taro.vue.d.ts} +7 -8
  225. package/dist/types/__VUE/toast/{index.vue.d.ts → index.taro.vue.d.ts} +44 -22
  226. package/dist/types/__VUE/trendarrow/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  227. package/dist/types/__VUE/uploader/{index.vue.d.ts → index.taro.vue.d.ts} +22 -13
  228. package/dist/types/__VUE/video/index.vue.d.ts +3 -1
  229. package/dist/types/__VUE/watermark/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  230. package/dist/types/index.d.ts +1 -1
  231. package/dist/types/nutui.d.ts +89 -89
  232. package/package.json +1 -1
  233. package/dist/types/__VUE/dialog/index.d.ts +0 -48
  234. package/dist/types/__VUE/image/index.vue.d.ts +0 -117
  235. package/dist/types/__VUE/image/type.d.ts +0 -6
  236. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +0 -108
  237. package/dist/types/__VUE/imagepreview/index.d.ts +0 -25
  238. package/dist/types/__VUE/notify/index.d.ts +0 -26
  239. package/dist/types/__VUE/tag/type.d.ts +0 -5
  240. package/dist/types/__VUE/toast/index.d.ts +0 -16
@@ -1,12 +1,15 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.5-beta.1 Tue Oct 25 2022 11:38:42 GMT+0800 (中国标准时间)
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, onUnmounted, ref, onActivated, onDeactivated, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, mergeProps, toDisplayString, renderSlot, Fragment, createCommentVNode } from "vue";
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
- scrollEl: window,
62
- scroller: null,
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 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;
93
+ const getParentElement = (el) => {
94
+ return Taro.createSelectorQuery().select(!!props.containerId ? `#${props.containerId} #${el}` : `#${el}`);
91
95
  };
92
- const calculateTopPosition = (el) => {
93
- return !el ? 0 : el.offsetTop + calculateTopPosition(el.offsetParent);
96
+ const getScrollHeight = () => {
97
+ const parentElement = getParentElement("scroller");
98
+ parentElement.boundingClientRect((rect) => {
99
+ state.scrollHeight = rect.height;
100
+ }).exec();
94
101
  };
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;
102
+ const lower = () => {
103
+ if (state.direction == "up" || !props.hasMore || state.isInfiniting) {
104
+ return false;
105
105
  } else {
106
- const { scrollHeight, clientHeight, scrollTop } = state.scrollEl;
107
- offsetDistance = scrollHeight - clientHeight - scrollTop;
108
- resScrollTop = scrollTop;
106
+ state.isInfiniting = true;
107
+ emit("load-more", infiniteDone);
109
108
  }
110
- if (state.beforeScrollTop > resScrollTop) {
111
- direction = "up";
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 = "down";
119
+ state.direction = "up";
114
120
  }
115
- state.beforeScrollTop = resScrollTop;
116
- emit("scroll-change", resScrollTop);
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.beforeScrollTop == 0 && !state.isTouching && props.isOpenRefresh) {
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
- if (state.distance < state.refreshMaxH) {
161
- state.distance = 0;
162
- } else {
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 getParentElement = (el) => {
168
- return !!props.containerId ? document.querySelector(`#${props.containerId}`) : el && el.parentNode;
151
+ const refreshDone = () => {
152
+ state.distance = 0;
153
+ state.isTouching = false;
169
154
  };
170
155
  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);
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 = { class: "top-box" };
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: 0,
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
- return openBlock(), createElementBlock("view", {
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
- 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, mergeProps({ class: "top-img" }, _ctx.$attrs, { name: _ctx.pullIcon }), null, 16, ["name"]),
231
- createElementVNode("view", _hoisted_2, toDisplayString(_ctx.pullTxt || _ctx.translate("pullTxt")), 1)
232
- ])
233
- ], 4),
234
- createElementVNode("view", _hoisted_3, [
235
- renderSlot(_ctx.$slots, "default")
236
- ]),
237
- createElementVNode("view", _hoisted_4, [
238
- _ctx.isInfiniting ? (openBlock(), createElementBlock("view", _hoisted_5, [
239
- !_ctx.slots.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
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
- ], 64)) : renderSlot(_ctx.$slots, "loading", { key: 1 })
243
- ])) : !_ctx.hasMore ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
244
- !_ctx.slots.finished ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.loadMoreTxt || _ctx.translate("loadMoreTxt")), 1)) : renderSlot(_ctx.$slots, "finished", { key: 1 })
245
- ], 64)) : createCommentVNode("", true)
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 index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
250
- export { index as default };
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.5-beta.1 Tue Oct 25 2022 11:38:42 GMT+0800 (中国标准时间)
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, createTextVNode } from "vue";
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 index2 = value.indexOf(char);
12
- if (index2 === -1) {
11
+ const index = value.indexOf(char);
12
+ if (index === -1) {
13
13
  return value;
14
14
  }
15
- if (char === "-" && index2 !== 0) {
16
- return value.slice(0, index2);
15
+ if (char === "-" && index !== 0) {
16
+ return value.slice(0, index);
17
17
  }
18
- return value.slice(0, index2 + 1) + value.slice(index2).replace(regExp, "");
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 (((_a = inputRef == null ? void 0 : inputRef.value) == null ? void 0 : _a.value) !== value) {
241
- inputRef.value.value = 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.stopImmediatePropagation();
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", "autofocus"];
344
- const _hoisted_8 = ["type", "maxlength", "placeholder", "disabled", "readonly", "value", "formatTrigger", "autofocus"];
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[11] || (_cache[11] = (...args) => _ctx.onClick && _ctx.onClick(...args))
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
- autofocus: _ctx.autofocus,
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
- autofocus: _ctx.autofocus,
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[10] || (_cache[10] = (...args) => _ctx.onClickRightIcon && _ctx.onClickRightIcon(...args))
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 index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
472
- export { index as default };
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.5-beta.1 Tue Oct 25 2022 11:38:42 GMT+0800 (中国标准时间)
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, createElementVNode } from "vue";
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.valueAsNumber, event);
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.valueAsNumber;
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 = ["min", "max", "disabled", "readonly", "value"];
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
- createElementVNode("input", {
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, _hoisted_1),
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 index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
171
- export { index as default };
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.5-beta.1 Tue Oct 25 2022 11:38:42 GMT+0800 (中国标准时间)
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, index2) => {
81
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index) => {
82
82
  return openBlock(), createBlock(_component_nut_form_item, {
83
- key: index2,
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 index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
141
- export { index as default };
141
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
142
+ export { index_taro as default };