mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 11:59:34 +00:00
Add tooltipPosition
to PaginationNav
per #1656
This commit is contained in:
parent
b9aaa3adca
commit
60c2df4c97
6 changed files with 404 additions and 248 deletions
|
@ -23,6 +23,12 @@
|
|||
/** Specify the backward button text */
|
||||
export let backwardText = "Previous page";
|
||||
|
||||
/**
|
||||
* Set the position of the tooltip relative to the icon
|
||||
* @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}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue