Remove initial work on pagination standard component

This commit is contained in:
Andrew Kingston 2021-05-13 12:39:46 +01:00
parent c1b6f26f28
commit 25fdb30e34
2 changed files with 0 additions and 38 deletions

View File

@ -1521,18 +1521,5 @@
"context": {
"type": "schema"
}
},
"pagination": {
"name": "Pagination Control",
"icon": "",
"styleable": true,
"hasChildren": "false",
"settings": [
{
"type": "dataProvider",
"label": "Provider",
"key": "dataProviderId"
}
]
}
}

View File

@ -1,25 +0,0 @@
<script>
import { getContext } from "svelte"
export let dataProviderId
const component = getContext("component")
const { styleable, ActionTypes, builderStore } = getContext("sdk")
const dataContext = getContext("context")
$: dataProviderContext = dataContext?.[dataProviderId]
$: pageNumber = dataProviderContext?.pageNumber ?? 1
$: hasPrevPage = dataProviderContext?.hasPrevPage ?? false
$: hasNextPage = dataProviderContext?.hasNextPage ?? false
$: prevPage = dataContext?.[`${dataProviderId}_${ActionTypes.PrevPage}`]
$: nextPage = dataContext?.[`${dataProviderId}_${ActionTypes.NextPage}`]
$: hasValidContext = dataProviderContext != null && nextPage != null
</script>
{#if hasValidContext}
<div>
Page {pageNumber}
</div>
{:else if builderStore.inBuilder}
<div>Choose a data provider to control with this pagination component.</div>
{/if}