@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.
- package/es/action-sheet/ActionSheet.mjs +97 -67
- package/es/action-sheet/index.mjs +43 -28
- package/es/action-sheet/props.mjs +39 -8
- package/es/app-bar/AppBar.mjs +129 -56
- package/es/app-bar/index.mjs +10 -5
- package/es/app-bar/props.mjs +6 -3
- package/es/avatar/Avatar.mjs +97 -87
- package/es/avatar/index.mjs +10 -5
- package/es/avatar/props.mjs +8 -5
- package/es/avatar-group/AvatarGroup.mjs +26 -20
- package/es/avatar-group/index.mjs +10 -5
- package/es/avatar-group/props.mjs +5 -2
- package/es/back-top/BackTop.mjs +71 -53
- package/es/back-top/index.mjs +10 -5
- package/es/back-top/props.mjs +6 -3
- package/es/badge/Badge.mjs +74 -46
- package/es/badge/index.mjs +10 -5
- package/es/badge/props.mjs +7 -4
- package/es/bottom-navigation/BottomNavigation.mjs +100 -97
- package/es/bottom-navigation/index.mjs +10 -5
- package/es/bottom-navigation/props.mjs +7 -4
- package/es/bottom-navigation/provide.mjs +13 -9
- package/es/bottom-navigation-item/BottomNavigationItem.mjs +93 -74
- package/es/bottom-navigation-item/index.mjs +10 -5
- package/es/bottom-navigation-item/props.mjs +7 -4
- package/es/bottom-navigation-item/provide.mjs +14 -11
- package/es/breadcrumb/Breadcrumb.mjs +51 -36
- package/es/breadcrumb/index.mjs +10 -5
- package/es/breadcrumb/props.mjs +6 -3
- package/es/breadcrumb/provide.mjs +12 -11
- package/es/breadcrumbs/Breadcrumbs.mjs +26 -24
- package/es/breadcrumbs/index.mjs +10 -5
- package/es/breadcrumbs/props.mjs +6 -3
- package/es/breadcrumbs/provide.mjs +11 -9
- package/es/button/Button.mjs +88 -90
- package/es/button/index.mjs +10 -5
- package/es/button/props.mjs +31 -10
- package/es/button/provide.mjs +8 -9
- package/es/button-group/ButtonGroup.mjs +38 -26
- package/es/button-group/index.mjs +8 -4
- package/es/button-group/props.mjs +8 -5
- package/es/button-group/provide.mjs +9 -9
- package/es/card/Card.mjs +292 -189
- package/es/card/index.mjs +10 -5
- package/es/card/props.mjs +9 -6
- package/es/cell/Cell.mjs +96 -52
- package/es/cell/index.mjs +10 -5
- package/es/cell/props.mjs +6 -3
- package/es/checkbox/Checkbox.mjs +136 -130
- package/es/checkbox/index.mjs +10 -5
- package/es/checkbox/props.mjs +9 -6
- package/es/checkbox/provide.mjs +10 -9
- package/es/checkbox-group/CheckboxGroup.mjs +63 -96
- package/es/checkbox-group/index.mjs +10 -5
- package/es/checkbox-group/props.mjs +9 -6
- package/es/checkbox-group/provide.mjs +11 -9
- package/es/chip/Chip.mjs +66 -50
- package/es/chip/index.mjs +10 -5
- package/es/chip/props.mjs +10 -7
- package/es/col/Col.mjs +60 -55
- package/es/col/index.mjs +10 -5
- package/es/col/props.mjs +7 -4
- package/es/col/provide.mjs +8 -9
- package/es/collapse/Collapse.mjs +70 -73
- package/es/collapse/index.mjs +10 -5
- package/es/collapse/props.mjs +7 -4
- package/es/collapse/provide.mjs +11 -9
- package/es/collapse-item/CollapseItem.mjs +156 -93
- package/es/collapse-item/index.mjs +10 -5
- package/es/collapse-item/props.mjs +6 -3
- package/es/collapse-item/provide.mjs +12 -11
- package/es/context/index.mjs +9 -5
- package/es/context/lock.mjs +18 -22
- package/es/context/zIndex.mjs +19 -16
- package/es/countdown/Countdown.mjs +73 -70
- package/es/countdown/index.mjs +10 -5
- package/es/countdown/props.mjs +7 -4
- package/es/counter/Counter.mjs +169 -173
- package/es/counter/index.mjs +10 -5
- package/es/counter/props.mjs +8 -5
- package/es/counter/provide.ts +3 -0
- package/es/date-picker/DatePicker.mjs +411 -304
- package/es/date-picker/index.mjs +10 -5
- package/es/date-picker/props.mjs +71 -45
- package/es/date-picker/src/day-picker-panel.mjs +270 -208
- package/es/date-picker/src/month-picker-panel.mjs +205 -175
- package/es/date-picker/src/panel-header.mjs +101 -83
- package/es/date-picker/src/year-picker-panel.mjs +64 -54
- package/es/dialog/Dialog.mjs +171 -106
- package/es/dialog/index.mjs +49 -33
- package/es/dialog/props.mjs +39 -9
- package/es/divider/Divider.mjs +56 -51
- package/es/divider/index.mjs +10 -5
- package/es/divider/props.mjs +5 -2
- package/es/drag/Drag.mjs +126 -144
- package/es/drag/index.mjs +10 -5
- package/es/drag/props.mjs +8 -5
- package/es/ellipsis/Ellipsis.mjs +81 -50
- package/es/ellipsis/index.mjs +8 -4
- package/es/ellipsis/props.mjs +5 -2
- package/es/fab/Fab.mjs +73 -75
- package/es/fab/index.mjs +8 -4
- package/es/fab/props.mjs +14 -11
- package/es/field-decorator/FieldDecorator.mjs +215 -110
- package/es/field-decorator/props.mjs +9 -6
- package/es/form/Form.mjs +69 -79
- package/es/form/index.mjs +11 -6
- package/es/form/props.mjs +6 -3
- package/es/form/provide.mjs +35 -22
- package/es/form-details/FormDetails.mjs +81 -39
- package/es/form-details/index.mjs +10 -5
- package/es/form-details/props.mjs +7 -4
- package/es/hover/index.mjs +37 -40
- package/es/hover-overlay/HoverOverlay.mjs +18 -14
- package/es/hover-overlay/index.mjs +13 -8
- package/es/hover-overlay/props.mjs +5 -2
- package/es/icon/Icon.mjs +50 -33
- package/es/icon/index.mjs +10 -5
- package/es/icon/props.mjs +7 -4
- package/es/image/Image.mjs +76 -82
- package/es/image/index.mjs +10 -5
- package/es/image/props.mjs +7 -4
- package/es/image-preview/ImagePreview.mjs +176 -193
- package/es/image-preview/index.mjs +44 -30
- package/es/image-preview/props.mjs +34 -9
- package/es/index-anchor/IndexAnchor.mjs +45 -42
- package/es/index-anchor/index.mjs +10 -5
- package/es/index-anchor/props.mjs +5 -2
- package/es/index-anchor/provide.mjs +12 -11
- package/es/index-bar/IndexBar.mjs +130 -131
- package/es/index-bar/index.mjs +10 -5
- package/es/index-bar/props.mjs +6 -3
- package/es/index-bar/provide.mjs +11 -9
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/input/Input.mjs +231 -247
- package/es/input/index.mjs +10 -5
- package/es/input/props.mjs +38 -8
- package/es/input/provide.ts +3 -0
- package/es/lazy/index.mjs +94 -87
- package/es/link/Link.mjs +39 -45
- package/es/link/index.mjs +10 -5
- package/es/link/props.mjs +8 -5
- package/es/list/List.mjs +144 -97
- package/es/list/index.mjs +10 -5
- package/es/list/props.mjs +8 -5
- package/es/list/provide.mjs +8 -9
- package/es/loading/Loading.mjs +165 -72
- package/es/loading/index.mjs +10 -5
- package/es/loading/props.mjs +7 -4
- package/es/loading-bar/LoadingBar.mjs +19 -16
- package/es/loading-bar/index.mjs +37 -30
- package/es/loading-bar/props.mjs +5 -2
- package/es/locale/en-US.mjs +76 -73
- package/es/locale/index.mjs +52 -41
- package/es/locale/zh-CN.mjs +76 -73
- package/es/menu/Menu.mjs +76 -57
- package/es/menu/index.mjs +10 -5
- package/es/menu/props.mjs +11 -8
- package/es/menu/usePopover.mjs +214 -207
- package/es/option/Option.mjs +86 -70
- package/es/option/index.mjs +10 -5
- package/es/option/props.mjs +5 -2
- package/es/option/provide.mjs +10 -11
- package/es/overlay/Overlay.mjs +29 -31
- package/es/overlay/index.mjs +10 -5
- package/es/overlay/props.mjs +7 -4
- package/es/pagination/Pagination.mjs +334 -202
- package/es/pagination/index.mjs +10 -5
- package/es/pagination/props.mjs +8 -5
- package/es/paper/Paper.mjs +43 -31
- package/es/paper/index.mjs +10 -5
- package/es/paper/props.mjs +6 -3
- package/es/picker/Picker.mjs +288 -224
- package/es/picker/index.mjs +24 -23
- package/es/picker/props.mjs +37 -7
- package/es/popup/Popup.mjs +68 -58
- package/es/popup/index.mjs +10 -5
- package/es/popup/props.mjs +9 -6
- package/es/popup/provide.mjs +12 -15
- package/es/progress/Progress.mjs +186 -114
- package/es/progress/index.mjs +10 -5
- package/es/progress/props.mjs +7 -4
- package/es/pull-refresh/PullRefresh.mjs +136 -116
- package/es/pull-refresh/index.mjs +10 -5
- package/es/pull-refresh/props.mjs +8 -5
- package/es/radio/Radio.mjs +122 -118
- package/es/radio/index.mjs +10 -5
- package/es/radio/props.mjs +8 -5
- package/es/radio/provide.mjs +8 -9
- package/es/radio-group/RadioGroup.mjs +50 -58
- package/es/radio-group/index.mjs +10 -5
- package/es/radio-group/props.mjs +10 -7
- package/es/radio-group/provide.mjs +11 -9
- package/es/rate/Rate.mjs +103 -132
- package/es/rate/index.mjs +10 -5
- package/es/rate/props.mjs +10 -7
- package/es/rate/provide.ts +3 -0
- package/es/result/Empty.mjs +21 -12
- package/es/result/Error.mjs +18 -9
- package/es/result/Info.mjs +18 -9
- package/es/result/Question.mjs +18 -9
- package/es/result/Result.mjs +102 -55
- package/es/result/Success.mjs +84 -40
- package/es/result/Warning.mjs +18 -9
- package/es/result/index.mjs +10 -5
- package/es/result/props.mjs +6 -3
- package/es/ripple/index.mjs +89 -101
- package/es/row/Row.mjs +40 -45
- package/es/row/index.mjs +10 -5
- package/es/row/props.mjs +8 -5
- package/es/row/provide.mjs +9 -9
- package/es/select/Select.mjs +308 -298
- package/es/select/index.mjs +10 -5
- package/es/select/props.mjs +40 -10
- package/es/select/provide.mjs +9 -9
- package/es/skeleton/Skeleton.mjs +182 -71
- package/es/skeleton/index.mjs +10 -5
- package/es/skeleton/props.mjs +5 -2
- package/es/slider/Slider.mjs +310 -260
- package/es/slider/index.mjs +10 -5
- package/es/slider/props.mjs +15 -11
- package/es/slider/provide.ts +3 -0
- package/es/snackbar/Snackbar.mjs +47 -34
- package/es/snackbar/core.mjs +140 -77
- package/es/snackbar/index.mjs +111 -97
- package/es/snackbar/props.mjs +35 -14
- package/es/space/Space.mjs +30 -28
- package/es/space/index.mjs +10 -5
- package/es/space/margin.mjs +22 -23
- package/es/space/props.mjs +8 -5
- package/es/step/Step.mjs +96 -74
- package/es/step/index.mjs +10 -5
- package/es/step/props.mjs +6 -3
- package/es/step/provide.mjs +10 -11
- package/es/steps/Steps.mjs +31 -30
- package/es/steps/index.mjs +10 -5
- package/es/steps/props.mjs +7 -4
- package/es/steps/provide.mjs +9 -8
- package/es/sticky/Sticky.mjs +104 -92
- package/es/sticky/index.mjs +10 -5
- package/es/sticky/props.mjs +6 -3
- package/es/style-provider/StyleProvider.mjs +19 -18
- package/es/style-provider/index.mjs +15 -11
- package/es/style-provider/props.mjs +6 -3
- package/es/swipe/Swipe.mjs +281 -268
- package/es/swipe/index.mjs +10 -5
- package/es/swipe/props.mjs +6 -3
- package/es/swipe/provide.mjs +11 -9
- package/es/swipe-item/SwipeItem.mjs +29 -29
- package/es/swipe-item/index.mjs +8 -4
- package/es/swipe-item/provide.mjs +10 -11
- package/es/switch/Switch.mjs +143 -103
- package/es/switch/index.mjs +10 -5
- package/es/switch/props.mjs +7 -4
- package/es/switch/provide.ts +3 -0
- package/es/tab/Tab.mjs +48 -61
- package/es/tab/index.mjs +10 -5
- package/es/tab/props.mjs +6 -3
- package/es/tab/provide.mjs +10 -11
- package/es/tab-item/TabItem.mjs +27 -32
- package/es/tab-item/index.mjs +10 -5
- package/es/tab-item/props.mjs +5 -2
- package/es/tab-item/provide.mjs +17 -18
- package/es/table/Table.mjs +54 -25
- package/es/table/index.mjs +10 -5
- package/es/table/props.mjs +6 -3
- package/es/tabs/Tabs.mjs +162 -134
- package/es/tabs/index.mjs +10 -5
- package/es/tabs/props.mjs +15 -12
- package/es/tabs/provide.mjs +9 -9
- package/es/tabs-items/TabsItems.mjs +61 -65
- package/es/tabs-items/index.mjs +10 -5
- package/es/tabs-items/props.mjs +7 -4
- package/es/tabs-items/provide.mjs +11 -9
- package/es/themes/dark/actionSheet.mjs +8 -5
- package/es/themes/dark/appBar.mjs +6 -3
- package/es/themes/dark/avatar.mjs +7 -4
- package/es/themes/dark/badge.mjs +6 -3
- package/es/themes/dark/bottomNavigation.mjs +7 -4
- package/es/themes/dark/bottomNavigationItem.mjs +6 -3
- package/es/themes/dark/breadcrumb.mjs +6 -3
- package/es/themes/dark/button.mjs +7 -4
- package/es/themes/dark/card.mjs +10 -7
- package/es/themes/dark/cell.mjs +7 -4
- package/es/themes/dark/checkbox.mjs +7 -4
- package/es/themes/dark/chip.mjs +7 -4
- package/es/themes/dark/collapse.mjs +8 -5
- package/es/themes/dark/countdown.mjs +6 -3
- package/es/themes/dark/datePicker.mjs +10 -7
- package/es/themes/dark/dialog.mjs +8 -5
- package/es/themes/dark/divider.mjs +7 -4
- package/es/themes/dark/fieldDecorator.mjs +7 -4
- package/es/themes/dark/index.mjs +69 -51
- package/es/themes/dark/link.mjs +6 -3
- package/es/themes/dark/menu.mjs +6 -3
- package/es/themes/dark/option.mjs +6 -3
- package/es/themes/dark/pagination.mjs +11 -8
- package/es/themes/dark/paper.mjs +6 -3
- package/es/themes/dark/picker.mjs +11 -8
- package/es/themes/dark/popup.mjs +6 -3
- package/es/themes/dark/progress.mjs +6 -3
- package/es/themes/dark/pullRefresh.mjs +6 -3
- package/es/themes/dark/radio.mjs +7 -4
- package/es/themes/dark/result.mjs +12 -9
- package/es/themes/dark/select.mjs +6 -3
- package/es/themes/dark/skeleton.mjs +11 -6
- package/es/themes/dark/steps.mjs +8 -5
- package/es/themes/dark/switch.mjs +7 -4
- package/es/themes/dark/tab.mjs +6 -3
- package/es/themes/dark/table.mjs +12 -9
- package/es/themes/dark/tabs.mjs +6 -3
- package/es/themes/dark/timePicker.mjs +9 -6
- package/es/themes/dark/uploader.mjs +10 -7
- package/es/themes/dark/watermark.mjs +6 -3
- package/es/themes/index.mjs +7 -5
- package/es/time-picker/TimePicker.mjs +297 -232
- package/es/time-picker/clock.mjs +222 -172
- package/es/time-picker/index.mjs +10 -5
- package/es/time-picker/props.mjs +14 -8
- package/es/time-picker/utils.mjs +46 -86
- package/es/tooltip/Tooltip.mjs +82 -62
- package/es/tooltip/index.mjs +10 -5
- package/es/tooltip/props.mjs +12 -9
- package/es/uploader/Uploader.mjs +315 -308
- package/es/uploader/index.mjs +10 -5
- package/es/uploader/props.mjs +10 -7
- package/es/uploader/provide.ts +3 -0
- package/es/utils/components.mjs +158 -127
- package/es/utils/elements.mjs +106 -123
- package/es/utils/logger.mjs +9 -5
- package/es/utils/shared.mjs +25 -23
- package/es/utils/test.mjs +105 -93
- package/es/varlet.esm.js +12464 -13425
- package/es/watermark/Watermark.mjs +191 -109
- package/es/watermark/index.mjs +8 -4
- package/es/watermark/props.mjs +8 -5
- package/highlight/web-types.en-US.json +3 -3
- package/highlight/web-types.zh-CN.json +2 -2
- package/lib/varlet.cjs.js +9187 -10199
- package/package.json +7 -7
- package/umd/varlet.js +4 -4
- package/es/counter/provide.mjs +0 -1
- package/es/input/provide.mjs +0 -1
- package/es/rate/provide.mjs +0 -1
- package/es/slider/provide.mjs +0 -1
- package/es/switch/provide.mjs +0 -1
- package/es/uploader/provide.mjs +0 -1
package/es/swipe/Swipe.mjs
CHANGED
|
@@ -1,157 +1,218 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
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
|
-
|
|
22
|
-
|
|
35
|
+
const _withScopeId = (n2) => (_pushScopeId(""), n2 = n2(), _popScopeId(), n2);
|
|
36
|
+
const _hoisted_1 = ["onClick"];
|
|
23
37
|
function __render__(_ctx, _cache) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return _withDirectives((_openBlock(), _createElementBlock(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
199
|
+
const __sfc__ = defineComponent({
|
|
127
200
|
name,
|
|
128
|
-
directives: {
|
|
129
|
-
|
|
130
|
-
},
|
|
131
|
-
components: {
|
|
132
|
-
VarButton,
|
|
133
|
-
VarIcon
|
|
134
|
-
},
|
|
201
|
+
directives: { Hover },
|
|
202
|
+
components: { VarButton, VarIcon },
|
|
135
203
|
props,
|
|
136
|
-
setup(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
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(
|
|
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 (!
|
|
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
|
-
|
|
230
|
-
|
|
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
|
-
|
|
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(
|
|
254
|
-
if (
|
|
255
|
-
if (
|
|
256
|
-
return length.value +
|
|
301
|
+
function clampIndex(index2) {
|
|
302
|
+
if (props2.loop) {
|
|
303
|
+
if (index2 < 0) {
|
|
304
|
+
return length.value + index2;
|
|
257
305
|
}
|
|
258
|
-
if (
|
|
259
|
-
return
|
|
306
|
+
if (index2 >= length.value) {
|
|
307
|
+
return index2 - length.value;
|
|
260
308
|
}
|
|
261
|
-
return
|
|
309
|
+
return index2;
|
|
262
310
|
}
|
|
263
|
-
return clamp(
|
|
311
|
+
return clamp(index2, 0, length.value - 1);
|
|
264
312
|
}
|
|
265
313
|
function fixPosition() {
|
|
266
|
-
return
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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(
|
|
334
|
+
index.value = clampIndex(toNumber(props2.initialIndex));
|
|
291
335
|
initializedIndex = true;
|
|
292
336
|
}
|
|
293
337
|
function startAutoplay() {
|
|
294
|
-
|
|
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(
|
|
314
|
-
return
|
|
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
|
-
|
|
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 + (
|
|
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
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
398
|
-
|
|
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(
|
|
419
|
-
return
|
|
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
|
-
|
|
428
|
-
|
|
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
|
-
|
|
455
|
-
|
|
456
|
-
Array.from({
|
|
457
|
-
|
|
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
|
-
|
|
465
|
-
if (
|
|
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 (
|
|
471
|
-
return
|
|
480
|
+
if (props2.navigation !== "hover") {
|
|
481
|
+
return "";
|
|
472
482
|
}
|
|
473
|
-
return
|
|
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
|
-
|
|
509
|
+
var stdin_default = __sfc__;
|
|
510
|
+
export {
|
|
511
|
+
stdin_default as default
|
|
512
|
+
};
|