@varlet/ui 2.16.7 → 2.16.8-alpha.1695118057982

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 (348) hide show
  1. package/es/action-sheet/ActionSheet.mjs +97 -67
  2. package/es/action-sheet/index.mjs +43 -28
  3. package/es/action-sheet/props.mjs +39 -8
  4. package/es/app-bar/AppBar.mjs +129 -56
  5. package/es/app-bar/index.mjs +10 -5
  6. package/es/app-bar/props.mjs +6 -3
  7. package/es/avatar/Avatar.mjs +97 -87
  8. package/es/avatar/index.mjs +10 -5
  9. package/es/avatar/props.mjs +8 -5
  10. package/es/avatar-group/AvatarGroup.mjs +26 -20
  11. package/es/avatar-group/index.mjs +10 -5
  12. package/es/avatar-group/props.mjs +5 -2
  13. package/es/back-top/BackTop.mjs +71 -53
  14. package/es/back-top/index.mjs +10 -5
  15. package/es/back-top/props.mjs +6 -3
  16. package/es/badge/Badge.mjs +74 -46
  17. package/es/badge/index.mjs +10 -5
  18. package/es/badge/props.mjs +7 -4
  19. package/es/bottom-navigation/BottomNavigation.mjs +100 -97
  20. package/es/bottom-navigation/index.mjs +10 -5
  21. package/es/bottom-navigation/props.mjs +7 -4
  22. package/es/bottom-navigation/provide.mjs +13 -9
  23. package/es/bottom-navigation-item/BottomNavigationItem.mjs +93 -74
  24. package/es/bottom-navigation-item/index.mjs +10 -5
  25. package/es/bottom-navigation-item/props.mjs +7 -4
  26. package/es/bottom-navigation-item/provide.mjs +14 -11
  27. package/es/breadcrumb/Breadcrumb.mjs +51 -36
  28. package/es/breadcrumb/index.mjs +10 -5
  29. package/es/breadcrumb/props.mjs +6 -3
  30. package/es/breadcrumb/provide.mjs +12 -11
  31. package/es/breadcrumbs/Breadcrumbs.mjs +26 -24
  32. package/es/breadcrumbs/index.mjs +10 -5
  33. package/es/breadcrumbs/props.mjs +6 -3
  34. package/es/breadcrumbs/provide.mjs +11 -9
  35. package/es/button/Button.mjs +88 -90
  36. package/es/button/index.mjs +10 -5
  37. package/es/button/props.mjs +31 -10
  38. package/es/button/provide.mjs +8 -9
  39. package/es/button-group/ButtonGroup.mjs +38 -26
  40. package/es/button-group/index.mjs +8 -4
  41. package/es/button-group/props.mjs +8 -5
  42. package/es/button-group/provide.mjs +9 -9
  43. package/es/card/Card.mjs +292 -189
  44. package/es/card/index.mjs +10 -5
  45. package/es/card/props.mjs +9 -6
  46. package/es/cell/Cell.mjs +96 -52
  47. package/es/cell/index.mjs +10 -5
  48. package/es/cell/props.mjs +6 -3
  49. package/es/checkbox/Checkbox.mjs +136 -130
  50. package/es/checkbox/index.mjs +10 -5
  51. package/es/checkbox/props.mjs +9 -6
  52. package/es/checkbox/provide.mjs +10 -9
  53. package/es/checkbox-group/CheckboxGroup.mjs +63 -96
  54. package/es/checkbox-group/index.mjs +10 -5
  55. package/es/checkbox-group/props.mjs +9 -6
  56. package/es/checkbox-group/provide.mjs +11 -9
  57. package/es/chip/Chip.mjs +66 -50
  58. package/es/chip/index.mjs +10 -5
  59. package/es/chip/props.mjs +10 -7
  60. package/es/col/Col.mjs +60 -55
  61. package/es/col/index.mjs +10 -5
  62. package/es/col/props.mjs +7 -4
  63. package/es/col/provide.mjs +8 -9
  64. package/es/collapse/Collapse.mjs +70 -73
  65. package/es/collapse/index.mjs +10 -5
  66. package/es/collapse/props.mjs +7 -4
  67. package/es/collapse/provide.mjs +11 -9
  68. package/es/collapse-item/CollapseItem.mjs +156 -93
  69. package/es/collapse-item/index.mjs +10 -5
  70. package/es/collapse-item/props.mjs +6 -3
  71. package/es/collapse-item/provide.mjs +12 -11
  72. package/es/context/index.mjs +9 -5
  73. package/es/context/lock.mjs +18 -22
  74. package/es/context/zIndex.mjs +19 -16
  75. package/es/countdown/Countdown.mjs +73 -70
  76. package/es/countdown/index.mjs +10 -5
  77. package/es/countdown/props.mjs +7 -4
  78. package/es/counter/Counter.mjs +169 -173
  79. package/es/counter/index.mjs +10 -5
  80. package/es/counter/props.mjs +8 -5
  81. package/es/counter/provide.ts +3 -0
  82. package/es/date-picker/DatePicker.mjs +411 -304
  83. package/es/date-picker/index.mjs +10 -5
  84. package/es/date-picker/props.mjs +71 -45
  85. package/es/date-picker/src/day-picker-panel.mjs +270 -208
  86. package/es/date-picker/src/month-picker-panel.mjs +205 -175
  87. package/es/date-picker/src/panel-header.mjs +101 -83
  88. package/es/date-picker/src/year-picker-panel.mjs +64 -54
  89. package/es/dialog/Dialog.mjs +171 -106
  90. package/es/dialog/index.mjs +49 -33
  91. package/es/dialog/props.mjs +39 -9
  92. package/es/divider/Divider.mjs +56 -51
  93. package/es/divider/index.mjs +10 -5
  94. package/es/divider/props.mjs +5 -2
  95. package/es/drag/Drag.mjs +126 -144
  96. package/es/drag/index.mjs +10 -5
  97. package/es/drag/props.mjs +8 -5
  98. package/es/ellipsis/Ellipsis.mjs +81 -50
  99. package/es/ellipsis/index.mjs +8 -4
  100. package/es/ellipsis/props.mjs +5 -2
  101. package/es/fab/Fab.mjs +73 -75
  102. package/es/fab/index.mjs +8 -4
  103. package/es/fab/props.mjs +14 -11
  104. package/es/field-decorator/FieldDecorator.mjs +215 -110
  105. package/es/field-decorator/props.mjs +9 -6
  106. package/es/form/Form.mjs +69 -79
  107. package/es/form/index.mjs +11 -6
  108. package/es/form/props.mjs +6 -3
  109. package/es/form/provide.mjs +35 -22
  110. package/es/form-details/FormDetails.mjs +81 -39
  111. package/es/form-details/index.mjs +10 -5
  112. package/es/form-details/props.mjs +7 -4
  113. package/es/hover/index.mjs +37 -40
  114. package/es/hover-overlay/HoverOverlay.mjs +18 -14
  115. package/es/hover-overlay/index.mjs +13 -8
  116. package/es/hover-overlay/props.mjs +5 -2
  117. package/es/icon/Icon.mjs +50 -33
  118. package/es/icon/index.mjs +10 -5
  119. package/es/icon/props.mjs +7 -4
  120. package/es/image/Image.mjs +76 -82
  121. package/es/image/index.mjs +10 -5
  122. package/es/image/props.mjs +7 -4
  123. package/es/image-preview/ImagePreview.mjs +176 -193
  124. package/es/image-preview/index.mjs +44 -30
  125. package/es/image-preview/props.mjs +34 -9
  126. package/es/index-anchor/IndexAnchor.mjs +45 -42
  127. package/es/index-anchor/index.mjs +10 -5
  128. package/es/index-anchor/props.mjs +5 -2
  129. package/es/index-anchor/provide.mjs +12 -11
  130. package/es/index-bar/IndexBar.mjs +130 -131
  131. package/es/index-bar/index.mjs +10 -5
  132. package/es/index-bar/props.mjs +6 -3
  133. package/es/index-bar/provide.mjs +11 -9
  134. package/es/index.bundle.mjs +1 -1
  135. package/es/index.mjs +1 -1
  136. package/es/input/Input.mjs +231 -247
  137. package/es/input/index.mjs +10 -5
  138. package/es/input/props.mjs +38 -8
  139. package/es/input/provide.ts +3 -0
  140. package/es/lazy/index.mjs +94 -87
  141. package/es/link/Link.mjs +39 -45
  142. package/es/link/index.mjs +10 -5
  143. package/es/link/props.mjs +8 -5
  144. package/es/list/List.mjs +144 -97
  145. package/es/list/index.mjs +10 -5
  146. package/es/list/props.mjs +8 -5
  147. package/es/list/provide.mjs +8 -9
  148. package/es/loading/Loading.mjs +165 -72
  149. package/es/loading/index.mjs +10 -5
  150. package/es/loading/props.mjs +7 -4
  151. package/es/loading-bar/LoadingBar.mjs +19 -16
  152. package/es/loading-bar/index.mjs +37 -30
  153. package/es/loading-bar/props.mjs +5 -2
  154. package/es/locale/en-US.mjs +76 -73
  155. package/es/locale/index.mjs +52 -41
  156. package/es/locale/zh-CN.mjs +76 -73
  157. package/es/menu/Menu.mjs +76 -57
  158. package/es/menu/index.mjs +10 -5
  159. package/es/menu/props.mjs +11 -8
  160. package/es/menu/usePopover.mjs +214 -207
  161. package/es/option/Option.mjs +86 -70
  162. package/es/option/index.mjs +10 -5
  163. package/es/option/props.mjs +5 -2
  164. package/es/option/provide.mjs +10 -11
  165. package/es/overlay/Overlay.mjs +29 -31
  166. package/es/overlay/index.mjs +10 -5
  167. package/es/overlay/props.mjs +7 -4
  168. package/es/pagination/Pagination.mjs +334 -202
  169. package/es/pagination/index.mjs +10 -5
  170. package/es/pagination/props.mjs +8 -5
  171. package/es/paper/Paper.mjs +43 -31
  172. package/es/paper/index.mjs +10 -5
  173. package/es/paper/props.mjs +6 -3
  174. package/es/picker/Picker.mjs +288 -224
  175. package/es/picker/index.mjs +24 -23
  176. package/es/picker/props.mjs +37 -7
  177. package/es/popup/Popup.mjs +68 -58
  178. package/es/popup/index.mjs +10 -5
  179. package/es/popup/props.mjs +9 -6
  180. package/es/popup/provide.mjs +12 -15
  181. package/es/progress/Progress.mjs +186 -114
  182. package/es/progress/index.mjs +10 -5
  183. package/es/progress/props.mjs +7 -4
  184. package/es/pull-refresh/PullRefresh.mjs +136 -116
  185. package/es/pull-refresh/index.mjs +10 -5
  186. package/es/pull-refresh/props.mjs +8 -5
  187. package/es/radio/Radio.mjs +122 -118
  188. package/es/radio/index.mjs +10 -5
  189. package/es/radio/props.mjs +8 -5
  190. package/es/radio/provide.mjs +8 -9
  191. package/es/radio-group/RadioGroup.mjs +50 -58
  192. package/es/radio-group/index.mjs +10 -5
  193. package/es/radio-group/props.mjs +10 -7
  194. package/es/radio-group/provide.mjs +11 -9
  195. package/es/rate/Rate.mjs +103 -132
  196. package/es/rate/index.mjs +10 -5
  197. package/es/rate/props.mjs +10 -7
  198. package/es/rate/provide.ts +3 -0
  199. package/es/result/Empty.mjs +21 -12
  200. package/es/result/Error.mjs +18 -9
  201. package/es/result/Info.mjs +18 -9
  202. package/es/result/Question.mjs +18 -9
  203. package/es/result/Result.mjs +102 -55
  204. package/es/result/Success.mjs +84 -40
  205. package/es/result/Warning.mjs +18 -9
  206. package/es/result/index.mjs +10 -5
  207. package/es/result/props.mjs +6 -3
  208. package/es/ripple/index.mjs +89 -101
  209. package/es/row/Row.mjs +40 -45
  210. package/es/row/index.mjs +10 -5
  211. package/es/row/props.mjs +8 -5
  212. package/es/row/provide.mjs +9 -9
  213. package/es/select/Select.mjs +308 -298
  214. package/es/select/index.mjs +10 -5
  215. package/es/select/props.mjs +40 -10
  216. package/es/select/provide.mjs +9 -9
  217. package/es/skeleton/Skeleton.mjs +182 -71
  218. package/es/skeleton/index.mjs +10 -5
  219. package/es/skeleton/props.mjs +5 -2
  220. package/es/slider/Slider.mjs +310 -260
  221. package/es/slider/index.mjs +10 -5
  222. package/es/slider/props.mjs +15 -11
  223. package/es/slider/provide.ts +3 -0
  224. package/es/snackbar/Snackbar.mjs +47 -34
  225. package/es/snackbar/core.mjs +140 -77
  226. package/es/snackbar/index.mjs +111 -97
  227. package/es/snackbar/props.mjs +35 -14
  228. package/es/space/Space.mjs +30 -28
  229. package/es/space/index.mjs +10 -5
  230. package/es/space/margin.mjs +22 -23
  231. package/es/space/props.mjs +8 -5
  232. package/es/step/Step.mjs +96 -74
  233. package/es/step/index.mjs +10 -5
  234. package/es/step/props.mjs +6 -3
  235. package/es/step/provide.mjs +10 -11
  236. package/es/steps/Steps.mjs +31 -30
  237. package/es/steps/index.mjs +10 -5
  238. package/es/steps/props.mjs +7 -4
  239. package/es/steps/provide.mjs +9 -8
  240. package/es/sticky/Sticky.mjs +104 -92
  241. package/es/sticky/index.mjs +10 -5
  242. package/es/sticky/props.mjs +6 -3
  243. package/es/style-provider/StyleProvider.mjs +19 -18
  244. package/es/style-provider/index.mjs +15 -11
  245. package/es/style-provider/props.mjs +6 -3
  246. package/es/swipe/Swipe.mjs +281 -268
  247. package/es/swipe/index.mjs +10 -5
  248. package/es/swipe/props.mjs +6 -3
  249. package/es/swipe/provide.mjs +11 -9
  250. package/es/swipe-item/SwipeItem.mjs +29 -29
  251. package/es/swipe-item/index.mjs +8 -4
  252. package/es/swipe-item/provide.mjs +10 -11
  253. package/es/switch/Switch.mjs +143 -103
  254. package/es/switch/index.mjs +10 -5
  255. package/es/switch/props.mjs +7 -4
  256. package/es/switch/provide.ts +3 -0
  257. package/es/tab/Tab.mjs +48 -61
  258. package/es/tab/index.mjs +10 -5
  259. package/es/tab/props.mjs +6 -3
  260. package/es/tab/provide.mjs +10 -11
  261. package/es/tab-item/TabItem.mjs +27 -32
  262. package/es/tab-item/index.mjs +10 -5
  263. package/es/tab-item/props.mjs +5 -2
  264. package/es/tab-item/provide.mjs +17 -18
  265. package/es/table/Table.mjs +54 -25
  266. package/es/table/index.mjs +10 -5
  267. package/es/table/props.mjs +6 -3
  268. package/es/tabs/Tabs.mjs +162 -134
  269. package/es/tabs/index.mjs +10 -5
  270. package/es/tabs/props.mjs +15 -12
  271. package/es/tabs/provide.mjs +9 -9
  272. package/es/tabs-items/TabsItems.mjs +61 -65
  273. package/es/tabs-items/index.mjs +10 -5
  274. package/es/tabs-items/props.mjs +7 -4
  275. package/es/tabs-items/provide.mjs +11 -9
  276. package/es/themes/dark/actionSheet.mjs +8 -5
  277. package/es/themes/dark/appBar.mjs +6 -3
  278. package/es/themes/dark/avatar.mjs +7 -4
  279. package/es/themes/dark/badge.mjs +6 -3
  280. package/es/themes/dark/bottomNavigation.mjs +7 -4
  281. package/es/themes/dark/bottomNavigationItem.mjs +6 -3
  282. package/es/themes/dark/breadcrumb.mjs +6 -3
  283. package/es/themes/dark/button.mjs +7 -4
  284. package/es/themes/dark/card.mjs +10 -7
  285. package/es/themes/dark/cell.mjs +7 -4
  286. package/es/themes/dark/checkbox.mjs +7 -4
  287. package/es/themes/dark/chip.mjs +7 -4
  288. package/es/themes/dark/collapse.mjs +8 -5
  289. package/es/themes/dark/countdown.mjs +6 -3
  290. package/es/themes/dark/datePicker.mjs +10 -7
  291. package/es/themes/dark/dialog.mjs +8 -5
  292. package/es/themes/dark/divider.mjs +7 -4
  293. package/es/themes/dark/fieldDecorator.mjs +7 -4
  294. package/es/themes/dark/index.mjs +69 -51
  295. package/es/themes/dark/link.mjs +6 -3
  296. package/es/themes/dark/menu.mjs +6 -3
  297. package/es/themes/dark/option.mjs +6 -3
  298. package/es/themes/dark/pagination.mjs +11 -8
  299. package/es/themes/dark/paper.mjs +6 -3
  300. package/es/themes/dark/picker.mjs +11 -8
  301. package/es/themes/dark/popup.mjs +6 -3
  302. package/es/themes/dark/progress.mjs +6 -3
  303. package/es/themes/dark/pullRefresh.mjs +6 -3
  304. package/es/themes/dark/radio.mjs +7 -4
  305. package/es/themes/dark/result.mjs +12 -9
  306. package/es/themes/dark/select.mjs +6 -3
  307. package/es/themes/dark/skeleton.mjs +11 -6
  308. package/es/themes/dark/steps.mjs +8 -5
  309. package/es/themes/dark/switch.mjs +7 -4
  310. package/es/themes/dark/tab.mjs +6 -3
  311. package/es/themes/dark/table.mjs +12 -9
  312. package/es/themes/dark/tabs.mjs +6 -3
  313. package/es/themes/dark/timePicker.mjs +9 -6
  314. package/es/themes/dark/uploader.mjs +10 -7
  315. package/es/themes/dark/watermark.mjs +6 -3
  316. package/es/themes/index.mjs +7 -5
  317. package/es/time-picker/TimePicker.mjs +297 -232
  318. package/es/time-picker/clock.mjs +222 -172
  319. package/es/time-picker/index.mjs +10 -5
  320. package/es/time-picker/props.mjs +14 -8
  321. package/es/time-picker/utils.mjs +46 -86
  322. package/es/tooltip/Tooltip.mjs +82 -62
  323. package/es/tooltip/index.mjs +10 -5
  324. package/es/tooltip/props.mjs +12 -9
  325. package/es/uploader/Uploader.mjs +315 -308
  326. package/es/uploader/index.mjs +10 -5
  327. package/es/uploader/props.mjs +10 -7
  328. package/es/uploader/provide.ts +3 -0
  329. package/es/utils/components.mjs +158 -127
  330. package/es/utils/elements.mjs +106 -123
  331. package/es/utils/logger.mjs +9 -5
  332. package/es/utils/shared.mjs +25 -23
  333. package/es/utils/test.mjs +105 -93
  334. package/es/varlet.esm.js +12464 -13425
  335. package/es/watermark/Watermark.mjs +191 -109
  336. package/es/watermark/index.mjs +8 -4
  337. package/es/watermark/props.mjs +8 -5
  338. package/highlight/web-types.en-US.json +3 -3
  339. package/highlight/web-types.zh-CN.json +2 -2
  340. package/lib/varlet.cjs.js +9187 -10199
  341. package/package.json +7 -7
  342. package/umd/varlet.js +4 -4
  343. package/es/counter/provide.mjs +0 -1
  344. package/es/input/provide.mjs +0 -1
  345. package/es/rate/provide.mjs +0 -1
  346. package/es/slider/provide.mjs +0 -1
  347. package/es/switch/provide.mjs +0 -1
  348. package/es/uploader/provide.mjs +0 -1
@@ -1,157 +1,218 @@
1
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
3
- import VarButton from '../button/index.mjs';
4
- import VarIcon from '../icon/index.mjs';
5
- import Hover from '../hover/index.mjs';
6
- import { defineComponent, ref, computed, watch, onActivated } from 'vue';
7
- import { useSwipeItems } from './provide.mjs';
8
- import { props } from './props.mjs';
9
- import { clamp, isNumber, toNumber, doubleRaf } from '@varlet/shared';
10
- import { call, createNamespace } from '../utils/components.mjs';
11
- import { onSmartUnmounted, onWindowResize, useTouch } from '@varlet/use';
12
- import { usePopup } from '../popup/provide.mjs';
13
- var SWIPE_DELAY = 250;
14
- var SWIPE_OFFSET = 20;
15
- var {
16
- name,
17
- n,
18
- classes
19
- } = createNamespace('swipe');
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import VarButton from "../button/index.mjs";
22
+ import VarIcon from "../icon/index.mjs";
23
+ import Hover from "../hover/index.mjs";
24
+ import { defineComponent, ref, computed, watch, onActivated } from "vue";
25
+ import { useSwipeItems } from "./provide.mjs";
26
+ import { props } from "./props.mjs";
27
+ import { clamp, isNumber, toNumber, doubleRaf } from "@varlet/shared";
28
+ import { call, createNamespace } from "../utils/components.mjs";
29
+ import { onSmartUnmounted, onWindowResize, useTouch } from "@varlet/use";
30
+ import { usePopup } from "../popup/provide.mjs";
31
+ const SWIPE_DELAY = 250;
32
+ const SWIPE_OFFSET = 20;
33
+ const { name, n, classes } = createNamespace("swipe");
20
34
  import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Transition as _Transition, mergeProps as _mergeProps, renderList as _renderList, Fragment as _Fragment, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
21
- var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
22
- var _hoisted_1 = ["onClick"];
35
+ const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
36
+ const _hoisted_1 = ["onClick"];
23
37
  function __render__(_ctx, _cache) {
24
- var _component_var_icon = _resolveComponent("var-icon");
25
- var _component_var_button = _resolveComponent("var-button");
26
- var _directive_hover = _resolveDirective("hover");
27
- return _withDirectives((_openBlock(), _createElementBlock("div", {
28
- class: _normalizeClass(_ctx.n()),
29
- ref: "swipeEl"
30
- }, [_createElementVNode("div", {
31
- class: _normalizeClass(_ctx.classes(_ctx.n('track'), [_ctx.vertical, _ctx.n('--vertical')])),
32
- style: _normalizeStyle({
33
- width: !_ctx.vertical ? _ctx.trackSize + "px" : undefined,
34
- height: _ctx.vertical ? _ctx.trackSize + "px" : undefined,
35
- transform: "translate" + (_ctx.vertical ? 'Y' : 'X') + "(" + _ctx.trackTranslate + "px)",
36
- transitionDuration: _ctx.lockDuration ? "0ms" : _ctx.toNumber(_ctx.duration) + "ms"
37
- }),
38
- onTouchstart: _cache[0] || (_cache[0] = function () {
39
- return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
40
- }),
41
- onTouchmove: _cache[1] || (_cache[1] = function () {
42
- return _ctx.handleTouchmove && _ctx.handleTouchmove(...arguments);
43
- }),
44
- onTouchend: _cache[2] || (_cache[2] = function () {
45
- return _ctx.handleTouchend && _ctx.handleTouchend(...arguments);
46
- })
47
- }, [_renderSlot(_ctx.$slots, "default")], 38 /* CLASS, STYLE, HYDRATE_EVENTS */), _ctx.navigation ? _renderSlot(_ctx.$slots, "prev", _normalizeProps(_mergeProps({
48
- key: 0
49
- }, {
50
- index: _ctx.index,
51
- length: _ctx.length,
52
- prev: _ctx.prev,
53
- next: _ctx.next,
54
- to: _ctx.to,
55
- hovering: _ctx.hovering
56
- })), () => [_createVNode(_Transition, {
57
- name: _ctx.getNavigationAnimation('prev')
58
- }, {
59
- default: _withCtx(() => [_ctx.navigation === true || _ctx.hovering ? (_openBlock(), _createElementBlock("div", {
60
- key: 0,
61
- class: _normalizeClass(_ctx.classes(_ctx.n('navigation'), _ctx.n('navigation-prev'), [_ctx.vertical, _ctx.n('--navigation-vertical-prev')]))
62
- }, [_createVNode(_component_var_button, {
63
- "var-swipe-cover": "",
64
- disabled: !_ctx.loop && _ctx.index === 0,
65
- class: _normalizeClass(_ctx.n('navigation-prev-button')),
66
- onClick: _cache[3] || (_cache[3] = $event => _ctx.prev())
67
- }, {
68
- default: _withCtx(() => [_createVNode(_component_var_icon, {
69
- "var-swipe-cover": "",
70
- class: _normalizeClass(_ctx.n('navigation-prev-button-icon')),
71
- name: _ctx.vertical ? 'chevron-up' : 'chevron-left'
72
- }, null, 8 /* PROPS */, ["class", "name"])]),
73
- _: 1 /* STABLE */
74
- }, 8 /* PROPS */, ["disabled", "class"])], 2 /* CLASS */)) : _createCommentVNode("v-if", true)]),
75
- _: 1 /* STABLE */
76
- }, 8 /* PROPS */, ["name"])]) : _createCommentVNode("v-if", true), _ctx.navigation ? _renderSlot(_ctx.$slots, "next", _normalizeProps(_mergeProps({
77
- key: 1
78
- }, {
79
- index: _ctx.index,
80
- length: _ctx.length,
81
- hovering: _ctx.hovering,
82
- prev: _ctx.prev,
83
- next: _ctx.next,
84
- to: _ctx.to
85
- })), () => [_createVNode(_Transition, {
86
- name: _ctx.getNavigationAnimation('next')
87
- }, {
88
- default: _withCtx(() => [_ctx.navigation === true || _ctx.hovering ? (_openBlock(), _createElementBlock("div", {
89
- key: 0,
90
- class: _normalizeClass(_ctx.classes(_ctx.n('navigation'), _ctx.n('navigation-next'), [_ctx.vertical, _ctx.n('--navigation-vertical-next')]))
91
- }, [_createVNode(_component_var_button, {
92
- "var-swipe-cover": "",
93
- class: _normalizeClass(_ctx.n('navigation-next-button')),
94
- disabled: !_ctx.loop && _ctx.index === _ctx.length - 1,
95
- onClick: _cache[4] || (_cache[4] = $event => _ctx.next())
96
- }, {
97
- default: _withCtx(() => [_createVNode(_component_var_icon, {
98
- "var-swipe-cover": "",
99
- class: _normalizeClass(_ctx.n('navigation-next-button-icon')),
100
- name: _ctx.vertical ? 'chevron-down' : 'chevron-right'
101
- }, null, 8 /* PROPS */, ["class", "name"])]),
102
- _: 1 /* STABLE */
103
- }, 8 /* PROPS */, ["class", "disabled"])], 2 /* CLASS */)) : _createCommentVNode("v-if", true)]),
104
- _: 1 /* STABLE */
105
- }, 8 /* PROPS */, ["name"])]) : _createCommentVNode("v-if", true), _renderSlot(_ctx.$slots, "indicator", _normalizeProps(_guardReactiveProps({
106
- index: _ctx.index,
107
- length: _ctx.length,
108
- hovering: _ctx.hovering,
109
- prev: _ctx.prev,
110
- next: _ctx.next,
111
- to: _ctx.to
112
- })), () => [_ctx.indicator && _ctx.length ? (_openBlock(), _createElementBlock("div", {
113
- key: 0,
114
- class: _normalizeClass(_ctx.classes(_ctx.n('indicators'), [_ctx.vertical, _ctx.n('--indicators-vertical')]))
115
- }, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.length, (l, idx) => {
116
- return _openBlock(), _createElementBlock("div", {
117
- class: _normalizeClass(_ctx.classes(_ctx.n('indicator'), [_ctx.index === idx, _ctx.n('--indicator-active')], [_ctx.vertical, _ctx.n('--indicator-vertical')])),
118
- style: _normalizeStyle({
119
- background: _ctx.indicatorColor
120
- }),
121
- key: l,
122
- onClick: $event => _ctx.to(idx)
123
- }, null, 14 /* CLASS, STYLE, PROPS */, _hoisted_1);
124
- }), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */)) : _createCommentVNode("v-if", true)])], 2 /* CLASS */)), [[_directive_hover, _ctx.handleHovering]]);
38
+ const _component_var_icon = _resolveComponent("var-icon");
39
+ const _component_var_button = _resolveComponent("var-button");
40
+ const _directive_hover = _resolveDirective("hover");
41
+ return _withDirectives((_openBlock(), _createElementBlock(
42
+ "div",
43
+ {
44
+ class: _normalizeClass(_ctx.n()),
45
+ ref: "swipeEl"
46
+ },
47
+ [
48
+ _createElementVNode(
49
+ "div",
50
+ {
51
+ class: _normalizeClass(_ctx.classes(_ctx.n("track"), [_ctx.vertical, _ctx.n("--vertical")])),
52
+ style: _normalizeStyle({
53
+ width: !_ctx.vertical ? `${_ctx.trackSize}px` : void 0,
54
+ height: _ctx.vertical ? `${_ctx.trackSize}px` : void 0,
55
+ transform: `translate${_ctx.vertical ? "Y" : "X"}(${_ctx.trackTranslate}px)`,
56
+ transitionDuration: _ctx.lockDuration ? `0ms` : `${_ctx.toNumber(_ctx.duration)}ms`
57
+ }),
58
+ onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.handleTouchstart && _ctx.handleTouchstart(...args)),
59
+ onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.handleTouchmove && _ctx.handleTouchmove(...args)),
60
+ onTouchend: _cache[2] || (_cache[2] = (...args) => _ctx.handleTouchend && _ctx.handleTouchend(...args))
61
+ },
62
+ [
63
+ _renderSlot(_ctx.$slots, "default")
64
+ ],
65
+ 38
66
+ /* CLASS, STYLE, HYDRATE_EVENTS */
67
+ ),
68
+ _ctx.navigation ? _renderSlot(_ctx.$slots, "prev", _normalizeProps(_mergeProps({ key: 0 }, {
69
+ index: _ctx.index,
70
+ length: _ctx.length,
71
+ prev: _ctx.prev,
72
+ next: _ctx.next,
73
+ to: _ctx.to,
74
+ hovering: _ctx.hovering
75
+ })), () => [
76
+ _createVNode(_Transition, {
77
+ name: _ctx.getNavigationAnimation("prev")
78
+ }, {
79
+ default: _withCtx(() => [
80
+ _ctx.navigation === true || _ctx.hovering ? (_openBlock(), _createElementBlock(
81
+ "div",
82
+ {
83
+ key: 0,
84
+ class: _normalizeClass(_ctx.classes(_ctx.n("navigation"), _ctx.n("navigation-prev"), [_ctx.vertical, _ctx.n("--navigation-vertical-prev")]))
85
+ },
86
+ [
87
+ _createVNode(_component_var_button, {
88
+ "var-swipe-cover": "",
89
+ disabled: !_ctx.loop && _ctx.index === 0,
90
+ class: _normalizeClass(_ctx.n("navigation-prev-button")),
91
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.prev())
92
+ }, {
93
+ default: _withCtx(() => [
94
+ _createVNode(_component_var_icon, {
95
+ "var-swipe-cover": "",
96
+ class: _normalizeClass(_ctx.n("navigation-prev-button-icon")),
97
+ name: _ctx.vertical ? "chevron-up" : "chevron-left"
98
+ }, null, 8, ["class", "name"])
99
+ ]),
100
+ _: 1
101
+ /* STABLE */
102
+ }, 8, ["disabled", "class"])
103
+ ],
104
+ 2
105
+ /* CLASS */
106
+ )) : _createCommentVNode("v-if", true)
107
+ ]),
108
+ _: 1
109
+ /* STABLE */
110
+ }, 8, ["name"])
111
+ ]) : _createCommentVNode("v-if", true),
112
+ _ctx.navigation ? _renderSlot(_ctx.$slots, "next", _normalizeProps(_mergeProps({ key: 1 }, {
113
+ index: _ctx.index,
114
+ length: _ctx.length,
115
+ hovering: _ctx.hovering,
116
+ prev: _ctx.prev,
117
+ next: _ctx.next,
118
+ to: _ctx.to
119
+ })), () => [
120
+ _createVNode(_Transition, {
121
+ name: _ctx.getNavigationAnimation("next")
122
+ }, {
123
+ default: _withCtx(() => [
124
+ _ctx.navigation === true || _ctx.hovering ? (_openBlock(), _createElementBlock(
125
+ "div",
126
+ {
127
+ key: 0,
128
+ class: _normalizeClass(_ctx.classes(_ctx.n("navigation"), _ctx.n("navigation-next"), [_ctx.vertical, _ctx.n("--navigation-vertical-next")]))
129
+ },
130
+ [
131
+ _createVNode(_component_var_button, {
132
+ "var-swipe-cover": "",
133
+ class: _normalizeClass(_ctx.n("navigation-next-button")),
134
+ disabled: !_ctx.loop && _ctx.index === _ctx.length - 1,
135
+ onClick: _cache[4] || (_cache[4] = ($event) => _ctx.next())
136
+ }, {
137
+ default: _withCtx(() => [
138
+ _createVNode(_component_var_icon, {
139
+ "var-swipe-cover": "",
140
+ class: _normalizeClass(_ctx.n("navigation-next-button-icon")),
141
+ name: _ctx.vertical ? "chevron-down" : "chevron-right"
142
+ }, null, 8, ["class", "name"])
143
+ ]),
144
+ _: 1
145
+ /* STABLE */
146
+ }, 8, ["class", "disabled"])
147
+ ],
148
+ 2
149
+ /* CLASS */
150
+ )) : _createCommentVNode("v-if", true)
151
+ ]),
152
+ _: 1
153
+ /* STABLE */
154
+ }, 8, ["name"])
155
+ ]) : _createCommentVNode("v-if", true),
156
+ _renderSlot(_ctx.$slots, "indicator", _normalizeProps(_guardReactiveProps({
157
+ index: _ctx.index,
158
+ length: _ctx.length,
159
+ hovering: _ctx.hovering,
160
+ prev: _ctx.prev,
161
+ next: _ctx.next,
162
+ to: _ctx.to
163
+ })), () => [
164
+ _ctx.indicator && _ctx.length ? (_openBlock(), _createElementBlock(
165
+ "div",
166
+ {
167
+ key: 0,
168
+ class: _normalizeClass(_ctx.classes(_ctx.n("indicators"), [_ctx.vertical, _ctx.n("--indicators-vertical")]))
169
+ },
170
+ [
171
+ (_openBlock(true), _createElementBlock(
172
+ _Fragment,
173
+ null,
174
+ _renderList(_ctx.length, (l, idx) => {
175
+ return _openBlock(), _createElementBlock("div", {
176
+ class: _normalizeClass(
177
+ _ctx.classes(_ctx.n("indicator"), [_ctx.index === idx, _ctx.n("--indicator-active")], [_ctx.vertical, _ctx.n("--indicator-vertical")])
178
+ ),
179
+ style: _normalizeStyle({ background: _ctx.indicatorColor }),
180
+ key: l,
181
+ onClick: ($event) => _ctx.to(idx)
182
+ }, null, 14, _hoisted_1);
183
+ }),
184
+ 128
185
+ /* KEYED_FRAGMENT */
186
+ ))
187
+ ],
188
+ 2
189
+ /* CLASS */
190
+ )) : _createCommentVNode("v-if", true)
191
+ ])
192
+ ],
193
+ 2
194
+ /* CLASS */
195
+ )), [
196
+ [_directive_hover, _ctx.handleHovering]
197
+ ]);
125
198
  }
126
- var __sfc__ = defineComponent({
199
+ const __sfc__ = defineComponent({
127
200
  name,
128
- directives: {
129
- Hover
130
- },
131
- components: {
132
- VarButton,
133
- VarIcon
134
- },
201
+ directives: { Hover },
202
+ components: { VarButton, VarIcon },
135
203
  props,
136
- setup(props) {
137
- var swipeEl = ref(null);
138
- var size = ref(0);
139
- var vertical = computed(() => props.vertical);
140
- var trackSize = ref(0);
141
- var trackTranslate = ref(0);
142
- var lockDuration = ref(false);
143
- var index = ref(0);
144
- var hovering = ref(false);
145
- var {
146
- swipeItems,
147
- bindSwipeItems,
148
- length
149
- } = useSwipeItems();
150
- var {
151
- popup,
152
- bindPopup
153
- } = usePopup();
154
- var {
204
+ setup(props2) {
205
+ const swipeEl = ref(null);
206
+ const size = ref(0);
207
+ const vertical = computed(() => props2.vertical);
208
+ const trackSize = ref(0);
209
+ const trackTranslate = ref(0);
210
+ const lockDuration = ref(false);
211
+ const index = ref(0);
212
+ const hovering = ref(false);
213
+ const { swipeItems, bindSwipeItems, length } = useSwipeItems();
214
+ const { popup, bindPopup } = usePopup();
215
+ const {
155
216
  deltaX,
156
217
  deltaY,
157
218
  moveX,
@@ -165,71 +226,60 @@ var __sfc__ = defineComponent({
165
226
  moveTouch,
166
227
  endTouch
167
228
  } = useTouch();
168
- var isExpectDirection = computed(() => direction.value === (props.vertical ? 'vertical' : 'horizontal'));
169
- var initializedIndex = false;
170
- var timer = -1;
171
- var swipeProvider = {
229
+ const isExpectDirection = computed(() => direction.value === (props2.vertical ? "vertical" : "horizontal"));
230
+ let initializedIndex = false;
231
+ let timer = -1;
232
+ const swipeProvider = {
172
233
  size,
173
234
  vertical
174
235
  };
175
236
  bindSwipeItems(swipeProvider);
176
237
  call(bindPopup, null);
177
- watch(() => length.value, /*#__PURE__*/_asyncToGenerator(function* () {
178
- // In nuxt, the size of the swipe cannot got when the route is change, need double raf
179
- yield doubleRaf();
180
- initialIndex();
181
- resize();
182
- }));
238
+ watch(
239
+ () => length.value,
240
+ () => __async(this, null, function* () {
241
+ yield doubleRaf();
242
+ initialIndex();
243
+ resize();
244
+ })
245
+ );
183
246
  if (popup) {
184
- // watch popup show again
185
- watch(() => popup.show.value, /*#__PURE__*/function () {
186
- var _ref2 = _asyncToGenerator(function* (show) {
247
+ watch(
248
+ () => popup.show.value,
249
+ (show) => __async(this, null, function* () {
187
250
  if (show) {
188
251
  yield doubleRaf();
189
252
  resize();
190
253
  } else {
191
254
  stopAutoplay();
192
255
  }
193
- });
194
- return function (_x) {
195
- return _ref2.apply(this, arguments);
196
- };
197
- }());
256
+ })
257
+ );
198
258
  }
199
259
  onActivated(resize);
200
260
  onSmartUnmounted(stopAutoplay);
201
261
  onWindowResize(resize);
202
262
  function findSwipeItem(idx) {
203
- return swipeItems.find(_ref3 => {
204
- var {
205
- index
206
- } = _ref3;
207
- return index.value === idx;
208
- });
263
+ return swipeItems.find(({ index: index2 }) => index2.value === idx);
209
264
  }
210
265
  function dispatchSwipeItems() {
211
- if (!props.loop) {
266
+ if (!props2.loop) {
212
267
  return;
213
268
  }
214
- // track out of bounds from left
215
269
  if (trackTranslate.value >= 0) {
216
270
  findSwipeItem(length.value - 1).setTranslate(-trackSize.value);
217
271
  }
218
- // track out of bounds from right
219
272
  if (trackTranslate.value <= -(trackSize.value - size.value)) {
220
273
  findSwipeItem(0).setTranslate(trackSize.value);
221
274
  }
222
- // track not out of bounds
223
275
  if (trackTranslate.value > -(trackSize.value - size.value) && trackTranslate.value < 0) {
224
276
  findSwipeItem(length.value - 1).setTranslate(0);
225
277
  findSwipeItem(0).setTranslate(0);
226
278
  }
227
279
  }
228
280
  function getSwipeIndex(targetSwipeIndex) {
229
- var swipeIndex = isNumber(targetSwipeIndex) ? targetSwipeIndex : Math.floor((trackTranslate.value - size.value / 2) / -size.value);
230
- var {
231
- loop
232
- } = props;
281
+ const swipeIndex = isNumber(targetSwipeIndex) ? targetSwipeIndex : Math.floor((trackTranslate.value - size.value / 2) / -size.value);
282
+ const { loop } = props2;
233
283
  if (swipeIndex <= -1) {
234
284
  return loop ? -1 : 0;
235
285
  }
@@ -239,9 +289,7 @@ var __sfc__ = defineComponent({
239
289
  return swipeIndex;
240
290
  }
241
291
  function swipeIndexToIndex(swipeIndex) {
242
- var {
243
- loop
244
- } = props;
292
+ const { loop } = props2;
245
293
  if (swipeIndex === -1) {
246
294
  return loop ? length.value - 1 : 0;
247
295
  }
@@ -250,27 +298,24 @@ var __sfc__ = defineComponent({
250
298
  }
251
299
  return swipeIndex;
252
300
  }
253
- function clampIndex(index) {
254
- if (props.loop) {
255
- if (index < 0) {
256
- return length.value + index;
301
+ function clampIndex(index2) {
302
+ if (props2.loop) {
303
+ if (index2 < 0) {
304
+ return length.value + index2;
257
305
  }
258
- if (index >= length.value) {
259
- return index - length.value;
306
+ if (index2 >= length.value) {
307
+ return index2 - length.value;
260
308
  }
261
- return index;
309
+ return index2;
262
310
  }
263
- return clamp(index, 0, length.value - 1);
311
+ return clamp(index2, 0, length.value - 1);
264
312
  }
265
313
  function fixPosition() {
266
- return _fixPosition.apply(this, arguments);
267
- }
268
- function _fixPosition() {
269
- _fixPosition = _asyncToGenerator(function* () {
270
- var overLeft = trackTranslate.value >= size.value;
271
- var overRight = trackTranslate.value <= -trackSize.value;
272
- var leftTranslate = 0;
273
- var rightTranslate = -(trackSize.value - size.value);
314
+ return __async(this, null, function* () {
315
+ const overLeft = trackTranslate.value >= size.value;
316
+ const overRight = trackTranslate.value <= -trackSize.value;
317
+ const leftTranslate = 0;
318
+ const rightTranslate = -(trackSize.value - size.value);
274
319
  lockDuration.value = true;
275
320
  if (overLeft || overRight) {
276
321
  lockDuration.value = true;
@@ -281,19 +326,16 @@ var __sfc__ = defineComponent({
281
326
  yield doubleRaf();
282
327
  lockDuration.value = false;
283
328
  });
284
- return _fixPosition.apply(this, arguments);
285
329
  }
286
330
  function initialIndex() {
287
331
  if (initializedIndex) {
288
332
  return;
289
333
  }
290
- index.value = clampIndex(toNumber(props.initialIndex));
334
+ index.value = clampIndex(toNumber(props2.initialIndex));
291
335
  initializedIndex = true;
292
336
  }
293
337
  function startAutoplay() {
294
- var {
295
- autoplay
296
- } = props;
338
+ const { autoplay } = props2;
297
339
  if (!autoplay || length.value <= 1) {
298
340
  return;
299
341
  }
@@ -310,12 +352,9 @@ var __sfc__ = defineComponent({
310
352
  trackTranslate.value = value;
311
353
  dispatchSwipeItems();
312
354
  }
313
- function handleTouchstart(_x2) {
314
- return _handleTouchstart.apply(this, arguments);
315
- }
316
- function _handleTouchstart() {
317
- _handleTouchstart = _asyncToGenerator(function* (event) {
318
- if (length.value <= 1 || !props.touchable) {
355
+ function handleTouchstart(event) {
356
+ return __async(this, null, function* () {
357
+ if (length.value <= 1 || !props2.touchable) {
319
358
  return;
320
359
  }
321
360
  startTouch(event);
@@ -323,13 +362,9 @@ var __sfc__ = defineComponent({
323
362
  yield fixPosition();
324
363
  lockDuration.value = true;
325
364
  });
326
- return _handleTouchstart.apply(this, arguments);
327
365
  }
328
366
  function handleTouchmove(event) {
329
- var {
330
- touchable,
331
- vertical
332
- } = props;
367
+ const { touchable, vertical: vertical2 } = props2;
333
368
  if (!touching.value || !touchable) {
334
369
  return;
335
370
  }
@@ -338,7 +373,7 @@ var __sfc__ = defineComponent({
338
373
  return;
339
374
  }
340
375
  event.preventDefault();
341
- setTrackTranslate(trackTranslate.value + (vertical ? moveY.value : moveX.value));
376
+ setTrackTranslate(trackTranslate.value + (vertical2 ? moveY.value : moveX.value));
342
377
  }
343
378
  function handleTouchend() {
344
379
  if (!touching.value) {
@@ -348,34 +383,29 @@ var __sfc__ = defineComponent({
348
383
  if (!isExpectDirection.value) {
349
384
  return;
350
385
  }
351
- var {
352
- vertical,
353
- onChange
354
- } = props;
355
- var positive = vertical ? deltaY.value < 0 : deltaX.value < 0;
356
- var offset = vertical ? offsetY.value : offsetX.value;
357
- var quickSwiping = performance.now() - startTime.value <= SWIPE_DELAY && offset >= SWIPE_OFFSET;
358
- var swipeIndex = quickSwiping ? positive ? getSwipeIndex(index.value + 1) : getSwipeIndex(index.value - 1) : getSwipeIndex();
386
+ const { vertical: vertical2, onChange } = props2;
387
+ const positive = vertical2 ? deltaY.value < 0 : deltaX.value < 0;
388
+ const offset = vertical2 ? offsetY.value : offsetX.value;
389
+ const quickSwiping = performance.now() - startTime.value <= SWIPE_DELAY && offset >= SWIPE_OFFSET;
390
+ const swipeIndex = quickSwiping ? positive ? getSwipeIndex(index.value + 1) : getSwipeIndex(index.value - 1) : getSwipeIndex();
359
391
  lockDuration.value = false;
360
392
  setTrackTranslate(swipeIndex * -size.value);
361
- var prevIndex = index.value;
393
+ const prevIndex = index.value;
362
394
  index.value = swipeIndexToIndex(swipeIndex);
363
395
  startAutoplay();
364
396
  if (prevIndex !== index.value) {
365
397
  call(onChange, index.value);
366
398
  }
367
399
  }
368
-
369
- // expose
370
400
  function resize() {
371
401
  if (!swipeEl.value) {
372
402
  return;
373
403
  }
374
404
  lockDuration.value = true;
375
- size.value = props.vertical ? swipeEl.value.offsetHeight : swipeEl.value.offsetWidth;
405
+ size.value = props2.vertical ? swipeEl.value.offsetHeight : swipeEl.value.offsetWidth;
376
406
  trackSize.value = size.value * length.value;
377
407
  trackTranslate.value = index.value * -size.value;
378
- swipeItems.forEach(swipeItem => {
408
+ swipeItems.forEach((swipeItem) => {
379
409
  swipeItem.setTranslate(0);
380
410
  });
381
411
  startAutoplay();
@@ -383,22 +413,14 @@ var __sfc__ = defineComponent({
383
413
  lockDuration.value = false;
384
414
  });
385
415
  }
386
-
387
- // expose
388
- function next(_x3) {
389
- return _next2.apply(this, arguments);
390
- } // expose
391
- function _next2() {
392
- _next2 = _asyncToGenerator(function* (options) {
416
+ function next(options) {
417
+ return __async(this, null, function* () {
393
418
  if (length.value <= 1) {
394
419
  return;
395
420
  }
396
421
  initialIndex();
397
- var {
398
- loop,
399
- onChange
400
- } = props;
401
- var currentIndex = index.value;
422
+ const { loop, onChange } = props2;
423
+ const currentIndex = index.value;
402
424
  index.value = clampIndex(currentIndex + 1);
403
425
  if ((options == null ? void 0 : options.event) !== false) {
404
426
  call(onChange, index.value);
@@ -413,22 +435,15 @@ var __sfc__ = defineComponent({
413
435
  trackTranslate.value = index.value * -size.value;
414
436
  }
415
437
  });
416
- return _next2.apply(this, arguments);
417
438
  }
418
- function prev(_x4) {
419
- return _prev.apply(this, arguments);
420
- } // expose
421
- function _prev() {
422
- _prev = _asyncToGenerator(function* (options) {
439
+ function prev(options) {
440
+ return __async(this, null, function* () {
423
441
  if (length.value <= 1) {
424
442
  return;
425
443
  }
426
444
  initialIndex();
427
- var {
428
- loop,
429
- onChange
430
- } = props;
431
- var currentIndex = index.value;
445
+ const { loop, onChange } = props2;
446
+ const currentIndex = index.value;
432
447
  index.value = clampIndex(currentIndex - 1);
433
448
  if ((options == null ? void 0 : options.event) !== false) {
434
449
  call(onChange, index.value);
@@ -443,7 +458,6 @@ var __sfc__ = defineComponent({
443
458
  trackTranslate.value = index.value * -size.value;
444
459
  }
445
460
  });
446
- return _prev.apply(this, arguments);
447
461
  }
448
462
  function to(idx, options) {
449
463
  if (length.value <= 1 || idx === index.value) {
@@ -451,26 +465,22 @@ var __sfc__ = defineComponent({
451
465
  }
452
466
  idx = idx < 0 ? 0 : idx;
453
467
  idx = idx >= length.value ? length.value : idx;
454
- var task = idx > index.value ? next : prev;
455
- var count = Math.abs(idx - index.value);
456
- Array.from({
457
- length: count
458
- }).forEach((_, index) => {
459
- task({
460
- event: index === count - 1 ? options == null ? void 0 : options.event : false
461
- });
468
+ const task = idx > index.value ? next : prev;
469
+ const count = Math.abs(idx - index.value);
470
+ Array.from({ length: count }).forEach((_, index2) => {
471
+ task({ event: index2 === count - 1 ? options == null ? void 0 : options.event : false });
462
472
  });
463
473
  }
464
- var handleHovering = value => {
465
- if (props.navigation === 'hover') {
474
+ const handleHovering = (value) => {
475
+ if (props2.navigation === "hover") {
466
476
  hovering.value = value;
467
477
  }
468
478
  };
469
479
  function getNavigationAnimation(type) {
470
- if (props.navigation !== 'hover') {
471
- return '';
480
+ if (props2.navigation !== "hover") {
481
+ return "";
472
482
  }
473
- return props.vertical ? n("--navigation-vertical-" + type + "-animation") : n("--navigation-" + type + "-animation");
483
+ return props2.vertical ? n(`--navigation-vertical-${type}-animation`) : n(`--navigation-${type}-animation`);
474
484
  }
475
485
  return {
476
486
  length,
@@ -496,4 +506,7 @@ var __sfc__ = defineComponent({
496
506
  }
497
507
  });
498
508
  __sfc__.render = __render__;
499
- export default __sfc__;
509
+ var stdin_default = __sfc__;
510
+ export {
511
+ stdin_default as default
512
+ };