integrates PR # 1260: filteredItems is not exported anymore

This commit is contained in:
davideraccagni 2022-04-21 00:00:04 +02:00
commit 5ca0b83137
4 changed files with 6 additions and 22 deletions

View file

@ -295,8 +295,7 @@ export interface AutoCompleteItem {
| open | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the dropdown | | open | <code>let</code> | Yes | <code>boolean</code> | <code>false</code> | Set to `true` to open the dropdown |
| selectedItem | <code>let</code> | Yes | <code>AutoCompleteItem</code> | <code>undefined</code> | Specify the selected item | | selectedItem | <code>let</code> | Yes | <code>AutoCompleteItem</code> | <code>undefined</code> | Specify the selected item |
| selectedId | <code>let</code> | Yes | <code>AutoCompleteItemId</code> | <code>undefined</code> | Specify the selected item id | | selectedId | <code>let</code> | Yes | <code>AutoCompleteItemId</code> | <code>undefined</code> | Specify the selected item id |
| filteredItems | <code>let</code> | Yes | <code>[]</code> | <code>[]</code> | -- | | items | <code>let</code> | No | <code>AutoCompleteItem[]</code> | <code>[]</code> | Set the full list of items |
| items | <code>let</code> | No | <code>AutoCompleteItem[]</code> | <code>[]</code> | Set the dropdown items |
| itemToString | <code>let</code> | No | <code>(item: AutoCompleteItem) => string</code> | <code>(item) => item.text &#124;&#124; item.id</code> | Override the display of a dropdown item | | itemToString | <code>let</code> | No | <code>(item: AutoCompleteItem) => string</code> | <code>(item) => item.text &#124;&#124; item.id</code> | Override the display of a dropdown item |
| type | <code>let</code> | No | <code>"default" &#124; "inline"</code> | <code>"default"</code> | Specify the type of dropdown | | type | <code>let</code> | No | <code>"default" &#124; "inline"</code> | <code>"default"</code> | Specify the type of dropdown |
| direction | <code>let</code> | No | <code>"bottom" &#124; "top"</code> | <code>"bottom"</code> | Specify the direction of the dropdown menu | | direction | <code>let</code> | No | <code>"bottom" &#124; "top"</code> | <code>"bottom"</code> | Specify the direction of the dropdown menu |

View file

@ -238,7 +238,7 @@
{ {
"name": "items", "name": "items",
"kind": "let", "kind": "let",
"description": "Set full list of items", "description": "Set the full list of items",
"type": "AutoCompleteItem[]", "type": "AutoCompleteItem[]",
"value": "[]", "value": "[]",
"isFunction": false, "isFunction": false,
@ -246,16 +246,6 @@
"constant": false, "constant": false,
"reactive": false "reactive": false
}, },
{
"name": "filteredItems",
"kind": "let",
"type": "[]",
"value": "[]",
"isFunction": false,
"isFunctionDeclaration": false,
"constant": false,
"reactive": true
},
{ {
"name": "itemToString", "name": "itemToString",
"kind": "let", "kind": "let",

View file

@ -8,13 +8,11 @@
*/ */
/** /**
* Set the dropdown items * Set the full list of items
* @type {AutoCompleteItem[]} * @type {AutoCompleteItem[]}
*/ */
export let items = []; export let items = [];
export let filteredItems = [];
/** /**
* Override the display of a dropdown item * Override the display of a dropdown item
* @type {(item: AutoCompleteItem) => string} * @type {(item: AutoCompleteItem) => string}
@ -112,6 +110,8 @@
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
let filteredItems = [];
let highlightedIndex = -1; let highlightedIndex = -1;
let innerValue = undefined; let innerValue = undefined;

View file

@ -13,16 +13,11 @@ export interface AutoCompleteItem {
export interface AutoCompleteProps export interface AutoCompleteProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> { extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/** /**
* Set the dropdown items * Set the full list of items
* @default [] * @default []
*/ */
items?: AutoCompleteItem[]; items?: AutoCompleteItem[];
/**
* @default []
*/
filteredItems?: [];
/** /**
* Override the display of a dropdown item * Override the display of a dropdown item
* @default (item) => item.text || item.id * @default (item) => item.text || item.id