File tree Expand file tree Collapse file tree 6 files changed +33
-3
lines changed
Expand file tree Collapse file tree 6 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ Import component
4747| ` autoplayProgressVisible ` | ` boolean ` | ` false ` | Show autoplay duration progress indicator |
4848| ` dots ` | ` boolean ` | ` true ` | Current page indicator dots |
4949| ` timingFunction ` | ` string ` | ` 'ease-in-out' ` | CSS animation timing function |
50+ | ` swiping ` | ` boolean ` | ` true ` | Enable swiping |
5051
5152## Events
5253
Original file line number Diff line number Diff line change 9090 */
9191 export let dots = true
9292
93+ /**
94+ * Enable swiping
95+ */
96+ export let swiping = true
97+
9398 export async function goTo (pageIndex , options ) {
9499 const animated = get (options, ' animated' , true )
95100 if (typeof pageIndex !== ' number' ) {
281286
282287 // gestures
283288 function handleSwipeStart () {
289+ if (! swiping) return
284290 _duration = 0
285291 }
286292 async function handleThreshold (event ) {
293+ if (! swiping) return
287294 await directionFnDescription[event .detail .direction ]()
288295 }
289296 function handleSwipeMove (event ) {
297+ if (! swiping) return
290298 offset += event .detail .dx
291299 }
292300 function handleSwipeEnd () {
301+ if (! swiping) return
293302 showPage (currentPageIndex)
294303 }
295304 function handleFocused (event ) {
Original file line number Diff line number Diff line change 5656 */
5757 export let dots = true
5858
59+ /**
60+ * Enable swiping
61+ */
62+ export let swiping = true
63+
5964 const colors = [
6065 { color: ' #e5f9f0' , text: ' 0' },
6166 { color: ' #ccf3e2' , text: ' 1' },
8994 {pauseOnFocus }
9095 {autoplayProgressVisible }
9196 {dots }
97+ {swiping }
9298 on:pageChange ={
9399 event => console .log (` Current page index: ${event .detail } ` )
94100 }
115121 {pauseOnFocus }
116122 {autoplayProgressVisible }
117123 {dots }
124+ {swiping }
118125 >
119126 {#each colors2 as { color, text } (color )}
120127 <div
145152 font-style : italic ;
146153 font-size : 18px ;
147154 }
148- </style >
155+ </style >
Original file line number Diff line number Diff line change 5656 */
5757 export let dots = true
5858
59+ /**
60+ * Enable swiping
61+ */
62+ export let swiping = true
63+
5964 const colors = [
6065 ' #e5f9f0' ,
6166 ' #ccf3e2' ,
8388 {pauseOnFocus }
8489 {autoplayProgressVisible }
8590 {dots }
91+ {swiping }
8692 let:showPrevPage
8793 let:showNextPage
8894 >
138144 cursor : pointer ;
139145 -webkit-tap-highlight-color : transparent ;
140146 }
141- </style >
147+ </style >
Original file line number Diff line number Diff line change 5656 */
5757 export let dots = true
5858
59+ /**
60+ * Enable swiping
61+ */
62+ export let swiping = true
63+
5964 function onPageChange (event , showPage ) {
6065 showPage (Number (event .target .value ))
6166 }
8792 {pauseOnFocus }
8893 {autoplayProgressVisible }
8994 {dots }
95+ {swiping }
9096 let:currentPageIndex
9197 let:pagesCount
9298 let:showPage
148154 width : 100px ;
149155 border-radius : 5px ;
150156 }
151- </style >
157+ </style >
Original file line number Diff line number Diff line change @@ -273,6 +273,7 @@ Import component
273273| `autoplayProgressVisible` | `boolean` | `false` | Show autoplay duration progress indicator |
274274| `dots` | `boolean` | `true` | Current page indicator dots |
275275| `timingFunction` | `string` | `'ease-in-out'` | CSS animation timing function |
276+ | `swiping` | `boolean` | `true` | Enable swiping |
276277
277278<Divider />
278279
You can’t perform that action at this time.
0 commit comments