@nutui/nutui 3.2.6-beta.1 → 3.2.6

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 (241) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +18 -4
  3. package/dist/nutui.es.js +4461 -4135
  4. package/dist/nutui.umd.js +4559 -4133
  5. package/dist/packages/_es/ActionSheet.js +19 -18
  6. package/dist/packages/_es/Address.js +85 -94
  7. package/dist/packages/_es/AddressList.js +12 -25
  8. package/dist/packages/_es/Animate.js +3 -3
  9. package/dist/packages/_es/Audio.js +2 -9
  10. package/dist/packages/_es/AudioOperate.js +1 -5
  11. package/dist/packages/_es/Avatar.js +10 -10
  12. package/dist/packages/_es/AvatarGroup.js +5 -5
  13. package/dist/packages/_es/BackTop.js +108 -55
  14. package/dist/packages/_es/Badge.js +12 -10
  15. package/dist/packages/_es/Barrage.js +103 -79
  16. package/dist/packages/_es/Button.js +3 -5
  17. package/dist/packages/_es/Calendar.js +23 -36
  18. package/dist/packages/_es/CalendarItem.js +3 -4
  19. package/dist/packages/_es/Card.js +5 -15
  20. package/dist/packages/_es/Cascader.js +11 -12
  21. package/dist/packages/_es/Category.js +12 -13
  22. package/dist/packages/_es/CategoryPane.js +13 -17
  23. package/dist/packages/_es/Cell.js +12 -9
  24. package/dist/packages/_es/CellGroup.js +2 -4
  25. package/dist/packages/_es/Checkbox.js +1 -1
  26. package/dist/packages/_es/CheckboxGroup.js +2 -2
  27. package/dist/packages/_es/CircleProgress.js +82 -98
  28. package/dist/packages/_es/Col.js +1 -1
  29. package/dist/packages/_es/Collapse.js +34 -65
  30. package/dist/packages/_es/CollapseItem.js +60 -93
  31. package/dist/packages/_es/Comment.js +19 -43
  32. package/dist/packages/_es/ConfigProvider.js +1 -1
  33. package/dist/packages/_es/CountDown.js +3 -3
  34. package/dist/packages/_es/CountUp.js +52 -47
  35. package/dist/packages/_es/DatePicker.js +54 -37
  36. package/dist/packages/_es/Dialog.js +88 -9
  37. package/dist/packages/_es/Divider.js +3 -3
  38. package/dist/packages/_es/Drag.js +49 -75
  39. package/dist/packages/_es/Ecard.js +18 -20
  40. package/dist/packages/_es/Elevator.js +76 -101
  41. package/dist/packages/_es/Ellipsis.js +100 -140
  42. package/dist/packages/_es/Empty.js +4 -6
  43. package/dist/packages/_es/FixedNav.js +6 -11
  44. package/dist/packages/_es/Form.js +4 -4
  45. package/dist/packages/_es/FormItem.js +1 -3
  46. package/dist/packages/_es/Grid.js +1 -1
  47. package/dist/packages/_es/GridItem.js +27 -10
  48. package/dist/packages/_es/Icon.js +1 -1
  49. package/dist/packages/_es/Image.js +114 -13
  50. package/dist/packages/_es/ImagePreview.js +411 -149
  51. package/dist/packages/_es/Indicator.js +3 -3
  52. package/dist/packages/_es/InfiniteLoading.js +115 -103
  53. package/dist/packages/_es/Input.js +32 -56
  54. package/dist/packages/_es/InputNumber.js +16 -25
  55. package/dist/packages/_es/Invoice.js +5 -6
  56. package/dist/packages/_es/Layout.js +1 -1
  57. package/dist/packages/_es/List.js +34 -47
  58. package/dist/packages/_es/Menu.js +35 -35
  59. package/dist/packages/_es/MenuItem.js +29 -56
  60. package/dist/packages/_es/Navbar.js +39 -49
  61. package/dist/packages/_es/NoticeBar.js +45 -54
  62. package/dist/packages/_es/Notify.js +162 -44
  63. package/dist/packages/_es/NumberKeyboard.js +20 -15
  64. package/dist/packages/_es/OldPicker.js +116 -130
  65. package/dist/packages/_es/OverLay.js +28 -5
  66. package/dist/packages/_es/Pagination.js +5 -8
  67. package/dist/packages/_es/Picker.js +74 -198
  68. package/dist/packages/_es/Popover.js +881 -201
  69. package/dist/packages/_es/Popup.js +84 -28
  70. package/dist/packages/_es/Price.js +6 -22
  71. package/dist/packages/_es/Progress.js +11 -18
  72. package/dist/packages/_es/PullRefresh.js +2 -4
  73. package/dist/packages/_es/Radio.js +3 -3
  74. package/dist/packages/_es/RadioGroup.js +1 -1
  75. package/dist/packages/_es/Range.js +34 -48
  76. package/dist/packages/_es/Rate.js +14 -15
  77. package/dist/packages/_es/Row.js +1 -1
  78. package/dist/packages/_es/SearchBar.js +36 -39
  79. package/dist/packages/_es/ShortPassword.js +66 -97
  80. package/dist/packages/_es/SideNavBar.js +18 -7
  81. package/dist/packages/_es/SideNavBarItem.js +1 -1
  82. package/dist/packages/_es/Signature.js +80 -113
  83. package/dist/packages/_es/Skeleton.js +11 -12
  84. package/dist/packages/_es/Sku.js +38 -63
  85. package/dist/packages/_es/Step.js +2 -7
  86. package/dist/packages/_es/Steps.js +1 -1
  87. package/dist/packages/_es/Sticky.js +23 -33
  88. package/dist/packages/_es/SubSideNavBar.js +2 -4
  89. package/dist/packages/_es/Swipe.js +26 -41
  90. package/dist/packages/_es/Swiper.js +21 -38
  91. package/dist/packages/_es/SwiperItem.js +2 -2
  92. package/dist/packages/_es/Switch.js +8 -8
  93. package/dist/packages/_es/TabPane.js +1 -1
  94. package/dist/packages/_es/Tabbar.js +13 -15
  95. package/dist/packages/_es/TabbarItem.js +30 -24
  96. package/dist/packages/_es/Table.js +17 -22
  97. package/dist/packages/_es/Tabs.js +16 -49
  98. package/dist/packages/_es/Tag.js +5 -6
  99. package/dist/packages/_es/TextArea.js +49 -114
  100. package/dist/packages/_es/TimeDetail.js +3 -4
  101. package/dist/packages/_es/TimePannel.js +3 -3
  102. package/dist/packages/_es/TimeSelect.js +10 -12
  103. package/dist/packages/_es/Toast.js +164 -53
  104. package/dist/packages/_es/TrendArrow.js +4 -6
  105. package/dist/packages/_es/Uploader.js +140 -141
  106. package/dist/packages/_es/Video.js +18 -39
  107. package/dist/packages/_es/WaterMark.js +14 -22
  108. package/dist/packages/_es/common.js +1 -1
  109. package/dist/packages/_es/component.js +1 -1
  110. package/dist/packages/_es/index.js +6 -44
  111. package/dist/packages/_es/index2.js +31 -8
  112. package/dist/packages/_es/index3.js +7 -64
  113. package/dist/packages/_es/index4.js +62 -424
  114. package/dist/packages/_es/{index.taro.js → index5.js} +154 -167
  115. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  116. package/dist/packages/_es/pxCheck.js +1 -1
  117. package/dist/packages/_es/raf.js +1 -1
  118. package/dist/packages/_es/style.css +3 -21
  119. package/dist/packages/checkbox/index.scss +1 -0
  120. package/dist/packages/locale/lang/baseLang.js +1 -1
  121. package/dist/packages/locale/lang/en-US.js +1 -1
  122. package/dist/packages/locale/lang/id-ID.js +1 -1
  123. package/dist/packages/locale/lang/index.js +1 -1
  124. package/dist/packages/locale/lang/zh-CN.js +1 -1
  125. package/dist/packages/locale/lang/zh-TW.js +1 -1
  126. package/dist/packages/menuitem/index.scss +12 -3
  127. package/dist/smartips/attributes.json +5 -1
  128. package/dist/smartips/tags.json +1 -0
  129. package/dist/smartips/web-types.json +11 -2
  130. package/dist/style.css +1 -1
  131. package/dist/styles/themes/default.scss +49 -49
  132. package/dist/styles/themes/jdb.scss +49 -49
  133. package/dist/styles/themes/jddkh.scss +49 -49
  134. package/dist/styles/themes/jdt.scss +49 -49
  135. package/dist/types/__VUE/actionsheet/{index.taro.vue.d.ts → index.vue.d.ts} +9 -9
  136. package/dist/types/__VUE/address/{index.taro.vue.d.ts → index.vue.d.ts} +32 -72
  137. package/dist/types/__VUE/addresslist/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  138. package/dist/types/__VUE/animate/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  139. package/dist/types/__VUE/avatar/{index.taro.vue.d.ts → index.vue.d.ts} +6 -6
  140. package/dist/types/__VUE/avatargroup/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  141. package/dist/types/__VUE/backtop/{index.taro.vue.d.ts → index.vue.d.ts} +37 -15
  142. package/dist/types/__VUE/badge/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  143. package/dist/types/__VUE/barrage/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
  144. package/dist/types/__VUE/button/index.vue.d.ts +1 -1
  145. package/dist/types/__VUE/calendar/{index.taro.vue.d.ts → index.vue.d.ts} +1 -13
  146. package/dist/types/__VUE/calendaritem/{index.taro.vue.d.ts → index.vue.d.ts} +17 -17
  147. package/dist/types/__VUE/card/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  148. package/dist/types/__VUE/cascader/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  149. package/dist/types/__VUE/category/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  150. package/dist/types/__VUE/categorypane/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  151. package/dist/types/__VUE/cell/{index.taro.vue.d.ts → index.vue.d.ts} +6 -13
  152. package/dist/types/__VUE/checkbox/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  153. package/dist/types/__VUE/circleprogress/{index.taro.vue.d.ts → index.vue.d.ts} +15 -14
  154. package/dist/types/__VUE/collapse/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  155. package/dist/types/__VUE/collapseitem/{index.taro.vue.d.ts → index.vue.d.ts} +10 -2
  156. package/dist/types/__VUE/comment/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
  157. package/dist/types/__VUE/configprovider/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  158. package/dist/types/__VUE/countdown/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  159. package/dist/types/__VUE/countup/{index.taro.vue.d.ts → index.vue.d.ts} +7 -5
  160. package/dist/types/__VUE/datepicker/{index.taro.vue.d.ts → index.vue.d.ts} +5 -5
  161. package/dist/types/__VUE/dialog/index.d.ts +48 -0
  162. package/dist/types/__VUE/dialog/{index.taro.vue.d.ts → index.vue.d.ts} +12 -9
  163. package/dist/types/__VUE/divider/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  164. package/dist/types/__VUE/drag/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
  165. package/dist/types/__VUE/ecard/{index.taro.vue.d.ts → index.vue.d.ts} +3 -3
  166. package/dist/types/__VUE/elevator/{index.taro.vue.d.ts → index.vue.d.ts} +2 -11
  167. package/dist/types/__VUE/ellipsis/{index.taro.vue.d.ts → index.vue.d.ts} +0 -4
  168. package/dist/types/__VUE/empty/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  169. package/dist/types/__VUE/fixednav/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  170. package/dist/types/__VUE/form/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  171. package/dist/types/__VUE/grid/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  172. package/dist/types/__VUE/griditem/{index.taro.vue.d.ts → index.vue.d.ts} +27 -2
  173. package/dist/types/__VUE/image/index.vue.d.ts +117 -0
  174. package/dist/types/__VUE/image/type.d.ts +6 -0
  175. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +109 -0
  176. package/dist/types/__VUE/imagepreview/index.d.ts +25 -0
  177. package/dist/types/__VUE/imagepreview/{index.taro.vue.d.ts → index.vue.d.ts} +44 -33
  178. package/dist/types/__VUE/indicator/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  179. package/dist/types/__VUE/infiniteloading/{index.taro.vue.d.ts → index.vue.d.ts} +8 -15
  180. package/dist/types/__VUE/input/{index.taro.vue.d.ts → index.vue.d.ts} +16 -34
  181. package/dist/types/__VUE/inputnumber/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
  182. package/dist/types/__VUE/invoice/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  183. package/dist/types/__VUE/layout/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  184. package/dist/types/__VUE/list/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
  185. package/dist/types/__VUE/menu/{index.taro.vue.d.ts → index.vue.d.ts} +0 -1
  186. package/dist/types/__VUE/menuitem/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  187. package/dist/types/__VUE/navbar/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
  188. package/dist/types/__VUE/noticebar/{index.taro.vue.d.ts → index.vue.d.ts} +4 -4
  189. package/dist/types/__VUE/notify/index.d.ts +26 -0
  190. package/dist/types/__VUE/notify/{index.taro.vue.d.ts → index.vue.d.ts} +18 -5
  191. package/dist/types/__VUE/numberkeyboard/{index.taro.vue.d.ts → index.vue.d.ts} +29 -5
  192. package/dist/types/__VUE/oldpicker/{ColumnTaro.vue.d.ts → Column.vue.d.ts} +17 -28
  193. package/dist/types/__VUE/oldpicker/{index.taro.vue.d.ts → index.vue.d.ts} +44 -64
  194. package/dist/types/__VUE/pagination/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  195. package/dist/types/__VUE/picker/{ColumnTaro.vue.d.ts → Column.vue.d.ts} +4 -16
  196. package/dist/types/__VUE/picker/{index.taro.vue.d.ts → index.vue.d.ts} +28 -53
  197. package/dist/types/__VUE/popover/{index.taro.vue.d.ts → index.vue.d.ts} +12 -14
  198. package/dist/types/__VUE/popup/index.vue.d.ts +1 -1
  199. package/dist/types/__VUE/price/{index.taro.vue.d.ts → index.vue.d.ts} +0 -1
  200. package/dist/types/__VUE/progress/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  201. package/dist/types/__VUE/radio/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  202. package/dist/types/__VUE/range/{index.taro.vue.d.ts → index.vue.d.ts} +6 -7
  203. package/dist/types/__VUE/rate/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  204. package/dist/types/__VUE/searchbar/{index.taro.vue.d.ts → index.vue.d.ts} +19 -19
  205. package/dist/types/__VUE/shortpassword/{index.taro.vue.d.ts → index.vue.d.ts} +21 -6
  206. package/dist/types/__VUE/sidenavbar/{index.taro.vue.d.ts → index.vue.d.ts} +5 -0
  207. package/dist/types/__VUE/signature/{index.taro.vue.d.ts → index.vue.d.ts} +5 -8
  208. package/dist/types/__VUE/skeleton/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  209. package/dist/types/__VUE/sku/index.vue.d.ts +310 -0
  210. package/dist/types/__VUE/step/index.vue.d.ts +1 -1
  211. package/dist/types/__VUE/steps/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  212. package/dist/types/__VUE/sticky/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  213. package/dist/types/__VUE/swipe/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
  214. package/dist/types/__VUE/swiper/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
  215. package/dist/types/__VUE/swiperitem/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  216. package/dist/types/__VUE/switch/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  217. package/dist/types/__VUE/tabbar/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
  218. package/dist/types/__VUE/tabbaritem/{index.taro.vue.d.ts → index.vue.d.ts} +9 -9
  219. package/dist/types/__VUE/table/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  220. package/dist/types/__VUE/tabs/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  221. package/dist/types/__VUE/tag/{index.taro.vue.d.ts → index.vue.d.ts} +4 -4
  222. package/dist/types/__VUE/tag/type.d.ts +5 -0
  223. package/dist/types/__VUE/textarea/{index.taro.vue.d.ts → index.vue.d.ts} +3 -5
  224. package/dist/types/__VUE/timedetail/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  225. package/dist/types/__VUE/timepannel/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  226. package/dist/types/__VUE/timeselect/{index.taro.vue.d.ts → index.vue.d.ts} +8 -7
  227. package/dist/types/__VUE/toast/index.d.ts +16 -0
  228. package/dist/types/__VUE/toast/{index.taro.vue.d.ts → index.vue.d.ts} +22 -44
  229. package/dist/types/__VUE/trendarrow/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
  230. package/dist/types/__VUE/uploader/{index.taro.vue.d.ts → index.vue.d.ts} +11 -20
  231. package/dist/types/__VUE/watermark/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
  232. package/dist/types/index.d.ts +1 -1
  233. package/dist/types/nutui.d.ts +89 -89
  234. package/package.json +3 -2
  235. package/dist/packages/_es/use-lock-scroll.js +0 -23
  236. package/dist/types/__VUE/button/index.taro.vue.d.ts +0 -116
  237. package/dist/types/__VUE/icon/index.taro.vue.d.ts +0 -74
  238. package/dist/types/__VUE/image/index.taro.vue.d.ts +0 -33
  239. package/dist/types/__VUE/overlay/index.taro.vue.d.ts +0 -85
  240. package/dist/types/__VUE/popup/index.taro.vue.d.ts +0 -1728
  241. package/dist/types/__VUE/sku/index.taro.vue.d.ts +0 -182
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { h, ref, reactive, computed, watch, onMounted, onActivated, onDeactivated, onUnmounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, normalizeStyle, renderSlot, createBlock, createCommentVNode, createTextVNode, createElementVNode, toDisplayString, withModifiers, createVNode, mergeProps, vShow, Fragment, renderList } from "vue";
6
+ import { h, ref, reactive, computed, watch, onMounted, onActivated, onDeactivated, onUnmounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, withDirectives, normalizeStyle, renderSlot, createBlock, createCommentVNode, createElementVNode, createTextVNode, toDisplayString, withModifiers, createVNode, mergeProps, vShow, Fragment, renderList } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import Taro from "@tarojs/taro";
8
+ import { p as pxCheck } from "./pxCheck.js";
9
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
10
  import "../locale/lang";
11
11
  const { componentName, create } = createComponent("noticebar");
@@ -49,7 +49,7 @@ const _sfc_main = create({
49
49
  rightIcon: { type: String, default: "" },
50
50
  color: {
51
51
  type: String,
52
- default: "#F9911B"
52
+ default: ""
53
53
  },
54
54
  background: {
55
55
  type: String,
@@ -71,6 +71,7 @@ const _sfc_main = create({
71
71
  components: {
72
72
  ScrollItem: function(props) {
73
73
  props.item.props.style = props.style;
74
+ props.item.key = props.key;
74
75
  return h(props.item);
75
76
  }
76
77
  },
@@ -90,8 +91,7 @@ const _sfc_main = create({
90
91
  distance: 0,
91
92
  timer: null,
92
93
  keepAlive: false,
93
- isCanScroll: null,
94
- id: Math.round(Math.random() * 1e5)
94
+ isCanScroll: null
95
95
  });
96
96
  const classes = computed(() => {
97
97
  const prefixCls = componentName;
@@ -101,7 +101,7 @@ const _sfc_main = create({
101
101
  });
102
102
  const isEllipsis = computed(() => {
103
103
  if (state.isCanScroll == null) {
104
- return false;
104
+ return props.wrapable;
105
105
  } else {
106
106
  return !state.isCanScroll && !props.wrapable;
107
107
  }
@@ -114,10 +114,9 @@ const _sfc_main = create({
114
114
  }
115
115
  });
116
116
  const barStyle = computed(() => {
117
- let style = {
118
- color: props.color,
119
- background: props.background
120
- };
117
+ let style = {};
118
+ props.color && (style.color = props.color);
119
+ props.background && (style.background = props.background);
121
120
  if (props.direction == "vertical") {
122
121
  style.height = `${props.height}px`;
123
122
  }
@@ -145,8 +144,9 @@ const _sfc_main = create({
145
144
  };
146
145
  } else {
147
146
  if (state.animate) {
147
+ let a = ~~(props.height / props.speed / 4);
148
148
  styles = {
149
- transition: `all ${~~(props.height / props.speed / 4)}s`,
149
+ transition: `all ${a == 0 ? ~~(props.height / props.speed) : a}s`,
150
150
  "margin-top": `-${props.height}px`
151
151
  };
152
152
  }
@@ -173,26 +173,19 @@ const _sfc_main = create({
173
173
  if (!wrap.value || !content.value) {
174
174
  return;
175
175
  }
176
- let wrapWidth = 0;
177
- let offsetWidth = 0;
178
- Taro.createSelectorQuery().select(`.wrap${state.id}`).boundingClientRect((rect) => {
179
- if (rect.width > 0)
180
- wrapWidth = rect.width;
181
- }).exec();
182
- Taro.createSelectorQuery().select(`.content${state.id}`).boundingClientRect((rect) => {
183
- if (rect.width > 0)
184
- offsetWidth = rect.width;
185
- state.isCanScroll = props.scrollable == null ? offsetWidth > wrapWidth : props.scrollable;
186
- if (state.isCanScroll) {
187
- state.wrapWidth = wrapWidth;
188
- state.offsetWidth = offsetWidth;
189
- state.duration = offsetWidth / props.speed;
190
- state.animationClass = "play";
191
- } else {
192
- state.animationClass = "";
193
- }
194
- }).exec();
195
- }, 100);
176
+ const wrapWidth = wrap.value.getBoundingClientRect().width;
177
+ const offsetWidth = content.value.getBoundingClientRect().width;
178
+ state.isCanScroll = props.scrollable == null ? offsetWidth > wrapWidth : props.scrollable;
179
+ console.log(111, state.isCanScroll);
180
+ if (state.isCanScroll) {
181
+ state.wrapWidth = wrapWidth;
182
+ state.offsetWidth = offsetWidth;
183
+ state.duration = offsetWidth / props.speed;
184
+ state.animationClass = "play";
185
+ } else {
186
+ state.animationClass = "";
187
+ }
188
+ }, 0);
196
189
  };
197
190
  const handleClick = (event) => {
198
191
  emit("click", event);
@@ -212,7 +205,7 @@ const _sfc_main = create({
212
205
  };
213
206
  const startRollEasy = () => {
214
207
  showhorseLamp();
215
- state.timer = setInterval(showhorseLamp, ~~(props.height / props.speed / 4) * 1e3 + props.standTime);
208
+ state.timer = setInterval(showhorseLamp, ~~(props.height / props.speed / 4 * 1e3) + props.standTime);
216
209
  };
217
210
  const showhorseLamp = () => {
218
211
  state.animate = true;
@@ -220,7 +213,7 @@ const _sfc_main = create({
220
213
  state.scrollList.push(state.scrollList[0]);
221
214
  state.scrollList.shift();
222
215
  state.animate = false;
223
- }, ~~(props.height / props.speed / 4) * 1e3);
216
+ }, ~~(props.height / props.speed / 4 * 1e3));
224
217
  };
225
218
  const startRoll = () => {
226
219
  state.timer = setInterval(() => {
@@ -289,11 +282,16 @@ const _sfc_main = create({
289
282
  onAnimationEnd,
290
283
  go,
291
284
  handleClickIcon,
292
- slots
285
+ slots,
286
+ pxCheck
293
287
  };
294
288
  }
295
289
  });
296
- const _hoisted_1 = ["onClick"];
290
+ const _hoisted_1 = {
291
+ ref: "wrap",
292
+ class: "wrap"
293
+ };
294
+ const _hoisted_2 = ["onClick"];
297
295
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
298
296
  const _component_nut_icon = resolveComponent("nut-icon");
299
297
  const _component_ScrollItem = resolveComponent("ScrollItem");
@@ -320,14 +318,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
320
318
  }, null, 8, ["color"])) : createCommentVNode("", true)
321
319
  ])
322
320
  ], 4)) : createCommentVNode("", true),
323
- createTextVNode(),
324
- createElementVNode("view", {
325
- ref: "wrap",
326
- class: normalizeClass(`wrap wrap${_ctx.id}`)
327
- }, [
321
+ createElementVNode("view", _hoisted_1, [
328
322
  createElementVNode("view", {
329
323
  ref: "content",
330
- class: normalizeClass(["content", [_ctx.animationClass, { "nut-ellipsis": _ctx.isEllipsis }, `content${_ctx.id}`]]),
324
+ class: normalizeClass(["content", _ctx.animationClass, { "nut-ellipsis": _ctx.isEllipsis }]),
331
325
  style: normalizeStyle(_ctx.contentStyle),
332
326
  onAnimationend: _cache[0] || (_cache[0] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args)),
333
327
  "on:webkitAnimationEnd": _cache[1] || (_cache[1] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args))
@@ -336,8 +330,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
336
330
  createTextVNode(toDisplayString(_ctx.text), 1)
337
331
  ])
338
332
  ], 38)
339
- ], 2),
340
- createTextVNode(),
333
+ ], 512),
341
334
  _ctx.closeMode || _ctx.rightIcon ? (openBlock(), createElementBlock("view", {
342
335
  key: 1,
343
336
  class: "right-icon",
@@ -353,7 +346,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
353
346
  ], 6)), [
354
347
  [vShow, _ctx.showNoticeBar]
355
348
  ]) : createCommentVNode("", true),
356
- createTextVNode(),
357
349
  _ctx.scrollList.length > 0 && _ctx.direction == "vertical" ? (openBlock(), createElementBlock("view", {
358
350
  key: 1,
359
351
  class: "nut-noticebar-vertical",
@@ -364,9 +356,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
364
356
  class: "horseLamp_list",
365
357
  style: normalizeStyle(_ctx.horseLampStyle)
366
358
  }, [
367
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index) => {
359
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
368
360
  return openBlock(), createBlock(_component_ScrollItem, {
369
- key: index,
361
+ key: index2,
370
362
  style: normalizeStyle({ height: _ctx.height + "px", "line-height": _ctx.height + "px" }),
371
363
  item
372
364
  }, null, 8, ["style", "item"]);
@@ -376,16 +368,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
376
368
  class: "horseLamp_list",
377
369
  style: normalizeStyle(_ctx.horseLampStyle)
378
370
  }, [
379
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index) => {
371
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
380
372
  return openBlock(), createElementBlock("li", {
381
373
  class: "horseLamp_list_item",
382
- key: index,
383
- style: normalizeStyle({ height: _ctx.height }),
374
+ key: index2,
375
+ style: normalizeStyle({ height: _ctx.pxCheck(_ctx.height) }),
384
376
  onClick: ($event) => _ctx.go(item)
385
- }, toDisplayString(item), 13, _hoisted_1);
377
+ }, toDisplayString(item), 13, _hoisted_2);
386
378
  }), 128))
387
379
  ], 4)),
388
- createTextVNode(),
389
380
  createElementVNode("view", {
390
381
  class: "go",
391
382
  onClick: _cache[4] || (_cache[4] = ($event) => !_ctx.slots.rightIcon && _ctx.handleClickIcon())
@@ -400,5 +391,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
400
391
  ], 4)) : createCommentVNode("", true)
401
392
  ], 2);
402
393
  }
403
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
404
- export { index_taro as default };
394
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
395
+ export { index as default };
@@ -1,18 +1,17 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { watch, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, vShow } from "vue";
6
+ import { ref, watch, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, createVNode, render, onMounted, h } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
8
  import Popup from "./Popup.js";
9
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
10
  import "../locale/lang";
11
- import "./use-lock-scroll.js";
12
11
  import "./OverLay.js";
13
12
  import "./Icon.js";
14
13
  import "./pxCheck.js";
15
- const { componentName, create } = createComponent("notify");
14
+ const { create } = createComponent("notify");
16
15
  const _sfc_main = create({
17
16
  components: {
18
17
  [Popup.name]: Popup
@@ -38,69 +37,188 @@ const _sfc_main = create({
38
37
  position: {
39
38
  type: String,
40
39
  default: "top"
41
- }
40
+ },
41
+ isWrapTeleport: {
42
+ type: Boolean,
43
+ default: true
44
+ },
45
+ onClose: Function,
46
+ onClick: Function,
47
+ unmount: Function
42
48
  },
43
- emits: ["update:visible", "closed", "click"],
49
+ emits: ["update:visible"],
44
50
  setup(props, { emit }) {
45
- let timer = null;
46
- const onClick = () => {
47
- emit("click");
51
+ const clickCover = () => {
52
+ props.onClick && props.onClick();
48
53
  };
54
+ let timer = null;
49
55
  const clearTimer = () => {
50
- if (timer) {
51
- clearTimeout(timer);
52
- timer = null;
53
- }
56
+ timer && clearTimeout(timer);
57
+ timer = null;
54
58
  };
55
59
  const hide = () => {
56
60
  emit("update:visible", false);
57
- emit("closed");
58
61
  };
59
- watch(
62
+ const isShowPopup = ref(false);
63
+ const unWatch = watch(
60
64
  () => props.visible,
61
- (value) => {
62
- if (value) {
63
- show();
65
+ (newVal) => {
66
+ isShowPopup.value = props.visible;
67
+ const DURATION = props.duration;
68
+ if (newVal && DURATION) {
69
+ timer = setTimeout(() => {
70
+ hide();
71
+ }, DURATION);
64
72
  }
65
- }
73
+ },
74
+ { immediate: true }
66
75
  );
67
- const show = () => {
68
- clearTimer();
69
- if (props.duration) {
70
- timer = setTimeout(() => {
71
- hide();
72
- }, props.duration);
73
- }
74
- };
75
76
  const onAfterLeave = () => {
76
- if (props.visible) {
77
- clearTimer();
78
- hide();
79
- }
77
+ clearTimer();
78
+ unWatch && unWatch();
79
+ props.unmount && props.unmount(props.id);
80
+ props.onClose && props.onClose();
80
81
  };
81
- return { hide, onAfterLeave, onClick };
82
+ return { onAfterLeave, clickCover, isShowPopup };
82
83
  }
83
84
  });
84
85
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
85
- return openBlock(), createBlock(Transition, {
86
- name: "nut-fade",
87
- onAfterLeave: _ctx.onAfterLeave
86
+ const _component_nut_popup = resolveComponent("nut-popup");
87
+ return openBlock(), createBlock(_component_nut_popup, {
88
+ visible: _ctx.isShowPopup,
89
+ "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.isShowPopup = $event),
90
+ position: _ctx.position,
91
+ overlay: false,
92
+ isWrapTeleport: _ctx.isWrapTeleport
88
93
  }, {
89
94
  default: withCtx(() => [
90
- withDirectives(createElementVNode("view", {
91
- class: normalizeClass([`popup-${_ctx.position}`, "nut-notify", `nut-notify--${_ctx.type}`, _ctx.className]),
95
+ createElementVNode("div", {
96
+ class: normalizeClass(["nut-notify", `nut-notify--${_ctx.type}`, _ctx.className]),
92
97
  style: normalizeStyle({ color: _ctx.color, background: _ctx.background }),
93
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
98
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
94
99
  }, [
95
100
  _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
96
101
  createTextVNode(toDisplayString(_ctx.msg), 1)
97
102
  ], 64))
98
- ], 6), [
99
- [vShow, _ctx.visible]
100
- ])
103
+ ], 6)
101
104
  ]),
102
105
  _: 3
103
- }, 8, ["onAfterLeave"]);
106
+ }, 8, ["visible", "position", "isWrapTeleport"]);
104
107
  }
105
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
106
- export { index_taro as default };
108
+ var Notify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
109
+ const defaultOptions = {
110
+ type: "base",
111
+ visible: true,
112
+ msg: "",
113
+ color: void 0,
114
+ background: void 0,
115
+ duration: 3e3,
116
+ className: "",
117
+ teleport: "",
118
+ unmount: new Function()
119
+ };
120
+ let idsMap = [];
121
+ let optsMap = [];
122
+ const clearNotify = (id) => {
123
+ if (id) {
124
+ const container = document.getElementById(id);
125
+ optsMap = optsMap.filter((item) => item.id !== id);
126
+ idsMap = idsMap.filter((item) => item !== id);
127
+ if (container) {
128
+ document.body.removeChild(container);
129
+ }
130
+ } else {
131
+ idsMap.forEach((item) => {
132
+ const container = document.getElementById(item);
133
+ if (container) {
134
+ document.body.removeChild(container);
135
+ }
136
+ });
137
+ optsMap = [];
138
+ idsMap = [];
139
+ }
140
+ };
141
+ const updateNotify = (opts) => {
142
+ const container = document.getElementById(opts.id);
143
+ if (container) {
144
+ const currentOpt = optsMap.find((item) => item.id === opts.id);
145
+ if (currentOpt) {
146
+ opts = { ...defaultOptions, ...currentOpt, ...opts };
147
+ } else {
148
+ opts = { ...defaultOptions, ...opts };
149
+ }
150
+ const instance = createVNode(Notify, opts);
151
+ render(instance, container);
152
+ return instance.component.data;
153
+ }
154
+ };
155
+ const mountNotify = (opts) => {
156
+ opts.unmount = clearNotify;
157
+ let _id;
158
+ if (opts.id) {
159
+ _id = opts.id;
160
+ if (idsMap.find((item) => item === opts.id)) {
161
+ return updateNotify(opts);
162
+ }
163
+ } else {
164
+ _id = new Date().getTime() + "";
165
+ }
166
+ opts = { ...defaultOptions, ...opts };
167
+ opts.id = _id;
168
+ idsMap.push(opts.id);
169
+ optsMap.push(opts);
170
+ const root = document.createElement("view");
171
+ root.id = "notify-" + opts.id;
172
+ const Wrapper = {
173
+ setup() {
174
+ opts.teleport = `#notify-${opts.id}`;
175
+ onMounted(() => {
176
+ setTimeout(() => {
177
+ document.body.removeChild(root);
178
+ }, opts.duration);
179
+ });
180
+ return () => {
181
+ return h(Notify, opts);
182
+ };
183
+ }
184
+ };
185
+ const instance = createVNode(Wrapper);
186
+ document.body.appendChild(root);
187
+ render(instance, root);
188
+ };
189
+ const errorMsg = (msg) => {
190
+ if (!msg) {
191
+ console.warn("[NutUI Notify]: msg\u4E0D\u80FD\u4E3A\u7A7A");
192
+ return;
193
+ }
194
+ };
195
+ const NotifyFunction = {
196
+ text(msg, obj = {}) {
197
+ errorMsg(msg);
198
+ return mountNotify({ ...obj, msg });
199
+ },
200
+ primary(msg, obj = {}) {
201
+ errorMsg(msg);
202
+ return mountNotify({ ...obj, msg, type: "primary" });
203
+ },
204
+ success(msg, obj = {}) {
205
+ errorMsg(msg);
206
+ return mountNotify({ ...obj, msg, type: "success" });
207
+ },
208
+ danger(msg, obj = {}) {
209
+ errorMsg(msg);
210
+ return mountNotify({ ...obj, msg, type: "danger" });
211
+ },
212
+ warn(msg, obj = {}) {
213
+ errorMsg(msg);
214
+ return mountNotify({ ...obj, msg, type: "warning" });
215
+ },
216
+ hide() {
217
+ clearNotify();
218
+ },
219
+ install(app) {
220
+ app.use(Notify);
221
+ app.config.globalProperties.$notify = NotifyFunction;
222
+ }
223
+ };
224
+ export { Notify, NotifyFunction, NotifyFunction as default };
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.6-beta.1 Mon Oct 31 2022 19:38:22 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { ref, computed, watch, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, toDisplayString, createTextVNode, createCommentVNode, Fragment, renderList, normalizeClass } from "vue";
6
+ import { ref, computed, watch, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, toDisplayString, createCommentVNode, Fragment, renderList, normalizeClass, createTextVNode } 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";
@@ -46,6 +46,14 @@ const _sfc_main = create({
46
46
  type: Boolean,
47
47
  default: true
48
48
  },
49
+ isWrapTeleport: {
50
+ type: Boolean,
51
+ default: true
52
+ },
53
+ teleport: {
54
+ type: [String, Element],
55
+ default: "body"
56
+ },
49
57
  popClass: {
50
58
  type: String,
51
59
  default: ""
@@ -138,7 +146,8 @@ const _sfc_main = create({
138
146
  function onTouchMove(event) {
139
147
  event.stopPropagation();
140
148
  }
141
- function onTouchEnd() {
149
+ function onTouchEnd(event) {
150
+ event.preventDefault();
142
151
  clickKeyIndex.value = void 0;
143
152
  }
144
153
  function closeBoard() {
@@ -195,23 +204,23 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
195
204
  visible: _ctx.show,
196
205
  "onUpdate:visible": _cache[7] || (_cache[7] = ($event) => _ctx.show = $event),
197
206
  position: "bottom",
207
+ teleport: _ctx.teleport,
198
208
  popClass: _ctx.popClass,
199
209
  overlay: _ctx.overlay,
200
210
  onClickOverlay: _cache[8] || (_cache[8] = ($event) => _ctx.closeBoard()),
211
+ isWrapTeleport: _ctx.isWrapTeleport,
201
212
  "overlay-class": "nut-numberkeyboard-overlay"
202
213
  }, {
203
214
  default: withCtx(() => [
204
215
  createElementVNode("div", _hoisted_1, [
205
216
  _ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2, [
206
217
  createElementVNode("h3", _hoisted_3, toDisplayString(_ctx.title), 1),
207
- createTextVNode(),
208
218
  _ctx.type == "default" ? (openBlock(), createElementBlock("span", {
209
219
  key: 0,
210
220
  class: "keyboard-close",
211
221
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.closeBoard())
212
222
  }, toDisplayString(_ctx.translate("done")), 1)) : createCommentVNode("", true)
213
223
  ])) : createCommentVNode("", true),
214
- createTextVNode(),
215
224
  createElementVNode("div", _hoisted_4, [
216
225
  createElementVNode("div", _hoisted_5, [
217
226
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.keysList, (item) => {
@@ -233,32 +242,28 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
233
242
  ]),
234
243
  onTouchstart: (event) => _ctx.onTouchstart(item, event),
235
244
  onTouchmove: _cache[1] || (_cache[1] = (event) => _ctx.onTouchMove(event)),
236
- onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
245
+ onTouchend: _cache[2] || (_cache[2] = (event) => _ctx.onTouchEnd(event))
237
246
  }, [
238
247
  item.type == "number" || item.type == "custom" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
239
248
  createTextVNode(toDisplayString(item.id), 1)
240
249
  ], 64)) : createCommentVNode("", true),
241
- createTextVNode(),
242
250
  item.type == "lock" ? (openBlock(), createElementBlock("img", _hoisted_7)) : createCommentVNode("", true),
243
- createTextVNode(),
244
251
  item.type == "delete" ? (openBlock(), createElementBlock("img", _hoisted_8)) : createCommentVNode("", true)
245
252
  ], 42, _hoisted_6)
246
253
  ], 2);
247
254
  }), 128))
248
255
  ]),
249
- createTextVNode(),
250
256
  _ctx.type == "rightColumn" ? (openBlock(), createElementBlock("div", _hoisted_9, [
251
257
  createElementVNode("div", _hoisted_10, [
252
258
  createElementVNode("div", {
253
259
  class: normalizeClass(["key", { active: _ctx.clickKeyIndex == "delete" }]),
254
260
  onTouchstart: _cache[3] || (_cache[3] = (event) => _ctx.onTouchstart({ id: "delete", type: "delete" }, event)),
255
- onTouchmove: _cache[4] || (_cache[4] = (event) => _ctx.onTouchMove(event)),
261
+ onTouchmove: _cache[4] || (_cache[4] = (event) => _ctx.onTouchMove({ id: "delete", type: "delete" }, event)),
256
262
  onTouchend: _cache[5] || (_cache[5] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
257
263
  }, _hoisted_12, 34)
258
264
  ]),
259
- createTextVNode(),
260
265
  createElementVNode("div", {
261
- class: "key-board-wrapper",
266
+ class: "key-board-wrapper key-board-finish",
262
267
  onClick: _cache[6] || (_cache[6] = ($event) => _ctx.closeBoard())
263
268
  }, [
264
269
  createElementVNode("div", {
@@ -270,7 +275,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
270
275
  ], 512)
271
276
  ]),
272
277
  _: 1
273
- }, 8, ["visible", "popClass", "overlay"]);
278
+ }, 8, ["visible", "teleport", "popClass", "overlay", "isWrapTeleport"]);
274
279
  }
275
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
276
- export { index_taro as default };
280
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
281
+ export { index as default };