diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index efb80020..76cc14b2 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -1910,12 +1910,12 @@ None. ### Props -| Prop name | Required | Kind | Reactive | Type | Default value | Description | -| :-------------- | :------- | :--------------- | :------- | ------------------------------------------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------- | -| status | No | let | No | "active" | "inactive" | "finished" | "error" | "active" | Set the loading status | -| description | No | let | No | string | undefined | Set the loading description | -| iconDescription | No | let | No | string | undefined | Specify a description for the loading icon.
Defaults to the `status` prop for the "error" and "finished" states | -| successDelay | No | let | No | number | 1500 | Specify the timeout delay (ms) after `status` is set to "success" | +| Prop name | Required | Kind | Reactive | Type | Default value | Description | +| :-------------- | :------- | :--------------- | :------- | ------------------------------------------------------------------------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| status | No | let | No | "active" | "inactive" | "finished" | "error" | "active" | Set the loading status | +| description | No | let | No | string | undefined | Set the loading description | +| iconDescription | No | let | No | string | undefined | Specify a description for the loading icon.
Defaults to the `status` value for the
"error" and "finished" states. | +| successDelay | No | let | No | number | 1500 | Specify the timeout delay (ms) after `status` is set to "finished".
The `on:success` event will be dispatched after this delay. | ### Slots @@ -1925,10 +1925,6 @@ None. | Event name | Type | Detail | | :--------- | :--------- | :---------------- | -| click | forwarded | -- | -| mouseover | forwarded | -- | -| mouseenter | forwarded | -- | -| mouseleave | forwarded | -- | | success | dispatched | null | ## `InlineNotification` diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index a8d40ca8..61f0969d 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -5543,7 +5543,7 @@ { "name": "iconDescription", "kind": "let", - "description": "Specify a description for the loading icon.\nDefaults to the `status` prop for the \"error\" and \"finished\" states", + "description": "Specify a description for the loading icon.\nDefaults to the `status` value for the\n \"error\" and \"finished\" states.", "type": "string", "isFunction": false, "isFunctionDeclaration": false, @@ -5554,7 +5554,7 @@ { "name": "successDelay", "kind": "let", - "description": "Specify the timeout delay (ms) after `status` is set to \"success\"", + "description": "Specify the timeout delay (ms) after `status` is set to \"finished\".\nThe `on:success` event will be dispatched after this delay.", "type": "number", "value": "1500", "isFunction": false, @@ -5566,13 +5566,7 @@ ], "moduleExports": [], "slots": [], - "events": [ - { "type": "forwarded", "name": "click", "element": "div" }, - { "type": "forwarded", "name": "mouseover", "element": "div" }, - { "type": "forwarded", "name": "mouseenter", "element": "div" }, - { "type": "forwarded", "name": "mouseleave", "element": "div" }, - { "type": "dispatched", "name": "success", "detail": "null" } - ], + "events": [{ "type": "dispatched", "name": "success", "detail": "null" }], "typedefs": [], "rest_props": { "type": "Element", "name": "div" } }, diff --git a/src/InlineLoading/InlineLoading.svelte b/src/InlineLoading/InlineLoading.svelte index a560cb1a..0f8243d9 100644 --- a/src/InlineLoading/InlineLoading.svelte +++ b/src/InlineLoading/InlineLoading.svelte @@ -1,4 +1,6 @@ - - -
+
{#if status === "error"} + // @ts-check + /** Set to `true` to use the small variant */ export let small = false; diff --git a/types/InlineLoading/InlineLoading.svelte.d.ts b/types/InlineLoading/InlineLoading.svelte.d.ts index 215a989e..c1b70b92 100644 --- a/types/InlineLoading/InlineLoading.svelte.d.ts +++ b/types/InlineLoading/InlineLoading.svelte.d.ts @@ -18,13 +18,15 @@ export interface InlineLoadingProps extends RestProps { /** * Specify a description for the loading icon. - * Defaults to the `status` prop for the "error" and "finished" states + * Defaults to the `status` value for the + * "error" and "finished" states. * @default undefined */ iconDescription?: string; /** - * Specify the timeout delay (ms) after `status` is set to "success" + * Specify the timeout delay (ms) after `status` is set to "finished". + * The `on:success` event will be dispatched after this delay. * @default 1500 */ successDelay?: number; @@ -34,12 +36,6 @@ export interface InlineLoadingProps extends RestProps { export default class InlineLoading extends SvelteComponentTyped< InlineLoadingProps, - { - click: WindowEventMap["click"]; - mouseover: WindowEventMap["mouseover"]; - mouseenter: WindowEventMap["mouseenter"]; - mouseleave: WindowEventMap["mouseleave"]; - success: CustomEvent; - }, + { success: CustomEvent }, {} > {}