@nutui/nutui 3.2.6 → 3.2.8-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +11 -1
  3. package/dist/nutui.es.js +2685 -4599
  4. package/dist/nutui.umd.js +2684 -4600
  5. package/dist/packages/_es/ActionSheet.js +2 -5
  6. package/dist/packages/_es/Address.js +162 -250
  7. package/dist/packages/_es/AddressList.js +229 -307
  8. package/dist/packages/_es/Animate.js +1 -1
  9. package/dist/packages/_es/Audio.js +1 -1
  10. package/dist/packages/_es/AudioOperate.js +1 -1
  11. package/dist/packages/_es/Avatar.js +1 -1
  12. package/dist/packages/_es/AvatarGroup.js +1 -1
  13. package/dist/packages/_es/BackTop.js +1 -1
  14. package/dist/packages/_es/Badge.js +1 -1
  15. package/dist/packages/_es/Barrage.js +1 -1
  16. package/dist/packages/_es/Button.js +1 -1
  17. package/dist/packages/_es/Calendar.js +11 -4
  18. package/dist/packages/_es/CalendarItem.js +1 -1
  19. package/dist/packages/_es/Card.js +1 -1
  20. package/dist/packages/_es/Cascader.js +2 -5
  21. package/dist/packages/_es/Category.js +1 -1
  22. package/dist/packages/_es/CategoryPane.js +1 -1
  23. package/dist/packages/_es/Cell.js +1 -1
  24. package/dist/packages/_es/CellGroup.js +1 -1
  25. package/dist/packages/_es/Checkbox.js +1 -1
  26. package/dist/packages/_es/CheckboxGroup.js +1 -1
  27. package/dist/packages/_es/CircleProgress.js +2 -2
  28. package/dist/packages/_es/Col.js +1 -1
  29. package/dist/packages/_es/Collapse.js +4 -11
  30. package/dist/packages/_es/CollapseItem.js +12 -12
  31. package/dist/packages/_es/Comment.js +1 -1
  32. package/dist/packages/_es/ConfigProvider.js +1 -1
  33. package/dist/packages/_es/CountDown.js +2 -10
  34. package/dist/packages/_es/CountUp.js +1 -1
  35. package/dist/packages/_es/DatePicker.js +8 -17
  36. package/dist/packages/_es/Dialog.js +38 -63
  37. package/dist/packages/_es/Divider.js +1 -1
  38. package/dist/packages/_es/Drag.js +1 -1
  39. package/dist/packages/_es/Ecard.js +1 -1
  40. package/dist/packages/_es/Elevator.js +9 -3
  41. package/dist/packages/_es/Ellipsis.js +3 -3
  42. package/dist/packages/_es/Empty.js +1 -1
  43. package/dist/packages/_es/FixedNav.js +1 -1
  44. package/dist/packages/_es/Form.js +39 -31
  45. package/dist/packages/_es/FormItem.js +1 -1
  46. package/dist/packages/_es/Grid.js +2 -2
  47. package/dist/packages/_es/GridItem.js +1 -1
  48. package/dist/packages/_es/Icon.js +1 -1
  49. package/dist/packages/_es/Image.js +1 -1
  50. package/dist/packages/_es/ImagePreview.js +131 -214
  51. package/dist/packages/_es/Indicator.js +4 -4
  52. package/dist/packages/_es/InfiniteLoading.js +9 -2
  53. package/dist/packages/_es/Input.js +109 -132
  54. package/dist/packages/_es/InputNumber.js +1 -1
  55. package/dist/packages/_es/Invoice.js +1 -1
  56. package/dist/packages/_es/Layout.js +1 -1
  57. package/dist/packages/_es/List.js +1 -1
  58. package/dist/packages/_es/Menu.js +14 -1
  59. package/dist/packages/_es/MenuItem.js +14 -8
  60. package/dist/packages/_es/Navbar.js +1 -1
  61. package/dist/packages/_es/NoticeBar.js +1 -1
  62. package/dist/packages/_es/Notify.js +5 -7
  63. package/dist/packages/_es/NumberKeyboard.js +4 -4
  64. package/dist/packages/_es/OverLay.js +60 -63
  65. package/dist/packages/_es/Pagination.js +1 -1
  66. package/dist/packages/_es/Picker.js +25 -50
  67. package/dist/packages/_es/Popover.js +111 -930
  68. package/dist/packages/_es/Popup.js +108 -261
  69. package/dist/packages/_es/Price.js +1 -1
  70. package/dist/packages/_es/Progress.js +1 -1
  71. package/dist/packages/_es/Radio.js +1 -1
  72. package/dist/packages/_es/RadioGroup.js +1 -1
  73. package/dist/packages/_es/Range.js +1 -1
  74. package/dist/packages/_es/Rate.js +1 -1
  75. package/dist/packages/_es/Row.js +1 -1
  76. package/dist/packages/_es/SearchBar.js +1 -1
  77. package/dist/packages/_es/ShortPassword.js +4 -4
  78. package/dist/packages/_es/SideNavBar.js +1 -1
  79. package/dist/packages/_es/SideNavBarItem.js +1 -1
  80. package/dist/packages/_es/Signature.js +1 -1
  81. package/dist/packages/_es/Skeleton.js +19 -24
  82. package/dist/packages/_es/Sku.js +4 -7
  83. package/dist/packages/_es/Step.js +1 -1
  84. package/dist/packages/_es/Steps.js +1 -1
  85. package/dist/packages/_es/Sticky.js +1 -1
  86. package/dist/packages/_es/SubSideNavBar.js +1 -1
  87. package/dist/packages/_es/Swipe.js +1 -1
  88. package/dist/packages/_es/Swiper.js +1 -1
  89. package/dist/packages/_es/SwiperItem.js +1 -1
  90. package/dist/packages/_es/Switch.js +1 -1
  91. package/dist/packages/_es/TabPane.js +1 -1
  92. package/dist/packages/_es/Tabbar.js +1 -1
  93. package/dist/packages/_es/TabbarItem.js +24 -10
  94. package/dist/packages/_es/Table.js +1 -1
  95. package/dist/packages/_es/Tabs.js +2 -2
  96. package/dist/packages/_es/Tag.js +1 -1
  97. package/dist/packages/_es/TextArea.js +1 -1
  98. package/dist/packages/_es/TimeDetail.js +1 -1
  99. package/dist/packages/_es/TimePannel.js +1 -1
  100. package/dist/packages/_es/TimeSelect.js +4 -4
  101. package/dist/packages/_es/Toast.js +5 -6
  102. package/dist/packages/_es/TrendArrow.js +1 -1
  103. package/dist/packages/_es/Uploader.js +7 -7
  104. package/dist/packages/_es/Video.js +3 -2
  105. package/dist/packages/_es/WaterMark.js +1 -1
  106. package/dist/packages/_es/common.js +1 -1
  107. package/dist/packages/_es/component.js +22 -2
  108. package/dist/packages/_es/index.js +1 -1
  109. package/dist/packages/_es/index2.js +1 -1
  110. package/dist/packages/_es/index3.js +1 -1
  111. package/dist/packages/_es/index4.js +1 -1
  112. package/dist/packages/_es/index5.js +8 -2
  113. package/dist/packages/_es/interceptor.js +32 -0
  114. package/dist/packages/_es/mountComponent.js +42 -0
  115. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  116. package/dist/packages/_es/props.js +80 -0
  117. package/dist/packages/_es/pxCheck.js +1 -1
  118. package/dist/packages/_es/raf.js +1 -1
  119. package/dist/packages/_es/style.css +1 -1
  120. package/dist/packages/address/index.scss +12 -3
  121. package/dist/packages/addresslist/index.scss +61 -101
  122. package/dist/packages/card/index.scss +1 -0
  123. package/dist/packages/ellipsis/index.scss +4 -0
  124. package/dist/packages/formitem/index.scss +2 -0
  125. package/dist/packages/imagepreview/index.scss +14 -1
  126. package/dist/packages/inputnumber/index.scss +5 -1
  127. package/dist/packages/locale/lang/baseLang.js +1 -1
  128. package/dist/packages/locale/lang/en-US.js +1 -1
  129. package/dist/packages/locale/lang/id-ID.js +1 -1
  130. package/dist/packages/locale/lang/index.js +1 -1
  131. package/dist/packages/locale/lang/zh-CN.js +1 -1
  132. package/dist/packages/locale/lang/zh-TW.js +1 -1
  133. package/dist/packages/menuitem/index.scss +0 -14
  134. package/dist/packages/notify/index.scss +2 -2
  135. package/dist/packages/overlay/index.scss +2 -1
  136. package/dist/packages/picker/index.scss +20 -12
  137. package/dist/packages/popover/index.scss +191 -363
  138. package/dist/packages/popup/index.scss +3 -14
  139. package/dist/packages/signature/index.scss +6 -2
  140. package/dist/packages/skeleton/index.scss +21 -19
  141. package/dist/packages/sticky/index.scss +3 -0
  142. package/dist/packages/tabbaritem/index.scss +4 -0
  143. package/dist/packages/timeselect/index.scss +0 -1
  144. package/dist/smartips/attributes.json +91 -111
  145. package/dist/smartips/tags.json +22 -35
  146. package/dist/smartips/web-types.json +162 -221
  147. package/dist/style.css +1 -1
  148. package/dist/styles/font/config.json +4 -0
  149. package/dist/styles/font/demo_index.html +118 -26
  150. package/dist/styles/font/iconfont.css +23 -7
  151. package/dist/styles/font/iconfont.js +6 -6
  152. package/dist/styles/font/iconfont.json +35 -7
  153. package/dist/styles/font/iconfont.ttf +0 -0
  154. package/dist/styles/font/iconfont.woff +0 -0
  155. package/dist/styles/font/iconfont.woff2 +0 -0
  156. package/dist/styles/themes/default.scss +52 -54
  157. package/dist/styles/themes/jdb.scss +52 -54
  158. package/dist/styles/themes/jddkh.scss +52 -54
  159. package/dist/styles/themes/jdt.scss +52 -54
  160. package/dist/styles/variables-jdb.scss +8 -1
  161. package/dist/styles/variables-jddkh.scss +8 -1
  162. package/dist/styles/variables-jdt.scss +8 -1
  163. package/dist/styles/variables.scss +17 -1
  164. package/dist/types/__VUE/actionsheet/index.vue.d.ts +58 -54
  165. package/dist/types/__VUE/address/index.vue.d.ts +71 -91
  166. package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +29 -9
  167. package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +4 -13
  168. package/dist/types/__VUE/addresslist/components/SwipeShell.vue.d.ts +9 -9
  169. package/dist/types/__VUE/addresslist/index.vue.d.ts +23 -20
  170. package/dist/types/__VUE/audio/index.vue.d.ts +4 -4
  171. package/dist/types/__VUE/avatar/index.vue.d.ts +2 -2
  172. package/dist/types/__VUE/avatargroup/index.vue.d.ts +1 -1
  173. package/dist/types/__VUE/backtop/index.vue.d.ts +1 -1
  174. package/dist/types/__VUE/badge/index.vue.d.ts +1 -1
  175. package/dist/types/__VUE/button/index.vue.d.ts +1 -1
  176. package/dist/types/__VUE/calendar/index.vue.d.ts +11 -0
  177. package/dist/types/__VUE/calendaritem/index.vue.d.ts +15 -5
  178. package/dist/types/__VUE/cascader/index.vue.d.ts +47 -52
  179. package/dist/types/__VUE/cell/index.vue.d.ts +5 -5
  180. package/dist/types/__VUE/collapseitem/index.vue.d.ts +1 -1
  181. package/dist/types/__VUE/countdown/index.vue.d.ts +0 -1
  182. package/dist/types/__VUE/countdown/util.d.ts +0 -1
  183. package/dist/types/__VUE/countup/index.vue.d.ts +2 -2
  184. package/dist/types/__VUE/datepicker/index.vue.d.ts +55 -60
  185. package/dist/types/__VUE/dialog/index.d.ts +0 -3
  186. package/dist/types/__VUE/dialog/index.vue.d.ts +48 -57
  187. package/dist/types/__VUE/elevator/index.vue.d.ts +2 -1
  188. package/dist/types/__VUE/form/common.d.ts +4 -2
  189. package/dist/types/__VUE/form/index.vue.d.ts +4 -4
  190. package/dist/types/__VUE/grid/index.vue.d.ts +2 -2
  191. package/dist/types/__VUE/image/index.vue.d.ts +1 -1
  192. package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +27 -20
  193. package/dist/types/__VUE/imagepreview/index.d.ts +19 -5
  194. package/dist/types/__VUE/imagepreview/index.vue.d.ts +56 -42
  195. package/dist/types/__VUE/imagepreview/types.d.ts +44 -0
  196. package/dist/types/__VUE/indicator/index.vue.d.ts +1 -0
  197. package/dist/types/__VUE/input/index.vue.d.ts +37 -26
  198. package/dist/types/__VUE/invoice/index.vue.d.ts +1 -1
  199. package/dist/types/__VUE/menuitem/index.vue.d.ts +3 -1
  200. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  201. package/dist/types/__VUE/noticebar/index.vue.d.ts +4 -4
  202. package/dist/types/__VUE/notify/index.vue.d.ts +3 -3
  203. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +3 -3
  204. package/dist/types/__VUE/overlay/index.vue.d.ts +11 -12
  205. package/dist/types/__VUE/picker/Column.vue.d.ts +4 -6
  206. package/dist/types/__VUE/picker/index.vue.d.ts +60 -67
  207. package/dist/types/__VUE/popover/index.vue.d.ts +36 -139
  208. package/dist/types/__VUE/popup/common.d.ts +103 -0
  209. package/dist/types/__VUE/popup/index.vue.d.ts +55 -1591
  210. package/dist/types/__VUE/popup/props.d.ts +82 -0
  211. package/dist/types/__VUE/range/index.vue.d.ts +7 -7
  212. package/dist/types/__VUE/shortpassword/index.vue.d.ts +4 -4
  213. package/dist/types/__VUE/skeleton/common.d.ts +2 -3
  214. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -3
  215. package/dist/types/__VUE/sku/index.vue.d.ts +56 -61
  216. package/dist/types/__VUE/step/index.vue.d.ts +1 -1
  217. package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
  218. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -1
  219. package/dist/types/__VUE/timeselect/index.vue.d.ts +3 -3
  220. package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
  221. package/dist/types/__VUE/uploader/index.vue.d.ts +15 -6
  222. package/dist/types/__VUE/video/index.vue.d.ts +5 -5
  223. package/dist/types/index.d.ts +1 -1
  224. package/dist/types/nutui.d.ts +1 -3
  225. package/package.json +3 -3
  226. package/dist/packages/_es/OldPicker.js +0 -486
  227. package/dist/packages/_es/PullRefresh.js +0 -349
  228. package/dist/packages/oldpicker/index.scss +0 -133
  229. package/dist/packages/pullrefresh/index.scss +0 -71
  230. package/dist/types/__VUE/addresslist/components/LongPressShell.vue.d.ts +0 -47
  231. package/dist/types/__VUE/datepicker/utils.d.ts +0 -5
  232. package/dist/types/__VUE/oldpicker/Column.vue.d.ts +0 -96
  233. package/dist/types/__VUE/oldpicker/commonProps.d.ts +0 -22
  234. package/dist/types/__VUE/oldpicker/index.vue.d.ts +0 -369
  235. package/dist/types/__VUE/oldpicker/types.d.ts +0 -24
  236. package/dist/types/__VUE/popup/use-lock-scroll.d.ts +0 -5
  237. package/dist/types/__VUE/pullrefresh/index.vue.d.ts +0 -128
  238. package/dist/types/__VUE/pullrefresh/use-touch.d.ts +0 -20
  239. package/dist/types/__VUE/pullrefresh/util.d.ts +0 -6
@@ -1,29 +1,36 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.7 Fri Dec 02 2022 14:12:17 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { reactive, computed, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, createVNode, ref, onMounted, Fragment, renderList, toDisplayString, mergeProps, render, h } from "vue";
7
- import { c as createComponent, i as isPromise } from "./component.js";
6
+ import { reactive, computed, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle, createElementBlock, createCommentVNode, ref, onMounted, Fragment, renderList, toDisplayString, normalizeClass, createVNode, mergeProps, h } from "vue";
7
+ import { c as createComponent, a as preventDefault, j as isArray } from "./component.js";
8
+ import { u as useRect } from "./index2.js";
9
+ import { u as useTouch } from "./index4.js";
10
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
11
+ import { f as funInterceptor } from "./interceptor.js";
12
+ import "../locale/lang";
13
+ import { C as CreateComponent } from "./mountComponent.js";
8
14
  import Popup from "./Popup.js";
9
15
  import Video from "./Video.js";
10
16
  import Swiper from "./Swiper.js";
11
17
  import SwiperItem from "./SwiperItem.js";
12
18
  import _sfc_main$2 from "./Icon.js";
13
- import { u as useTouch } from "./index4.js";
14
- import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
15
- import "../locale/lang";
16
- import "./OverLay.js";
17
- import "./pxCheck.js";
19
+ import OverLay from "./OverLay.js";
20
+ import "./props.js";
18
21
  import "./index3.js";
22
+ import "./pxCheck.js";
23
+ const baseProps = {
24
+ show: { type: Boolean, default: false },
25
+ initNo: { type: Number, default: 0 },
26
+ showIndex: { type: Boolean, default: true },
27
+ minZoom: { type: Number, default: 1 / 3 },
28
+ maxZoom: { type: Number, default: 3 }
29
+ };
19
30
  const { create: create$1 } = createComponent("imagepreviewitem");
20
31
  const _sfc_main$1 = create$1({
21
32
  props: {
22
- show: {
23
- type: Boolean,
24
- default: false
25
- },
26
- initNo: Number,
33
+ ...baseProps,
27
34
  image: {
28
35
  type: Object,
29
36
  default: () => ({})
@@ -32,10 +39,6 @@ const _sfc_main$1 = create$1({
32
39
  type: Object,
33
40
  default: () => ({})
34
41
  },
35
- showIndex: {
36
- type: Boolean,
37
- default: true
38
- },
39
42
  rootWidth: {
40
43
  type: Number,
41
44
  default: 0
@@ -43,24 +46,10 @@ const _sfc_main$1 = create$1({
43
46
  rootHeight: {
44
47
  type: Number,
45
48
  default: 0
46
- },
47
- minZoom: {
48
- type: Number,
49
- default: 1 / 3
50
- },
51
- maxZoom: {
52
- type: Number,
53
- default: 3
54
49
  }
55
50
  },
56
51
  emits: ["close", "scale"],
57
- components: {
58
- [Popup.name]: Popup,
59
- [Video.name]: Video,
60
- [Swiper.name]: Swiper,
61
- [SwiperItem.name]: SwiperItem,
62
- [_sfc_main$2.name]: _sfc_main$2
63
- },
52
+ components: {},
64
53
  setup(props, { emit }) {
65
54
  const state = reactive({
66
55
  scale: 1,
@@ -79,16 +68,20 @@ const _sfc_main$1 = create$1({
79
68
  return state.imageRatio > rootRatio;
80
69
  });
81
70
  const imageStyle = computed(() => {
82
- const { scale, moveX, moveY, moving, zooming } = state;
83
- const style = {
84
- transitionDuration: zooming || moving ? "0s" : ".3s"
85
- };
86
- if (scale !== 1) {
87
- const offsetX = moveX / scale;
88
- const offsetY = moveY / scale;
89
- style.transform = `scale(${scale}, ${scale}) translate(${offsetX}px, ${offsetY}px)`;
71
+ const images = props.image;
72
+ if (images && images.src) {
73
+ const { scale, moveX, moveY, moving, zooming } = state;
74
+ const style = {
75
+ transitionDuration: zooming || moving ? "0s" : ".3s"
76
+ };
77
+ if (scale !== 1) {
78
+ const offsetX = moveX / scale;
79
+ const offsetY = moveY / scale;
80
+ style.transform = `scale(${scale}, ${scale}) translate(${offsetX}px, ${offsetY}px)`;
81
+ }
82
+ return style;
90
83
  }
91
- return style;
84
+ return {};
92
85
  });
93
86
  const maxMoveX = computed(() => {
94
87
  if (state.imageRatio) {
@@ -198,7 +191,6 @@ const _sfc_main$1 = create$1({
198
191
  }
199
192
  };
200
193
  const onTouchEnd = (event) => {
201
- console.log("ontauchend");
202
194
  let stopPropagation = false;
203
195
  if (state.moving || state.zooming) {
204
196
  stopPropagation = true;
@@ -227,17 +219,8 @@ const _sfc_main$1 = create$1({
227
219
  checkTap();
228
220
  touch.reset();
229
221
  };
230
- const preventDefault = (event, isStopPropagation) => {
231
- if (typeof event.cancelable !== "boolean" || event.cancelable) {
232
- event.preventDefault();
233
- }
234
- if (isStopPropagation) {
235
- event.stopPropagation();
236
- }
237
- };
238
222
  const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
239
- const closeSwiper = (event) => {
240
- console.log("\u5173\u95ED\u89C6\u9891");
223
+ const closeSwiper = () => {
241
224
  emit("close");
242
225
  };
243
226
  watch(() => props.initNo, resetScale);
@@ -267,8 +250,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
267
250
  const _component_nut_swiper_item = resolveComponent("nut-swiper-item");
268
251
  return openBlock(), createBlock(_component_nut_swiper_item, { onClick: _ctx.closeSwiper }, {
269
252
  default: withCtx(() => [
270
- _ctx.image && _ctx.image.src ? (openBlock(), createElementBlock("view", {
271
- key: 0,
253
+ createElementVNode("view", {
272
254
  style: normalizeStyle(_ctx.imageStyle),
273
255
  class: "nut-imagepreview-box",
274
256
  onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
@@ -276,26 +258,18 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
276
258
  onTouchend: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
277
259
  onTouchcancel: _cache[4] || (_cache[4] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
278
260
  }, [
279
- createElementVNode("img", {
261
+ _ctx.image && _ctx.image.src ? (openBlock(), createElementBlock("img", {
262
+ key: 0,
280
263
  src: _ctx.image.src,
281
264
  class: "nut-imagepreview-img",
282
265
  onLoad: _cache[0] || (_cache[0] = (...args) => _ctx.imageLoad && _ctx.imageLoad(...args))
283
- }, null, 40, _hoisted_1$1)
284
- ], 36)) : createCommentVNode("", true),
285
- _ctx.video && _ctx.video.source ? (openBlock(), createElementBlock("view", {
286
- key: 1,
287
- class: "nut-imagepreview-box",
288
- onClick: _cache[5] || (_cache[5] = (...args) => _ctx.videoClick && _ctx.videoClick(...args)),
289
- onTouchstart: _cache[6] || (_cache[6] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
290
- onTouchmove: _cache[7] || (_cache[7] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
291
- onTouchend: _cache[8] || (_cache[8] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
292
- onTouchcancel: _cache[9] || (_cache[9] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
293
- }, [
294
- createVNode(_component_nut_video, {
266
+ }, null, 40, _hoisted_1$1)) : createCommentVNode("", true),
267
+ _ctx.video && _ctx.video.source ? (openBlock(), createBlock(_component_nut_video, {
268
+ key: 1,
295
269
  source: _ctx.video.source,
296
270
  options: _ctx.video.options
297
- }, null, 8, ["source", "options"])
298
- ], 32)) : createCommentVNode("", true)
271
+ }, null, 8, ["source", "options"])) : createCommentVNode("", true)
272
+ ], 36)
299
273
  ]),
300
274
  _: 1
301
275
  }, 8, ["onClick"]);
@@ -304,46 +278,15 @@ var ImagePreviewItem = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc
304
278
  const { create } = createComponent("imagepreview");
305
279
  const _sfc_main = create({
306
280
  props: {
307
- show: {
308
- type: Boolean,
309
- default: false
310
- },
311
- images: {
312
- type: Array,
313
- default: () => []
314
- },
315
- videos: {
316
- type: Array,
317
- default: () => []
318
- },
319
- contentClose: {
320
- type: Boolean,
321
- default: true
322
- },
323
- initNo: {
324
- type: Number,
325
- default: 1
326
- },
327
- paginationVisible: {
328
- type: Boolean,
329
- default: false
330
- },
331
- paginationColor: {
332
- type: String,
333
- default: "#fff"
334
- },
335
- autoplay: {
336
- type: [Number, String],
337
- default: 0
338
- },
339
- isWrapTeleport: {
340
- type: Boolean,
341
- default: false
342
- },
343
- showIndex: {
344
- type: Boolean,
345
- default: true
346
- },
281
+ ...baseProps,
282
+ images: { type: Array, default: () => [] },
283
+ videos: { type: Array, default: () => [] },
284
+ contentClose: { type: Boolean, default: true },
285
+ paginationVisible: { type: Boolean, default: false },
286
+ paginationColor: { type: String, default: "#fff" },
287
+ autoplay: { type: [Number, String], default: 0 },
288
+ teleport: { type: [String, Element], default: "body" },
289
+ teleportDisable: { ype: Boolean, default: false },
347
290
  closeable: {
348
291
  type: Boolean,
349
292
  default: false
@@ -357,14 +300,6 @@ const _sfc_main = create({
357
300
  default: "top-right"
358
301
  },
359
302
  beforeClose: Function,
360
- minZoom: {
361
- type: Number,
362
- default: 1 / 3
363
- },
364
- maxZoom: {
365
- type: Number,
366
- default: 3
367
- },
368
303
  isLoop: {
369
304
  type: Boolean,
370
305
  default: true
@@ -372,64 +307,49 @@ const _sfc_main = create({
372
307
  },
373
308
  emits: ["close", "change"],
374
309
  components: {
375
- [Popup.name]: Popup,
376
- [Video.name]: Video,
377
- [Swiper.name]: Swiper,
378
- [SwiperItem.name]: SwiperItem,
379
- [_sfc_main$2.name]: _sfc_main$2,
380
310
  ImagePreviewItem
381
311
  },
382
312
  setup(props, { emit }) {
383
313
  const swipeRef = ref();
384
314
  const state = reactive({
385
- showPop: false,
386
- active: 1,
387
- maxNo: 1,
315
+ showPop: props.show,
316
+ active: 0,
388
317
  rootWidth: 0,
389
318
  rootHeight: 0
390
319
  });
391
- const styles = computed(() => {
392
- let style = {};
393
- if (props.closeIconPosition == "top-right") {
394
- style.right = "10px";
395
- } else {
396
- style.left = "10px";
320
+ const iconClasses = computed(() => {
321
+ const pre = "nut-imagepreview-close";
322
+ const iconn = props.closeIconPosition == "top-right" ? `${pre}-right` : `${pre}-left`;
323
+ return `nut-imagepreview-close-icon ${iconn}`;
324
+ });
325
+ const mergeImages = computed(() => {
326
+ if (isArray(props.videos)) {
327
+ return [].concat(props.videos).concat(props.images);
397
328
  }
398
- return style;
329
+ return props.images;
399
330
  });
400
- const slideChangeEnd = function(page) {
401
- state.active = page + 1;
402
- emit("change", state.active);
331
+ const setActive = (active) => {
332
+ if (active !== state.active) {
333
+ state.active = active;
334
+ emit("change", state.active);
335
+ }
403
336
  };
404
337
  const onClose = () => {
405
- if (props.beforeClose) {
406
- const returnVal = props.beforeClose.apply(null, state.active);
407
- if (isPromise(returnVal)) {
408
- returnVal.then((value) => {
409
- if (value) {
410
- closeDone();
411
- }
412
- });
413
- } else if (returnVal) {
414
- closeDone();
415
- }
416
- } else {
417
- closeDone();
418
- }
338
+ funInterceptor(props.beforeClose, {
339
+ args: [state.active],
340
+ done: () => closeDone()
341
+ });
419
342
  };
420
343
  const closeDone = () => {
421
344
  state.showPop = false;
422
- state.active = 1;
423
345
  emit("close");
424
346
  };
425
- const handleCloseIcon = () => {
426
- onClose();
427
- };
428
347
  const init = () => {
429
- setTimeout(() => {
430
- state.rootHeight = swipeRef.value.offsetHeight;
431
- state.rootWidth = swipeRef.value.offsetWidth;
432
- }, 100);
348
+ if (swipeRef.value) {
349
+ const rect = useRect(swipeRef.value);
350
+ state.rootHeight = rect.height;
351
+ state.rootWidth = rect.width;
352
+ }
433
353
  };
434
354
  watch(
435
355
  () => props.show,
@@ -438,18 +358,23 @@ const _sfc_main = create({
438
358
  init();
439
359
  }
440
360
  );
361
+ watch(
362
+ () => props.initNo,
363
+ (val) => {
364
+ if (val != state.active)
365
+ setActive(val);
366
+ }
367
+ );
441
368
  onMounted(() => {
442
- state.active = props.initNo;
443
- state.showPop = props.show;
444
- state.maxNo = props.images.length + props.videos.length;
369
+ setActive(props.initNo);
445
370
  });
446
371
  return {
447
372
  swipeRef,
448
373
  ...toRefs(state),
449
- slideChangeEnd,
450
374
  onClose,
451
- handleCloseIcon,
452
- styles
375
+ mergeImages,
376
+ setActive,
377
+ iconClasses
453
378
  };
454
379
  }
455
380
  });
@@ -467,12 +392,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
467
392
  const _component_nut_icon = resolveComponent("nut-icon");
468
393
  const _component_nut_popup = resolveComponent("nut-popup");
469
394
  return openBlock(), createBlock(_component_nut_popup, {
470
- "pop-class": "custom-pop",
395
+ "pop-class": "nut-imagepreview-custom-pop",
471
396
  visible: _ctx.showPop,
472
397
  "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPop = $event),
473
- isWrapTeleport: _ctx.isWrapTeleport,
398
+ teleportDisable: _ctx.teleportDisable,
399
+ teleport: _ctx.teleport,
474
400
  onClosed: _ctx.onClose,
475
- style: { "width": "100%" },
476
401
  "lock-scroll": ""
477
402
  }, {
478
403
  default: withCtx(() => [
@@ -484,97 +409,89 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
484
409
  loop: _ctx.isLoop,
485
410
  "is-preventDefault": false,
486
411
  direction: "horizontal",
487
- onChange: _ctx.slideChangeEnd,
488
- "init-page": _ctx.initNo > _ctx.maxNo ? _ctx.maxNo - 1 : _ctx.initNo - 1,
412
+ onChange: _ctx.setActive,
413
+ "init-page": _ctx.initNo,
489
414
  "pagination-visible": _ctx.paginationVisible,
490
415
  "pagination-color": _ctx.paginationColor
491
416
  }, {
492
417
  default: withCtx(() => [
493
- _ctx.videos.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.videos, (item, index) => {
418
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.mergeImages, (item, index) => {
494
419
  return openBlock(), createBlock(_component_image_preview_item, {
495
420
  key: index,
496
- video: item,
421
+ video: index < _ctx.videos.length ? item : {},
422
+ image: index >= _ctx.videos.length ? item : {},
497
423
  rootHeight: _ctx.rootHeight,
498
424
  rootWidth: _ctx.rootWidth,
499
425
  show: _ctx.showPop,
500
- "init-no": _ctx.active,
426
+ "init-no": _ctx.active + 1,
501
427
  onClose: _ctx.onClose,
502
428
  maxZoom: _ctx.maxZoom,
503
429
  minZoom: _ctx.minZoom
504
- }, null, 8, ["video", "rootHeight", "rootWidth", "show", "init-no", "onClose", "maxZoom", "minZoom"]);
505
- }), 128)) : createCommentVNode("", true),
506
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.images, (item, index) => {
507
- return openBlock(), createBlock(_component_image_preview_item, {
508
- key: index,
509
- image: item,
510
- rootHeight: _ctx.rootHeight,
511
- rootWidth: _ctx.rootWidth,
512
- show: _ctx.showPop,
513
- "init-no": _ctx.active,
514
- onClose: _ctx.onClose
515
- }, null, 8, ["image", "rootHeight", "rootWidth", "show", "init-no", "onClose"]);
430
+ }, null, 8, ["video", "image", "rootHeight", "rootWidth", "show", "init-no", "onClose", "maxZoom", "minZoom"]);
516
431
  }), 128))
517
432
  ]),
518
433
  _: 1
519
434
  }, 8, ["auto-play", "loop", "onChange", "init-page", "pagination-visible", "pagination-color"])) : createCommentVNode("", true)
520
435
  ], 512),
521
- _ctx.showIndex ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.images.length + _ctx.videos.length), 1)) : createCommentVNode("", true),
436
+ _ctx.showIndex ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.active + 1) + " / " + toDisplayString(_ctx.mergeImages.length), 1)) : createCommentVNode("", true),
522
437
  _ctx.closeable ? (openBlock(), createElementBlock("view", {
523
438
  key: 1,
524
- class: "nut-imagepreview-close-icon",
525
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleCloseIcon && _ctx.handleCloseIcon(...args)),
526
- style: normalizeStyle(_ctx.styles)
439
+ class: normalizeClass(_ctx.iconClasses),
440
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClose && _ctx.onClose(...args))
527
441
  }, [
528
442
  createVNode(_component_nut_icon, mergeProps({ name: _ctx.closeIcon }, _ctx.$attrs, { color: "#ffffff" }), null, 16, ["name"])
529
- ], 4)) : createCommentVNode("", true)
443
+ ], 2)) : createCommentVNode("", true)
530
444
  ]),
531
445
  _: 1
532
- }, 8, ["visible", "isWrapTeleport", "onClosed"]);
446
+ }, 8, ["visible", "teleportDisable", "teleport", "onClosed"]);
533
447
  }
534
448
  var ImagePreview = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
535
449
  class ImagePreviewOptions {
536
450
  constructor() {
537
451
  this.show = false;
538
452
  this.images = [];
539
- this.initNo = 1;
453
+ this.videos = [];
454
+ this.contentClose = true;
455
+ this.initNo = 0;
540
456
  this.paginationVisible = false;
541
457
  this.paginationColor = "";
542
- this.teleport = "body";
458
+ this.autoplay = 0;
459
+ this.isWrapTeleport = false;
460
+ this.showIndex = true;
461
+ this.closeable = false;
462
+ this.closeIcon = "circle-close";
463
+ this.closeIconPosition = "top-right";
464
+ this.maxZoom = 3;
465
+ this.minZoom = 1 / 3;
466
+ this.isLoop = true;
543
467
  this.onClose = () => {
544
468
  };
469
+ this.teleport = "body";
545
470
  }
546
471
  }
547
472
  class ImagePreviewFunction {
548
473
  constructor(_options) {
549
474
  this.options = new ImagePreviewOptions();
550
475
  const options = Object.assign(this.options, _options);
551
- let elWarp = document.body;
552
- const teleport = options.teleport;
553
- if (teleport != "body") {
554
- if (typeof teleport == "string") {
555
- elWarp = document.querySelector(teleport);
556
- } else {
557
- elWarp = options.teleport;
558
- }
559
- }
560
- const root = document.createElement("view");
561
- root.id = "imagepreview-" + new Date().getTime();
562
- const Wrapper = {
563
- setup() {
564
- options.teleport = `#${root.id}`;
565
- return () => {
566
- return h(ImagePreview, options);
476
+ const { instance, unmount } = CreateComponent(options, {
477
+ name: "imagepreview",
478
+ components: [Popup, Video, Swiper, SwiperItem, _sfc_main$2, OverLay],
479
+ wrapper: () => {
480
+ return {
481
+ setup() {
482
+ return () => {
483
+ options.onClose = () => {
484
+ unmount();
485
+ };
486
+ return h(ImagePreview, options);
487
+ };
488
+ }
567
489
  };
568
490
  }
569
- };
570
- const instance = createVNode(Wrapper);
571
- elWarp.appendChild(root);
572
- render(instance, root);
491
+ });
573
492
  }
574
493
  }
575
- const _ImagePreview = (options) => {
576
- return new ImagePreviewFunction(options);
577
- };
494
+ const _ImagePreview = (options) => new ImagePreviewFunction(options);
578
495
  _ImagePreview.install = (app) => {
579
496
  app.use(ImagePreview);
580
497
  app.config.globalProperties.$imagepreview = _ImagePreview;
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.7 Fri Dec 02 2022 14:12:17 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { toRefs, computed, openBlock, createElementBlock, normalizeClass, Fragment, renderList, toDisplayString } from "vue";
7
- import { c as createComponent } from "./component.js";
7
+ import { p as padZero, c as createComponent } from "./component.js";
8
8
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
9
  import "../locale/lang";
10
10
  const { componentName, create } = createComponent("indicator");
@@ -43,7 +43,7 @@ const _sfc_main = create({
43
43
  [`${prefixCls}--align__${align.value}`]: block.value && align.value
44
44
  };
45
45
  });
46
- return { classes, componentName };
46
+ return { classes, componentName, padZero };
47
47
  }
48
48
  });
49
49
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -55,7 +55,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
55
55
  item === _ctx.current ? (openBlock(), createElementBlock("view", {
56
56
  key: 0,
57
57
  class: normalizeClass(`${_ctx.componentName}--number`)
58
- }, toDisplayString(_ctx.fillZero && item < 10 ? `0${item}` : item), 3)) : (openBlock(), createElementBlock("view", {
58
+ }, toDisplayString(_ctx.fillZero && _ctx.padZero(item) || item), 3)) : (openBlock(), createElementBlock("view", {
59
59
  key: 1,
60
60
  class: normalizeClass(`${_ctx.componentName}--dot`)
61
61
  }, null, 2))
@@ -1,10 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.2.7 Fri Dec 02 2022 14:12:17 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { reactive, computed, onMounted, onUnmounted, ref, onActivated, onDeactivated, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createVNode, mergeProps, toDisplayString, renderSlot, Fragment, createCommentVNode } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
+ import { u as useTouch } from "./index4.js";
8
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
10
  import "../locale/lang";
10
11
  const { componentName, create, translate } = createComponent("infiniteloading");
@@ -57,6 +58,7 @@ const _sfc_main = create({
57
58
  },
58
59
  emits: ["scroll-change", "load-more", "refresh"],
59
60
  setup(props, { emit, slots }) {
61
+ const touch = useTouch();
60
62
  const state = reactive({
61
63
  scrollEl: window,
62
64
  scroller: null,
@@ -137,6 +139,7 @@ const _sfc_main = create({
137
139
  state.isTouching = false;
138
140
  };
139
141
  const touchStart = (event) => {
142
+ touch.start(event);
140
143
  if (state.beforeScrollTop == 0 && !state.isTouching && props.isOpenRefresh) {
141
144
  state.y = event.touches[0].pageY;
142
145
  state.isTouching = true;
@@ -145,8 +148,9 @@ const _sfc_main = create({
145
148
  }
146
149
  };
147
150
  const touchMove = (event) => {
151
+ touch.move(event);
148
152
  state.distance = event.touches[0].pageY - state.y;
149
- if (state.distance > 0 && state.isTouching) {
153
+ if (touch.isVertical() && state.distance > 0 && state.isTouching) {
150
154
  event.preventDefault();
151
155
  if (state.distance >= state.refreshMaxH)
152
156
  state.distance = state.refreshMaxH;
@@ -163,6 +167,9 @@ const _sfc_main = create({
163
167
  emit("refresh", refreshDone);
164
168
  }
165
169
  }
170
+ setTimeout(() => {
171
+ touch.reset();
172
+ }, 0);
166
173
  };
167
174
  const getParentElement = (el) => {
168
175
  return !!props.containerId ? document.querySelector(`#${props.containerId}`) : el && el.parentNode;