mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 19:01:05 +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
|
@ -179,7 +179,7 @@
|
|||
</script>
|
||||
|
||||
<svelte:window
|
||||
on:mousedown="{({ target }) => {
|
||||
on:mousedown={({ target }) => {
|
||||
if (open) {
|
||||
if (target.contains(refTooltip)) {
|
||||
if (refIcon) {
|
||||
|
@ -189,48 +189,48 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}}"
|
||||
on:click|capture="{({ target }) => {
|
||||
}}
|
||||
on:click|capture={({ target }) => {
|
||||
if (open && !ref.contains(target) && !refTooltip.contains(target)) {
|
||||
setTimeout(() => {
|
||||
open = false;
|
||||
});
|
||||
}
|
||||
}}"
|
||||
}}
|
||||
/>
|
||||
|
||||
<div
|
||||
style:position="relative"
|
||||
style:z-index="{open ? 1 : undefined}"
|
||||
style:z-index={open ? 1 : undefined}
|
||||
{...$$restProps}
|
||||
>
|
||||
{#if !hideIcon}
|
||||
<div bind:this="{ref}" id="{triggerId}" class:bx--tooltip__label="{true}">
|
||||
<div bind:this={ref} id={triggerId} class:bx--tooltip__label={true}>
|
||||
<slot name="triggerText">{triggerText}</slot>
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
<div
|
||||
bind:this="{refIcon}"
|
||||
bind:this={refIcon}
|
||||
{...buttonProps}
|
||||
aria-describedby="{tooltipId}"
|
||||
on:mousedown="{onMousedown}"
|
||||
on:focus="{onFocus}"
|
||||
on:keydown="{onKeydown}"
|
||||
aria-describedby={tooltipId}
|
||||
on:mousedown={onMousedown}
|
||||
on:focus={onFocus}
|
||||
on:keydown={onKeydown}
|
||||
>
|
||||
<slot name="icon">
|
||||
<svelte:component this="{icon}" name="{iconName}" />
|
||||
<svelte:component this={icon} name={iconName} />
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
{:else}
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
<div
|
||||
bind:this="{ref}"
|
||||
bind:this={ref}
|
||||
{...buttonProps}
|
||||
aria-describedby="{tooltipId}"
|
||||
on:mousedown="{onMousedown}"
|
||||
on:focus="{onFocus}"
|
||||
on:blur="{onBlur}"
|
||||
on:keydown="{onKeydown}"
|
||||
aria-describedby={tooltipId}
|
||||
on:mousedown={onMousedown}
|
||||
on:focus={onFocus}
|
||||
on:blur={onBlur}
|
||||
on:keydown={onKeydown}
|
||||
>
|
||||
<slot name="triggerText">{triggerText}</slot>
|
||||
</div>
|
||||
|
@ -238,27 +238,27 @@
|
|||
{#if open}
|
||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
||||
<div
|
||||
bind:this="{refTooltip}"
|
||||
id="{tooltipId}"
|
||||
data-floating-menu-direction="{direction}"
|
||||
class:bx--tooltip="{true}"
|
||||
class:bx--tooltip--shown="{open}"
|
||||
class:bx--tooltip--top="{direction === 'top'}"
|
||||
class:bx--tooltip--right="{direction === 'right'}"
|
||||
class:bx--tooltip--bottom="{direction === 'bottom'}"
|
||||
class:bx--tooltip--left="{direction === 'left'}"
|
||||
class:bx--tooltip--align-center="{align === 'center'}"
|
||||
class:bx--tooltip--align-start="{align === 'start'}"
|
||||
class:bx--tooltip--align-end="{align === 'end'}"
|
||||
on:keydown="{onKeydown}"
|
||||
bind:this={refTooltip}
|
||||
id={tooltipId}
|
||||
data-floating-menu-direction={direction}
|
||||
class:bx--tooltip={true}
|
||||
class:bx--tooltip--shown={open}
|
||||
class:bx--tooltip--top={direction === "top"}
|
||||
class:bx--tooltip--right={direction === "right"}
|
||||
class:bx--tooltip--bottom={direction === "bottom"}
|
||||
class:bx--tooltip--left={direction === "left"}
|
||||
class:bx--tooltip--align-center={align === "center"}
|
||||
class:bx--tooltip--align-start={align === "start"}
|
||||
class:bx--tooltip--align-end={align === "end"}
|
||||
on:keydown={onKeydown}
|
||||
>
|
||||
<span class:bx--tooltip__caret="{true}"></span>
|
||||
<span class:bx--tooltip__caret={true}></span>
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
||||
<div
|
||||
on:click|stopPropagation
|
||||
on:mousedown|stopPropagation
|
||||
class:bx--tooltip__content="{true}"
|
||||
class:bx--tooltip__content={true}
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
>
|
||||
|
|
|
@ -24,6 +24,6 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<div bind:this="{ref}" class:bx--tooltip__footer="{true}">
|
||||
<div bind:this={ref} class:bx--tooltip__footer={true}>
|
||||
<slot />
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue