@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,18 +1,22 @@
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, onBeforeMount, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, renderSlot } from "vue";
7
- import Picker from "./Picker.js";
8
- import { popupProps } from "./Popup.js";
6
+ import { reactive, computed, onBeforeMount, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createTextVNode } from "vue";
7
+ import nutPicker from "./Picker.js";
8
+ import { p as popupProps } from "./index4.js";
9
9
  import { c as createComponent } from "./component.js";
10
10
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
11
- import "./index4.js";
11
+ import "./Popup.js";
12
+ import "./use-lock-scroll.js";
12
13
  import "./OverLay.js";
13
14
  import "../locale/lang";
14
15
  import "./Icon.js";
15
16
  import "./pxCheck.js";
17
+ import "./index3.js";
18
+ import "./index.js";
19
+ import "@tarojs/taro";
16
20
  function padZero(num, targetLength = 2) {
17
21
  let str = num + "";
18
22
  while (str.length < targetLength) {
@@ -20,22 +24,22 @@ function padZero(num, targetLength = 2) {
20
24
  }
21
25
  return str;
22
26
  }
23
- const { componentName, create, translate } = createComponent("datepicker");
27
+ const { componentName, create } = createComponent("datepicker");
24
28
  const currentYear = new Date().getFullYear();
25
29
  function isDate(val) {
26
30
  return Object.prototype.toString.call(val) === "[object Date]" && !isNaN(val.getTime());
27
31
  }
28
32
  const zhCNType = {
29
- day: translate("day"),
30
- year: translate("year"),
31
- month: translate("month"),
32
- hour: translate("hour"),
33
- minute: translate("minute"),
34
- seconds: translate("seconds")
33
+ day: "\u65E5",
34
+ year: "\u5E74",
35
+ month: "\u6708",
36
+ hour: "\u65F6",
37
+ minute: "\u5206",
38
+ seconds: "\u79D2"
35
39
  };
36
40
  const _sfc_main = create({
37
41
  components: {
38
- [Picker.name]: Picker
42
+ nutPicker
39
43
  },
40
44
  props: {
41
45
  ...popupProps,
@@ -88,7 +92,7 @@ const _sfc_main = create({
88
92
  },
89
93
  filter: Function
90
94
  },
91
- emits: ["click", "update:visible", "change", "confirm", "update:modelValue"],
95
+ emits: ["click", "update:visible", "change", "confirm", "update:moduleValue"],
92
96
  setup(props, { emit }) {
93
97
  const state = reactive({
94
98
  show: props.visible,
@@ -111,12 +115,12 @@ const _sfc_main = create({
111
115
  const boundary = props[`${type}Date`];
112
116
  const year = boundary.getFullYear();
113
117
  let month = 1;
114
- let day = 1;
118
+ let date = 1;
115
119
  let hour = 0;
116
120
  let minute = 0;
117
121
  if (type === "max") {
118
122
  month = 12;
119
- day = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
123
+ date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
120
124
  hour = 23;
121
125
  minute = 59;
122
126
  }
@@ -124,36 +128,27 @@ const _sfc_main = create({
124
128
  if (value.getFullYear() === year) {
125
129
  month = boundary.getMonth() + 1;
126
130
  if (value.getMonth() + 1 === month) {
127
- day = boundary.getDate();
128
- if (value.getDate() === day) {
131
+ date = boundary.getDate();
132
+ if (value.getDate() === date) {
129
133
  hour = boundary.getHours();
130
134
  if (value.getHours() === hour) {
131
135
  minute = boundary.getMinutes();
132
136
  }
133
137
  }
134
138
  }
135
- } else {
136
- return {
137
- [`${type}Year`]: year,
138
- [`${type}Month`]: month,
139
- [`${type}Day`]: day,
140
- [`${type}Hour`]: hour,
141
- [`${type}Minute`]: minute,
142
- [`${type}Seconds`]: seconds
143
- };
144
139
  }
145
140
  return {
146
141
  [`${type}Year`]: year,
147
142
  [`${type}Month`]: month,
148
- [`${type}Day`]: day,
143
+ [`${type}Date`]: date,
149
144
  [`${type}Hour`]: hour,
150
145
  [`${type}Minute`]: minute,
151
146
  [`${type}Seconds`]: seconds
152
147
  };
153
148
  };
154
149
  const ranges = computed(() => {
155
- const { maxYear, maxDay, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary("max", state.currentDate);
156
- const { minYear, minDay, minMonth, minHour, minMinute, minSeconds } = getBoundary("min", state.currentDate);
150
+ const { maxYear, maxDate, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary("max", state.currentDate);
151
+ const { minYear, minDate, minMonth, minHour, minMinute, minSeconds } = getBoundary("min", state.currentDate);
157
152
  let result = [
158
153
  {
159
154
  type: "year",
@@ -165,7 +160,7 @@ const _sfc_main = create({
165
160
  },
166
161
  {
167
162
  type: "day",
168
- range: [minDay, maxDay]
163
+ range: [minDate, maxDate]
169
164
  },
170
165
  {
171
166
  type: "hour",
@@ -218,11 +213,11 @@ const _sfc_main = create({
218
213
  selectedValue.forEach((item) => {
219
214
  formatDate.push(item);
220
215
  });
221
- if (props.type == "month-day" && formatDate.length < 3) {
222
- formatDate.unshift(new Date(state.currentDate || props.minDate || props.maxDate).getFullYear());
216
+ if (props.type == "month-day") {
217
+ formatDate.unshift(new Date(props.modelValue || props.minDate || props.maxDate).getFullYear());
223
218
  }
224
219
  if (props.type == "year-month" && formatDate.length < 3) {
225
- formatDate.push(new Date(state.currentDate || props.minDate || props.maxDate).getDate());
220
+ formatDate.push(new Date(props.modelValue || props.minDate || props.maxDate).getDate());
226
221
  }
227
222
  const year = Number(formatDate[0]);
228
223
  const month = Number(formatDate[1]) - 1;
@@ -253,7 +248,7 @@ const _sfc_main = create({
253
248
  };
254
249
  const generateValue = (min, max, val, type, columnIndex) => {
255
250
  const arr = [];
256
- let index2 = 0;
251
+ let index = 0;
257
252
  while (min <= max) {
258
253
  arr.push(formatterOption(type, min));
259
254
  if (type === "minute") {
@@ -262,10 +257,10 @@ const _sfc_main = create({
262
257
  min++;
263
258
  }
264
259
  if (min <= val) {
265
- index2++;
260
+ index++;
266
261
  }
267
262
  }
268
- state.selectedValue[columnIndex] = arr[index2].value;
263
+ state.selectedValue[columnIndex] = arr[index].value;
269
264
  return props.filter ? props.filter(type, arr) : arr;
270
265
  };
271
266
  const getDateIndex = (type) => {
@@ -292,25 +287,13 @@ const _sfc_main = create({
292
287
  emit("confirm", val);
293
288
  };
294
289
  onBeforeMount(() => {
290
+ console.log("\u5E73\u94FA\u5C55\u793A");
295
291
  state.currentDate = formatValue(props.modelValue);
296
292
  });
297
293
  watch(
298
294
  () => props.modelValue,
299
295
  (value) => {
300
- const newValues = formatValue(value);
301
- const isSameValue = JSON.stringify(newValues) === JSON.stringify(state.currentDate);
302
- if (!isSameValue) {
303
- state.currentDate = newValues;
304
- }
305
- }
306
- );
307
- watch(
308
- () => state.currentDate,
309
- (newValues) => {
310
- const isSameValue = JSON.stringify(newValues) === JSON.stringify(props.modelValue);
311
- if (!isSameValue) {
312
- emit("update:modelValue", newValues);
313
- }
296
+ state.currentDate = formatValue(value);
314
297
  }
315
298
  );
316
299
  watch(
@@ -340,7 +323,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
340
323
  modelValue: _ctx.selectedValue,
341
324
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.selectedValue = $event),
342
325
  visible: _ctx.show,
343
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.show = $event),
344
326
  okText: _ctx.okText,
345
327
  cancelText: _ctx.cancelText,
346
328
  onClose: _ctx.closeHandler,
@@ -358,10 +340,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
358
340
  renderSlot(_ctx.$slots, "top")
359
341
  ]),
360
342
  default: withCtx(() => [
343
+ createTextVNode(),
361
344
  renderSlot(_ctx.$slots, "default")
362
345
  ]),
363
346
  _: 3
364
347
  }, 8, ["modelValue", "visible", "okText", "cancelText", "onClose", "columns", "onChange", "title", "onConfirm", "isWrapTeleport", "threeDimensional", "swipeDuration", "safeAreaInsetBottom", "destroyOnClose"]);
365
348
  }
366
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
367
- export { index as default };
349
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
350
+ export { index_taro as default };
@@ -1,14 +1,15 @@
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, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent, createVNode, render, h } from "vue";
6
+ import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent } from "vue";
7
7
  import { i as isPromise, c as createComponent } from "./component.js";
8
8
  import Popup, { popupProps } from "./Popup.js";
9
9
  import Button from "./Button.js";
10
10
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
11
11
  import "../locale/lang";
12
+ import "./use-lock-scroll.js";
12
13
  import "./OverLay.js";
13
14
  import "./Icon.js";
14
15
  import "./pxCheck.js";
@@ -132,8 +133,8 @@ const _sfc_main = create({
132
133
  }
133
134
  };
134
135
  const onOk = () => {
135
- emit("ok");
136
136
  closed("ok");
137
+ emit("ok");
137
138
  };
138
139
  return {
139
140
  closed,
@@ -176,6 +177,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
176
177
  createTextVNode(toDisplayString(_ctx.title), 1)
177
178
  ], 64))
178
179
  ])) : createCommentVNode("", true),
180
+ createTextVNode(),
179
181
  createElementVNode("view", {
180
182
  class: "nut-dialog__content",
181
183
  style: normalizeStyle({ textAlign: _ctx.textAlign })
@@ -185,6 +187,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
185
187
  innerHTML: _ctx.content
186
188
  }, null, 8, _hoisted_2)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.content), { key: 2 }))
187
189
  ], 4),
190
+ createTextVNode(),
188
191
  !_ctx.noFooter ? (openBlock(), createElementBlock("view", {
189
192
  key: 1,
190
193
  class: normalizeClass(["nut-dialog__footer", { [_ctx.footerDirection]: _ctx.footerDirection }])
@@ -203,6 +206,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
203
206
  ]),
204
207
  _: 1
205
208
  }, 8, ["onClick"])) : createCommentVNode("", true),
209
+ createTextVNode(),
206
210
  !_ctx.noOkBtn ? (openBlock(), createBlock(_component_nut_button, {
207
211
  key: 1,
208
212
  size: "small",
@@ -222,88 +226,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
222
226
  _: 3
223
227
  }, 8, ["teleport", "visible", "close-on-click-overlay", "lock-scroll", "pop-class", "style", "overlay-class", "overlay-style", "onClickOverlay", "onClickCloseIcon"]);
224
228
  }
225
- var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
226
- class DialogOptions {
227
- constructor() {
228
- this.title = "";
229
- this.content = "";
230
- this.cancelText = "";
231
- this.okText = "";
232
- this.textAlign = "center";
233
- this.customClass = "";
234
- this.overlayStyle = {};
235
- this.overlayClass = "";
236
- this.popStyle = {};
237
- this.popClass = "";
238
- this.teleport = "body";
239
- this.id = new Date().getTime();
240
- this.footerDirection = "horizontal";
241
- this.onUpdate = (value) => {
242
- };
243
- this.onOk = () => {
244
- };
245
- this.onCancel = () => {
246
- };
247
- this.onOpened = () => {
248
- };
249
- this.onClosed = () => {
250
- };
251
- this.visible = true;
252
- this.noFooter = false;
253
- this.noOkBtn = false;
254
- this.noCancelBtn = false;
255
- this.okBtnDisabled = false;
256
- this.closeOnPopstate = false;
257
- this.lockScroll = false;
258
- }
259
- }
260
- class DialogFunction {
261
- constructor(_options) {
262
- this.options = new DialogOptions();
263
- this.close = () => {
264
- };
265
- this.setDefaultOptions = (options2) => {
266
- };
267
- this.resetDefaultOptions = () => {
268
- };
269
- let options = Object.assign(this.options, _options);
270
- let elWarp = document.body;
271
- let teleport = options.teleport;
272
- if (teleport != "body") {
273
- if (typeof teleport == "string") {
274
- elWarp = document.querySelector(teleport);
275
- } else {
276
- elWarp = options.teleport;
277
- }
278
- }
279
- const root = document.createElement("view");
280
- root.id = "dialog-" + options.id;
281
- const Wrapper = {
282
- setup() {
283
- options.onUpdate = (val) => {
284
- if (val == false) {
285
- elWarp.removeChild(root);
286
- }
287
- };
288
- if (options == null ? void 0 : options.onOpened) {
289
- options == null ? void 0 : options.onOpened();
290
- }
291
- options.teleport = `#${root.id}`;
292
- return () => {
293
- return h(Dialog, options);
294
- };
295
- }
296
- };
297
- this.instance = createVNode(Wrapper);
298
- elWarp.appendChild(root);
299
- render(this.instance, root);
300
- }
301
- }
302
- const _Dialog = function(options) {
303
- return new DialogFunction(options);
304
- };
305
- _Dialog.install = (app) => {
306
- app.use(Dialog);
307
- app.config.globalProperties.$dialog = _Dialog;
308
- };
309
- export { Dialog, DialogOptions, _Dialog as default };
229
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
230
+ 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
  */
@@ -66,5 +66,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
66
66
  class: normalizeClass(_ctx.classes)
67
67
  }, null, 2));
68
68
  }
69
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
70
- export { index as default };
69
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
70
+ export { index_taro as default };
@@ -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, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
6
+ import { ref, reactive, computed, onMounted, onActivated, onDeactivated, openBlock, createElementBlock, normalizeClass, withModifiers, normalizeStyle, renderSlot } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
8
  import { r as requestAniFrame } from "./raf.js";
9
+ import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
9
10
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
10
11
  import "../locale/lang";
11
12
  const { componentName, create } = createComponent("drag");
@@ -31,7 +32,7 @@ const _sfc_main = create({
31
32
  }
32
33
  }
33
34
  },
34
- setup(props) {
35
+ setup(props, { emit }) {
35
36
  const myDrag = ref();
36
37
  const state = reactive({
37
38
  keepAlive: false,
@@ -41,10 +42,13 @@ const _sfc_main = create({
41
42
  screenHeight: 0,
42
43
  startTop: 0,
43
44
  startLeft: 0,
45
+ initTop: 0,
44
46
  nx: 0,
45
47
  ny: 0,
46
48
  xPum: 0,
47
49
  yPum: 0,
50
+ top: 0,
51
+ left: 0,
48
52
  position: { x: 0, y: 0 },
49
53
  boundary: {
50
54
  top: 0,
@@ -54,54 +58,57 @@ const _sfc_main = create({
54
58
  }
55
59
  });
56
60
  const classes = computed(() => {
57
- const prefixCls = componentName;
61
+ const prefixCls = "nut-taro-drag";
58
62
  return {
59
63
  [prefixCls]: true
60
64
  };
61
65
  });
66
+ const domElem = Taro.getSystemInfoSync();
62
67
  function getInfo() {
63
- const domElem = document.documentElement;
64
- state.elWidth = myDrag.value.offsetWidth;
65
- state.elHeight = myDrag.value.offsetHeight;
66
- state.screenWidth = domElem.clientWidth || 375;
67
- state.screenHeight = domElem.clientHeight || 667;
68
+ const query = Taro.createSelectorQuery();
69
+ query.select(".myDrag").boundingClientRect((rec) => {
70
+ state.elWidth = rec.width;
71
+ state.elHeight = rec.height;
72
+ state.initTop = rec.top;
73
+ }).exec();
74
+ state.screenWidth = domElem.screenWidth;
75
+ state.screenHeight = domElem.screenHeight;
68
76
  }
69
- function goLeft(target) {
77
+ function goLeft() {
70
78
  if (state.boundary.left) {
71
- if (+target.style.left.split("px")[0] > state.boundary.left) {
72
- target.style.left = +target.style.left.split("px")[0] - 10 + "px";
79
+ if (+state.left.split("px")[0] > state.boundary.left) {
80
+ state.left = +state.left.split("px")[0] - 10 + "px";
73
81
  requestAniFrame(() => {
74
- goLeft(target);
82
+ goLeft();
75
83
  });
76
84
  } else {
77
- target.style.left = `${state.boundary.left}px`;
85
+ state.left = `${state.boundary.left}px`;
78
86
  }
79
87
  } else {
80
- if (+target.style.left.split("px")[0] > 10) {
81
- target.style.left = +target.style.left.split("px")[0] - 10 + "px";
88
+ if (+state.left.split("px")[0] > 10) {
89
+ state.left = +state.left.split("px")[0] - 10 + "px";
82
90
  requestAniFrame(() => {
83
- goLeft(target);
91
+ goLeft();
84
92
  });
85
93
  } else {
86
- target.style.left = "0px";
94
+ state.left = "0px";
87
95
  }
88
96
  }
89
97
  }
90
- function goRight(target, rightLocation) {
91
- if (rightLocation - parseInt(target.style.left.split("px")[0]) > 10) {
92
- target.style.left = parseInt(target.style.left.split("px")[0]) + 10 + "px";
98
+ function goRight(rightLocation) {
99
+ if (rightLocation - parseInt(state.left.split("px")[0]) > 10) {
100
+ state.left = parseInt(state.left.split("px")[0]) + 10 + "px";
93
101
  requestAniFrame(() => {
94
- goRight(target, rightLocation);
102
+ goRight(rightLocation);
95
103
  });
96
104
  } else {
97
- target.style.left = rightLocation + "px";
105
+ state.left = rightLocation + "px";
98
106
  }
99
107
  }
100
108
  function touchMove(e) {
101
109
  e.preventDefault();
102
- const target = e.currentTarget;
103
- if (e.targetTouches.length === 1) {
104
- const touch = e.targetTouches[0];
110
+ if (e.touches.length === 1) {
111
+ const touch = e.touches[0];
105
112
  state.nx = touch.clientX - state.position.x;
106
113
  state.ny = touch.clientY - state.position.y;
107
114
  state.xPum = state.startLeft + state.nx;
@@ -118,15 +125,14 @@ const _sfc_main = create({
118
125
  state.yPum = state.screenHeight - state.elHeight - state.boundary.bottom;
119
126
  }
120
127
  if (props.direction != "y") {
121
- target.style.left = state.xPum + "px";
128
+ state.left = state.xPum;
122
129
  }
123
130
  if (props.direction != "x") {
124
- target.style.top = state.yPum + "px";
131
+ state.top = state.yPum;
125
132
  }
126
133
  }
127
134
  }
128
135
  function touchEnd(e) {
129
- const target = e.currentTarget;
130
136
  const touch = e.changedTouches[0];
131
137
  let currX = touch.clientX;
132
138
  const rightLocation = state.screenWidth - state.elWidth - state.boundary.right;
@@ -140,33 +146,47 @@ const _sfc_main = create({
140
146
  if (props.direction != "y" && props.attract) {
141
147
  if (currX < state.screenWidth / 2) {
142
148
  requestAniFrame(() => {
143
- goLeft(target);
149
+ goLeft();
144
150
  });
145
151
  } else {
146
152
  requestAniFrame(() => {
147
- goRight(target, rightLocation);
153
+ goRight(rightLocation);
148
154
  });
149
155
  }
150
156
  }
151
- if (props.direction != "x") {
152
- target.style.top = state.yPum + "px";
157
+ if (props.direction !== "x") {
158
+ state.top = state.yPum;
153
159
  }
154
160
  }
155
161
  function touchStart(e) {
156
- const target = e.currentTarget;
162
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
163
+ const query = Taro.createSelectorQuery();
164
+ let id = (_a = e == null ? void 0 : e.mpEvent) == null ? void 0 : _a.currentTarget.id;
165
+ let offsetTop = (_b = e == null ? void 0 : e.currentTarget) == null ? void 0 : _b.offsetTop;
166
+ let offsetLeft = (_c = e == null ? void 0 : e.currentTarget) == null ? void 0 : _c.offsetLeft;
157
167
  const touches = e.touches[0];
158
- const touch = e.targetTouches[0];
159
- state.startTop = target.offsetTop;
160
- state.startLeft = target.offsetLeft;
168
+ const mobileTop = (_f = (_e = (_d = e.touches[0]) == null ? void 0 : _d.target) == null ? void 0 : _e.parentNode) == null ? void 0 : _f.style.top;
169
+ const mobileLeft = (_i = (_h = (_g = e.touches[0]) == null ? void 0 : _g.target) == null ? void 0 : _h.parentNode) == null ? void 0 : _i.style.left;
170
+ query.selectAll(".myDrag").boundingClientRect((rec) => {
171
+ rec.forEach((element) => {
172
+ if (id && id == element.id) {
173
+ state.startTop = element.top - offsetTop;
174
+ state.startLeft = element.left - offsetLeft;
175
+ } else if (mobileTop) {
176
+ state.startTop = Number(mobileTop.slice(0, -2));
177
+ state.startLeft = Number(mobileLeft.slice(0, -2));
178
+ }
179
+ });
180
+ }).exec();
161
181
  state.position.x = touches.clientX;
162
182
  state.position.y = touches.clientY;
163
- state.nx = touch.clientX - state.position.x;
164
- state.ny = touch.clientY - state.position.y;
165
- state.xPum = state.startLeft + state.nx;
166
- state.yPum = state.startTop + state.ny;
167
183
  }
168
184
  onMounted(() => {
169
- getInfo();
185
+ setTimeout(() => {
186
+ getInfo();
187
+ }, 200);
188
+ eventCenter.once(getCurrentInstance().router.onReady, () => {
189
+ });
170
190
  state.boundary = props.boundary;
171
191
  });
172
192
  onActivated(() => {
@@ -185,20 +205,26 @@ const _sfc_main = create({
185
205
  myDrag,
186
206
  touchStart,
187
207
  touchMove,
188
- touchEnd
208
+ touchEnd,
209
+ state
189
210
  };
190
211
  }
191
212
  });
192
213
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
193
214
  return openBlock(), createElementBlock("view", {
194
- class: normalizeClass(_ctx.classes),
215
+ class: normalizeClass([_ctx.classes, "myDrag"]),
195
216
  ref: "myDrag",
196
217
  onTouchstart: _cache[0] || (_cache[0] = ($event) => _ctx.touchStart($event)),
197
- onTouchmove: _cache[1] || (_cache[1] = ($event) => _ctx.touchMove($event)),
198
- onTouchend: _cache[2] || (_cache[2] = ($event) => _ctx.touchEnd($event))
218
+ onTouchmove: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.touchMove($event), ["prevent"])),
219
+ catchtouchmove: "true",
220
+ style: normalizeStyle({
221
+ transform: ` translate(${_ctx.state.left + "px"}, ${_ctx.state.top + "px"})`,
222
+ top: _ctx.state.top + "px",
223
+ left: _ctx.state.left + "px"
224
+ })
199
225
  }, [
200
226
  renderSlot(_ctx.$slots, "default")
201
- ], 34);
227
+ ], 38);
202
228
  }
203
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
204
- export { index as default };
229
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
230
+ export { index_taro as default };