Merge branch 'main' into feature/#49-Update-focus-event-for-touch
This commit is contained in:
@@ -91,6 +91,11 @@
|
||||
*/
|
||||
export let dots = true
|
||||
|
||||
/**
|
||||
* Enable swiping
|
||||
*/
|
||||
export let swiping = true
|
||||
|
||||
export async function goTo(pageIndex, options) {
|
||||
const animated = get(options, 'animated', true)
|
||||
if (typeof pageIndex !== 'number') {
|
||||
@@ -283,15 +288,19 @@
|
||||
|
||||
// gestures
|
||||
function handleSwipeStart() {
|
||||
if (!swiping) return
|
||||
_duration = 0
|
||||
}
|
||||
async function handleThreshold(event) {
|
||||
if (!swiping) return
|
||||
await directionFnDescription[event.detail.direction]()
|
||||
}
|
||||
function handleSwipeMove(event) {
|
||||
if (!swiping) return
|
||||
offset += event.detail.dx
|
||||
}
|
||||
function handleSwipeEnd() {
|
||||
if (!swiping) return
|
||||
showPage(currentPageIndex)
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,11 @@
|
||||
*/
|
||||
export let dots = true
|
||||
|
||||
/**
|
||||
* Enable swiping
|
||||
*/
|
||||
export let swiping = true
|
||||
|
||||
const colors = [
|
||||
{ color: '#e5f9f0', text: '0' },
|
||||
{ color: '#ccf3e2', text: '1' },
|
||||
@@ -89,6 +94,7 @@
|
||||
{pauseOnFocus}
|
||||
{autoplayProgressVisible}
|
||||
{dots}
|
||||
{swiping}
|
||||
on:pageChange={
|
||||
event => console.log(`Current page index: ${event.detail}`)
|
||||
}
|
||||
@@ -115,6 +121,7 @@
|
||||
{pauseOnFocus}
|
||||
{autoplayProgressVisible}
|
||||
{dots}
|
||||
{swiping}
|
||||
>
|
||||
{#each colors2 as { color, text } (color)}
|
||||
<div
|
||||
@@ -145,4 +152,4 @@
|
||||
font-style: italic;
|
||||
font-size: 18px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -56,6 +56,11 @@
|
||||
*/
|
||||
export let dots = true
|
||||
|
||||
/**
|
||||
* Enable swiping
|
||||
*/
|
||||
export let swiping = true
|
||||
|
||||
const colors = [
|
||||
'#e5f9f0',
|
||||
'#ccf3e2',
|
||||
@@ -83,6 +88,7 @@
|
||||
{pauseOnFocus}
|
||||
{autoplayProgressVisible}
|
||||
{dots}
|
||||
{swiping}
|
||||
let:showPrevPage
|
||||
let:showNextPage
|
||||
>
|
||||
@@ -138,4 +144,4 @@
|
||||
cursor: pointer;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -56,6 +56,11 @@
|
||||
*/
|
||||
export let dots = true
|
||||
|
||||
/**
|
||||
* Enable swiping
|
||||
*/
|
||||
export let swiping = true
|
||||
|
||||
function onPageChange(event, showPage) {
|
||||
showPage(Number(event.target.value))
|
||||
}
|
||||
@@ -87,6 +92,7 @@
|
||||
{pauseOnFocus}
|
||||
{autoplayProgressVisible}
|
||||
{dots}
|
||||
{swiping}
|
||||
let:currentPageIndex
|
||||
let:pagesCount
|
||||
let:showPage
|
||||
@@ -148,4 +154,4 @@
|
||||
width: 100px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -273,6 +273,7 @@ Import component
|
||||
| `autoplayProgressVisible` | `boolean` | `false` | Show autoplay duration progress indicator |
|
||||
| `dots` | `boolean` | `true` | Current page indicator dots |
|
||||
| `timingFunction` | `string` | `'ease-in-out'` | CSS animation timing function |
|
||||
| `swiping` | `boolean` | `true` | Enable swiping |
|
||||
|
||||
<Divider />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user