mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 11:36:36 +00:00
refactor(inline-loading): use class name directive, resolve svelte imports
This commit is contained in:
parent
69fa34dbff
commit
b6d3d1774b
2 changed files with 9 additions and 8 deletions
|
@ -54,15 +54,13 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
function focus(element) {
|
function focus(element) {
|
||||||
if (selectorPrimaryFocus == null) {
|
if (selectorPrimaryFocus == null) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
const node =
|
const node =
|
||||||
(element || innerModal).querySelector(selectorPrimaryFocus) || buttonRef;
|
(element || innerModal).querySelector(selectorPrimaryFocus) || buttonRef;
|
||||||
if (node != null) node.focus();
|
if (node != null) node.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
$: opened = false;
|
let opened = false;
|
||||||
$: didOpen = open;
|
$: didOpen = open;
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
@ -116,7 +114,10 @@
|
||||||
<div
|
<div
|
||||||
bind:this="{innerModal}"
|
bind:this="{innerModal}"
|
||||||
class:bx--modal-container="{true}"
|
class:bx--modal-container="{true}"
|
||||||
class="{size && `bx--modal-container--${size}`} {containerClass}"
|
class:bx--modal-container--xs="{size === 'xs'}"
|
||||||
|
class:bx--modal-container--sm="{size === 'sm'}"
|
||||||
|
class:bx--modal-container--lg="{size === 'lg'}"
|
||||||
|
class="{containerClass}"
|
||||||
on:click="{() => {
|
on:click="{() => {
|
||||||
didClickInnerModal = true;
|
didClickInnerModal = true;
|
||||||
}}"
|
}}"
|
||||||
|
|
|
@ -21,9 +21,9 @@
|
||||||
export let successDelay = 1500;
|
export let successDelay = 1500;
|
||||||
|
|
||||||
import { createEventDispatcher, afterUpdate, onMount } from "svelte";
|
import { createEventDispatcher, afterUpdate, onMount } from "svelte";
|
||||||
import CheckmarkFilled16 from "carbon-icons-svelte/lib/CheckmarkFilled16";
|
import CheckmarkFilled16 from "carbon-icons-svelte/lib/CheckmarkFilled16/CheckmarkFilled16.svelte";
|
||||||
import Error20 from "carbon-icons-svelte/lib/Error20";
|
import Error20 from "carbon-icons-svelte/lib/Error20/Error20.svelte";
|
||||||
import { Loading } from "../Loading";
|
import Loading from "../Loading/Loading.svelte";
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue