@nutui/nutui 3.1.19-beta.1 → 3.1.19-beta.2

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 (230) hide show
  1. package/README.md +9 -8
  2. package/dist/nutui.es.js +2875 -3576
  3. package/dist/nutui.umd.js +2965 -3579
  4. package/dist/packages/_es/ActionSheet.js +18 -12
  5. package/dist/packages/_es/Address.js +69 -78
  6. package/dist/packages/_es/Audio.js +12 -12
  7. package/dist/packages/_es/AudioOperate.js +1 -1
  8. package/dist/packages/_es/Avatar.js +3 -3
  9. package/dist/packages/_es/BackTop.js +110 -68
  10. package/dist/packages/_es/Badge.js +3 -3
  11. package/dist/packages/_es/Barrage.js +55 -62
  12. package/dist/packages/_es/Button.js +2 -2
  13. package/dist/packages/_es/Calendar.js +27 -32
  14. package/dist/packages/_es/CalendarItem.js +3 -3
  15. package/dist/packages/_es/Card.js +5 -6
  16. package/dist/packages/_es/Cascader.js +7 -7
  17. package/dist/packages/_es/Cell.js +11 -4
  18. package/dist/packages/_es/CellGroup.js +1 -1
  19. package/dist/packages/_es/Checkbox.js +13 -3
  20. package/dist/packages/_es/CheckboxGroup.js +2 -2
  21. package/dist/packages/_es/CircleProgress.js +40 -149
  22. package/dist/packages/_es/Col.js +1 -1
  23. package/dist/packages/_es/Collapse.js +8 -34
  24. package/dist/packages/_es/CollapseItem.js +59 -90
  25. package/dist/packages/_es/CountDown.js +5 -5
  26. package/dist/packages/_es/CountUp.js +51 -43
  27. package/dist/packages/_es/DatePicker.js +20 -21
  28. package/dist/packages/_es/Dialog.js +91 -12
  29. package/dist/packages/_es/Divider.js +4 -4
  30. package/dist/packages/_es/Drag.js +54 -92
  31. package/dist/packages/_es/Elevator.js +50 -75
  32. package/dist/packages/_es/Empty.js +3 -3
  33. package/dist/packages/_es/FixedNav.js +10 -11
  34. package/dist/packages/_es/Form.js +5 -9
  35. package/dist/packages/_es/FormItem.js +1 -1
  36. package/dist/packages/_es/Grid.js +1 -1
  37. package/dist/packages/_es/GridItem.js +26 -8
  38. package/dist/packages/_es/Icon.js +1 -1
  39. package/dist/packages/_es/ImagePreview.js +83 -14
  40. package/dist/packages/_es/Indicator.js +3 -3
  41. package/dist/packages/_es/InfiniteLoading.js +107 -93
  42. package/dist/packages/_es/Input.js +8 -8
  43. package/dist/packages/_es/InputNumber.js +16 -23
  44. package/dist/packages/_es/Layout.js +1 -1
  45. package/dist/packages/_es/List.js +34 -41
  46. package/dist/packages/_es/Menu.js +12 -15
  47. package/dist/packages/_es/MenuItem.js +7 -7
  48. package/dist/packages/_es/Navbar.js +4 -3
  49. package/dist/packages/_es/NoticeBar.js +40 -47
  50. package/dist/packages/_es/Notify.js +166 -27
  51. package/dist/packages/_es/NumberKeyboard.js +18 -8
  52. package/dist/packages/_es/OldPicker.js +120 -122
  53. package/dist/packages/_es/OverLay.js +25 -5
  54. package/dist/packages/_es/Pagination.js +14 -13
  55. package/dist/packages/_es/Picker.js +16 -39
  56. package/dist/packages/_es/Popover.js +29 -154
  57. package/dist/packages/_es/Popup.js +69 -6
  58. package/dist/packages/_es/Price.js +5 -17
  59. package/dist/packages/_es/Progress.js +8 -18
  60. package/dist/packages/_es/PullRefresh.js +1 -1
  61. package/dist/packages/_es/Radio.js +14 -4
  62. package/dist/packages/_es/RadioGroup.js +1 -1
  63. package/dist/packages/_es/Range.js +33 -46
  64. package/dist/packages/_es/Rate.js +19 -16
  65. package/dist/packages/_es/Row.js +1 -1
  66. package/dist/packages/_es/SearchBar.js +11 -12
  67. package/dist/packages/_es/ShortPassword.js +67 -89
  68. package/dist/packages/_es/SideNavBar.js +16 -5
  69. package/dist/packages/_es/SideNavBarItem.js +1 -1
  70. package/dist/packages/_es/Signature.js +88 -69
  71. package/dist/packages/_es/Skeleton.js +11 -8
  72. package/dist/packages/_es/Sku.js +57 -49
  73. package/dist/packages/_es/Step.js +1 -1
  74. package/dist/packages/_es/Steps.js +1 -1
  75. package/dist/packages/_es/Sticky.js +23 -28
  76. package/dist/packages/_es/SubSideNavBar.js +1 -1
  77. package/dist/packages/_es/Swipe.js +26 -39
  78. package/dist/packages/_es/Swiper.js +14 -32
  79. package/dist/packages/_es/SwiperItem.js +2 -2
  80. package/dist/packages/_es/Switch.js +3 -3
  81. package/dist/packages/_es/TabPane.js +1 -1
  82. package/dist/packages/_es/Tabbar.js +3 -3
  83. package/dist/packages/_es/TabbarItem.js +21 -11
  84. package/dist/packages/_es/Table.js +13 -13
  85. package/dist/packages/_es/Tabs.js +20 -21
  86. package/dist/packages/_es/Tag.js +4 -4
  87. package/dist/packages/_es/TextArea.js +42 -44
  88. package/dist/packages/_es/TimeDetail.js +3 -4
  89. package/dist/packages/_es/TimePannel.js +3 -3
  90. package/dist/packages/_es/TimeSelect.js +7 -8
  91. package/dist/packages/_es/Toast.js +170 -41
  92. package/dist/packages/_es/Uploader.js +138 -109
  93. package/dist/packages/_es/Video.js +9 -8
  94. package/dist/packages/_es/common.js +1 -1
  95. package/dist/packages/_es/component.js +135 -3
  96. package/dist/packages/_es/index.js +6 -44
  97. package/dist/packages/_es/index2.js +31 -8
  98. package/dist/packages/_es/index3.js +7 -58
  99. package/dist/packages/_es/index4.js +56 -413
  100. package/dist/packages/_es/{index.taro.js → index5.js} +113 -140
  101. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  102. package/dist/packages/_es/pxCheck.js +1 -1
  103. package/dist/packages/_es/raf.js +19 -0
  104. package/dist/style.css +1 -1
  105. package/dist/styles/themes/default.scss +42 -42
  106. package/dist/styles/themes/jdt.scss +42 -42
  107. package/dist/types/__VUE/actionsheet/index.d.ts +269 -0
  108. package/dist/types/__VUE/address/index.d.ts +386 -0
  109. package/dist/types/__VUE/audio/index.d.ts +92 -0
  110. package/dist/types/__VUE/audiooperate/index.d.ts +68 -0
  111. package/dist/types/__VUE/avatar/index.d.ts +66 -0
  112. package/dist/types/__VUE/backtop/index.d.ts +105 -0
  113. package/dist/types/__VUE/badge/index.d.ts +94 -0
  114. package/dist/types/__VUE/barrage/index.d.ts +80 -0
  115. package/dist/types/__VUE/button/index.d.ts +116 -0
  116. package/dist/types/__VUE/calendar/index.d.ts +155 -0
  117. package/dist/types/__VUE/calendaritem/index.d.ts +195 -0
  118. package/dist/types/__VUE/card/index.d.ts +81 -0
  119. package/dist/types/__VUE/cascader/cascader-item.d.ts +76 -0
  120. package/dist/types/__VUE/cascader/helper.d.ts +8 -0
  121. package/dist/types/__VUE/cascader/index.d.ts +76 -0
  122. package/dist/types/__VUE/cascader/tree.d.ts +17 -0
  123. package/dist/types/__VUE/cascader/types.d.ts +30 -0
  124. package/dist/types/__VUE/cell/index.d.ts +109 -0
  125. package/dist/types/__VUE/cellgroup/index.d.ts +38 -0
  126. package/dist/types/__VUE/checkbox/index.d.ts +102 -0
  127. package/dist/types/__VUE/checkboxgroup/index.d.ts +39 -0
  128. package/dist/types/__VUE/circleprogress/index.d.ts +66 -0
  129. package/dist/types/__VUE/col/index.d.ts +42 -0
  130. package/dist/types/__VUE/collapse/index.d.ts +104 -0
  131. package/dist/types/__VUE/collapseitem/index.d.ts +83 -0
  132. package/dist/types/__VUE/countdown/index.d.ts +90 -0
  133. package/dist/types/__VUE/countup/index.d.ts +216 -0
  134. package/dist/types/__VUE/datepicker/index.d.ts +347 -0
  135. package/dist/types/__VUE/datepicker/utils.d.ts +5 -0
  136. package/dist/types/__VUE/dialog/index.d.ts +306 -0
  137. package/dist/types/__VUE/divider/index.d.ts +47 -0
  138. package/dist/types/__VUE/drag/index.d.ts +61 -0
  139. package/dist/types/__VUE/elevator/index.d.ts +71 -0
  140. package/dist/types/__VUE/empty/index.d.ts +46 -0
  141. package/dist/types/__VUE/fixednav/index.d.ts +96 -0
  142. package/dist/types/__VUE/form/common.d.ts +20 -0
  143. package/dist/types/__VUE/form/index.d.ts +32 -0
  144. package/dist/types/__VUE/form/types.d.ts +13 -0
  145. package/dist/types/__VUE/formitem/index.d.ts +120 -0
  146. package/dist/types/__VUE/formitem/types.d.ts +10 -0
  147. package/dist/types/__VUE/grid/common.d.ts +91 -0
  148. package/dist/types/__VUE/grid/index.d.ts +100 -0
  149. package/dist/types/__VUE/griditem/index.d.ts +80 -0
  150. package/dist/types/__VUE/icon/index.d.ts +74 -0
  151. package/dist/types/__VUE/imagepreview/index.d.ts +125 -0
  152. package/dist/types/__VUE/indicator/index.d.ts +70 -0
  153. package/dist/types/__VUE/infiniteloading/index.d.ts +140 -0
  154. package/dist/types/__VUE/input/index.d.ts +336 -0
  155. package/dist/types/__VUE/input/util.d.ts +5 -0
  156. package/dist/types/__VUE/inputnumber/index.d.ts +117 -0
  157. package/dist/types/__VUE/layout/index.d.ts +13 -0
  158. package/dist/types/__VUE/list/index.d.ts +48 -0
  159. package/dist/types/__VUE/menu/index.d.ts +51 -0
  160. package/dist/types/__VUE/menuitem/index.d.ts +77 -0
  161. package/dist/types/__VUE/navbar/index.d.ts +84 -0
  162. package/dist/types/__VUE/noticebar/index.d.ts +209 -0
  163. package/dist/types/__VUE/notify/index.d.ts +103 -0
  164. package/dist/types/__VUE/numberkeyboard/index.d.ts +123 -0
  165. package/dist/types/__VUE/oldpicker/Column.d.ts +96 -0
  166. package/dist/types/__VUE/oldpicker/commonProps.d.ts +22 -0
  167. package/dist/types/__VUE/oldpicker/index.d.ts +360 -0
  168. package/dist/types/__VUE/oldpicker/types.d.ts +24 -0
  169. package/dist/types/__VUE/overlay/index.d.ts +1614 -0
  170. package/dist/types/__VUE/pagination/index.d.ts +112 -0
  171. package/dist/types/__VUE/picker/Column.d.ts +90 -0
  172. package/dist/types/__VUE/picker/index.d.ts +342 -0
  173. package/dist/types/__VUE/picker/types.d.ts +26 -0
  174. package/dist/types/__VUE/popover/index.d.ts +233 -0
  175. package/dist/types/__VUE/popup/index.d.ts +1734 -0
  176. package/dist/types/__VUE/popup/use-lock-scroll.d.ts +5 -0
  177. package/dist/types/__VUE/price/index.d.ts +87 -0
  178. package/dist/types/__VUE/progress/index.d.ts +137 -0
  179. package/dist/types/__VUE/pullrefresh/index.d.ts +128 -0
  180. package/dist/types/__VUE/pullrefresh/use-touch.d.ts +20 -0
  181. package/dist/types/__VUE/pullrefresh/util.d.ts +6 -0
  182. package/dist/types/__VUE/radio/index.d.ts +90 -0
  183. package/dist/types/__VUE/radiogroup/index.d.ts +48 -0
  184. package/dist/types/__VUE/range/index.d.ts +156 -0
  185. package/dist/types/__VUE/rate/index.d.ts +142 -0
  186. package/dist/types/__VUE/row/index.d.ts +63 -0
  187. package/dist/types/__VUE/searchbar/index.d.ts +100 -0
  188. package/dist/types/__VUE/shortpassword/index.d.ts +136 -0
  189. package/dist/types/__VUE/sidenavbar/index.d.ts +36 -0
  190. package/dist/types/__VUE/sidenavbaritem/index.d.ts +41 -0
  191. package/dist/types/__VUE/signature/index.d.ts +73 -0
  192. package/dist/types/__VUE/skeleton/common.d.ts +63 -0
  193. package/dist/types/__VUE/skeleton/index.d.ts +117 -0
  194. package/dist/types/__VUE/sku/components/SkuHeader.d.ts +27 -0
  195. package/dist/types/__VUE/sku/components/SkuOperate.d.ts +70 -0
  196. package/dist/types/__VUE/sku/components/SkuSelect.d.ts +30 -0
  197. package/dist/types/__VUE/sku/components/SkuStepper.d.ts +67 -0
  198. package/dist/types/__VUE/sku/index.d.ts +300 -0
  199. package/dist/types/__VUE/step/index.d.ts +70 -0
  200. package/dist/types/__VUE/steps/index.d.ts +47 -0
  201. package/dist/types/__VUE/sticky/index.d.ts +63 -0
  202. package/dist/types/__VUE/subsidenavbar/index.d.ts +54 -0
  203. package/dist/types/__VUE/swipe/index.d.ts +69 -0
  204. package/dist/types/__VUE/swiper/index.d.ts +163 -0
  205. package/dist/types/__VUE/swiper/use-touch.d.ts +20 -0
  206. package/dist/types/__VUE/swiperitem/index.d.ts +24 -0
  207. package/dist/types/__VUE/switch/index.d.ts +136 -0
  208. package/dist/types/__VUE/tabbar/index.d.ts +84 -0
  209. package/dist/types/__VUE/tabbaritem/index.d.ts +108 -0
  210. package/dist/types/__VUE/table/common.d.ts +54 -0
  211. package/dist/types/__VUE/table/index.d.ts +75 -0
  212. package/dist/types/__VUE/table/renderColumn.d.ts +20 -0
  213. package/dist/types/__VUE/table/types.d.ts +19 -0
  214. package/dist/types/__VUE/tabpane/index.d.ts +47 -0
  215. package/dist/types/__VUE/tabs/index.d.ts +128 -0
  216. package/dist/types/__VUE/tag/index.d.ts +89 -0
  217. package/dist/types/__VUE/textarea/index.d.ts +120 -0
  218. package/dist/types/__VUE/timedetail/index.d.ts +48 -0
  219. package/dist/types/__VUE/timepannel/index.d.ts +43 -0
  220. package/dist/types/__VUE/timeselect/index.d.ts +82 -0
  221. package/dist/types/__VUE/toast/index.d.ts +149 -0
  222. package/dist/types/__VUE/uploader/index.d.ts +258 -0
  223. package/dist/types/__VUE/uploader/uploader.d.ts +25 -0
  224. package/dist/types/__VUE/video/index.d.ts +123 -0
  225. package/dist/{index.d.ts → types/index.d.ts} +0 -0
  226. package/dist/types/nutui.d.ts +92 -0
  227. package/package.json +14 -5
  228. package/dist/nutui.d.ts +0 -104
  229. package/dist/packages/_es/use-lock-scroll.js +0 -23
  230. package/dist/packages/_es/util.js +0 -47
@@ -18,47 +18,40 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, toRaw, resolveComponent, createBlock, withCtx, createVNode } from "vue";
25
+ import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, toRaw, resolveComponent, createVNode, withCtx } from "vue";
26
26
  import { c as createComponent } from "./component.js";
27
- import { u as useTaroRect } from "./index.js";
28
- import Taro from "@tarojs/taro";
29
27
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
30
- import { p as popupProps } from "./index4.js";
31
- import "./use-lock-scroll.js";
28
+ import Popup, { popupProps } from "./Popup.js";
29
+ import "./OverLay.js";
30
+ import "./Icon.js";
32
31
  import "./pxCheck.js";
33
- const commonProps = {
34
- listData: {
35
- type: Array,
36
- default: () => {
37
- return [];
38
- }
39
- },
40
- readonly: {
41
- type: Boolean,
42
- default: false
43
- },
44
- defaultIndex: {
45
- type: [Number, String],
46
- default: 0
47
- },
48
- itemHeight: {
49
- type: [Number, String],
50
- default: 35
51
- }
52
- };
53
32
  const { create: create$1 } = createComponent("oldpicker-column");
54
33
  const _sfc_main$1 = create$1({
55
- props: __spreadValues({
34
+ props: {
56
35
  dataType: String,
57
36
  itemShow: {
58
37
  type: Boolean,
59
38
  default: false
39
+ },
40
+ listData: {
41
+ type: Object,
42
+ default: () => {
43
+ return {};
44
+ }
45
+ },
46
+ readonly: {
47
+ type: Boolean,
48
+ default: false
49
+ },
50
+ defaultIndex: {
51
+ type: [Number, String],
52
+ default: 0
60
53
  }
61
- }, commonProps),
54
+ },
62
55
  emits: ["click", "change"],
63
56
  setup(props, { emit }) {
64
57
  const wrapper = ref();
@@ -68,8 +61,7 @@ const _sfc_main$1 = create$1({
68
61
  endY: 0,
69
62
  startTime: 0,
70
63
  endTime: 0,
71
- lastY: 0,
72
- lastTime: 0
64
+ lastY: 0
73
65
  },
74
66
  currIndex: 1,
75
67
  transformY: 0,
@@ -97,7 +89,6 @@ const _sfc_main$1 = create$1({
97
89
  };
98
90
  });
99
91
  const onTouchStart = (event) => {
100
- console.log(event);
101
92
  event.preventDefault();
102
93
  let changedTouches = event.changedTouches[0];
103
94
  state.touchParams.startY = changedTouches.pageY;
@@ -116,7 +107,7 @@ const _sfc_main$1 = create$1({
116
107
  event.preventDefault();
117
108
  let changedTouches = event.changedTouches[0];
118
109
  state.touchParams.lastY = changedTouches.pageY;
119
- state.touchParams.lastTime = event.timeStamp || Date.now();
110
+ state.touchParams.lastTime = event.timestamp || Date.now();
120
111
  let move = state.touchParams.lastY - state.touchParams.startY;
121
112
  let moveTime = state.touchParams.lastTime - state.touchParams.startTime;
122
113
  if (moveTime <= 300) {
@@ -127,11 +118,11 @@ const _sfc_main$1 = create$1({
127
118
  setMove(move, "end");
128
119
  }
129
120
  };
130
- const setRollerStyle = (index) => {
131
- return `transform: rotate3d(1, 0, 0, ${-state.rotation * index}deg) translate3d(0px, 0px, 104px)`;
121
+ const setRollerStyle = (index2) => {
122
+ return `transform: rotate3d(1, 0, 0, ${-state.rotation * index2}deg) translate3d(0px, 0px, 104px)`;
132
123
  };
133
- const isHidden = (index) => {
134
- if (index >= state.currIndex + 8 || index <= state.currIndex - 8) {
124
+ const isHidden = (index2) => {
125
+ if (index2 >= state.currIndex + 8 || index2 <= state.currIndex - 8) {
135
126
  return true;
136
127
  } else {
137
128
  return false;
@@ -179,42 +170,25 @@ const _sfc_main$1 = create$1({
179
170
  emit("change", state.currIndex - 1);
180
171
  };
181
172
  const modifyStatus = (type) => {
182
- let index = props.defaultIndex;
183
- state.currIndex = index === -1 ? 1 : index + 1;
184
- let move = index === -1 ? 0 : index * state.lineSpacing;
173
+ let index2 = props.defaultIndex;
174
+ state.currIndex = index2 === -1 ? 1 : index2 + 1;
175
+ let move = index2 === -1 ? 0 : index2 * state.lineSpacing;
185
176
  type && setChooseValue();
186
177
  setMove(-move);
187
178
  };
188
- const getReference = async () => {
189
- const refe = await useTaroRect(list, Taro);
190
- state.lineSpacing = refe.height / props.listData.values.length;
191
- modifyStatus(true);
192
- };
193
179
  watch(() => props.listData, (val) => {
194
180
  state.transformY = 0;
195
181
  modifyStatus(false);
196
182
  }, {
197
183
  deep: true
198
184
  });
199
- watch(() => props.itemShow, (val) => {
200
- if (val) {
201
- setTimeout(() => {
202
- getReference();
203
- }, 200);
204
- }
205
- }, {
206
- deep: true
207
- });
208
185
  watch(() => props.defaultIndex, (val) => {
209
186
  state.transformY = 0;
210
187
  modifyStatus(false);
211
188
  });
212
189
  onMounted(() => {
213
- setTimeout(() => {
214
- getReference();
215
- }, 200);
190
+ modifyStatus(true);
216
191
  });
217
- const refRandomId = Math.random().toString(36).slice(-8);
218
192
  return __spreadProps(__spreadValues(__spreadValues({}, toRefs(state)), toRefs(props)), {
219
193
  wrapper,
220
194
  setRollerStyle,
@@ -227,19 +201,17 @@ const _sfc_main$1 = create$1({
227
201
  onTouchEnd,
228
202
  touchRollerStyle,
229
203
  touchListStyle,
230
- refRandomId
204
+ setMove
231
205
  });
232
206
  }
233
207
  });
234
208
  const _hoisted_1$1 = { class: "nut-oldpicker-content" };
235
- const _hoisted_2$1 = ["id"];
236
- const _hoisted_3$1 = {
209
+ const _hoisted_2$1 = {
237
210
  key: 0,
238
211
  class: "nut-oldpicker-placeholder"
239
212
  };
240
213
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
241
- return _ctx.itemShow ? (openBlock(), createElementBlock("view", {
242
- key: 0,
214
+ return openBlock(), createElementBlock("view", {
243
215
  class: "nut-oldpicker__list",
244
216
  onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
245
217
  onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
@@ -250,11 +222,11 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
250
222
  ref: "roller",
251
223
  style: normalizeStyle(_ctx.touchRollerStyle)
252
224
  }, [
253
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listData.values, (item, index) => {
225
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listData.values, (item, index2) => {
254
226
  return openBlock(), createElementBlock("view", {
255
- class: normalizeClass(["nut-oldpicker-roller-item", { "nut-oldpicker-roller-item-hidden": _ctx.isHidden(index + 1) }]),
256
- style: normalizeStyle(_ctx.setRollerStyle(index + 1)),
257
- key: item.label ? item.label : index
227
+ class: normalizeClass(["nut-oldpicker-roller-item", { "nut-oldpicker-roller-item-hidden": _ctx.isHidden(index2 + 1) }]),
228
+ style: normalizeStyle(_ctx.setRollerStyle(index2 + 1)),
229
+ key: item.label ? item.label : index2
258
230
  }, toDisplayString(_ctx.dataType === "cascade" ? item.text : item), 7);
259
231
  }), 128))
260
232
  ], 4),
@@ -262,27 +234,27 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
262
234
  createElementVNode("view", {
263
235
  class: "nut-oldpicker-list-panel",
264
236
  ref: "list",
265
- id: "list" + _ctx.refRandomId,
266
237
  style: normalizeStyle(_ctx.touchListStyle)
267
238
  }, [
268
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listData.values, (item, index) => {
239
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listData.values, (item, index2) => {
269
240
  return openBlock(), createElementBlock("view", {
270
241
  class: "nut-oldpicker-item nut-oldpicker-item-ref",
271
- key: item.label ? item.label : index
242
+ key: item.label ? item.label : index2
272
243
  }, toDisplayString(_ctx.dataType === "cascade" ? item.text : item), 1);
273
244
  }), 128)),
274
- _ctx.listData && _ctx.listData.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_3$1)) : createCommentVNode("", true)
275
- ], 12, _hoisted_2$1)
245
+ _ctx.listData && _ctx.listData.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_2$1)) : createCommentVNode("", true)
246
+ ], 4)
276
247
  ])
277
- ], 32)) : createCommentVNode("", true);
248
+ ], 32);
278
249
  }
279
250
  var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
280
251
  const { create, componentName } = createComponent("oldpicker");
281
252
  const _sfc_main = create({
282
253
  components: {
283
- [column.name]: column
254
+ [column.name]: column,
255
+ [Popup.name]: Popup
284
256
  },
285
- props: __spreadValues(__spreadProps(__spreadValues({}, popupProps), {
257
+ props: __spreadProps(__spreadValues({}, popupProps), {
286
258
  title: {
287
259
  type: String,
288
260
  default: ""
@@ -294,8 +266,22 @@ const _sfc_main = create({
294
266
  okText: {
295
267
  type: String,
296
268
  default: "\u786E\u5B9A"
269
+ },
270
+ listData: {
271
+ type: Array,
272
+ default: () => {
273
+ return [];
274
+ }
275
+ },
276
+ readonly: {
277
+ type: Boolean,
278
+ default: false
279
+ },
280
+ defaultIndex: {
281
+ type: [Number, String],
282
+ default: 0
297
283
  }
298
- }), commonProps),
284
+ }),
299
285
  emits: ["close", "change", "confirm", "update:visible"],
300
286
  setup(props, { emit }) {
301
287
  const childrenKey = "children";
@@ -410,6 +396,14 @@ const _sfc_main = create({
410
396
  }
411
397
  emit("update:visible", false);
412
398
  };
399
+ onMounted(() => {
400
+ if (props.visible)
401
+ state.show = props.visible;
402
+ });
403
+ onBeforeUnmount(() => {
404
+ if (props.visible)
405
+ state.show = false;
406
+ });
413
407
  watch(() => props.visible, (val) => {
414
408
  state.show = val;
415
409
  });
@@ -435,52 +429,56 @@ const _hoisted_4 = /* @__PURE__ */ createElementVNode("view", { class: "nut-oldp
435
429
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
436
430
  const _component_nut_oldpicker_column = resolveComponent("nut-oldpicker-column");
437
431
  const _component_nut_popup = resolveComponent("nut-popup");
438
- return openBlock(), createBlock(_component_nut_popup, {
439
- position: "bottom",
440
- visible: _ctx.show,
441
- "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => _ctx.show = $event),
442
- teleport: _ctx.teleport,
443
- "lock-scroll": _ctx.lockScroll,
444
- "close-on-click-overlay": _ctx.closeOnClickOverlay,
445
- onClose: _ctx.close,
446
- round: true
447
- }, {
448
- default: withCtx(() => [
449
- createElementVNode("view", _hoisted_1, [
450
- createElementVNode("view", {
451
- class: "nut-oldpicker__button nut-oldpicker__left",
452
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
453
- }, toDisplayString(_ctx.cancelText), 1),
454
- createElementVNode("view", _hoisted_2, toDisplayString(_ctx.title), 1),
455
- createElementVNode("view", {
456
- class: "nut-oldpicker__button nut-oldpicker__right",
457
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirm())
458
- }, toDisplayString(_ctx.okText), 1)
432
+ return openBlock(), createElementBlock("view", {
433
+ class: normalizeClass(_ctx.classes)
434
+ }, [
435
+ createVNode(_component_nut_popup, {
436
+ position: "bottom",
437
+ visible: _ctx.show,
438
+ "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => _ctx.show = $event),
439
+ teleport: _ctx.teleport,
440
+ "lock-scroll": _ctx.lockScroll,
441
+ "close-on-click-overlay": _ctx.closeOnClickOverlay,
442
+ onClose: _ctx.close,
443
+ round: true,
444
+ isWrapTeleport: _ctx.isWrapTeleport
445
+ }, {
446
+ default: withCtx(() => [
447
+ createElementVNode("view", _hoisted_1, [
448
+ createElementVNode("view", {
449
+ class: "nut-oldpicker__cancel nut-oldpicker__left nut-oldpicker__button",
450
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
451
+ }, toDisplayString(_ctx.cancelText), 1),
452
+ createElementVNode("view", _hoisted_2, toDisplayString(_ctx.title), 1),
453
+ createElementVNode("view", {
454
+ class: "nut-oldpicker__confirm nut-oldpicker__button nut-oldpicker__right",
455
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirm())
456
+ }, toDisplayString(_ctx.okText), 1)
457
+ ]),
458
+ createElementVNode("view", _hoisted_3, [
459
+ _hoisted_4,
460
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnList, (item, columnIndex) => {
461
+ return openBlock(), createElementBlock("view", {
462
+ class: "nut-oldpicker__columnitem",
463
+ key: columnIndex
464
+ }, [
465
+ createVNode(_component_nut_oldpicker_column, {
466
+ itemShow: _ctx.show,
467
+ "list-data": item,
468
+ readonly: _ctx.readonly,
469
+ "default-index": item.defaultIndex,
470
+ "data-type": _ctx.dataType,
471
+ onChange: (dataIndex) => {
472
+ _ctx.changeHandler(columnIndex, dataIndex);
473
+ }
474
+ }, null, 8, ["itemShow", "list-data", "readonly", "default-index", "data-type", "onChange"])
475
+ ]);
476
+ }), 128))
477
+ ])
459
478
  ]),
460
- createElementVNode("view", _hoisted_3, [
461
- _hoisted_4,
462
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnList, (item, columnIndex) => {
463
- return openBlock(), createElementBlock("view", {
464
- class: "nut-oldpicker__columnitem",
465
- key: columnIndex
466
- }, [
467
- createVNode(_component_nut_oldpicker_column, {
468
- itemShow: _ctx.show,
469
- "list-data": item,
470
- readonly: _ctx.readonly,
471
- "default-index": item.defaultIndex,
472
- "visible-item-count": _ctx.visibleItemCount,
473
- "data-type": _ctx.dataType,
474
- onChange: (dataIndex) => {
475
- _ctx.changeHandler(columnIndex, dataIndex);
476
- }
477
- }, null, 8, ["itemShow", "list-data", "readonly", "default-index", "visible-item-count", "data-type", "onChange"])
478
- ]);
479
- }), 128))
480
- ])
481
- ]),
482
- _: 1
483
- }, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose"]);
479
+ _: 1
480
+ }, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose", "isWrapTeleport"])
481
+ ], 2);
484
482
  }
485
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
486
- export { index_taro as default };
483
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
484
+ export { index as default };
@@ -15,11 +15,11 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  /*!
18
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
18
+ * @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
19
19
  * (c) 2022 @jdf2e.
20
20
  * Released under the MIT License.
21
21
  */
22
- import { computed, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, vShow } from "vue";
22
+ import { computed, watch, onDeactivated, onBeforeUnmount, onMounted, onActivated, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, withModifiers, normalizeStyle, renderSlot, vShow } from "vue";
23
23
  import { c as createComponent } from "./component.js";
24
24
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
25
25
  const { componentName, create } = createComponent("overlay");
@@ -63,19 +63,38 @@ const _sfc_main = create({
63
63
  [props.overlayClass]: true
64
64
  };
65
65
  });
66
+ watch(() => props.visible, (value) => {
67
+ value ? lock() : unlock();
68
+ });
69
+ const lock = () => {
70
+ if (props.lockScroll && props.visible) {
71
+ document.body.classList.add("nut-overflow-hidden");
72
+ }
73
+ };
74
+ const unlock = () => {
75
+ document.body.classList.remove("nut-overflow-hidden");
76
+ };
77
+ onDeactivated(unlock);
78
+ onBeforeUnmount(unlock);
79
+ onMounted(lock);
80
+ onActivated(lock);
66
81
  const style = computed(() => {
67
82
  return __spreadValues({
68
83
  animationDuration: `${props.duration}s`,
69
84
  zIndex: props.zIndex
70
85
  }, props.overlayStyle);
71
86
  });
87
+ const touchmove = (e) => {
88
+ if (props.lockScroll)
89
+ e.preventDefault();
90
+ };
72
91
  const onClick = (e) => {
73
92
  emit("click", e);
74
93
  if (props.closeOnClickOverlay) {
75
94
  emit("update:visible", false);
76
95
  }
77
96
  };
78
- return { classes, style, onClick };
97
+ return { classes, style, touchmove, onClick };
79
98
  }
80
99
  });
81
100
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -83,11 +102,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
83
102
  default: withCtx(() => [
84
103
  withDirectives(createElementVNode("view", {
85
104
  class: normalizeClass(_ctx.classes),
86
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
105
+ onTouchmove: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.touchmove && _ctx.touchmove(...args), ["stop"])),
106
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
87
107
  style: normalizeStyle(_ctx.style)
88
108
  }, [
89
109
  renderSlot(_ctx.$slots, "default")
90
- ], 6), [
110
+ ], 38), [
91
111
  [vShow, _ctx.visible]
92
112
  ])
93
113
  ]),
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { toRefs, computed, watchEffect, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, createTextVNode, toDisplayString, Fragment, renderList, createCommentVNode } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
- const { componentName, create } = createComponent("pagination");
9
+ const { componentName, create, translate } = createComponent("pagination");
10
10
  const _sfc_main = create({
11
11
  props: {
12
12
  modelValue: {
@@ -19,11 +19,11 @@ const _sfc_main = create({
19
19
  },
20
20
  prevText: {
21
21
  type: String,
22
- default: "\u4E0A\u4E00\u9875"
22
+ default: ""
23
23
  },
24
24
  nextText: {
25
25
  type: String,
26
- default: "\u4E0B\u4E00\u9875"
26
+ default: ""
27
27
  },
28
28
  pageCount: {
29
29
  type: [String, Number],
@@ -67,13 +67,13 @@ const _sfc_main = create({
67
67
  return { number, text, active };
68
68
  };
69
69
  const pages = computed(() => {
70
+ if (mode.value == "simple")
71
+ return;
70
72
  let items = [];
71
73
  const pageCount = countRef.value;
72
74
  const pageSize = showPageSize.value;
73
75
  let startPage = 1;
74
76
  let endPage = pageCount;
75
- if (mode.value == "simple")
76
- return;
77
77
  const partialShow = pageCount > pageSize;
78
78
  if (partialShow) {
79
79
  startPage = Math.max(modelValue.value - Math.floor(pageSize / 2), 1);
@@ -108,7 +108,8 @@ const _sfc_main = create({
108
108
  countRef,
109
109
  mode,
110
110
  pages,
111
- forceEllipses
111
+ forceEllipses,
112
+ translate
112
113
  };
113
114
  }
114
115
  });
@@ -130,13 +131,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
130
131
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.select(_ctx.modelValue - 1, true))
131
132
  }, [
132
133
  renderSlot(_ctx.$slots, "prev-text", {}, () => [
133
- createTextVNode(toDisplayString(_ctx.prevText), 1)
134
+ createTextVNode(toDisplayString(_ctx.prevText || _ctx.translate("prev")), 1)
134
135
  ])
135
136
  ], 2),
136
137
  _ctx.mode == "multi" ? (openBlock(), createElementBlock("view", _hoisted_2, [
137
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pages, (item, index) => {
138
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pages, (item, index2) => {
138
139
  return openBlock(), createElementBlock("view", {
139
- key: index + "pagination",
140
+ key: index2 + "pagination",
140
141
  class: normalizeClass(["nut-pagination-item", item.active ? "active" : ""]),
141
142
  onClick: ($event) => _ctx.select(item.number, true)
142
143
  }, [
@@ -154,10 +155,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
154
155
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.select(_ctx.modelValue + 1, true))
155
156
  }, [
156
157
  renderSlot(_ctx.$slots, "next-text", {}, () => [
157
- createTextVNode(toDisplayString(_ctx.nextText), 1)
158
+ createTextVNode(toDisplayString(_ctx.nextText || _ctx.translate("next")), 1)
158
159
  ])
159
160
  ], 2)
160
161
  ]);
161
162
  }
162
- var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
163
- export { index_taro as default };
163
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
164
+ export { index as default };
@@ -18,17 +18,14 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.19-beta.2 Thu Apr 07 2022 17:52:31 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx } from "vue";
26
26
  import { c as createComponent } from "./component.js";
27
- import { popupProps } from "./Popup.js";
28
- import { u as useTaroRect } from "./index.js";
29
- import Taro from "@tarojs/taro";
27
+ import Popup, { popupProps } from "./Popup.js";
30
28
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
31
- import "./use-lock-scroll.js";
32
29
  import "./OverLay.js";
33
30
  import "./Icon.js";
34
31
  import "./pxCheck.js";
@@ -53,7 +50,6 @@ const _sfc_main$1 = create$1({
53
50
  emits: ["click", "change"],
54
51
  setup(props, { emit }) {
55
52
  const wrapper = ref();
56
- const itemref = ref();
57
53
  const state = reactive({
58
54
  touchParams: {
59
55
  startY: 0,
@@ -72,7 +68,7 @@ const _sfc_main$1 = create$1({
72
68
  });
73
69
  const roller = ref(null);
74
70
  const list = ref(null);
75
- const listitem = ref(null);
71
+ const listItem = ref(null);
76
72
  const touchDeg = ref(0);
77
73
  const touchTime = ref(0);
78
74
  const touchTranslateY = ref(0);
@@ -177,53 +173,33 @@ const _sfc_main$1 = create$1({
177
173
  type && setChooseValue();
178
174
  setMove(-move);
179
175
  };
180
- const getReference = async () => {
181
- const refe = await useTaroRect(list, Taro);
182
- state.lineSpacing = refe.height / props.column.length;
183
- modifyStatus(true);
184
- };
185
176
  watch(() => props.column, (val) => {
186
177
  state.transformY = 0;
187
178
  modifyStatus(false);
188
179
  }, {
189
180
  deep: true
190
181
  });
191
- watch(() => props.itemShow, (val) => {
192
- if (val) {
193
- setTimeout(() => {
194
- getReference();
195
- }, 200);
196
- }
197
- }, {
198
- deep: true
199
- });
200
182
  onMounted(() => {
201
- setTimeout(() => {
202
- getReference();
203
- }, 200);
183
+ modifyStatus(true);
204
184
  });
205
- const refRandomId = Math.random().toString(36).slice(-8);
206
185
  return __spreadProps(__spreadValues(__spreadValues({}, toRefs(state)), toRefs(props)), {
207
186
  wrapper,
208
- itemref,
209
187
  setRollerStyle,
210
188
  isHidden,
211
189
  roller,
212
190
  list,
213
- listitem,
191
+ listItem,
214
192
  onTouchStart,
215
193
  onTouchMove,
216
194
  onTouchEnd,
217
195
  touchRollerStyle,
218
196
  touchListStyle,
219
- setMove,
220
- refRandomId
197
+ setMove
221
198
  });
222
199
  }
223
200
  });
224
201
  const _hoisted_1$1 = { class: "nut-picker-content" };
225
- const _hoisted_2$1 = ["id"];
226
- const _hoisted_3$1 = {
202
+ const _hoisted_2$1 = {
227
203
  key: 0,
228
204
  class: "nut-picker-placeholder"
229
205
  };
@@ -251,7 +227,6 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
251
227
  createElementVNode("view", {
252
228
  class: "nut-picker-list-panel",
253
229
  ref: "list",
254
- id: "list" + _ctx.refRandomId,
255
230
  style: normalizeStyle(_ctx.touchListStyle)
256
231
  }, [
257
232
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.column, (item, index) => {
@@ -260,8 +235,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
260
235
  key: item.value ? item.value : index
261
236
  }, toDisplayString(item.text), 3);
262
237
  }), 128)),
263
- _ctx.column && _ctx.column.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_3$1)) : createCommentVNode("", true)
264
- ], 12, _hoisted_2$1)
238
+ _ctx.column && _ctx.column.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_2$1)) : createCommentVNode("", true)
239
+ ], 4)
265
240
  ])
266
241
  ], 32);
267
242
  }
@@ -269,7 +244,8 @@ var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]
269
244
  const { componentName, create } = createComponent("picker");
270
245
  const _sfc_main = create({
271
246
  components: {
272
- [column.name]: column
247
+ [column.name]: column,
248
+ [Popup.name]: Popup
273
249
  },
274
250
  props: __spreadProps(__spreadValues({}, popupProps), {
275
251
  modelValue: {
@@ -453,7 +429,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
453
429
  "lock-scroll": _ctx.lockScroll,
454
430
  "close-on-click-overlay": _ctx.closeOnClickOverlay,
455
431
  onClose: _ctx.close,
456
- round: true
432
+ round: true,
433
+ isWrapTeleport: _ctx.isWrapTeleport
457
434
  }, {
458
435
  default: withCtx(() => [
459
436
  createElementVNode("view", _hoisted_1, [
@@ -489,8 +466,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
489
466
  ])
490
467
  ]),
491
468
  _: 1
492
- }, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose"])
469
+ }, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose", "isWrapTeleport"])
493
470
  ], 2);
494
471
  }
495
- var nutPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
496
- export { nutPicker as default };
472
+ var picker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
473
+ export { picker as default };