mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
chore(prettier): use svelteStrictMode
This commit is contained in:
parent
322b238cf0
commit
42b8159b1c
182 changed files with 2020 additions and 1912 deletions
|
@ -45,23 +45,23 @@
|
|||
<div
|
||||
role="listbox"
|
||||
tabindex="-1"
|
||||
data-invalid={invalid || undefined}
|
||||
class:bx--list-box={true}
|
||||
class:bx--list-box--inline={type === 'inline'}
|
||||
class:bx--list-box--disabled={disabled}
|
||||
class:bx--list-box--expanded={open}
|
||||
class:bx--list-box--light={light}
|
||||
data-invalid="{invalid || undefined}"
|
||||
class:bx--list-box="{true}"
|
||||
class:bx--list-box--inline="{type === 'inline'}"
|
||||
class:bx--list-box--disabled="{disabled}"
|
||||
class:bx--list-box--expanded="{open}"
|
||||
class:bx--list-box--light="{light}"
|
||||
{...$$restProps}
|
||||
class="{size && `bx--list-box--${size}`} {$$restProps.class}"
|
||||
on:keydown
|
||||
on:keydown={(e) => {
|
||||
on:keydown="{(e) => {
|
||||
if (e.key === 'Escape') {
|
||||
e.stopPropagation();
|
||||
}
|
||||
}}
|
||||
}}"
|
||||
on:click|preventDefault|stopPropagation>
|
||||
<slot />
|
||||
</div>
|
||||
{#if invalid}
|
||||
<div class:bx--form-requirement={true}>{invalidText}</div>
|
||||
<div class:bx--form-requirement="{true}">{invalidText}</div>
|
||||
{/if}
|
||||
|
|
|
@ -63,15 +63,15 @@
|
|||
</script>
|
||||
|
||||
<div
|
||||
bind:this={ref}
|
||||
role={ariaExpanded ? 'combobox' : role}
|
||||
aria-expanded={ariaExpanded}
|
||||
aria-owns={(ariaExpanded && menuId) || undefined}
|
||||
aria-controls={(ariaExpanded && menuId) || undefined}
|
||||
aria-disabled={disabled}
|
||||
aria-label={ariaExpanded ? translateWithId('close') : translateWithId('open')}
|
||||
tabindex={disabled ? '-1' : tabindex}
|
||||
class:bx--list-box__field={true}
|
||||
bind:this="{ref}"
|
||||
role="{ariaExpanded ? 'combobox' : role}"
|
||||
aria-expanded="{ariaExpanded}"
|
||||
aria-owns="{(ariaExpanded && menuId) || undefined}"
|
||||
aria-controls="{(ariaExpanded && menuId) || undefined}"
|
||||
aria-disabled="{disabled}"
|
||||
aria-label="{ariaExpanded ? translateWithId('close') : translateWithId('open')}"
|
||||
tabindex="{disabled ? '-1' : tabindex}"
|
||||
class:bx--list-box__field="{true}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div
|
||||
role="listbox"
|
||||
id="menu-{id}"
|
||||
class:bx--list-box__menu={true}
|
||||
class:bx--list-box__menu="{true}"
|
||||
{...$$restProps}>
|
||||
<slot />
|
||||
</div>
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
</script>
|
||||
|
||||
<div
|
||||
class:bx--list-box__menu-icon={true}
|
||||
class:bx--list-box__menu-icon--open={open}
|
||||
class:bx--list-box__menu-icon="{true}"
|
||||
class:bx--list-box__menu-icon--open="{open}"
|
||||
{...$$restProps}
|
||||
on:click|preventDefault|stopPropagation>
|
||||
<ChevronDown16 aria-label={description} title={description} />
|
||||
<ChevronDown16 aria-label="{description}" title="{description}" />
|
||||
</div>
|
||||
|
|
|
@ -13,14 +13,14 @@
|
|||
</script>
|
||||
|
||||
<div
|
||||
class:bx--list-box__menu-item={true}
|
||||
class:bx--list-box__menu-item--active={active}
|
||||
class:bx--list-box__menu-item--highlighted={highlighted}
|
||||
class:bx--list-box__menu-item="{true}"
|
||||
class:bx--list-box__menu-item--active="{active}"
|
||||
class:bx--list-box__menu-item--highlighted="{highlighted}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseenter
|
||||
on:mouseleave>
|
||||
<div class:bx--list-box__menu-item__option={true}>
|
||||
<div class:bx--list-box__menu-item__option="{true}">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -57,25 +57,25 @@
|
|||
</script>
|
||||
|
||||
<div
|
||||
bind:this={ref}
|
||||
bind:this="{ref}"
|
||||
role="button"
|
||||
aria-label="Clear Selection"
|
||||
tabindex={disabled ? '-1' : '0'}
|
||||
title={description}
|
||||
class:bx--list-box__selection={true}
|
||||
class:bx--tag--filter={selectionCount}
|
||||
class:bx--list-box__selection--multi={selectionCount}
|
||||
tabindex="{disabled ? '-1' : '0'}"
|
||||
title="{description}"
|
||||
class:bx--list-box__selection="{true}"
|
||||
class:bx--tag--filter="{selectionCount}"
|
||||
class:bx--list-box__selection--multi="{selectionCount}"
|
||||
{...$$restProps}
|
||||
on:click|preventDefault|stopPropagation={(e) => {
|
||||
on:click|preventDefault|stopPropagation="{(e) => {
|
||||
if (!disabled) {
|
||||
dispatch('clear', e);
|
||||
}
|
||||
}}
|
||||
on:keydown|stopPropagation={(e) => {
|
||||
}}"
|
||||
on:keydown|stopPropagation="{(e) => {
|
||||
if (!disabled && e.key === 'Enter') {
|
||||
dispatch('clear', e);
|
||||
}
|
||||
}}>
|
||||
}}">
|
||||
{#if selectionCount}{selectionCount}{/if}
|
||||
<Close16 />
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue