@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,14 +1,17 @@
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, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx, renderSlot } from "vue";
6
+ import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, createTextVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx, renderSlot } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
- import Popup, { popupProps } from "./Popup.js";
9
- import { u as useTouch } from "./index4.js";
8
+ import { popupProps } from "./Popup.js";
9
+ import { u as useTouch } from "./index3.js";
10
10
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
11
+ import { u as useTaroRect } from "./index.js";
12
+ import Taro from "@tarojs/taro";
11
13
  import "../locale/lang";
14
+ import "./use-lock-scroll.js";
12
15
  import "./OverLay.js";
13
16
  import "./Icon.js";
14
17
  import "./pxCheck.js";
@@ -17,6 +20,10 @@ const _sfc_main$1 = create$1({
17
20
  props: {
18
21
  value: [String, Number],
19
22
  columnsType: String,
23
+ lineSpacing: {
24
+ type: Number,
25
+ default: 36
26
+ },
20
27
  itemShow: {
21
28
  type: Boolean,
22
29
  default: false
@@ -42,6 +49,7 @@ const _sfc_main$1 = create$1({
42
49
  setup(props, { emit }) {
43
50
  const touch = useTouch();
44
51
  const wrapper = ref();
52
+ const itemref = ref();
45
53
  const state = reactive({
46
54
  touchParams: {
47
55
  startY: 0,
@@ -54,28 +62,29 @@ const _sfc_main$1 = create$1({
54
62
  currIndex: 1,
55
63
  transformY: 0,
56
64
  scrollDistance: 0,
57
- lineSpacing: 36,
58
65
  rotation: 20,
59
66
  timer: null
60
67
  });
61
68
  const roller = ref(null);
62
69
  const list = ref(null);
70
+ const listitem = ref(null);
63
71
  const moving = ref(false);
64
72
  const touchDeg = ref(0);
65
73
  const touchTime = ref(0);
74
+ const touchTranslateY = ref(0);
66
75
  const DEFAULT_DURATION = 200;
67
76
  const INERTIA_TIME = 300;
68
77
  const INERTIA_DISTANCE = 15;
69
- const touchRollerStyle = computed(() => {
78
+ const touchTileStyle = computed(() => {
70
79
  return {
71
80
  transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
72
- transform: `rotate3d(1, 0, 0, ${touchDeg.value})`
81
+ transform: `translate3d(0, ${state.scrollDistance}px, 0)`
73
82
  };
74
83
  });
75
- const touchTileStyle = computed(() => {
84
+ const touchRollerStyle = computed(() => {
76
85
  return {
77
86
  transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
78
- transform: `translate3d(0, ${state.scrollDistance}px, 0)`
87
+ transform: `rotate3d(1, 0, 0, ${touchDeg.value})`
79
88
  };
80
89
  });
81
90
  const setRollerStyle = (index) => {
@@ -97,7 +106,7 @@ const _sfc_main$1 = create$1({
97
106
  };
98
107
  const onTouchMove = (event) => {
99
108
  touch.move(event);
100
- if (touch.isVertical()) {
109
+ if (touch.isVertical) {
101
110
  moving.value = true;
102
111
  preventDefault(event, true);
103
112
  }
@@ -141,6 +150,7 @@ const _sfc_main$1 = create$1({
141
150
  touchTime.value = 0;
142
151
  }
143
152
  touchDeg.value = deg;
153
+ touchTranslateY.value = translateY;
144
154
  state.scrollDistance = translateY;
145
155
  };
146
156
  const setMove = (move, type, time) => {
@@ -149,22 +159,22 @@ const _sfc_main$1 = create$1({
149
159
  if (updateMove > 0) {
150
160
  updateMove = 0;
151
161
  }
152
- if (updateMove < -(props.column.length - 1) * state.lineSpacing) {
153
- updateMove = -(props.column.length - 1) * state.lineSpacing;
162
+ if (updateMove < -(props.column.length - 1) * props.lineSpacing) {
163
+ updateMove = -(props.column.length - 1) * props.lineSpacing;
154
164
  }
155
- let endMove = Math.round(updateMove / state.lineSpacing) * state.lineSpacing;
156
- let deg = `${(Math.abs(Math.round(endMove / state.lineSpacing)) + 1) * state.rotation}deg`;
165
+ let endMove = Math.round(updateMove / props.lineSpacing) * props.lineSpacing;
166
+ let deg = `${(Math.abs(Math.round(endMove / props.lineSpacing)) + 1) * state.rotation}deg`;
157
167
  setTransform(endMove, type, time, deg);
158
- state.currIndex = Math.abs(Math.round(endMove / state.lineSpacing)) + 1;
168
+ state.currIndex = Math.abs(Math.round(endMove / props.lineSpacing)) + 1;
159
169
  } else {
160
170
  let deg = 0;
161
- let currentDeg = (-updateMove / state.lineSpacing + 1) * state.rotation;
171
+ let currentDeg = (-updateMove / props.lineSpacing + 1) * state.rotation;
162
172
  const maxDeg = (props.column.length + 1) * state.rotation;
163
173
  const minDeg = 0;
164
174
  deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
165
175
  if (minDeg < deg && deg < maxDeg) {
166
176
  setTransform(updateMove, null, void 0, deg + "deg");
167
- state.currIndex = Math.abs(Math.round(updateMove / state.lineSpacing)) + 1;
177
+ state.currIndex = Math.abs(Math.round(updateMove / props.lineSpacing)) + 1;
168
178
  }
169
179
  }
170
180
  };
@@ -175,7 +185,7 @@ const _sfc_main$1 = create$1({
175
185
  const { column: column2 } = props;
176
186
  let index = column2.findIndex((columnItem) => columnItem.value == props.value);
177
187
  state.currIndex = index === -1 ? 1 : index + 1;
178
- let move = index === -1 ? 0 : index * state.lineSpacing;
188
+ let move = index === -1 ? 0 : index * props.lineSpacing;
179
189
  type && setChooseValue();
180
190
  setMove(-move);
181
191
  };
@@ -214,36 +224,47 @@ const _sfc_main$1 = create$1({
214
224
  deep: true
215
225
  }
216
226
  );
227
+ watch(
228
+ () => props.lineSpacing,
229
+ (val) => {
230
+ console.log("\u66F4\u65B0");
231
+ modifyStatus(false);
232
+ },
233
+ {
234
+ deep: true
235
+ }
236
+ );
217
237
  onMounted(() => {
218
- modifyStatus(true);
238
+ modifyStatus(false);
219
239
  });
240
+ const refRandomId = Math.random().toString(36).slice(-8);
220
241
  return {
221
242
  ...toRefs(state),
222
243
  ...toRefs(props),
223
244
  wrapper,
245
+ itemref,
224
246
  setRollerStyle,
225
247
  isHidden,
226
248
  roller,
227
249
  list,
250
+ listitem,
228
251
  onTouchStart,
229
252
  onTouchMove,
230
253
  onTouchEnd,
231
- touchRollerStyle,
232
254
  touchTileStyle,
255
+ touchRollerStyle,
233
256
  setMove,
257
+ refRandomId,
234
258
  stopMomentum
235
259
  };
236
260
  }
237
261
  });
238
- const _hoisted_1$1 = {
262
+ const _hoisted_1$1 = ["id"];
263
+ const _hoisted_2$1 = {
239
264
  key: 1,
240
265
  class: "nut-picker-roller-item-tile"
241
266
  };
242
- const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker-roller-mask" }, null, -1);
243
- const _hoisted_3$1 = {
244
- key: 0,
245
- class: "nut-picker-content"
246
- };
267
+ const _hoisted_3$1 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker-roller-mask" }, null, -1);
247
268
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
248
269
  return openBlock(), createElementBlock("view", {
249
270
  class: "nut-picker__list",
@@ -254,6 +275,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
254
275
  createElementVNode("view", {
255
276
  class: "nut-picker-roller",
256
277
  ref: "roller",
278
+ id: "roller" + _ctx.refRandomId,
257
279
  style: normalizeStyle(_ctx.threeDimensional ? _ctx.touchRollerStyle : _ctx.touchTileStyle),
258
280
  onTransitionend: _cache[0] || (_cache[0] = (...args) => _ctx.stopMomentum && _ctx.stopMomentum(...args))
259
281
  }, [
@@ -266,26 +288,20 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
266
288
  class: normalizeClass(["nut-picker-roller-item", { "nut-picker-roller-item-hidden": _ctx.isHidden(index + 1) }]),
267
289
  style: normalizeStyle(_ctx.setRollerStyle(index + 1))
268
290
  }, toDisplayString(item.text), 7)) : createCommentVNode("", true),
269
- item && item.text && !_ctx.threeDimensional ? (openBlock(), createElementBlock("view", _hoisted_1$1, toDisplayString(item.text), 1)) : createCommentVNode("", true)
291
+ createTextVNode(),
292
+ item && item.text && !_ctx.threeDimensional ? (openBlock(), createElementBlock("view", _hoisted_2$1, toDisplayString(item.text), 1)) : createCommentVNode("", true)
270
293
  ], 64);
271
294
  }), 128))
272
- ], 36),
273
- _hoisted_2$1,
274
- _ctx.threeDimensional ? (openBlock(), createElementBlock("view", _hoisted_3$1, [
275
- createElementVNode("view", {
276
- class: "nut-picker-list-panel",
277
- ref: "list",
278
- style: normalizeStyle(_ctx.touchTileStyle)
279
- }, null, 4)
280
- ])) : createCommentVNode("", true)
295
+ ], 44, _hoisted_1$1),
296
+ createTextVNode(),
297
+ _hoisted_3$1
281
298
  ], 32);
282
299
  }
283
300
  var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
284
301
  const { componentName, create, translate } = createComponent("picker");
285
302
  const _sfc_main = create({
286
303
  components: {
287
- [column.name]: column,
288
- [Popup.name]: Popup
304
+ [column.name]: column
289
305
  },
290
306
  props: {
291
307
  ...popupProps,
@@ -328,9 +344,15 @@ const _sfc_main = create({
328
344
  setup(props, { emit }) {
329
345
  const state = reactive({
330
346
  show: false,
331
- formattedColumns: props.columns
347
+ formattedColumns: props.columns,
348
+ lineSpacing: 36,
349
+ picking: false,
350
+ ENV: Taro.getEnv(),
351
+ ENV_TYPE: Taro.ENV_TYPE
332
352
  });
353
+ const pickerline = ref(null);
333
354
  let defaultValues = ref(props.modelValue);
355
+ let defaultIndexes = ref([]);
334
356
  const pickerColumn = ref([]);
335
357
  const swipeRef = (el) => {
336
358
  if (el && pickerColumn.value.length < columnsList.value.length) {
@@ -345,11 +367,13 @@ const _sfc_main = create({
345
367
  });
346
368
  const selectedOptions = computed(() => {
347
369
  let optins = [];
348
- columnsList.value.map((column2, index) => {
349
- let currOptions = [];
350
- currOptions = column2.filter((item) => item.value == defaultValues.value[index]);
351
- optins.push(currOptions[0]);
352
- });
370
+ columnsList.value.map(
371
+ (column2, index) => {
372
+ let currOptions = [];
373
+ currOptions = column2.filter((item) => item.value == defaultValues.value[index]);
374
+ optins.push(currOptions[0]);
375
+ }
376
+ );
353
377
  return optins;
354
378
  });
355
379
  const columnsType = computed(() => {
@@ -425,25 +449,83 @@ const _sfc_main = create({
425
449
  });
426
450
  }
427
451
  };
428
- const confirmHandler = () => {
429
- pickerColumn.value.length > 0 && pickerColumn.value.forEach((column2) => {
430
- column2.stopMomentum();
452
+ const defaultValuesConvert = computed(() => {
453
+ let defaultIndexs = [];
454
+ if (defaultValues.value.length > 0) {
455
+ defaultValues.value.forEach((value, index) => {
456
+ for (let i = 0; i < columnsList.value[index].length; i++) {
457
+ if (columnsList.value[index][i].value == value) {
458
+ defaultIndexs.push(i);
459
+ break;
460
+ }
461
+ }
462
+ });
463
+ }
464
+ return defaultIndexs;
465
+ });
466
+ const tileChange = ({ detail }) => {
467
+ console.log("\u9009\u62E9");
468
+ const prevDefaultValue = defaultIndexes.value;
469
+ let changeIndex = 0;
470
+ detail.value.forEach((col, index) => {
471
+ if (prevDefaultValue[index] != col)
472
+ changeIndex = index;
431
473
  });
474
+ if (state.show) {
475
+ defaultIndexes.value = detail.value;
476
+ changeHandler(changeIndex, columnsList.value[changeIndex][detail.value[changeIndex]]);
477
+ }
478
+ };
479
+ const confirmHandler = () => {
480
+ if (state.picking) {
481
+ console.log("\u6EDA\u52A8\u4E2D");
482
+ setTimeout(() => {
483
+ confirmHandlerAwit();
484
+ }, 0);
485
+ } else {
486
+ confirmHandlerAwit();
487
+ }
488
+ };
489
+ const confirmHandlerAwit = () => {
432
490
  if (defaultValues.value && !defaultValues.value.length) {
433
491
  columnsList.value.forEach((columns) => {
434
492
  defaultValues.value.push(columns[0].value);
435
493
  selectedOptions.value.push(columns[0]);
436
494
  });
437
495
  }
496
+ console.log("\u786E\u5B9A", defaultValues.value);
438
497
  emit("confirm", {
439
498
  selectedValue: defaultValues.value,
440
499
  selectedOptions: selectedOptions.value
441
500
  });
442
501
  emit("update:visible", false);
502
+ state.show = false;
503
+ };
504
+ const handlePickstart = () => {
505
+ console.log("\u5F00\u59CB\u6EDA\u52A8");
506
+ state.picking = true;
507
+ };
508
+ const handlePickend = () => {
509
+ console.log("\u6EDA\u52A8\u7ED3\u675F");
510
+ state.picking = false;
511
+ };
512
+ const refRandomId = Math.random().toString(36).slice(-8);
513
+ const getReference = async () => {
514
+ const refe = await useTaroRect(pickerline, Taro);
515
+ console.log(refe.height);
516
+ state.lineSpacing = refe.height ? refe.height : 36;
443
517
  };
444
518
  onMounted(() => {
445
- if (props.visible)
519
+ if (props.visible) {
520
+ if (Taro.getEnv() == Taro.ENV_TYPE.WEB) {
521
+ setTimeout(() => {
522
+ getReference();
523
+ }, 200);
524
+ } else {
525
+ defaultIndexes.value = defaultValuesConvert.value;
526
+ }
446
527
  state.show = props.visible;
528
+ }
447
529
  });
448
530
  onBeforeUnmount(() => {
449
531
  if (props.visible)
@@ -455,6 +537,7 @@ const _sfc_main = create({
455
537
  const isSameValue = JSON.stringify(newValues) === JSON.stringify(defaultValues.value);
456
538
  if (!isSameValue) {
457
539
  defaultValues.value = newValues;
540
+ defaultIndexes.value = defaultValuesConvert.value;
458
541
  }
459
542
  },
460
543
  { deep: true }
@@ -473,8 +556,16 @@ const _sfc_main = create({
473
556
  () => props.visible,
474
557
  (val) => {
475
558
  state.show = val;
476
- if (val)
477
- pickerColumn.value = [];
559
+ if (val) {
560
+ if (Taro.getEnv() == Taro.ENV_TYPE.WEB) {
561
+ setTimeout(() => {
562
+ getReference();
563
+ }, 200);
564
+ pickerColumn.value = [];
565
+ } else {
566
+ defaultIndexes.value = defaultValuesConvert.value;
567
+ }
568
+ }
478
569
  }
479
570
  );
480
571
  watch(
@@ -494,19 +585,27 @@ const _sfc_main = create({
494
585
  changeHandler,
495
586
  confirmHandler,
496
587
  defaultValues,
588
+ defaultIndexes,
497
589
  translate,
498
590
  pickerColumn,
499
- swipeRef
591
+ swipeRef,
592
+ refRandomId,
593
+ pickerline,
594
+ tileChange,
595
+ defaultValuesConvert,
596
+ handlePickstart,
597
+ handlePickend
500
598
  };
501
599
  }
502
600
  });
503
601
  const _hoisted_1 = { class: "nut-picker__bar" };
504
602
  const _hoisted_2 = { class: "nut-picker__title" };
505
- const _hoisted_3 = {
506
- class: "nut-picker__column",
507
- ref: "wrapHeight"
603
+ const _hoisted_3 = ["value"];
604
+ const _hoisted_4 = {
605
+ key: 1,
606
+ class: "nut-picker__column"
508
607
  };
509
- const _hoisted_4 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker__hairline" }, null, -1);
608
+ const _hoisted_5 = ["id"];
510
609
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
511
610
  const _component_nut_picker_column = resolveComponent("nut-picker-column");
512
611
  const _component_nut_popup = resolveComponent("nut-popup");
@@ -516,13 +615,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
516
615
  createVNode(_component_nut_popup, {
517
616
  position: "bottom",
518
617
  visible: _ctx.show,
519
- "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => _ctx.show = $event),
618
+ "onUpdate:visible": _cache[5] || (_cache[5] = ($event) => _ctx.show = $event),
520
619
  teleport: _ctx.teleport,
521
620
  "lock-scroll": _ctx.lockScroll,
522
621
  "close-on-click-overlay": _ctx.closeOnClickOverlay,
523
622
  onClose: _ctx.close,
524
623
  round: true,
525
- isWrapTeleport: _ctx.isWrapTeleport,
526
624
  safeAreaInsetBottom: _ctx.safeAreaInsetBottom,
527
625
  destroyOnClose: _ctx.destroyOnClose
528
626
  }, {
@@ -532,15 +630,46 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
532
630
  class: "nut-picker__cancel nut-picker__left nut-picker__button",
533
631
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
534
632
  }, toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1),
633
+ createTextVNode(),
535
634
  createElementVNode("view", _hoisted_2, toDisplayString(_ctx.title), 1),
635
+ createTextVNode(),
536
636
  createElementVNode("view", {
537
637
  class: "nut-picker__confirm nut-picker__right nut-picker__button",
538
638
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirmHandler())
539
639
  }, toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)
540
640
  ]),
641
+ createTextVNode(),
541
642
  renderSlot(_ctx.$slots, "top"),
542
- createElementVNode("view", _hoisted_3, [
543
- _hoisted_4,
643
+ createTextVNode(),
644
+ _ctx.ENV == _ctx.ENV_TYPE.WEAPP ? (openBlock(), createElementBlock("picker-view", {
645
+ key: 0,
646
+ "indicator-style": "height: 34px;",
647
+ value: _ctx.defaultIndexes,
648
+ style: { "width": "100%", "height": "252px" },
649
+ "immediate-change": true,
650
+ onChange: _cache[2] || (_cache[2] = (...args) => _ctx.tileChange && _ctx.tileChange(...args)),
651
+ onPickstart: _cache[3] || (_cache[3] = (...args) => _ctx.handlePickstart && _ctx.handlePickstart(...args)),
652
+ onPickend: _cache[4] || (_cache[4] = (...args) => _ctx.handlePickend && _ctx.handlePickend(...args))
653
+ }, [
654
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnsList, (column2, columnIndex) => {
655
+ return openBlock(), createElementBlock("picker-view-column", { key: columnIndex }, [
656
+ (openBlock(true), createElementBlock(Fragment, null, renderList(column2, (item, index) => {
657
+ return openBlock(), createElementBlock("view", {
658
+ class: "nut-picker-roller-item-tarotile",
659
+ key: item.value ? item.value : index
660
+ }, toDisplayString(item.text), 1);
661
+ }), 128))
662
+ ]);
663
+ }), 128))
664
+ ], 40, _hoisted_3)) : createCommentVNode("", true),
665
+ createTextVNode(),
666
+ _ctx.ENV == _ctx.ENV_TYPE.WEB ? (openBlock(), createElementBlock("view", _hoisted_4, [
667
+ createElementVNode("view", {
668
+ class: "nut-picker__hairline",
669
+ ref: "pickerline",
670
+ id: "pickerline" + _ctx.refRandomId
671
+ }, null, 8, _hoisted_5),
672
+ createTextVNode(),
544
673
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnsList, (column2, columnIndex) => {
545
674
  return openBlock(), createElementBlock("view", {
546
675
  class: "nut-picker__columnitem",
@@ -554,20 +683,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
554
683
  readonly: _ctx.readonly,
555
684
  columnsType: _ctx.columnsType,
556
685
  value: _ctx.defaultValues[columnIndex],
557
- threeDimensional: _ctx.threeDimensional,
686
+ threeDimensional: false,
558
687
  swipeDuration: _ctx.swipeDuration,
688
+ lineSpacing: _ctx.lineSpacing,
559
689
  onChange: (option) => {
560
690
  _ctx.changeHandler(columnIndex, option);
561
691
  }
562
- }, null, 8, ["itemShow", "column", "readonly", "columnsType", "value", "threeDimensional", "swipeDuration", "onChange"])
692
+ }, null, 8, ["itemShow", "column", "readonly", "columnsType", "value", "swipeDuration", "lineSpacing", "onChange"])
563
693
  ]);
564
694
  }), 128))
565
- ], 512),
695
+ ])) : createCommentVNode("", true),
696
+ createTextVNode(),
566
697
  renderSlot(_ctx.$slots, "default")
567
698
  ]),
568
699
  _: 3
569
- }, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose", "isWrapTeleport", "safeAreaInsetBottom", "destroyOnClose"])
700
+ }, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose", "safeAreaInsetBottom", "destroyOnClose"])
570
701
  ], 2);
571
702
  }
572
- var Picker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
573
- export { Picker as default };
703
+ var nutPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
704
+ export { nutPicker as default };