carbon-components-svelte/tests/Pagination.test.svelte
Enrico Sacchetti 7e64ee57de feat(pagination): dispatch change event
Whenever the user interacts with Pagination, `change` is dispatched
2022-12-12 14:26:07 -05:00

24 lines
605 B
Svelte

<script lang="ts">
import { Pagination, PaginationSkeleton } from "../types";
</script>
<Pagination
totalItems="{102}"
pageSizes="{[10, 15, 20]}"
on:change="{(e) => {
console.log(e.detail); // { pageSize?: number, page?: number }
}}"
on:update="{(e) => {
console.log(e.detail); // { pageSize: number; page: number; }
}}"
/>
<Pagination totalItems="{102}" page="{4}" />
<Pagination totalItems="{102}" pageSizes="{[16, 36, 99]}" pageSize="{36}" />
<Pagination totalItems="{102}" pageInputDisabled />
<Pagination totalItems="{102}" pageSizeInputDisabled />
<PaginationSkeleton />