@loickit-v/swiper 0.0.6 → 0.0.8
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/README.md +106 -105
- package/dist/components/Slide/index.vue.js +68 -57
- package/dist/components/Slide/provide.js +3 -3
- package/dist/components/SlideItem/index.vue.js +34 -27
- package/dist/types/components/Slide/index.d.ts +3 -2
- package/dist/types/components/Slide/index.vue.d.ts +3 -2
- package/dist/types/components/Slide/provide.d.ts +3 -1
- package/dist/types/components/SlideItem/index.d.ts +3 -9
- package/dist/types/components/SlideItem/index.vue.d.ts +2 -6
- package/dist/types/components/types/index.d.ts +1 -1
- package/dist/types/hooks/defineSlide/index.d.ts +0 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,152 +1,153 @@
|
|
1
1
|
# @loickit-v/swiper
|
2
2
|
|
3
|
+
[中文](./README-zh.md)
|
4
|
+
|
3
5
|
## Components
|
4
6
|
|
5
7
|
### LSlide
|
6
|
-
|
7
|
-
the Slide Component
|
8
|
-
|
8
|
+
The Slide Component
|
9
9
|
#### Props
|
10
|
+
- `name`
|
11
|
+
A unique identifier for the slide, which should be obtained via `defineSlide`.
|
12
|
+
- `list <Array>`
|
13
|
+
Only takes effect in `infinite` mode; enables automatic cached rendering.
|
14
|
+
- `loadMore <Function>`
|
15
|
+
Only takes effect in `infinite` mode; triggered when the sliding pointer reaches the end of the list.
|
10
16
|
|
11
|
-
- name
|
12
|
-
|
13
|
-
identification of this slide, get by `defineSlide`
|
14
|
-
|
15
|
-
- list \<Array>
|
16
|
-
|
17
|
-
just avaliable `infinite` mode, the long list of render, will cached by `slotScope.cacheList`
|
18
|
-
|
19
|
-
- loadMore \<Function>
|
20
|
-
|
21
|
-
just avaliable `infinite` mode, when the pointer points to the cacheList end, will trigger.
|
22
|
-
|
23
|
-
#### Hooks
|
24
|
-
|
25
|
-
**defineSlide**
|
26
|
-
|
27
|
-
define a slide object
|
28
|
-
|
29
|
-
argument:
|
30
|
-
|
31
|
-
- provideKey \<string>
|
32
|
-
|
33
|
-
the identification of target slide
|
34
|
-
|
35
|
-
return \[createSlide, useSlide]
|
36
|
-
|
37
|
-
- createSlide
|
38
|
-
|
39
|
-
create a slide states, use return value to registe a slide
|
40
|
-
|
41
|
-
params:
|
42
|
-
|
43
|
-
- initial \<SlideState>
|
44
|
-
|
45
|
-
- direction \<SLIDE\*DIRECTION> _optional_
|
46
17
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
pointer
|
54
|
-
|
55
|
-
- duration \<number> _optional_
|
56
|
-
|
57
|
-
slide switch animation duration
|
58
|
-
|
59
|
-
- infinite \<boolean> `infinite` _optional_
|
60
|
-
|
61
|
-
mode enable
|
62
|
-
|
63
|
-
return:
|
64
|
-
|
65
|
-
- name
|
66
|
-
|
67
|
-
the identification of target slide
|
18
|
+
### LSlideItem
|
19
|
+
The Slide Item Component
|
20
|
+
#### Props
|
21
|
+
- `index <number>` _optional_
|
22
|
+
Must be passed in `infinite` mode, used for dynamic rendering calculations.
|
68
23
|
|
69
|
-
- state \<SlideState>
|
70
24
|
|
71
|
-
|
25
|
+
## Hooks
|
72
26
|
|
73
|
-
|
27
|
+
### `defineSlide`
|
28
|
+
Defines a slide
|
74
29
|
|
75
|
-
|
30
|
+
**Parameters**:
|
31
|
+
- `provideKey <string>`
|
32
|
+
Sets a unique identifier for the current slide.
|
76
33
|
|
77
|
-
|
34
|
+
**Returns**:
|
35
|
+
`[createSlide, useSlide]`
|
78
36
|
|
79
|
-
|
37
|
+
- `createSlide`
|
38
|
+
Creates a slide state; its return value is used to register the `l-slide` component.
|
80
39
|
|
81
|
-
**
|
40
|
+
**Parameters**:
|
41
|
+
- `initial <SlideState>`
|
42
|
+
- `direction <SLIDE_DIRECTION>` _optional_
|
43
|
+
Sliding direction
|
44
|
+
Default value: SLIDE_DIRECTION.HORIZONTAL
|
45
|
+
- `currentIndex <number>` _optional_
|
46
|
+
Pointer
|
47
|
+
Default value: 0
|
48
|
+
- `duration <number>` _optional_
|
49
|
+
Animation duration for slide switching
|
50
|
+
Default value: 300 (ms)
|
51
|
+
- `infinite <boolean>` _optional_
|
52
|
+
Whether to enable infinite mode
|
53
|
+
Default value: false
|
82
54
|
|
83
|
-
|
55
|
+
**Returns**:
|
56
|
+
- `name`
|
57
|
+
A unique identifier for the slide, which should be assigned to the `name` prop of `l-slide`.
|
58
|
+
- `state <SlideState>`
|
59
|
+
The slide state
|
84
60
|
|
85
|
-
|
61
|
+
- `useSlide`
|
62
|
+
**Returns**: `<SlideState>`
|
63
|
+
Use it to get the current slide state in any child component.
|
86
64
|
|
87
|
-
### LSlideItem
|
88
|
-
|
89
|
-
#### Props
|
90
65
|
|
91
|
-
|
66
|
+
## Slot
|
67
|
+
**default**
|
68
|
+
- `cacheList`
|
69
|
+
Only takes effect in `infinite` mode; caches the list data.
|
92
70
|
|
93
|
-
the index of this slide item, required when `infinite` mode
|
94
71
|
|
95
|
-
|
72
|
+
## Usage
|
96
73
|
|
97
74
|
```vue
|
98
75
|
<script setup lang="ts">
|
99
76
|
import {
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
77
|
+
defineSlide,
|
78
|
+
LSlide,
|
79
|
+
LSlideItem,
|
80
|
+
SLIDE_DIRECTION,
|
81
|
+
type SlideSwitchEvent
|
104
82
|
} from '@loickit-v/swiper';
|
83
|
+
import '@loickit-v/swiper/style';
|
84
|
+
import { reactive } from 'vue';
|
105
85
|
|
106
|
-
|
86
|
+
const handleSwitch = (value: SlideSwitchEvent) => {
|
87
|
+
console.log(value);
|
88
|
+
};
|
107
89
|
|
108
90
|
const [createSlide] = defineSlide('one');
|
109
|
-
|
110
91
|
const oneSlide = createSlide({
|
111
|
-
|
92
|
+
currentIndex: 1
|
112
93
|
});
|
113
94
|
|
114
95
|
const [createSlide2] = defineSlide('two');
|
115
|
-
|
116
96
|
const twoSlide = createSlide2({
|
117
|
-
|
97
|
+
direction: SLIDE_DIRECTION.VERTICAL
|
118
98
|
});
|
119
|
-
|
120
99
|
const oneToTwo = () => {
|
121
|
-
|
100
|
+
oneSlide.state.currentIndex = 1;
|
101
|
+
};
|
102
|
+
const list = reactive([{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }]);
|
103
|
+
const onLoadMore = () => {
|
104
|
+
list.push({ id: list[list.length - 1].id + 1 });
|
122
105
|
};
|
123
106
|
</script>
|
124
107
|
|
125
108
|
<template>
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
<LSlideItem style="background-color:
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
109
|
+
<div style="position: fixed; bottom: 0; left: 0; z-index: 999">
|
110
|
+
<p>one currentIndex: {{ oneSlide.state.currentIndex }}</p>
|
111
|
+
<p>two currentIndex: {{ twoSlide.state.currentIndex }}</p>
|
112
|
+
|
113
|
+
<button @click="oneToTwo">click to two "HORIZONTAL-2"</button>
|
114
|
+
</div>
|
115
|
+
<LSlide :name="oneSlide.name" @switch="handleSwitch">
|
116
|
+
<LSlideItem style="background-color: red; width: 30%">
|
117
|
+
<h1>HORIZONTAL-1</h1>
|
118
|
+
</LSlideItem>
|
119
|
+
<LSlideItem style="background-color: blue">
|
120
|
+
<h1>HORIZONTAL-2</h1>
|
121
|
+
</LSlideItem>
|
122
|
+
<LSlideItem style="background-color: green">
|
123
|
+
<LSlide
|
124
|
+
infinite
|
125
|
+
:name="twoSlide.name"
|
126
|
+
:list="list"
|
127
|
+
:load-more="onLoadMore"
|
128
|
+
@switch="handleSwitch"
|
129
|
+
>
|
130
|
+
<template #="{ cacheList }">
|
131
|
+
<LSlideItem
|
132
|
+
v-for="(item, idx) in cacheList"
|
133
|
+
:key="item.id"
|
134
|
+
:index="idx"
|
135
|
+
>
|
136
|
+
<h1>INFINITE-VERTICAL</h1>
|
137
|
+
<h2>{{ item.id }}</h2>
|
138
|
+
</LSlideItem>
|
139
|
+
</template>
|
140
|
+
</LSlide>
|
141
|
+
</LSlideItem>
|
142
|
+
</LSlide>
|
142
143
|
</template>
|
143
144
|
|
144
145
|
<style lang="scss">
|
145
146
|
body,
|
146
147
|
#app {
|
147
|
-
|
148
|
-
|
149
|
-
|
148
|
+
background-color: #ccc;
|
149
|
+
height: 800px;
|
150
|
+
width: 800px;
|
150
151
|
}
|
151
152
|
</style>
|
152
|
-
```
|
153
|
+
```
|
@@ -1,99 +1,110 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
import { u_setStyle as
|
3
|
-
import { u_setTransform as m, u_setFlush as
|
1
|
+
import { defineComponent as H, ref as w, watch as y, computed as g, onMounted as V, createElementBlock as Z, openBlock as $, withModifiers as d, createElementVNode as X, normalizeStyle as Y, unref as f, renderSlot as k, reactive as b, provide as j, nextTick as q } from "vue";
|
2
|
+
import { u_setStyle as z } from "@likcheung/shared";
|
3
|
+
import { u_setTransform as m, u_setFlush as F } from "../../utils/index.js";
|
4
4
|
import { SLIDE_DIRECTION as v } from "../constant/index.js";
|
5
|
-
import { checkDirection as
|
6
|
-
import { COMMON_SLIDE_PROVIDE_NAME as
|
7
|
-
import { useSlideState as
|
8
|
-
import { defaultState as
|
9
|
-
import {
|
10
|
-
const
|
5
|
+
import { checkDirection as U } from "../../utils/slide.js";
|
6
|
+
import { COMMON_SLIDE_PROVIDE_NAME as M } from "../constant/private.js";
|
7
|
+
import { useSlideState as G } from "../Provide/index.js";
|
8
|
+
import { defaultState as J } from "../../hooks/defineSlide/default.js";
|
9
|
+
import { createSlidePrivateProvide as K } from "./provide.js";
|
10
|
+
const le = /* @__PURE__ */ H({
|
11
11
|
name: "LSlide",
|
12
12
|
__name: "index",
|
13
13
|
props: {
|
14
|
-
name: { default:
|
14
|
+
name: { default: M },
|
15
|
+
infinite: { type: Boolean },
|
15
16
|
list: { default: () => [] },
|
16
17
|
loadMore: {}
|
17
18
|
},
|
18
19
|
emits: ["switch"],
|
19
|
-
setup(S, { emit:
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
20
|
+
setup(S, { emit: _ }) {
|
21
|
+
var I;
|
22
|
+
const t = S;
|
23
|
+
if (t.infinite && !((I = t.list) != null && I.length))
|
24
|
+
throw new Error("list is required when infinite is true");
|
25
|
+
const L = _, c = () => {
|
26
|
+
z(
|
27
|
+
r.value,
|
28
|
+
"transition-duration",
|
29
|
+
`${e.duration}ms`
|
30
|
+
), m(e.direction, r.value, -s.value);
|
31
|
+
}, p = K({
|
32
|
+
name: t.name,
|
33
|
+
itemsInfo: [],
|
34
|
+
infinite: t.infinite
|
35
|
+
}), O = () => {
|
36
|
+
const n = b(J);
|
37
|
+
return j(t.name, n), n;
|
38
|
+
}, e = t.name !== M ? G(t.name) : O(), x = () => t.list.slice(e.currentIndex, e.currentIndex + 3), o = t.infinite ? w(x()) : null;
|
39
|
+
t.infinite && y(
|
40
|
+
() => t.list,
|
31
41
|
() => {
|
32
|
-
o.value =
|
42
|
+
o.value = x();
|
33
43
|
},
|
34
44
|
{ once: !0 }
|
35
|
-
),
|
36
|
-
const r =
|
45
|
+
), y(() => e.currentIndex, c);
|
46
|
+
const r = w(), s = g(
|
37
47
|
() => (
|
38
48
|
// 通过收集所有 slide-item 的宽和高, 叠加计算
|
39
|
-
|
49
|
+
p.itemsInfo.slice(0, e.currentIndex).reduce((n, i) => (n += i[e.direction === v.HORIZONTAL ? "width" : "height"], n), 0)
|
40
50
|
)
|
41
|
-
),
|
42
|
-
() => e.currentIndex === 0 && !e.isNext || e.currentIndex ===
|
51
|
+
), P = g(
|
52
|
+
() => e.currentIndex === 0 && !e.isNext || e.currentIndex === p.itemsInfo.length - 1 && e.isNext
|
43
53
|
), l = { x: 0, y: 0 };
|
44
|
-
let
|
45
|
-
const
|
46
|
-
|
47
|
-
}, { isConsistent:
|
48
|
-
if (!
|
49
|
-
const i =
|
50
|
-
e.isNext =
|
54
|
+
let a = !1;
|
55
|
+
const D = (n) => {
|
56
|
+
a = !0, l.x = n.pageX, l.y = n.pageY;
|
57
|
+
}, { isConsistent: E, checkDirectionConsistent: C, resetCheckDirection: R } = U(e.direction), T = (n) => {
|
58
|
+
if (!a) return;
|
59
|
+
const i = n.pageX - l.x, N = n.pageY - l.y, u = e.direction === v.HORIZONTAL ? i : N;
|
60
|
+
e.isNext = u < 0, !P.value && (C(i, N), E.value && (F(r.value), m(
|
51
61
|
e.direction,
|
52
62
|
r.value,
|
53
|
-
Math.min(-s.value +
|
54
|
-
), e.shouldNext = Math.abs(
|
63
|
+
Math.min(-s.value + u, e.isNext ? -s.value : 0)
|
64
|
+
), e.shouldNext = Math.abs(u) > e.judgeValue));
|
55
65
|
}, h = () => {
|
56
|
-
e.shouldNext = !1,
|
57
|
-
},
|
66
|
+
e.shouldNext = !1, a = !1, R();
|
67
|
+
}, A = () => t.infinite ? e.currentIndex === o.value.length - 1 : !1, B = () => {
|
58
68
|
if (!e.shouldNext)
|
59
|
-
return
|
60
|
-
e.currentIndex += e.isNext ? 1 : -1,
|
69
|
+
return c(), h();
|
70
|
+
e.currentIndex += e.isNext ? 1 : -1, c();
|
71
|
+
const n = {
|
61
72
|
index: e.currentIndex
|
62
|
-
}
|
63
|
-
|
64
|
-
(o == null ? void 0 : o.value.length) ===
|
65
|
-
const
|
66
|
-
|
73
|
+
};
|
74
|
+
t.infinite && (n.item = t.list[e.currentIndex]), L("switch", n), h(), A() && q(async () => {
|
75
|
+
(o == null ? void 0 : o.value.length) === t.list.length && t.loadMore && await t.loadMore();
|
76
|
+
const i = t.list[e.currentIndex + 1];
|
77
|
+
i && o.value.push(i);
|
67
78
|
});
|
68
79
|
};
|
69
80
|
return V(() => {
|
70
81
|
m(e.direction, r.value, -s.value);
|
71
|
-
}), (
|
82
|
+
}), (n, i) => ($(), Z(
|
72
83
|
"div",
|
73
84
|
{
|
74
85
|
class: "loickit-slide",
|
75
86
|
id: "loickit-slide",
|
76
|
-
onPointerdown:
|
77
|
-
onPointermove:
|
78
|
-
onPointerup:
|
87
|
+
onPointerdown: d(D, ["prevent"]),
|
88
|
+
onPointermove: d(T, ["prevent"]),
|
89
|
+
onPointerup: d(B, ["prevent"])
|
79
90
|
},
|
80
91
|
[
|
81
|
-
|
92
|
+
X(
|
82
93
|
"div",
|
83
94
|
{
|
84
95
|
class: "loickit-slide-list",
|
85
|
-
style:
|
96
|
+
style: Y({
|
86
97
|
// 根据方向设置 flex-direction
|
87
|
-
flexDirection:
|
98
|
+
flexDirection: f(e).direction === f(v).HORIZONTAL ? "row" : "column"
|
88
99
|
}),
|
89
100
|
ref_key: "slideListRef",
|
90
101
|
ref: r
|
91
102
|
},
|
92
103
|
[
|
93
|
-
|
104
|
+
t.infinite ? k(n.$slots, "default", {
|
94
105
|
key: 1,
|
95
|
-
cacheList:
|
96
|
-
}) :
|
106
|
+
cacheList: f(o)
|
107
|
+
}) : k(n.$slots, "default", { key: 0 })
|
97
108
|
],
|
98
109
|
4
|
99
110
|
/* STYLE */
|
@@ -105,5 +116,5 @@ const oe = /* @__PURE__ */ T({
|
|
105
116
|
}
|
106
117
|
});
|
107
118
|
export {
|
108
|
-
|
119
|
+
le as default
|
109
120
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { createProvide as e } from "../../utils/createProvide.js";
|
2
2
|
import { SLIDE_PROVIDE_KEY as r } from "../constant/private.js";
|
3
|
-
const [o,
|
3
|
+
const [o, a] = e(r);
|
4
4
|
export {
|
5
|
-
o as
|
6
|
-
|
5
|
+
o as createSlidePrivateProvide,
|
6
|
+
a as useSlidePrivateState
|
7
7
|
};
|
@@ -1,45 +1,52 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
import { useSlideState as
|
3
|
-
import { useSlidePrivateState as
|
4
|
-
const
|
1
|
+
import { defineComponent as a, ref as l, watch as c, onMounted as m, onBeforeUnmount as p, createElementBlock as u, openBlock as h, createElementVNode as x, renderSlot as v } from "vue";
|
2
|
+
import { useSlideState as I } from "../Provide/index.js";
|
3
|
+
import { useSlidePrivateState as w } from "../Slide/provide.js";
|
4
|
+
const C = /* @__PURE__ */ a({
|
5
5
|
name: "LSlideItem",
|
6
6
|
__name: "index",
|
7
7
|
props: {
|
8
|
-
index: {
|
8
|
+
index: {}
|
9
9
|
},
|
10
|
-
setup(
|
11
|
-
const
|
12
|
-
|
13
|
-
(
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
10
|
+
setup(f) {
|
11
|
+
const i = f, e = w(), r = I(e.name), o = l(), s = l();
|
12
|
+
if (e.infinite) {
|
13
|
+
if (typeof i.index != "number")
|
14
|
+
throw new Error(
|
15
|
+
`index is required when infinite is true
|
16
|
+
please use the second parameter of the "v-for" directive`
|
17
|
+
);
|
18
|
+
c(
|
19
|
+
() => r.currentIndex,
|
20
|
+
() => {
|
21
|
+
var t;
|
22
|
+
r.currentIndex <= i.index + 1 && r.currentIndex >= i.index - 1 ? (t = o.value) == null || t.appendChild(
|
23
|
+
e.itemsInfo[i.index].el
|
24
|
+
) : s.value.remove();
|
25
|
+
}
|
26
|
+
);
|
27
|
+
}
|
28
|
+
const n = {
|
29
|
+
index: i.index
|
23
30
|
};
|
24
31
|
return m(() => {
|
25
32
|
var d;
|
26
|
-
const
|
27
|
-
|
33
|
+
const t = (d = o.value) == null ? void 0 : d.getBoundingClientRect();
|
34
|
+
n.width = t.width, n.height = t.height, e.infinite && (n.el = s.value), e.itemsInfo.push(n);
|
28
35
|
}), p(() => {
|
29
|
-
|
30
|
-
|
36
|
+
e.itemsInfo.splice(
|
37
|
+
e.itemsInfo.indexOf(n),
|
31
38
|
1
|
32
39
|
);
|
33
|
-
}), (
|
40
|
+
}), (t, d) => (h(), u(
|
34
41
|
"div",
|
35
42
|
{
|
36
43
|
ref_key: "slideItemRef",
|
37
|
-
ref:
|
44
|
+
ref: o,
|
38
45
|
class: "loickit-slide-item",
|
39
46
|
style: { position: "relative" }
|
40
47
|
},
|
41
48
|
[
|
42
|
-
|
49
|
+
x(
|
43
50
|
"div",
|
44
51
|
{
|
45
52
|
ref_key: "slideItemContentWrapperRef",
|
@@ -47,7 +54,7 @@ const R = /* @__PURE__ */ f({
|
|
47
54
|
class: "loickit-slide-item-content-wrapper"
|
48
55
|
},
|
49
56
|
[
|
50
|
-
|
57
|
+
v(t.$slots, "default")
|
51
58
|
],
|
52
59
|
512
|
53
60
|
/* NEED_PATCH */
|
@@ -59,5 +66,5 @@ const R = /* @__PURE__ */ f({
|
|
59
66
|
}
|
60
67
|
});
|
61
68
|
export {
|
62
|
-
|
69
|
+
C as default
|
63
70
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export declare const LSlide: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
1
|
+
export declare const LSlide: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: {
|
2
2
|
attrs: any;
|
3
3
|
emit: (e: "switch", value: import("../types/index.js").SlideSwitchEvent) => void;
|
4
4
|
slots: {
|
@@ -10,8 +10,9 @@ export declare const LSlide: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_s
|
|
10
10
|
props: {
|
11
11
|
readonly onSwitch?: ((value: import("../types/index.js").SlideSwitchEvent) => any) | undefined;
|
12
12
|
name?: import("../types/private.js").SlideNameType | undefined;
|
13
|
+
infinite?: boolean | undefined;
|
13
14
|
list?: T[] | undefined;
|
14
|
-
loadMore?: (() =>
|
15
|
+
loadMore?: (() => any) | undefined;
|
15
16
|
} & import("vue").PublicProps;
|
16
17
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
17
18
|
attrs: any;
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import type { SlideNameType } from '../types/private';
|
2
2
|
import type { SlideSwitchEvent } from '../types';
|
3
|
-
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
3
|
+
declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
5
5
|
readonly onSwitch?: ((value: SlideSwitchEvent) => any) | undefined;
|
6
6
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onSwitch"> & {
|
7
7
|
name?: SlideNameType;
|
8
|
+
infinite?: boolean;
|
8
9
|
list?: T[];
|
9
|
-
loadMore?: () =>
|
10
|
+
loadMore?: () => any;
|
10
11
|
} & Partial<{}>> & import("vue").PublicProps;
|
11
12
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
12
13
|
attrs: any;
|
@@ -2,8 +2,9 @@ import { SlideItemInfo, SlideNameType } from '../types/private';
|
|
2
2
|
type SlidePrivateState = {
|
3
3
|
name: SlideNameType;
|
4
4
|
itemsInfo: SlideItemInfo[];
|
5
|
+
infinite: boolean;
|
5
6
|
};
|
6
|
-
export declare const
|
7
|
+
export declare const createSlidePrivateProvide: (state: SlidePrivateState) => {
|
7
8
|
name: SlideNameType;
|
8
9
|
itemsInfo: {
|
9
10
|
height: number;
|
@@ -11,5 +12,6 @@ export declare const useSlidePrivateProvide: (state: SlidePrivateState) => {
|
|
11
12
|
index: import("../types/private").SlideItemInfoNameType;
|
12
13
|
el?: HTMLElement | undefined;
|
13
14
|
}[];
|
15
|
+
infinite: boolean;
|
14
16
|
}, useSlidePrivateState: () => SlidePrivateState;
|
15
17
|
export {};
|
@@ -1,9 +1,7 @@
|
|
1
1
|
export declare const LSlideItem: {
|
2
2
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{
|
3
3
|
index?: number;
|
4
|
-
}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
5
|
-
index: number;
|
6
|
-
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
4
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
7
5
|
P: {};
|
8
6
|
B: {};
|
9
7
|
D: {};
|
@@ -12,17 +10,13 @@ export declare const LSlideItem: {
|
|
12
10
|
Defaults: {};
|
13
11
|
}, Readonly<{
|
14
12
|
index?: number;
|
15
|
-
}> & Readonly<{}>, {}, {}, {}, {}, {
|
16
|
-
index: number;
|
17
|
-
}>;
|
13
|
+
}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
18
14
|
__isFragment?: never;
|
19
15
|
__isTeleport?: never;
|
20
16
|
__isSuspense?: never;
|
21
17
|
} & import("vue").ComponentOptionsBase<Readonly<{
|
22
18
|
index?: number;
|
23
|
-
}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
24
|
-
index: number;
|
25
|
-
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
19
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
26
20
|
$slots: {
|
27
21
|
default?: ((props: {}) => any) | undefined;
|
28
22
|
};
|
@@ -11,12 +11,8 @@ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$
|
|
11
11
|
declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
|
12
12
|
slideItemRef: typeof slideItemRef;
|
13
13
|
slideItemContentWrapperRef: typeof slideItemContentWrapperRef;
|
14
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
15
|
-
|
16
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
17
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
18
|
-
index: number;
|
19
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
15
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
20
16
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
21
17
|
export default _default;
|
22
18
|
type __VLS_WithSlots<T, S> = T & {
|