mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
Merge pull request #292 from weaseldotro/patch-1
feat(pagination): add pageSizeInputDisabled
This commit is contained in:
commit
c2fb2d213d
2 changed files with 11 additions and 1 deletions
|
@ -20,6 +20,7 @@ export const Default = () => ({
|
|||
false
|
||||
),
|
||||
pageInputDisabled: boolean("Disable page input (pageInputDisabled)", false),
|
||||
pageSizeInputDisabled: boolean("Disable page size input (pageSizeInputDisabled)", false),
|
||||
backwardText: text(
|
||||
"The description for the backward icon (backwardText)",
|
||||
"Previous page"
|
||||
|
@ -49,6 +50,7 @@ export const Multiple = () => ({
|
|||
false
|
||||
),
|
||||
pageInputDisabled: boolean("Disable page input (pageInputDisabled)", false),
|
||||
pageSizeInputDisabled: boolean("Disable page size input (pageSizeInputDisabled)", false),
|
||||
backwardText: text(
|
||||
"The description for the backward icon (backwardText)",
|
||||
"Previous page"
|
||||
|
|
|
@ -54,6 +54,12 @@
|
|||
*/
|
||||
export let pageInputDisabled = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the page size input
|
||||
* @type {boolean} [pageSizeInputDisabled=false]
|
||||
*/
|
||||
export let pageSizeInputDisabled = false;
|
||||
|
||||
/**
|
||||
* Specify the number of items to display in a page
|
||||
* @type {number} [pageSize=10]
|
||||
|
@ -118,6 +124,7 @@
|
|||
|
||||
<div id="{id}" class:bx--pagination="{true}" {...$$restProps}>
|
||||
<div class:bx--pagination__left="{true}">
|
||||
{#if !pageSizeInputDisabled}
|
||||
<label
|
||||
id="bx--pagination-select-{id}-count-label"
|
||||
for="bx--pagination-select-{id}"
|
||||
|
@ -137,7 +144,8 @@
|
|||
<SelectItem value="{size}" text="{size.toString()}" />
|
||||
{/each}
|
||||
</Select>
|
||||
<span class:bx--pagination__text="{true}">
|
||||
{/if}
|
||||
<span class:bx--pagination__text="{!pageSizeInputDisabled}">
|
||||
{#if pagesUnknown}
|
||||
{itemText(pageSize * (page - 1) + 1, page * pageSize)}
|
||||
{:else}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue