diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 80ef3100..e7560f4f 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -1958,7 +1958,7 @@ export type ListBoxSelectionTranslationId = "clearAll" | "clearSelection"; | Prop name | Kind | Reactive | Type | Default value | Description | | :-------------- | :----------------- | :------- | :----------------------------------------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------ | | ref | let | Yes | null | HTMLDivElement | null | Obtain a reference to the top-level HTML element | -| selectionCount | let | No | any | -- | Specify the number of selected items | +| selectionCount | let | No | number | -- | Specify the number of selected items | | disabled | let | No | boolean | false | Set to `true` to disable the list box selection | | translationIds | const | No | { clearAll: "clearAll", clearSelection: "clearSelection", } | { clearAll: "clearAll", clearSelection: "clearSelection", } | Default translation ids | | translateWithId | let | No | (id: ListBoxSelectionTranslationId) => string | (id) => defaultTranslations[id] | Override the default translation ids | diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index c7a6260a..3ea015e6 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -4595,7 +4595,7 @@ "name": "selectionCount", "kind": "let", "description": "Specify the number of selected items", - "type": "any", + "type": "number", "isFunction": false, "constant": false, "reactive": false diff --git a/src/ListBox/ListBoxSelection.svelte b/src/ListBox/ListBoxSelection.svelte index 6fc1d25e..ef094b4a 100644 --- a/src/ListBox/ListBoxSelection.svelte +++ b/src/ListBox/ListBoxSelection.svelte @@ -5,7 +5,7 @@ /** * Specify the number of selected items - * @type {any} + * @type {number} */ export let selectionCount = undefined; @@ -46,27 +46,61 @@ : translateWithId("clearSelection"); -
- {#if selectionCount}{selectionCount}{/if} - -
+{#if selectionCount !== undefined} +
+ + {selectionCount} + +
+ +
+
+{:else} +
+ {#if selectionCount !== undefined}{selectionCount}{/if} + +
+{/if} diff --git a/types/ListBox/ListBoxSelection.d.ts b/types/ListBox/ListBoxSelection.d.ts index c6e9f4b2..134e969f 100644 --- a/types/ListBox/ListBoxSelection.d.ts +++ b/types/ListBox/ListBoxSelection.d.ts @@ -8,7 +8,7 @@ export interface ListBoxSelectionProps /** * Specify the number of selected items */ - selectionCount?: any; + selectionCount?: number; /** * Set to `true` to disable the list box selection