@nutui/nutui 3.2.5 → 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 (239) 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} +11 -11
  136. package/dist/types/__VUE/address/{index.vue.d.ts → index.taro.vue.d.ts} +74 -34
  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} +5 -5
  140. package/dist/types/__VUE/avatargroup/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  141. package/dist/types/__VUE/backtop/{index.vue.d.ts → index.taro.vue.d.ts} +14 -36
  142. package/dist/types/__VUE/badge/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  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/calendar/{index.vue.d.ts → index.taro.vue.d.ts} +14 -2
  146. package/dist/types/__VUE/calendaritem/{index.vue.d.ts → index.taro.vue.d.ts} +17 -17
  147. package/dist/types/__VUE/card/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  148. package/dist/types/__VUE/cascader/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  149. package/dist/types/__VUE/category/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  150. package/dist/types/__VUE/categorypane/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  151. package/dist/types/__VUE/cell/{index.vue.d.ts → index.taro.vue.d.ts} +12 -5
  152. package/dist/types/__VUE/checkbox/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  153. package/dist/types/__VUE/circleprogress/{index.vue.d.ts → index.taro.vue.d.ts} +14 -15
  154. package/dist/types/__VUE/collapse/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  155. package/dist/types/__VUE/collapseitem/{index.vue.d.ts → index.taro.vue.d.ts} +1 -9
  156. package/dist/types/__VUE/comment/{index.vue.d.ts → index.taro.vue.d.ts} +1 -2
  157. package/dist/types/__VUE/configprovider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  158. package/dist/types/__VUE/countdown/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  159. package/dist/types/__VUE/countup/{index.vue.d.ts → index.taro.vue.d.ts} +5 -7
  160. package/dist/types/__VUE/datepicker/{index.vue.d.ts → index.taro.vue.d.ts} +6 -6
  161. package/dist/types/__VUE/dialog/{index.vue.d.ts → index.taro.vue.d.ts} +10 -13
  162. package/dist/types/__VUE/divider/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  163. package/dist/types/__VUE/drag/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
  164. package/dist/types/__VUE/ecard/{index.vue.d.ts → index.taro.vue.d.ts} +3 -3
  165. package/dist/types/__VUE/elevator/{index.vue.d.ts → index.taro.vue.d.ts} +11 -2
  166. package/dist/types/__VUE/ellipsis/{index.vue.d.ts → index.taro.vue.d.ts} +4 -0
  167. package/dist/types/__VUE/empty/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  168. package/dist/types/__VUE/fixednav/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  169. package/dist/types/__VUE/form/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  170. package/dist/types/__VUE/grid/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  171. package/dist/types/__VUE/griditem/{index.vue.d.ts → index.taro.vue.d.ts} +2 -27
  172. package/dist/types/__VUE/icon/index.taro.vue.d.ts +74 -0
  173. package/dist/types/__VUE/image/index.taro.vue.d.ts +33 -0
  174. package/dist/types/__VUE/imagepreview/{index.vue.d.ts → index.taro.vue.d.ts} +41 -43
  175. package/dist/types/__VUE/indicator/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  176. package/dist/types/__VUE/infiniteloading/{index.vue.d.ts → index.taro.vue.d.ts} +15 -8
  177. package/dist/types/__VUE/input/{index.vue.d.ts → index.taro.vue.d.ts} +34 -16
  178. package/dist/types/__VUE/inputnumber/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  179. package/dist/types/__VUE/invoice/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  180. package/dist/types/__VUE/layout/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  181. package/dist/types/__VUE/list/{index.vue.d.ts → index.taro.vue.d.ts} +2 -2
  182. package/dist/types/__VUE/menu/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
  183. package/dist/types/__VUE/menuitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  184. package/dist/types/__VUE/navbar/{index.vue.d.ts → index.taro.vue.d.ts} +1 -2
  185. package/dist/types/__VUE/noticebar/{index.vue.d.ts → index.taro.vue.d.ts} +6 -5
  186. package/dist/types/__VUE/notify/{index.vue.d.ts → index.taro.vue.d.ts} +10 -25
  187. package/dist/types/__VUE/numberkeyboard/{index.vue.d.ts → index.taro.vue.d.ts} +6 -30
  188. package/dist/types/__VUE/oldpicker/{Column.vue.d.ts → ColumnTaro.vue.d.ts} +28 -17
  189. package/dist/types/__VUE/oldpicker/{index.vue.d.ts → index.taro.vue.d.ts} +65 -45
  190. package/dist/types/__VUE/overlay/index.taro.vue.d.ts +85 -0
  191. package/dist/types/__VUE/pagination/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  192. package/dist/types/__VUE/picker/{Column.vue.d.ts → ColumnTaro.vue.d.ts} +16 -4
  193. package/dist/types/__VUE/picker/{index.vue.d.ts → index.taro.vue.d.ts} +54 -29
  194. package/dist/types/__VUE/popover/{index.vue.d.ts → index.taro.vue.d.ts} +18 -16
  195. package/dist/types/__VUE/popup/index.taro.vue.d.ts +1728 -0
  196. package/dist/types/__VUE/popup/index.vue.d.ts +4 -4
  197. package/dist/types/__VUE/price/{index.vue.d.ts → index.taro.vue.d.ts} +1 -0
  198. package/dist/types/__VUE/progress/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  199. package/dist/types/__VUE/radio/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  200. package/dist/types/__VUE/range/{index.vue.d.ts → index.taro.vue.d.ts} +7 -6
  201. package/dist/types/__VUE/rate/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  202. package/dist/types/__VUE/searchbar/{index.vue.d.ts → index.taro.vue.d.ts} +19 -19
  203. package/dist/types/__VUE/shortpassword/{index.vue.d.ts → index.taro.vue.d.ts} +6 -21
  204. package/dist/types/__VUE/sidenavbar/{index.vue.d.ts → index.taro.vue.d.ts} +0 -5
  205. package/dist/types/__VUE/signature/{index.vue.d.ts → index.taro.vue.d.ts} +8 -5
  206. package/dist/types/__VUE/skeleton/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  207. package/dist/types/__VUE/sku/{index.vue.d.ts → index.taro.vue.d.ts} +55 -183
  208. package/dist/types/__VUE/step/index.vue.d.ts +1 -1
  209. package/dist/types/__VUE/steps/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  210. package/dist/types/__VUE/sticky/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  211. package/dist/types/__VUE/swipe/{index.vue.d.ts → index.taro.vue.d.ts} +4 -3
  212. package/dist/types/__VUE/swiper/{index.vue.d.ts → index.taro.vue.d.ts} +2 -1
  213. package/dist/types/__VUE/swiperitem/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  214. package/dist/types/__VUE/switch/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  215. package/dist/types/__VUE/tabbar/{index.vue.d.ts → index.taro.vue.d.ts} +10 -0
  216. package/dist/types/__VUE/tabbaritem/{index.vue.d.ts → index.taro.vue.d.ts} +8 -8
  217. package/dist/types/__VUE/table/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  218. package/dist/types/__VUE/tabs/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  219. package/dist/types/__VUE/tag/{index.vue.d.ts → index.taro.vue.d.ts} +4 -4
  220. package/dist/types/__VUE/textarea/{index.vue.d.ts → index.taro.vue.d.ts} +5 -3
  221. package/dist/types/__VUE/timedetail/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  222. package/dist/types/__VUE/timepannel/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  223. package/dist/types/__VUE/timeselect/{index.vue.d.ts → index.taro.vue.d.ts} +7 -8
  224. package/dist/types/__VUE/toast/{index.vue.d.ts → index.taro.vue.d.ts} +44 -22
  225. package/dist/types/__VUE/trendarrow/{index.vue.d.ts → index.taro.vue.d.ts} +0 -0
  226. package/dist/types/__VUE/uploader/{index.vue.d.ts → index.taro.vue.d.ts} +22 -13
  227. package/dist/types/__VUE/video/index.vue.d.ts +4 -2
  228. package/dist/types/__VUE/watermark/{index.vue.d.ts → index.taro.vue.d.ts} +1 -1
  229. package/dist/types/index.d.ts +1 -1
  230. package/dist/types/nutui.d.ts +89 -89
  231. package/package.json +1 -1
  232. package/dist/types/__VUE/dialog/index.d.ts +0 -48
  233. package/dist/types/__VUE/image/index.vue.d.ts +0 -117
  234. package/dist/types/__VUE/image/type.d.ts +0 -6
  235. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +0 -108
  236. package/dist/types/__VUE/imagepreview/index.d.ts +0 -25
  237. package/dist/types/__VUE/notify/index.d.ts +0 -26
  238. package/dist/types/__VUE/tag/type.d.ts +0 -5
  239. package/dist/types/__VUE/toast/index.d.ts +0 -16
@@ -1,10 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.5 Tue Oct 25 2022 18:40:57 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 { 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";
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";
7
7
  import { c as createComponent } from "./component.js";
8
+ import Taro from "@tarojs/taro";
8
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
10
  import "../locale/lang";
10
11
  const { componentName, create } = createComponent("noticebar");
@@ -48,7 +49,7 @@ const _sfc_main = create({
48
49
  rightIcon: { type: String, default: "" },
49
50
  color: {
50
51
  type: String,
51
- default: ""
52
+ default: "#F9911B"
52
53
  },
53
54
  background: {
54
55
  type: String,
@@ -70,7 +71,6 @@ const _sfc_main = create({
70
71
  components: {
71
72
  ScrollItem: function(props) {
72
73
  props.item.props.style = props.style;
73
- props.item.key = props.key;
74
74
  return h(props.item);
75
75
  }
76
76
  },
@@ -90,7 +90,8 @@ const _sfc_main = create({
90
90
  distance: 0,
91
91
  timer: null,
92
92
  keepAlive: false,
93
- isCanScroll: null
93
+ isCanScroll: null,
94
+ id: Math.round(Math.random() * 1e5)
94
95
  });
95
96
  const classes = computed(() => {
96
97
  const prefixCls = componentName;
@@ -100,7 +101,7 @@ const _sfc_main = create({
100
101
  });
101
102
  const isEllipsis = computed(() => {
102
103
  if (state.isCanScroll == null) {
103
- return props.wrapable;
104
+ return false;
104
105
  } else {
105
106
  return !state.isCanScroll && !props.wrapable;
106
107
  }
@@ -113,9 +114,10 @@ const _sfc_main = create({
113
114
  }
114
115
  });
115
116
  const barStyle = computed(() => {
116
- let style = {};
117
- props.color && (style.color = props.color);
118
- props.background && (style.background = props.background);
117
+ let style = {
118
+ color: props.color,
119
+ background: props.background
120
+ };
119
121
  if (props.direction == "vertical") {
120
122
  style.height = `${props.height}px`;
121
123
  }
@@ -143,9 +145,8 @@ const _sfc_main = create({
143
145
  };
144
146
  } else {
145
147
  if (state.animate) {
146
- let a = ~~(props.height / props.speed / 4);
147
148
  styles = {
148
- transition: `all ${a == 0 ? ~~(props.height / props.speed) : a}s`,
149
+ transition: `all ${~~(props.height / props.speed / 4)}s`,
149
150
  "margin-top": `-${props.height}px`
150
151
  };
151
152
  }
@@ -172,19 +173,26 @@ const _sfc_main = create({
172
173
  if (!wrap.value || !content.value) {
173
174
  return;
174
175
  }
175
- const wrapWidth = wrap.value.getBoundingClientRect().width;
176
- const offsetWidth = content.value.getBoundingClientRect().width;
177
- state.isCanScroll = props.scrollable == null ? offsetWidth > wrapWidth : props.scrollable;
178
- console.log(111, state.isCanScroll);
179
- if (state.isCanScroll) {
180
- state.wrapWidth = wrapWidth;
181
- state.offsetWidth = offsetWidth;
182
- state.duration = offsetWidth / props.speed;
183
- state.animationClass = "play";
184
- } else {
185
- state.animationClass = "";
186
- }
187
- }, 0);
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);
188
196
  };
189
197
  const handleClick = (event) => {
190
198
  emit("click", event);
@@ -204,7 +212,7 @@ const _sfc_main = create({
204
212
  };
205
213
  const startRollEasy = () => {
206
214
  showhorseLamp();
207
- state.timer = setInterval(showhorseLamp, ~~(props.height / props.speed / 4 * 1e3) + props.standTime);
215
+ state.timer = setInterval(showhorseLamp, ~~(props.height / props.speed / 4) * 1e3 + props.standTime);
208
216
  };
209
217
  const showhorseLamp = () => {
210
218
  state.animate = true;
@@ -212,7 +220,7 @@ const _sfc_main = create({
212
220
  state.scrollList.push(state.scrollList[0]);
213
221
  state.scrollList.shift();
214
222
  state.animate = false;
215
- }, ~~(props.height / props.speed / 4 * 1e3));
223
+ }, ~~(props.height / props.speed / 4) * 1e3);
216
224
  };
217
225
  const startRoll = () => {
218
226
  state.timer = setInterval(() => {
@@ -285,11 +293,7 @@ const _sfc_main = create({
285
293
  };
286
294
  }
287
295
  });
288
- const _hoisted_1 = {
289
- ref: "wrap",
290
- class: "wrap"
291
- };
292
- const _hoisted_2 = ["onClick"];
296
+ const _hoisted_1 = ["onClick"];
293
297
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
294
298
  const _component_nut_icon = resolveComponent("nut-icon");
295
299
  const _component_ScrollItem = resolveComponent("ScrollItem");
@@ -316,10 +320,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
316
320
  }, null, 8, ["color"])) : createCommentVNode("", true)
317
321
  ])
318
322
  ], 4)) : createCommentVNode("", true),
319
- createElementVNode("view", _hoisted_1, [
323
+ createTextVNode(),
324
+ createElementVNode("view", {
325
+ ref: "wrap",
326
+ class: normalizeClass(`wrap wrap${_ctx.id}`)
327
+ }, [
320
328
  createElementVNode("view", {
321
329
  ref: "content",
322
- class: normalizeClass(["content", _ctx.animationClass, { "nut-ellipsis": _ctx.isEllipsis }]),
330
+ class: normalizeClass(["content", [_ctx.animationClass, { "nut-ellipsis": _ctx.isEllipsis }, `content${_ctx.id}`]]),
323
331
  style: normalizeStyle(_ctx.contentStyle),
324
332
  onAnimationend: _cache[0] || (_cache[0] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args)),
325
333
  "on:webkitAnimationEnd": _cache[1] || (_cache[1] = (...args) => _ctx.onAnimationEnd && _ctx.onAnimationEnd(...args))
@@ -328,7 +336,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
328
336
  createTextVNode(toDisplayString(_ctx.text), 1)
329
337
  ])
330
338
  ], 38)
331
- ], 512),
339
+ ], 2),
340
+ createTextVNode(),
332
341
  _ctx.closeMode || _ctx.rightIcon ? (openBlock(), createElementBlock("view", {
333
342
  key: 1,
334
343
  class: "right-icon",
@@ -344,6 +353,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
344
353
  ], 6)), [
345
354
  [vShow, _ctx.showNoticeBar]
346
355
  ]) : createCommentVNode("", true),
356
+ createTextVNode(),
347
357
  _ctx.scrollList.length > 0 && _ctx.direction == "vertical" ? (openBlock(), createElementBlock("view", {
348
358
  key: 1,
349
359
  class: "nut-noticebar-vertical",
@@ -354,9 +364,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
354
364
  class: "horseLamp_list",
355
365
  style: normalizeStyle(_ctx.horseLampStyle)
356
366
  }, [
357
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
367
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index) => {
358
368
  return openBlock(), createBlock(_component_ScrollItem, {
359
- key: index2,
369
+ key: index,
360
370
  style: normalizeStyle({ height: _ctx.height + "px", "line-height": _ctx.height + "px" }),
361
371
  item
362
372
  }, null, 8, ["style", "item"]);
@@ -366,15 +376,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
366
376
  class: "horseLamp_list",
367
377
  style: normalizeStyle(_ctx.horseLampStyle)
368
378
  }, [
369
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index2) => {
379
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.scrollList, (item, index) => {
370
380
  return openBlock(), createElementBlock("li", {
371
381
  class: "horseLamp_list_item",
372
- key: index2,
382
+ key: index,
373
383
  style: normalizeStyle({ height: _ctx.height }),
374
384
  onClick: ($event) => _ctx.go(item)
375
- }, toDisplayString(item), 13, _hoisted_2);
385
+ }, toDisplayString(item), 13, _hoisted_1);
376
386
  }), 128))
377
387
  ], 4)),
388
+ createTextVNode(),
378
389
  createElementVNode("view", {
379
390
  class: "go",
380
391
  onClick: _cache[4] || (_cache[4] = ($event) => !_ctx.slots.rightIcon && _ctx.handleClickIcon())
@@ -389,5 +400,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
389
400
  ], 4)) : createCommentVNode("", true)
390
401
  ], 2);
391
402
  }
392
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
393
- export { index as default };
403
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
404
+ export { index_taro as default };
@@ -1,17 +1,18 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.5 Tue Oct 25 2022 18:40:57 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, onMounted, ref, watch, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, createVNode, render, h } from "vue";
6
+ import { watch, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, vShow } 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";
11
12
  import "./OverLay.js";
12
13
  import "./Icon.js";
13
14
  import "./pxCheck.js";
14
- const { create } = createComponent("notify");
15
+ const { componentName, create } = createComponent("notify");
15
16
  const _sfc_main = create({
16
17
  components: {
17
18
  [Popup.name]: Popup
@@ -30,32 +31,20 @@ const _sfc_main = create({
30
31
  type: String,
31
32
  default: "danger"
32
33
  },
33
- modelVisible: {
34
+ visible: {
34
35
  type: Boolean,
35
36
  default: false
36
37
  },
37
38
  position: {
38
39
  type: String,
39
40
  default: "top"
40
- },
41
- isWrapTeleport: {
42
- type: Boolean,
43
- default: true
44
- },
45
- onClose: Function,
46
- onClick: Function,
47
- unmount: Function
41
+ }
48
42
  },
49
- setup(props) {
43
+ emits: ["update:visible", "closed", "click"],
44
+ setup(props, { emit }) {
50
45
  let timer = null;
51
- const state = reactive({
52
- mounted: false
53
- });
54
- onMounted(() => {
55
- });
56
- const showPopup = ref(props.modelVisible);
57
- const clickCover = () => {
58
- props.onClick && props.onClick();
46
+ const onClick = () => {
47
+ emit("click");
59
48
  };
60
49
  const clearTimer = () => {
61
50
  if (timer) {
@@ -64,8 +53,17 @@ const _sfc_main = create({
64
53
  }
65
54
  };
66
55
  const hide = () => {
67
- state.mounted = false;
56
+ emit("update:visible", false);
57
+ emit("closed");
68
58
  };
59
+ watch(
60
+ () => props.visible,
61
+ (value) => {
62
+ if (value) {
63
+ show();
64
+ }
65
+ }
66
+ );
69
67
  const show = () => {
70
68
  clearTimer();
71
69
  if (props.duration) {
@@ -74,162 +72,35 @@ const _sfc_main = create({
74
72
  }, props.duration);
75
73
  }
76
74
  };
77
- if (props.duration) {
78
- show();
79
- }
80
- watch(
81
- () => props.duration,
82
- (val) => {
83
- if (val) {
84
- show();
85
- }
86
- }
87
- );
88
75
  const onAfterLeave = () => {
89
- clearTimer();
90
- props.unmount && props.unmount(props.id);
91
- props.onClose && props.onClose();
76
+ if (props.visible) {
77
+ clearTimer();
78
+ hide();
79
+ }
92
80
  };
93
- return { state, hide, onAfterLeave, clickCover, showPopup };
81
+ return { hide, onAfterLeave, onClick };
94
82
  }
95
83
  });
96
84
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
97
- const _component_nut_popup = resolveComponent("nut-popup");
98
- return openBlock(), createBlock(_component_nut_popup, {
99
- visible: _ctx.showPopup,
100
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPopup = $event),
101
- position: _ctx.position,
102
- overlay: false,
103
- isWrapTeleport: _ctx.isWrapTeleport
85
+ return openBlock(), createBlock(Transition, {
86
+ name: "nut-fade",
87
+ onAfterLeave: _ctx.onAfterLeave
104
88
  }, {
105
89
  default: withCtx(() => [
106
- createElementVNode("div", {
107
- class: normalizeClass(["nut-notify", `nut-notify--${_ctx.type}`, _ctx.className]),
90
+ withDirectives(createElementVNode("view", {
91
+ class: normalizeClass([`popup-${_ctx.position}`, "nut-notify", `nut-notify--${_ctx.type}`, _ctx.className]),
108
92
  style: normalizeStyle({ color: _ctx.color, background: _ctx.background }),
109
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
93
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
110
94
  }, [
111
95
  _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
112
96
  createTextVNode(toDisplayString(_ctx.msg), 1)
113
97
  ], 64))
114
- ], 6)
98
+ ], 6), [
99
+ [vShow, _ctx.visible]
100
+ ])
115
101
  ]),
116
102
  _: 3
117
- }, 8, ["visible", "position", "isWrapTeleport"]);
103
+ }, 8, ["onAfterLeave"]);
118
104
  }
119
- var Notify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
120
- const defaultOptions = {
121
- type: "base",
122
- visible: true,
123
- msg: "",
124
- color: void 0,
125
- background: void 0,
126
- duration: 3e3,
127
- className: "",
128
- teleport: "",
129
- unmount: new Function()
130
- };
131
- let idsMap = [];
132
- let optsMap = [];
133
- const clearNotify = (id) => {
134
- if (id) {
135
- const container = document.getElementById(id);
136
- optsMap = optsMap.filter((item) => item.id !== id);
137
- idsMap = idsMap.filter((item) => item !== id);
138
- if (container) {
139
- document.body.removeChild(container);
140
- }
141
- } else {
142
- idsMap.forEach((item) => {
143
- const container = document.getElementById(item);
144
- if (container) {
145
- document.body.removeChild(container);
146
- }
147
- });
148
- optsMap = [];
149
- idsMap = [];
150
- }
151
- };
152
- const updateNotify = (opts) => {
153
- const container = document.getElementById(opts.id);
154
- if (container) {
155
- const currentOpt = optsMap.find((item) => item.id === opts.id);
156
- if (currentOpt) {
157
- opts = { ...defaultOptions, ...currentOpt, ...opts };
158
- } else {
159
- opts = { ...defaultOptions, ...opts };
160
- }
161
- const instance = createVNode(Notify, opts);
162
- render(instance, container);
163
- return instance.component.data;
164
- }
165
- };
166
- const mountNotify = (opts) => {
167
- opts.unmount = clearNotify;
168
- let _id;
169
- if (opts.id) {
170
- _id = opts.id;
171
- if (idsMap.find((item) => item === opts.id)) {
172
- return updateNotify(opts);
173
- }
174
- } else {
175
- _id = new Date().getTime() + "";
176
- }
177
- opts = { ...defaultOptions, ...opts };
178
- opts.id = _id;
179
- idsMap.push(opts.id);
180
- optsMap.push(opts);
181
- const root = document.createElement("view");
182
- root.id = "notify-" + opts.id;
183
- const Wrapper = {
184
- setup() {
185
- opts.teleport = `#notify-${opts.id}`;
186
- onMounted(() => {
187
- setTimeout(() => {
188
- document.body.removeChild(root);
189
- }, opts.duration);
190
- });
191
- return () => {
192
- return h(Notify, opts);
193
- };
194
- }
195
- };
196
- const instance = createVNode(Wrapper);
197
- document.body.appendChild(root);
198
- render(instance, root);
199
- };
200
- const errorMsg = (msg) => {
201
- if (!msg) {
202
- console.warn("[NutUI Notify]: msg\u4E0D\u80FD\u4E3A\u7A7A");
203
- return;
204
- }
205
- };
206
- const NotifyFunction = {
207
- text(msg, obj = {}) {
208
- errorMsg(msg);
209
- return mountNotify({ ...obj, msg });
210
- },
211
- primary(msg, obj = {}) {
212
- errorMsg(msg);
213
- return mountNotify({ ...obj, msg, type: "primary" });
214
- },
215
- success(msg, obj = {}) {
216
- errorMsg(msg);
217
- return mountNotify({ ...obj, msg, type: "success" });
218
- },
219
- danger(msg, obj = {}) {
220
- errorMsg(msg);
221
- return mountNotify({ ...obj, msg, type: "danger" });
222
- },
223
- warn(msg, obj = {}) {
224
- errorMsg(msg);
225
- return mountNotify({ ...obj, msg, type: "warning" });
226
- },
227
- hide() {
228
- clearNotify();
229
- },
230
- install(app) {
231
- app.use(Notify);
232
- app.config.globalProperties.$notify = NotifyFunction;
233
- }
234
- };
235
- export { Notify, NotifyFunction, NotifyFunction as default };
105
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
106
+ export { index_taro as default };
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.5 Tue Oct 25 2022 18:40:57 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, computed, watch, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, toDisplayString, createCommentVNode, Fragment, renderList, normalizeClass, createTextVNode } from "vue";
6
+ import { ref, computed, watch, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, toDisplayString, createTextVNode, createCommentVNode, Fragment, renderList, normalizeClass } 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,14 +46,6 @@ 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
- },
57
49
  popClass: {
58
50
  type: String,
59
51
  default: ""
@@ -146,8 +138,7 @@ const _sfc_main = create({
146
138
  function onTouchMove(event) {
147
139
  event.stopPropagation();
148
140
  }
149
- function onTouchEnd(event) {
150
- event.preventDefault();
141
+ function onTouchEnd() {
151
142
  clickKeyIndex.value = void 0;
152
143
  }
153
144
  function closeBoard() {
@@ -204,23 +195,23 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
204
195
  visible: _ctx.show,
205
196
  "onUpdate:visible": _cache[7] || (_cache[7] = ($event) => _ctx.show = $event),
206
197
  position: "bottom",
207
- teleport: _ctx.teleport,
208
198
  popClass: _ctx.popClass,
209
199
  overlay: _ctx.overlay,
210
200
  onClickOverlay: _cache[8] || (_cache[8] = ($event) => _ctx.closeBoard()),
211
- isWrapTeleport: _ctx.isWrapTeleport,
212
201
  "overlay-class": "nut-numberkeyboard-overlay"
213
202
  }, {
214
203
  default: withCtx(() => [
215
204
  createElementVNode("div", _hoisted_1, [
216
205
  _ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2, [
217
206
  createElementVNode("h3", _hoisted_3, toDisplayString(_ctx.title), 1),
207
+ createTextVNode(),
218
208
  _ctx.type == "default" ? (openBlock(), createElementBlock("span", {
219
209
  key: 0,
220
210
  class: "keyboard-close",
221
211
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.closeBoard())
222
212
  }, toDisplayString(_ctx.translate("done")), 1)) : createCommentVNode("", true)
223
213
  ])) : createCommentVNode("", true),
214
+ createTextVNode(),
224
215
  createElementVNode("div", _hoisted_4, [
225
216
  createElementVNode("div", _hoisted_5, [
226
217
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.keysList, (item) => {
@@ -242,28 +233,32 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
242
233
  ]),
243
234
  onTouchstart: (event) => _ctx.onTouchstart(item, event),
244
235
  onTouchmove: _cache[1] || (_cache[1] = (event) => _ctx.onTouchMove(event)),
245
- onTouchend: _cache[2] || (_cache[2] = (event) => _ctx.onTouchEnd(event))
236
+ onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
246
237
  }, [
247
238
  item.type == "number" || item.type == "custom" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
248
239
  createTextVNode(toDisplayString(item.id), 1)
249
240
  ], 64)) : createCommentVNode("", true),
241
+ createTextVNode(),
250
242
  item.type == "lock" ? (openBlock(), createElementBlock("img", _hoisted_7)) : createCommentVNode("", true),
243
+ createTextVNode(),
251
244
  item.type == "delete" ? (openBlock(), createElementBlock("img", _hoisted_8)) : createCommentVNode("", true)
252
245
  ], 42, _hoisted_6)
253
246
  ], 2);
254
247
  }), 128))
255
248
  ]),
249
+ createTextVNode(),
256
250
  _ctx.type == "rightColumn" ? (openBlock(), createElementBlock("div", _hoisted_9, [
257
251
  createElementVNode("div", _hoisted_10, [
258
252
  createElementVNode("div", {
259
253
  class: normalizeClass(["key", { active: _ctx.clickKeyIndex == "delete" }]),
260
254
  onTouchstart: _cache[3] || (_cache[3] = (event) => _ctx.onTouchstart({ id: "delete", type: "delete" }, event)),
261
- onTouchmove: _cache[4] || (_cache[4] = (event) => _ctx.onTouchMove({ id: "delete", type: "delete" }, event)),
255
+ onTouchmove: _cache[4] || (_cache[4] = (event) => _ctx.onTouchMove(event)),
262
256
  onTouchend: _cache[5] || (_cache[5] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
263
257
  }, _hoisted_12, 34)
264
258
  ]),
259
+ createTextVNode(),
265
260
  createElementVNode("div", {
266
- class: "key-board-wrapper key-board-finish",
261
+ class: "key-board-wrapper",
267
262
  onClick: _cache[6] || (_cache[6] = ($event) => _ctx.closeBoard())
268
263
  }, [
269
264
  createElementVNode("div", {
@@ -275,7 +270,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
275
270
  ], 512)
276
271
  ]),
277
272
  _: 1
278
- }, 8, ["visible", "teleport", "popClass", "overlay", "isWrapTeleport"]);
273
+ }, 8, ["visible", "popClass", "overlay"]);
279
274
  }
280
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
281
- export { index as default };
275
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
276
+ export { index_taro as default };