From 5ca0b8313703c2c58338d5fd718aba87980ceb32 Mon Sep 17 00:00:00 2001 From: davideraccagni Date: Thu, 21 Apr 2022 00:00:04 +0200 Subject: [PATCH] integrates PR # 1260: filteredItems is not exported anymore --- COMPONENT_INDEX.md | 3 +-- docs/src/COMPONENT_API.json | 12 +----------- src/AutoComplete/AutoComplete.svelte | 6 +++--- types/AutoComplete/AutoComplete.svelte.d.ts | 7 +------ 4 files changed, 6 insertions(+), 22 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index ccf5b2db..e21d983d 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -295,8 +295,7 @@ export interface AutoCompleteItem { | open | let | Yes | boolean | false | Set to `true` to open the dropdown | | selectedItem | let | Yes | AutoCompleteItem | undefined | Specify the selected item | | selectedId | let | Yes | AutoCompleteItemId | undefined | Specify the selected item id | -| filteredItems | let | Yes | [] | [] | -- | -| items | let | No | AutoCompleteItem[] | [] | Set the dropdown items | +| items | let | No | AutoCompleteItem[] | [] | Set the full list of items | | itemToString | let | No | (item: AutoCompleteItem) => string | (item) => item.text || item.id | Override the display of a dropdown item | | type | let | No | "default" | "inline" | "default" | Specify the type of dropdown | | direction | let | No | "bottom" | "top" | "bottom" | Specify the direction of the dropdown menu | diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index d45d101b..5d280b64 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -238,7 +238,7 @@ { "name": "items", "kind": "let", - "description": "Set full list of items", + "description": "Set the full list of items", "type": "AutoCompleteItem[]", "value": "[]", "isFunction": false, @@ -246,16 +246,6 @@ "constant": false, "reactive": false }, - { - "name": "filteredItems", - "kind": "let", - "type": "[]", - "value": "[]", - "isFunction": false, - "isFunctionDeclaration": false, - "constant": false, - "reactive": true - }, { "name": "itemToString", "kind": "let", diff --git a/src/AutoComplete/AutoComplete.svelte b/src/AutoComplete/AutoComplete.svelte index 8a373a8b..1b07701b 100644 --- a/src/AutoComplete/AutoComplete.svelte +++ b/src/AutoComplete/AutoComplete.svelte @@ -8,13 +8,11 @@ */ /** - * Set the dropdown items + * Set the full list of items * @type {AutoCompleteItem[]} */ export let items = []; - export let filteredItems = []; - /** * Override the display of a dropdown item * @type {(item: AutoCompleteItem) => string} @@ -112,6 +110,8 @@ const dispatch = createEventDispatcher(); + let filteredItems = []; + let highlightedIndex = -1; let innerValue = undefined; diff --git a/types/AutoComplete/AutoComplete.svelte.d.ts b/types/AutoComplete/AutoComplete.svelte.d.ts index d22df35d..c1a147fc 100644 --- a/types/AutoComplete/AutoComplete.svelte.d.ts +++ b/types/AutoComplete/AutoComplete.svelte.d.ts @@ -13,16 +13,11 @@ export interface AutoCompleteItem { export interface AutoCompleteProps extends svelte.JSX.HTMLAttributes { /** - * Set the dropdown items + * Set the full list of items * @default [] */ items?: AutoCompleteItem[]; - /** - * @default [] - */ - filteredItems?: []; - /** * Override the display of a dropdown item * @default (item) => item.text || item.id