mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
chore(prettier): use svelteStrictMode
This commit is contained in:
parent
322b238cf0
commit
42b8159b1c
182 changed files with 2020 additions and 1912 deletions
|
@ -16,21 +16,21 @@
|
|||
|
||||
{#if story === 'selected'}
|
||||
<ContentSwitcher
|
||||
{light}
|
||||
on:change={({ detail }) => {
|
||||
light="{light}"
|
||||
on:change="{({ detail }) => {
|
||||
console.log('on:change', detail);
|
||||
}}>
|
||||
}}">
|
||||
<Switch {...$$props} text="First section" />
|
||||
<Switch {...$$props} text="Second section" selected />
|
||||
<Switch {...$$props} text="Third section" />
|
||||
</ContentSwitcher>
|
||||
{:else}
|
||||
<ContentSwitcher
|
||||
{light}
|
||||
light="{light}"
|
||||
bind:selectedIndex
|
||||
on:change={({ detail }) => {
|
||||
on:change="{({ detail }) => {
|
||||
console.log('on:change', detail);
|
||||
}}>
|
||||
}}">
|
||||
<Switch {...$$props} text="First section" />
|
||||
<Switch {...$$props} text="Second section" />
|
||||
<Switch {...$$props}>
|
||||
|
@ -42,9 +42,9 @@
|
|||
</ContentSwitcher>
|
||||
<div
|
||||
style="margin-top: 1.5rem"
|
||||
on:click={() => {
|
||||
on:click="{() => {
|
||||
selectedIndex = 1;
|
||||
}}>
|
||||
}}">
|
||||
Programmatically set to second index
|
||||
</div>
|
||||
{/if}
|
||||
|
|
|
@ -58,8 +58,8 @@
|
|||
|
||||
<div
|
||||
role="tablist"
|
||||
class:bx--content-switcher={true}
|
||||
class:bx--content-switcher--light={light}
|
||||
class:bx--content-switcher="{true}"
|
||||
class:bx--content-switcher--light="{light}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
|
|
|
@ -52,31 +52,31 @@
|
|||
</script>
|
||||
|
||||
<button
|
||||
bind:this={ref}
|
||||
bind:this="{ref}"
|
||||
role="tab"
|
||||
tabindex={selected ? '0' : '-1'}
|
||||
aria-selected={selected}
|
||||
{disabled}
|
||||
{id}
|
||||
class:bx--content-switcher-btn={true}
|
||||
class:bx--content-switcher--selected={selected}
|
||||
tabindex="{selected ? '0' : '-1'}"
|
||||
aria-selected="{selected}"
|
||||
disabled="{disabled}"
|
||||
id="{id}"
|
||||
class:bx--content-switcher-btn="{true}"
|
||||
class:bx--content-switcher--selected="{selected}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:click|preventDefault={() => {
|
||||
on:click|preventDefault="{() => {
|
||||
ctx.update(id);
|
||||
}}
|
||||
}}"
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
on:keydown
|
||||
on:keydown={({ key }) => {
|
||||
on:keydown="{({ key }) => {
|
||||
if (key === 'ArrowRight') {
|
||||
ctx.change(1);
|
||||
} else if (key === 'ArrowLeft') {
|
||||
ctx.change(-1);
|
||||
}
|
||||
}}>
|
||||
<span class:bx--content-switcher__label={true}>
|
||||
}}">
|
||||
<span class:bx--content-switcher__label="{true}">
|
||||
<slot>{text}</slot>
|
||||
</span>
|
||||
</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue