feat(pagination-nav): add tooltipPosition prop (#1733)

* Add `tooltipPosition` to `PaginationNav` per #1656

* Rebuild test

* Update description in documentation

Co-authored-by: Enrico Sacchetti <esacchetti@gmail.com>

* chore: update docs

---------

Co-authored-by: Samuel Janda <hi@simpleprogramming.com.au>
Co-authored-by: Enrico Sacchetti <esacchetti@gmail.com>
Co-authored-by: Enrico Sacchetti <enrico@theetrain.ca>
This commit is contained in:
Sam 2023-05-22 03:59:53 +10:00 committed by GitHub
commit 60a796ea48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 11 deletions

View file

@ -23,6 +23,12 @@
/** Specify the backward button text */
export let backwardText = "Previous page";
/**
* Set the position of the tooltip relative to the pagination buttons.
* @type {"top" | "right" | "bottom" | "left" | "outside" | "inside"}
*/
export let tooltipPosition = "bottom";
import { createEventDispatcher } from "svelte";
import CaretLeft from "../icons/CaretLeft.svelte";
import CaretRight from "../icons/CaretRight.svelte";
@ -76,7 +82,11 @@
<Button
kind="ghost"
tooltipAlignment="center"
tooltipPosition="bottom"
tooltipPosition="{tooltipPosition === 'inside'
? 'right'
: tooltipPosition === 'outside'
? 'left'
: tooltipPosition}"
iconDescription="{backwardText}"
disabled="{!loop && page === 1}"
icon="{CaretLeft}"
@ -147,7 +157,11 @@
<Button
kind="ghost"
tooltipAlignment="center"
tooltipPosition="bottom"
tooltipPosition="{tooltipPosition === 'inside'
? 'left'
: tooltipPosition === 'outside'
? 'right'
: tooltipPosition}"
iconDescription="{forwardText}"
disabled="{!loop && page === total}"
icon="{CaretRight}"