@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,11 +1,12 @@
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, onUnmounted, h, unref } from "vue";
6
+ import { ref, reactive, computed, watch, h, unref } from "vue";
7
+ import Taro, { usePageScroll, useReady } from "@tarojs/taro";
7
8
  import { c as createComponent } from "./component.js";
8
- import { u as useRect } from "./index2.js";
9
+ import { u as useTaroRect } from "./index.js";
9
10
  import "../locale/lang";
10
11
  const { componentName, create } = createComponent("sticky");
11
12
  const _sfc_main = create({
@@ -33,6 +34,8 @@ const _sfc_main = create({
33
34
  emits: ["change", "scroll"],
34
35
  setup(props, { emit, slots }) {
35
36
  const root = ref();
37
+ const query = Taro.createSelectorQuery();
38
+ const refRandomId = Math.random().toString(36).slice(-8);
36
39
  const state = reactive({
37
40
  width: 0,
38
41
  height: 0,
@@ -68,19 +71,25 @@ const _sfc_main = create({
68
71
  const el = unref(elementRef);
69
72
  if (!el)
70
73
  return false;
71
- const style = window.getComputedStyle(el);
72
- const hidden = style.display === "none";
73
- const parentHidden = el.offsetParent === null && style.position !== "fixed";
74
- return hidden || parentHidden;
74
+ return new Promise((resolve, reject) => {
75
+ query.select(`#${el.id}`).fields(
76
+ {
77
+ computedStyle: ["display", "position"]
78
+ },
79
+ (res) => {
80
+ const hidden = res.display === "none";
81
+ const parentHidden = el.offsetParent === null && res.position !== "fixed";
82
+ resolve(hidden || parentHidden);
83
+ }
84
+ ).exec();
85
+ });
75
86
  };
76
- const isExistRoot = () => {
77
- if (!root.value || isHidden(root))
87
+ const isExistRoot = async () => {
88
+ const hidden = await isHidden(root);
89
+ if (!root.value || hidden)
78
90
  return false;
79
91
  return true;
80
92
  };
81
- const getScrollTop = (el) => {
82
- return Math.max(0, "scrollTop" in el ? el.scrollTop : el.pageYOffset);
83
- };
84
93
  const renderFixed = () => {
85
94
  var _a;
86
95
  return h(
@@ -92,19 +101,18 @@ const _sfc_main = create({
92
101
  (_a = slots.default) == null ? void 0 : _a.call(slots)
93
102
  );
94
103
  };
95
- const onScroll = () => {
104
+ const onScroll = async (scrollTop) => {
96
105
  if (!isExistRoot())
97
106
  return;
98
107
  const { container, position } = props;
99
- const scrollTop = getScrollTop(window);
100
- const rootRect = useRect(root);
108
+ const rootRect = await useTaroRect(root, Taro);
101
109
  if (rootRect.width || rootRect.height) {
102
110
  state.width = rootRect.width;
103
111
  state.height = rootRect.height;
104
112
  }
105
113
  if (position === "top") {
106
114
  if (container) {
107
- const containerRect = useRect(container);
115
+ const containerRect = await useTaroRect(container, Taro);
108
116
  const diff = containerRect.bottom - +offset.value - state.height;
109
117
  state.fixed = +offset.value > rootRect.top && containerRect.bottom > 0;
110
118
  state.transform = diff < 0 ? diff : 0;
@@ -112,9 +120,9 @@ const _sfc_main = create({
112
120
  state.fixed = offset.value > rootRect.top;
113
121
  }
114
122
  } else if (position === "bottom") {
115
- const clientHeight = document.documentElement.clientHeight;
123
+ const clientHeight = Taro.getSystemInfoSync().windowHeight;
116
124
  if (container) {
117
- const containerRect = useRect(container);
125
+ const containerRect = await useTaroRect(container, Taro);
118
126
  const diff = clientHeight - containerRect.top - +offset.value - state.height;
119
127
  state.fixed = clientHeight - +offset.value < rootRect.bottom && clientHeight > containerRect.top;
120
128
  state.transform = diff < 0 ? -diff : 0;
@@ -133,18 +141,20 @@ const _sfc_main = create({
133
141
  emit("change", val);
134
142
  }
135
143
  );
136
- onMounted(() => {
137
- window.addEventListener("scroll", onScroll);
138
- onScroll();
144
+ usePageScroll((res) => {
145
+ onScroll(res.scrollTop);
139
146
  });
140
- onUnmounted(() => {
141
- window.removeEventListener("scroll", onScroll);
147
+ useReady(() => {
148
+ Taro.nextTick(() => {
149
+ onScroll(0);
150
+ });
142
151
  });
143
152
  return () => {
144
153
  return h(
145
154
  "view",
146
155
  {
147
156
  style: rootStyle.value,
157
+ id: `root-${refRandomId}`,
148
158
  ref: root
149
159
  },
150
160
  [renderFixed()]
@@ -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 { reactive, computed, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, toDisplayString, createVNode, normalizeStyle, renderSlot } from "vue";
6
+ import { reactive, computed, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, toDisplayString, createTextVNode, createVNode, normalizeStyle, renderSlot } 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";
@@ -68,6 +68,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
68
68
  onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"]))
69
69
  }, [
70
70
  createElementVNode("span", _hoisted_2, toDisplayString(_ctx.title), 1),
71
+ createTextVNode(),
71
72
  createElementVNode("span", _hoisted_3, [
72
73
  createVNode(_component_nut_icon, {
73
74
  name: "down-arrow",
@@ -75,6 +76,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
75
76
  }, null, 8, ["class"])
76
77
  ])
77
78
  ]),
79
+ createTextVNode(),
78
80
  createElementVNode("view", {
79
81
  class: normalizeClass(["nut-subsidenavbar__list", !_ctx.direction ? "nutFadeIn" : "nutFadeOut"]),
80
82
  style: normalizeStyle(_ctx.style)
@@ -1,11 +1,13 @@
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 { u as useTouch } from "./index4.js";
7
- import { computed, ref, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot } from "vue";
6
+ import Taro from "@tarojs/taro";
7
+ import { u as useTouch } from "./index3.js";
8
+ import { computed, ref, onMounted, reactive, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createTextVNode } from "vue";
8
9
  import { c as createComponent } from "./component.js";
10
+ import { u as useTaroRect } from "./index.js";
9
11
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
12
  import "../locale/lang";
11
13
  const { componentName, create } = createComponent("swipe");
@@ -30,21 +32,29 @@ const _sfc_main = create({
30
32
  },
31
33
  emits: ["open", "close"],
32
34
  setup(props, { emit }) {
35
+ const refRandomId = Math.random().toString(36).slice(-8);
33
36
  const classes = computed(() => {
34
37
  const prefixCls = componentName;
35
38
  return {
36
39
  [prefixCls]: true
37
40
  };
38
41
  });
39
- const getRefWidth = (ref2) => {
40
- var _a;
41
- return ((_a = ref2.value) == null ? void 0 : _a.clientWidth) || 0;
42
+ const getRefWidth = async (ref2) => {
43
+ let rect = await useTaroRect(ref2, Taro);
44
+ return rect.width || 0;
42
45
  };
43
- const leftRef = ref(), leftRefWidth = computed(() => {
44
- return getRefWidth(leftRef);
45
- });
46
- const rightRef = ref(), rightRefWidth = computed(() => {
47
- return getRefWidth(rightRef);
46
+ const leftRef = ref();
47
+ const leftRefWidth = ref(0);
48
+ const rightRef = ref();
49
+ const rightRefWidth = ref(0);
50
+ const initWidth = async () => {
51
+ leftRefWidth.value = await getRefWidth(leftRef);
52
+ rightRefWidth.value = await getRefWidth(rightRef);
53
+ };
54
+ onMounted(() => {
55
+ setTimeout(() => {
56
+ initWidth();
57
+ }, 100);
48
58
  });
49
59
  let opened = false;
50
60
  let position = "";
@@ -104,7 +114,7 @@ const _sfc_main = create({
104
114
  return;
105
115
  touch.start(event);
106
116
  },
107
- onTouchMove(event) {
117
+ async onTouchMove(event) {
108
118
  if (props.disabled)
109
119
  return;
110
120
  touch.move(event);
@@ -150,20 +160,15 @@ const _sfc_main = create({
150
160
  ...touchMethods,
151
161
  leftRef,
152
162
  rightRef,
163
+ refRandomId,
153
164
  open,
154
165
  close
155
166
  };
156
167
  }
157
168
  });
158
- const _hoisted_1 = {
159
- class: "nut-swipe__left",
160
- ref: "leftRef"
161
- };
169
+ const _hoisted_1 = ["id"];
162
170
  const _hoisted_2 = { class: "nut-swipe__content" };
163
- const _hoisted_3 = {
164
- class: "nut-swipe__right",
165
- ref: "rightRef"
166
- };
171
+ const _hoisted_3 = ["id"];
167
172
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
168
173
  return openBlock(), createElementBlock("view", {
169
174
  class: normalizeClass(_ctx.classes),
@@ -173,16 +178,26 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
173
178
  onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
174
179
  onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
175
180
  }, [
176
- createElementVNode("view", _hoisted_1, [
181
+ createElementVNode("view", {
182
+ class: "nut-swipe__left",
183
+ ref: "leftRef",
184
+ id: "leftRef-" + _ctx.refRandomId
185
+ }, [
177
186
  renderSlot(_ctx.$slots, "left")
178
- ], 512),
187
+ ], 8, _hoisted_1),
188
+ createTextVNode(),
179
189
  createElementVNode("view", _hoisted_2, [
180
190
  renderSlot(_ctx.$slots, "default")
181
191
  ]),
182
- createElementVNode("view", _hoisted_3, [
192
+ createTextVNode(),
193
+ createElementVNode("view", {
194
+ class: "nut-swipe__right",
195
+ ref: "rightRef",
196
+ id: "rightRef-" + _ctx.refRandomId
197
+ }, [
183
198
  renderSlot(_ctx.$slots, "right")
184
- ], 512)
199
+ ], 8, _hoisted_3)
185
200
  ], 38);
186
201
  }
187
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
188
- export { index as default };
202
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
203
+ export { index_taro as default };
@@ -1,11 +1,13 @@
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, ref, computed, provide, onDeactivated, onBeforeUnmount, watch, nextTick, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode } from "vue";
6
+ import { reactive, ref, computed, provide, onDeactivated, onBeforeUnmount, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, createTextVNode, Fragment, renderList, createCommentVNode } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import { u as useExpose } from "./index3.js";
8
+ import { u as useTaroRect } from "./index.js";
9
+ import { u as useExpose } from "./index2.js";
10
+ import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
9
11
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
12
  import "../locale/lang";
11
13
  const DISTANCE = 5;
@@ -115,6 +117,7 @@ const _sfc_main = create({
115
117
  emits: ["change"],
116
118
  setup(props, { emit, slots }) {
117
119
  const container = ref();
120
+ const refRandomId = Math.random().toString(36).slice(-8);
118
121
  const state = reactive({
119
122
  active: 0,
120
123
  num: 0,
@@ -205,7 +208,7 @@ const _sfc_main = create({
205
208
  return Math.min(Math.max(num, min), max);
206
209
  };
207
210
  const requestFrame = (fn) => {
208
- window.requestAnimationFrame.call(window, fn);
211
+ requestAnimationFrame.call(null, fn);
209
212
  };
210
213
  const getOffset = (active, offset = 0) => {
211
214
  let currentPosition = active * size.value;
@@ -317,21 +320,21 @@ const _sfc_main = create({
317
320
  autoplay();
318
321
  }, Number(props.autoPlay));
319
322
  };
320
- const init = (active = +props.initPage) => {
323
+ const init = async (active = +props.initPage) => {
321
324
  stopAutoPlay();
322
- state.rect = container.value.getBoundingClientRect();
323
- active = Math.min(childCount.value - 1, active);
324
- state.width = props.width ? +props.width : state.rect.width;
325
- state.height = props.height ? +props.height : state.rect.height;
326
- state.active = active;
327
- state.offset = getOffset(state.active);
328
- state.moving = true;
329
- getStyle();
330
- autoplay();
325
+ state.rect = await useTaroRect(container, Taro);
326
+ if (state.rect) {
327
+ active = Math.min(childCount.value - 1, active);
328
+ state.width = props.width ? +props.width : state.rect.width;
329
+ state.height = props.height ? +props.height : state.rect.height;
330
+ state.active = active;
331
+ state.offset = getOffset(state.active);
332
+ state.moving = true;
333
+ getStyle();
334
+ autoplay();
335
+ }
331
336
  };
332
337
  const onTouchStart = (e) => {
333
- if (props.isPreventDefault)
334
- e.preventDefault();
335
338
  if (props.isStopPropagation)
336
339
  e.stopPropagation();
337
340
  if (!props.touchable)
@@ -394,17 +397,25 @@ const _sfc_main = create({
394
397
  watch(
395
398
  () => props.initPage,
396
399
  (val) => {
397
- nextTick(() => {
398
- init(Number(val));
400
+ Taro.nextTick(() => {
401
+ init(+val);
402
+ });
403
+ eventCenter.once(getCurrentInstance().router.onReady, () => {
404
+ init(+val);
399
405
  });
400
406
  }
401
407
  );
402
408
  watch(
403
409
  () => state.children.length,
404
410
  () => {
405
- nextTick(() => {
411
+ Taro.nextTick(() => {
406
412
  init();
407
413
  });
414
+ eventCenter.once(getCurrentInstance().router.onReady, () => {
415
+ Taro.nextTick(() => {
416
+ init();
417
+ });
418
+ });
408
419
  }
409
420
  );
410
421
  watch(
@@ -415,6 +426,7 @@ const _sfc_main = create({
415
426
  );
416
427
  return {
417
428
  state,
429
+ refRandomId,
418
430
  classes,
419
431
  container,
420
432
  componentName,
@@ -427,14 +439,17 @@ const _sfc_main = create({
427
439
  };
428
440
  }
429
441
  });
442
+ const _hoisted_1 = ["id", "catch-move"];
430
443
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
431
444
  return openBlock(), createElementBlock("view", {
432
445
  ref: "container",
446
+ id: "container-" + _ctx.refRandomId,
433
447
  class: normalizeClass(_ctx.classes),
434
448
  onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
435
449
  onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
436
450
  onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
437
- onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
451
+ onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
452
+ "catch-move": _ctx.isPreventDefault
438
453
  }, [
439
454
  createElementVNode("view", {
440
455
  class: normalizeClass({
@@ -445,7 +460,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
445
460
  }, [
446
461
  renderSlot(_ctx.$slots, "default")
447
462
  ], 6),
463
+ createTextVNode(),
448
464
  renderSlot(_ctx.$slots, "page"),
465
+ createTextVNode(),
449
466
  _ctx.paginationVisible && !_ctx.slots.page ? (openBlock(), createElementBlock("view", {
450
467
  key: 0,
451
468
  class: normalizeClass({
@@ -463,7 +480,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
463
480
  }, null, 6);
464
481
  }), 128))
465
482
  ], 2)) : createCommentVNode("", true)
466
- ], 34);
483
+ ], 42, _hoisted_1);
467
484
  }
468
485
  var Swiper = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
469
486
  export { Swiper as default };
@@ -1,11 +1,11 @@
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
6
  import { inject, getCurrentInstance, reactive, computed, onUnmounted, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import { u as useExpose } from "./index3.js";
8
+ import { u as useExpose } from "./index2.js";
9
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
10
  import "../locale/lang";
11
11
  const { create, componentName } = createComponent("swiper-item");
@@ -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, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createBlock, mergeProps, createCommentVNode, Fragment, withDirectives, toDisplayString, vShow } from "vue";
6
+ import { computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createBlock, mergeProps, createCommentVNode, createTextVNode, Fragment, withDirectives, toDisplayString, 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";
@@ -111,17 +111,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
111
111
  style: normalizeStyle(_ctx.style)
112
112
  }, [
113
113
  createElementVNode("view", _hoisted_1, [
114
- _ctx.loading ? (openBlock(), createBlock(_component_nut_icon, mergeProps({
115
- key: 0,
116
- name: _ctx.name
117
- }, _ctx.$attrs, {
114
+ _ctx.loading ? (openBlock(), createBlock(_component_nut_icon, mergeProps({ key: 0 }, _ctx.$attrs, {
115
+ name: _ctx.name,
118
116
  size: _ctx.size,
119
117
  color: _ctx.color
120
118
  }), null, 16, ["name", "size", "color"])) : createCommentVNode("", true),
119
+ createTextVNode(),
121
120
  _ctx.activeText ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
122
121
  withDirectives(createElementVNode("view", { class: "nut-switch-label open" }, toDisplayString(_ctx.activeText), 513), [
123
122
  [vShow, _ctx.modelValue]
124
123
  ]),
124
+ createTextVNode(),
125
125
  withDirectives(createElementVNode("view", { class: "nut-switch-label close" }, toDisplayString(_ctx.inactiveText), 513), [
126
126
  [vShow, !_ctx.modelValue]
127
127
  ])
@@ -129,5 +129,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
129
129
  ])
130
130
  ], 6);
131
131
  }
132
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
133
- export { index as default };
132
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
133
+ 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
  */
@@ -1,10 +1,11 @@
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, provide, watch, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
6
+ import { toRefs, reactive, ref, provide, watch, onMounted, openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass, renderSlot } 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 { create } = createComponent("tabbar");
@@ -37,18 +38,24 @@ const _sfc_main = create({
37
38
  safeAreaInsetBottom: {
38
39
  type: Boolean,
39
40
  default: false
41
+ },
42
+ placeholder: {
43
+ type: Boolean,
44
+ default: false
40
45
  }
41
46
  },
42
47
  emits: ["tab-switch", "update:visible"],
43
48
  setup(props, { emit, slots }) {
49
+ const { bottom, placeholder } = toRefs(props);
44
50
  const mdValue = reactive({
45
51
  val: props.visible,
46
52
  children: []
47
53
  });
48
- function changeIndex(index2, active) {
54
+ const height = ref();
55
+ function changeIndex(index, active) {
49
56
  emit("update:visible", active);
50
57
  parentData.modelValue = active;
51
- emit("tab-switch", parentData.children[index2], active);
58
+ emit("tab-switch", parentData.children[index], active);
52
59
  }
53
60
  let parentData = reactive({
54
61
  children: mdValue.children,
@@ -65,17 +72,41 @@ const _sfc_main = create({
65
72
  parentData.modelValue = value;
66
73
  }
67
74
  );
75
+ onMounted(() => {
76
+ if (bottom.value && placeholder.value) {
77
+ setTimeout(() => {
78
+ const query = Taro.createSelectorQuery();
79
+ query.select(".nut-tabbar").boundingClientRect();
80
+ query.exec((res) => {
81
+ height.value = res[0].height;
82
+ });
83
+ }, 500);
84
+ }
85
+ });
68
86
  return {
69
- changeIndex
87
+ changeIndex,
88
+ height
70
89
  };
71
90
  }
72
91
  });
73
92
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
74
- return openBlock(), createElementBlock("view", {
93
+ return _ctx.bottom && _ctx.placeholder ? (openBlock(), createElementBlock("div", {
94
+ key: 0,
95
+ class: "nut-tabbar__placeholder",
96
+ style: normalizeStyle({ height: _ctx.height + "px" })
97
+ }, [
98
+ createElementVNode("view", {
99
+ ref: "nutTabbar",
100
+ class: normalizeClass(["nut-tabbar", { "nut-tabbar-bottom": _ctx.bottom, "nut-tabbar-safebottom": _ctx.safeAreaInsetBottom }])
101
+ }, [
102
+ renderSlot(_ctx.$slots, "default")
103
+ ], 2)
104
+ ], 4)) : (openBlock(), createElementBlock("view", {
105
+ key: 1,
75
106
  class: normalizeClass(["nut-tabbar", { "nut-tabbar-bottom": _ctx.bottom, "nut-tabbar-safebottom": _ctx.safeAreaInsetBottom }])
76
107
  }, [
77
108
  renderSlot(_ctx.$slots, "default")
78
- ], 2);
109
+ ], 2));
79
110
  }
80
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
81
- export { index as default };
111
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
112
+ export { index_taro as default };