mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
chore: format files with Prettier 3
This commit is contained in:
parent
1dcd09bd98
commit
8e996dc683
391 changed files with 3725 additions and 3785 deletions
|
@ -94,13 +94,13 @@
|
|||
$: forwardButtonDisabled = disabled || page === totalPages;
|
||||
</script>
|
||||
|
||||
<div id="{id}" class:bx--pagination="{true}" {...$$restProps}>
|
||||
<div class:bx--pagination__left="{true}">
|
||||
<div {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}"
|
||||
class:bx--pagination__text="{true}"
|
||||
class:bx--pagination__text={true}
|
||||
>
|
||||
{itemsPerPageText}
|
||||
</label>
|
||||
|
@ -110,29 +110,29 @@
|
|||
hideLabel
|
||||
noLabel
|
||||
inline
|
||||
on:change="{() => {
|
||||
dispatch('change', { pageSize });
|
||||
}}"
|
||||
bind:selected="{pageSize}"
|
||||
on:change={() => {
|
||||
dispatch("change", { pageSize });
|
||||
}}
|
||||
bind:selected={pageSize}
|
||||
>
|
||||
{#each pageSizes as size, i (size)}
|
||||
<SelectItem value="{size}" text="{size.toString()}" />
|
||||
<SelectItem value={size} text={size.toString()} />
|
||||
{/each}
|
||||
</Select>
|
||||
{/if}
|
||||
<span class:bx--pagination__text="{!pageSizeInputDisabled}">
|
||||
<span class:bx--pagination__text={!pageSizeInputDisabled}>
|
||||
{#if pagesUnknown}
|
||||
{itemText(pageSize * (page - 1) + 1, page * pageSize)}
|
||||
{:else}
|
||||
{itemRangeText(
|
||||
Math.min(pageSize * (page - 1) + 1, totalItems),
|
||||
Math.min(page * pageSize, totalItems),
|
||||
totalItems
|
||||
totalItems,
|
||||
)}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
<div class:bx--pagination__right="{true}">
|
||||
<div class:bx--pagination__right={true}>
|
||||
{#if !pageInputDisabled}
|
||||
<Select
|
||||
id="bx--pagination-select-{id + 2}"
|
||||
|
@ -140,16 +140,16 @@
|
|||
labelText="Page number, of {totalPages} pages"
|
||||
inline
|
||||
hideLabel
|
||||
on:change="{() => {
|
||||
dispatch('change', { page });
|
||||
}}"
|
||||
bind:selected="{page}"
|
||||
on:change={() => {
|
||||
dispatch("change", { page });
|
||||
}}
|
||||
bind:selected={page}
|
||||
>
|
||||
{#each selectItems as size, i (size)}
|
||||
<SelectItem value="{size + 1}" text="{(size + 1).toString()}" />
|
||||
<SelectItem value={size + 1} text={(size + 1).toString()} />
|
||||
{/each}
|
||||
</Select>
|
||||
<span class:bx--pagination__text="{true}">
|
||||
<span class:bx--pagination__text={true}>
|
||||
{#if pagesUnknown}
|
||||
{pageText(page)}
|
||||
{:else}{pageRangeText(page, totalPages)}{/if}
|
||||
|
@ -159,33 +159,33 @@
|
|||
kind="ghost"
|
||||
tooltipAlignment="center"
|
||||
tooltipPosition="top"
|
||||
icon="{CaretLeft}"
|
||||
iconDescription="{backwardText}"
|
||||
disabled="{backButtonDisabled}"
|
||||
icon={CaretLeft}
|
||||
iconDescription={backwardText}
|
||||
disabled={backButtonDisabled}
|
||||
class="bx--pagination__button bx--pagination__button--backward {backButtonDisabled
|
||||
? 'bx--pagination__button--no-index'
|
||||
: ''}"
|
||||
on:click="{() => {
|
||||
on:click={() => {
|
||||
page--;
|
||||
dispatch('click:button--previous', { page });
|
||||
dispatch('change', { page });
|
||||
}}"
|
||||
dispatch("click:button--previous", { page });
|
||||
dispatch("change", { page });
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
kind="ghost"
|
||||
tooltipAlignment="end"
|
||||
tooltipPosition="top"
|
||||
icon="{CaretRight}"
|
||||
iconDescription="{forwardText}"
|
||||
disabled="{forwardButtonDisabled}"
|
||||
icon={CaretRight}
|
||||
iconDescription={forwardText}
|
||||
disabled={forwardButtonDisabled}
|
||||
class="bx--pagination__button bx--pagination__button--forward {forwardButtonDisabled
|
||||
? 'bx--pagination__button--no-index'
|
||||
: ''}"
|
||||
on:click="{() => {
|
||||
on:click={() => {
|
||||
page++;
|
||||
dispatch('click:button--next', { page });
|
||||
dispatch('change', { page });
|
||||
}}"
|
||||
dispatch("click:button--next", { page });
|
||||
dispatch("change", { page });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue