let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the list HTML element |
-| ref | let
| Yes | null | HTMLInputElement
| null
| Obtain a reference to the input HTML element |
-| open | let
| Yes | boolean
| false
| Set to `true` to open the combobox menu dropdown |
-| value | let
| Yes | string
| ""
| Specify the selected combobox value |
-| selectedId | let
| Yes | ComboBoxItemId
| undefined
| Set the selected item by value id |
-| items | let
| No | ComboBoxItem[]
| []
| Set the combobox items |
-| itemToString | let
| No | (item: ComboBoxItem) => string
| (item) => item.text || item.id
| Override the display of a combobox item |
-| direction | let
| No | "bottom" | "top"
| "bottom"
| Specify the direction of the combobox dropdown menu |
-| size | let
| No | "sm" | "xl"
| undefined
| Set the size of the combobox |
-| disabled | let
| No | boolean
| false
| Set to `true` to disable the combobox |
-| titleText | let
| No | string
| ""
| Specify the title text of the combobox |
-| placeholder | let
| No | string
| ""
| Specify the placeholder text |
-| helperText | let
| No | string
| ""
| Specify the helper text |
-| invalidText | let
| No | string
| ""
| Specify the invalid state text |
-| invalid | let
| No | boolean
| false
| Set to `true` to indicate an invalid state |
-| warn | let
| No | boolean
| false
| Set to `true` to indicate an warning state |
-| warnText | let
| No | string
| ""
| Specify the warning state text |
-| light | let
| No | boolean
| false
| Set to `true` to enable the light variant |
-| shouldFilterItem | let
| No | (item: ComboBoxItem, value: string) => boolean
| () => true
| Determine if an item should be filtered given the current combobox value |
-| translateWithId | let
| No | (id: import("../ListBox/ListBoxMenuIcon.svelte").ListBoxMenuIconTranslationId) => string
| undefined
| Override the chevron icon label based on the open state.let
| No | (id: any) => string
| undefined
| Override the menu label based on the open state.let
| No | (id: "clearSelection") => string
| undefined
| Override the label of the clear button when the input has a selection.let
| No | string
| "ccs-" + Math.random().toString(36)
| Set an id for the list box component |
-| name | let
| No | string
| undefined
| Specify a name attribute for the input |
-| clear | function
| No | (options?: { focus?: boolean; }) => void
| () => { prevSelectedId = null; highlightedIndex = -1; highlightedId = undefined; selectedId = undefined; selectedItem = undefined; open = false; inputValue = ""; if (options?.focus !== false) ref?.focus(); }
| Clear the combo box programmatically |
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :----------------------- | :-------------------- | :------- | :---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| listRef | let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the list HTML element |
+| ref | let
| Yes | null | HTMLInputElement
| null
| Obtain a reference to the input HTML element |
+| open | let
| Yes | boolean
| false
| Set to `true` to open the combobox menu dropdown |
+| value | let
| Yes | string
| ""
| Specify the selected combobox value |
+| selectedId | let
| Yes | ComboBoxItemId
| undefined
| Set the selected item by value id |
+| items | let
| No | ComboBoxItem[]
| []
| Set the combobox items |
+| itemToString | let
| No | (item: ComboBoxItem) => string
| (item) => item.text || item.id
| Override the display of a combobox item |
+| direction | let
| No | "bottom" | "top"
| "bottom"
| Specify the direction of the combobox dropdown menu |
+| size | let
| No | "sm" | "xl"
| undefined
| Set the size of the combobox |
+| disabled | let
| No | boolean
| false
| Set to `true` to disable the combobox |
+| titleText | let
| No | string
| ""
| Specify the title text of the combobox |
+| placeholder | let
| No | string
| ""
| Specify the placeholder text |
+| helperText | let
| No | string
| ""
| Specify the helper text |
+| invalidText | let
| No | string
| ""
| Specify the invalid state text |
+| invalid | let
| No | boolean
| false
| Set to `true` to indicate an invalid state |
+| warn | let
| No | boolean
| false
| Set to `true` to indicate an warning state |
+| warnText | let
| No | string
| ""
| Specify the warning state text |
+| light | let
| No | boolean
| false
| Set to `true` to enable the light variant |
+| shouldFilterItem | let
| No | (item: ComboBoxItem, value: string) => boolean
| () => true
| Determine if an item should be filtered given the current combobox value |
+| translateWithId | let
| No | (id: import("../ListBox/ListBoxMenuIcon.svelte").ListBoxMenuIconTranslationId) => string
| undefined
| Override the chevron icon label based on the open state.let
| No | (id: "clearSelection") => string
| undefined
| Override the label of the clear button when the input has a selection.let
| No | string
| "ccs-" + Math.random().toString(36)
| Set an id for the list box component |
+| name | let
| No | string
| undefined
| Specify a name attribute for the input |
+| clear | function
| No | (options?: { focus?: boolean; }) => void
| () => { prevSelectedId = null; highlightedIndex = -1; highlightedId = undefined; selectedId = undefined; selectedItem = undefined; open = false; inputValue = ""; if (options?.focus !== false) ref?.focus(); }
| Clear the combo box programmatically |
### Slots
@@ -2327,44 +2326,43 @@ export interface MultiSelectItem {
### Props
-| Prop name | Kind | Reactive | Type | Default value | Description |
-| :------------------- | :--------------- | :------- | :------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
-| highlightedId | let
| Yes | null | MultiSelectItemId
| null
| Id of the highlighted ListBoxMenuItem |
-| selectionRef | let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the selection element |
-| fieldRef | let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the field box element |
-| multiSelectRef | let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the outer div element |
-| inputRef | let
| Yes | null | HTMLInputElement
| null
| Obtain a reference to the input HTML element |
-| open | let
| Yes | boolean
| false
| Set to `true` to open the dropdown |
-| value | let
| Yes | string
| ""
| Specify the multiselect value |
-| selectedIds | let
| Yes | MultiSelectItemId[]
| []
| Set the selected ids |
-| items | let
| Yes | MultiSelectItem[]
| []
| Set the multiselect items |
-| itemToString | let
| No | (item: MultiSelectItem) => any
| (item) => item.text || item.id
| Override the display of a multiselect item |
-| itemToInput | let
| No | (item: MultiSelectItem) => { name?: string; labelText?: any; title?: string; }
| (item) => {}
| Override the item name, title, labelText passed to the checkbox input |
-| size | let
| No | "sm" | "lg" | "xl"
| undefined
| Set the size of the combobox |
-| type | let
| No | "default" | "inline"
| "default"
| Specify the type of multiselect |
-| direction | let
| No | "bottom" | "top"
| "bottom"
| Specify the direction of the multiselect dropdown menu |
-| selectionFeedback | let
| No | "top" | "fixed" | "top-after-reopen"
| "top-after-reopen"
| Specify the selection feedback after selecting items |
-| disabled | let
| No | boolean
| false
| Set to `true` to disable the dropdown |
-| filterable | let
| No | boolean
| false
| Set to `true` to filter items |
-| filterItem | let
| No | (item: MultiSelectItem, value: string) => string
| (item, value) => item.text.toLowerCase().includes(value.trim().toLowerCase())
| Override the filtering logiclet
| No | boolean
| false
| Set to `true` to enable the light variant |
-| locale | let
| No | string
| "en"
| Specify the locale |
-| placeholder | let
| No | string
| ""
| Specify the placeholder text |
-| sortItem | let
| No | ((a: MultiSelectItem, b: MultiSelectItem) => MultiSelectItem) | (() => void)
| (a, b) => a.text.localeCompare(b.text, locale, { numeric: true })
| Override the sorting logiclet
| No | (id: import("../ListBox/ListBoxMenuIcon.svelte").ListBoxMenuIconTranslationId) => string
| undefined
| Override the chevron icon label based on the open state.let
| No | (id: any) => string
| undefined
| Override the default translation ids for the menu |
-| translateWithIdInput | let
| No | (id: import("../ListBox/ListBoxSelection.svelte").ListBoxSelectionTranslationId) => string
| undefined
| Override the label of the clear button when the input has a selection.let
| No | string
| ""
| Specify the title text |
-| useTitleInItem | let
| No | boolean
| false
| Set to `true` to pass the item to `itemToString` in the checkbox |
-| invalid | let
| No | boolean
| false
| Set to `true` to indicate an invalid state |
-| invalidText | let
| No | string
| ""
| Specify the invalid state text |
-| warn | let
| No | boolean
| false
| Set to `true` to indicate an warning state |
-| warnText | let
| No | string
| ""
| Specify the warning state text |
-| helperText | let
| No | string
| ""
| Specify the helper text |
-| label | let
| No | string
| ""
| Specify the list box label |
-| hideLabel | let
| No | boolean
| false
| Set to `true` to visually hide the label text |
-| id | let
| No | string
| "ccs-" + Math.random().toString(36)
| Set an id for the list box component |
-| name | let
| No | string
| undefined
| Specify a name attribute for the select |
+| Prop name | Kind | Reactive | Type | Default value | Description |
+| :----------------------- | :--------------- | :------- | :------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| highlightedId | let
| Yes | null | MultiSelectItemId
| null
| Id of the highlighted ListBoxMenuItem |
+| selectionRef | let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the selection element |
+| fieldRef | let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the field box element |
+| multiSelectRef | let
| Yes | null | HTMLDivElement
| null
| Obtain a reference to the outer div element |
+| inputRef | let
| Yes | null | HTMLInputElement
| null
| Obtain a reference to the input HTML element |
+| open | let
| Yes | boolean
| false
| Set to `true` to open the dropdown |
+| value | let
| Yes | string
| ""
| Specify the multiselect value |
+| selectedIds | let
| Yes | MultiSelectItemId[]
| []
| Set the selected ids |
+| items | let
| Yes | MultiSelectItem[]
| []
| Set the multiselect items |
+| itemToString | let
| No | (item: MultiSelectItem) => any
| (item) => item.text || item.id
| Override the display of a multiselect item |
+| itemToInput | let
| No | (item: MultiSelectItem) => { name?: string; labelText?: any; title?: string; }
| (item) => {}
| Override the item name, title, labelText passed to the checkbox input |
+| size | let
| No | "sm" | "lg" | "xl"
| undefined
| Set the size of the combobox |
+| type | let
| No | "default" | "inline"
| "default"
| Specify the type of multiselect |
+| direction | let
| No | "bottom" | "top"
| "bottom"
| Specify the direction of the multiselect dropdown menu |
+| selectionFeedback | let
| No | "top" | "fixed" | "top-after-reopen"
| "top-after-reopen"
| Specify the selection feedback after selecting items |
+| disabled | let
| No | boolean
| false
| Set to `true` to disable the dropdown |
+| filterable | let
| No | boolean
| false
| Set to `true` to filter items |
+| filterItem | let
| No | (item: MultiSelectItem, value: string) => string
| (item, value) => item.text.toLowerCase().includes(value.trim().toLowerCase())
| Override the filtering logiclet
| No | boolean
| false
| Set to `true` to enable the light variant |
+| locale | let
| No | string
| "en"
| Specify the locale |
+| placeholder | let
| No | string
| ""
| Specify the placeholder text |
+| sortItem | let
| No | ((a: MultiSelectItem, b: MultiSelectItem) => MultiSelectItem) | (() => void)
| (a, b) => a.text.localeCompare(b.text, locale, { numeric: true })
| Override the sorting logiclet
| No | (id: import("../ListBox/ListBoxMenuIcon.svelte").ListBoxMenuIconTranslationId) => string
| undefined
| Override the chevron icon label based on the open state.let
| No | (id: import("../ListBox/ListBoxSelection.svelte").ListBoxSelectionTranslationId) => string
| undefined
| Override the label of the clear button when the input has a selection.let
| No | string
| ""
| Specify the title text |
+| useTitleInItem | let
| No | boolean
| false
| Set to `true` to pass the item to `itemToString` in the checkbox |
+| invalid | let
| No | boolean
| false
| Set to `true` to indicate an invalid state |
+| invalidText | let
| No | string
| ""
| Specify the invalid state text |
+| warn | let
| No | boolean
| false
| Set to `true` to indicate an warning state |
+| warnText | let
| No | string
| ""
| Specify the warning state text |
+| helperText | let
| No | string
| ""
| Specify the helper text |
+| label | let
| No | string
| ""
| Specify the list box label |
+| hideLabel | let
| No | boolean
| false
| Set to `true` to visually hide the label text |
+| id | let
| No | string
| "ccs-" + Math.random().toString(36)
| Set an id for the list box component |
+| name | let
| No | string
| undefined
| Specify a name attribute for the select |
### Slots
diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json
index f4f2d149..d6c41639 100644
--- a/docs/src/COMPONENT_API.json
+++ b/docs/src/COMPONENT_API.json
@@ -1563,19 +1563,9 @@
"reactive": false
},
{
- "name": "translateWithIdMenu",
+ "name": "translateWithIdSelection",
"kind": "let",
- "description": "Override the menu label based on the open state.\nDefaults to \"Open menu\" and \"Close menu\"",
- "type": "(id: any) => string",
- "isFunction": false,
- "isFunctionDeclaration": false,
- "constant": false,
- "reactive": false
- },
- {
- "name": "translateWithIdInput",
- "kind": "let",
- "description": "Override the label of the clear button when the input has a selection.\nDefaults to \"Clear selected item\"",
+ "description": "Override the label of the clear button when the input has a selection.\nDefaults to \"Clear selected item\" since a combo box can only have on selection.",
"type": "(id: \"clearSelection\") => string",
"isFunction": false,
"isFunctionDeclaration": false,
@@ -6611,19 +6601,9 @@
"reactive": false
},
{
- "name": "translateWithIdMenu",
+ "name": "translateWithIdSelection",
"kind": "let",
- "description": "Override the default translation ids for the menu",
- "type": "(id: any) => string",
- "isFunction": false,
- "isFunctionDeclaration": false,
- "constant": false,
- "reactive": false
- },
- {
- "name": "translateWithIdInput",
- "kind": "let",
- "description": "Override the label of the clear button when the input has a selection.\nDefaults to \"Clear selected item\" and \"Clear all items\"",
+ "description": "Override the label of the clear button when the input has a selection.\nDefaults to \"Clear selected item\" and \"Clear all items\" if more than one item is selected",
"type": "(id: import(\"../ListBox/ListBoxSelection.svelte\").ListBoxSelectionTranslationId) => string",
"isFunction": false,
"isFunctionDeclaration": false,
diff --git a/src/ComboBox/ComboBox.svelte b/src/ComboBox/ComboBox.svelte
index 52fbacbf..97b8ead0 100644
--- a/src/ComboBox/ComboBox.svelte
+++ b/src/ComboBox/ComboBox.svelte
@@ -82,19 +82,12 @@
*/
export let translateWithId = undefined;
- /**
- * Override the menu label based on the open state.
- * Defaults to "Open menu" and "Close menu"
- * @type {(id: any) => string}
- */
- export let translateWithIdMenu = undefined;
-
/**
* Override the label of the clear button when the input has a selection.
* Defaults to "Clear selected item" since a combo box can only have on selection.
* @type {(id: "clearSelection") => string}
*/
- export let translateWithIdInput = undefined;
+ export let translateWithIdSelection = undefined;
/** Set an id for the list box component */
export let id = "ccs-" + Math.random().toString(36);
@@ -246,7 +239,7 @@
}}"
id="{id}"
disabled="{disabled}"
- translateWithId="{translateWithIdMenu}"
+ translateWithId="{translateWithId}"
>
diff --git a/src/MultiSelect/MultiSelect.svelte b/src/MultiSelect/MultiSelect.svelte
index b9ce6d57..f72b6d99 100644
--- a/src/MultiSelect/MultiSelect.svelte
+++ b/src/MultiSelect/MultiSelect.svelte
@@ -101,18 +101,12 @@
*/
export let translateWithId = undefined;
- /**
- * Override the default translation ids for the menu
- * @type {(id: any) => string}
- */
- export let translateWithIdMenu = undefined;
-
/**
* Override the label of the clear button when the input has a selection.
- * Defaults to "Clear selected item" and "Clear all items"
+ * Defaults to "Clear selected item" and "Clear all items" if more than one item is selected
* @type {(id: import("../ListBox/ListBoxSelection.svelte").ListBoxSelectionTranslationId) => string}
*/
- export let translateWithIdInput = undefined;
+ export let translateWithIdSelection = undefined;
/** Specify the title text */
export let titleText = "";
@@ -375,7 +369,7 @@
}}"
id="{id}"
disabled="{disabled}"
- translateWithId="{translateWithIdMenu}"
+ translateWithId="{translateWithId}"
>
{#if checked.length > 0}