mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
feat(prettier): add svelteBracketNewLine
This commit is contained in:
parent
7a28d21ceb
commit
398887a3d3
182 changed files with 974 additions and 494 deletions
|
@ -18,7 +18,8 @@
|
|||
aria-current="{active ? 'page' : undefined}"
|
||||
class:bx--pagination-nav__page="{true}"
|
||||
class:bx--pagination-nav__page--active="{active}"
|
||||
on:click>
|
||||
on:click
|
||||
>
|
||||
<span class:bx--pagination-nav__accessibility-label="{true}">
|
||||
<slot />
|
||||
</span>
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
}}"
|
||||
on:click:button--next="{({ detail }) => {
|
||||
console.log('button--next', detail);
|
||||
}}" />
|
||||
}}"
|
||||
/>
|
||||
<div style="margin-top: 1.5rem">Bound page index: {page}</div>
|
||||
<Button
|
||||
kind="tertiary"
|
||||
|
@ -25,7 +26,8 @@
|
|||
style="margin-top: 1rem;"
|
||||
on:click="{() => {
|
||||
page = 3;
|
||||
}}">
|
||||
}}"
|
||||
>
|
||||
Set page to index 3
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
@ -103,25 +103,29 @@
|
|||
page--;
|
||||
}
|
||||
dispatch('click:button--previous', { page });
|
||||
}}" />
|
||||
}}"
|
||||
/>
|
||||
</li>
|
||||
{#if fit > MIN || (fit <= MIN && page <= 1)}
|
||||
<PaginationItem
|
||||
page="{1}"
|
||||
active="{page === 0}"
|
||||
on:click="{() => (page = 0)}">
|
||||
on:click="{() => (page = 0)}"
|
||||
>
|
||||
{page === 0 ? 'Active, Page' : 'Page'}
|
||||
</PaginationItem>
|
||||
{/if}
|
||||
<PaginationOverflow
|
||||
fromIndex="{startOffset}"
|
||||
count="{front}"
|
||||
on:select="{({ detail }) => (page = detail.index)}" />
|
||||
on:select="{({ detail }) => (page = detail.index)}"
|
||||
/>
|
||||
{#each items as item}
|
||||
<PaginationItem
|
||||
page="{item + 1}"
|
||||
active="{page === item}"
|
||||
on:click="{() => (page = item)}">
|
||||
on:click="{() => (page = item)}"
|
||||
>
|
||||
{page === item ? 'Active, Page' : 'Page'}
|
||||
</PaginationItem>
|
||||
{/each}
|
||||
|
@ -130,12 +134,14 @@
|
|||
count="{back}"
|
||||
on:select="{({ detail }) => {
|
||||
page = detail.index;
|
||||
}}" />
|
||||
}}"
|
||||
/>
|
||||
{#if total > 1}
|
||||
<PaginationItem
|
||||
page="{total}"
|
||||
active="{page === total - 1}"
|
||||
on:click="{() => (page = total - 1)}">
|
||||
on:click="{() => (page = total - 1)}"
|
||||
>
|
||||
{page === total - 1 ? 'Active, Page' : 'Page'}
|
||||
</PaginationItem>
|
||||
{/if}
|
||||
|
@ -155,13 +161,15 @@
|
|||
page++;
|
||||
}
|
||||
dispatch('click:button--next', { page });
|
||||
}}" />
|
||||
}}"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
<div
|
||||
aria-live="polite"
|
||||
aria-atomic="true"
|
||||
class:bx--pagination-nav__accessibility-label="{true}">
|
||||
class:bx--pagination-nav__accessibility-label="{true}"
|
||||
>
|
||||
Page {page + 1} of {total}
|
||||
</div>
|
||||
</nav>
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
on:change="{({ target }) => {
|
||||
value = '';
|
||||
dispatch('select', { index: Number(target.value) });
|
||||
}}">
|
||||
}}"
|
||||
>
|
||||
<option value="" hidden></option>
|
||||
{#each Array.from({ length: count }, (_, i) => i) as i}
|
||||
<option value="{fromIndex + i}" data-page="{fromIndex + i + 1}">
|
||||
|
@ -50,7 +51,8 @@
|
|||
page="{fromIndex + 1}"
|
||||
on:click="{() => {
|
||||
dispatch('select', { index: fromIndex });
|
||||
}}">
|
||||
}}"
|
||||
>
|
||||
Page
|
||||
</PaginationItem>
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue