feat(ui-shell): refactor UI Shell search component

This commit is contained in:
Eric Liu 2020-11-26 14:13:01 -08:00
commit 7d19ee8aa8
11 changed files with 595 additions and 5 deletions

View file

@ -1,5 +1,5 @@
{
"total": 154,
"total": 155,
"components": [
{
"moduleName": "SkeletonText",
@ -10258,6 +10258,92 @@
"typedefs": [],
"rest_props": { "type": "Element", "name": "button" }
},
{
"moduleName": "HeaderSearch",
"filePath": "/src/UIShell/HeaderSearch.svelte",
"props": [
{
"name": "value",
"kind": "let",
"description": "Specify the search input value",
"type": "string",
"value": "\"\"",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "active",
"kind": "let",
"description": "Set to `true` to activate and focus the search bar",
"type": "boolean",
"value": "false",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "ref",
"kind": "let",
"description": "Obtain a reference to the input HTML element",
"type": "null | HTMLInputElement",
"value": "null",
"isFunction": false,
"constant": false,
"reactive": true
},
{
"name": "results",
"kind": "let",
"description": "Render a list of search results",
"type": "HeaderSearchResult[]",
"value": "[]",
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "selectedResultIndex",
"kind": "let",
"description": "Specify the selected result index",
"type": "number",
"value": "-1",
"isFunction": false,
"constant": false,
"reactive": true
}
],
"slots": [
{
"name": "__default__",
"default": true,
"fallback": "{result.text}\n {#if result.description}<span> {result.description}</span>{/if}",
"slot_props": "{ result: any }"
}
],
"events": [
{ "type": "dispatched", "name": "clear", "detail": "any" },
{
"type": "dispatched",
"name": "search",
"detail": "{ value: string; selectedResultIndex: number; selectedResult: HeaderSearchResult }"
},
{ "type": "forwarded", "name": "change", "element": "input" },
{ "type": "forwarded", "name": "input", "element": "input" },
{ "type": "forwarded", "name": "focus", "element": "input" },
{ "type": "forwarded", "name": "blur", "element": "input" },
{ "type": "forwarded", "name": "keydown", "element": "input" },
{ "type": "dispatched", "name": "select" }
],
"typedefs": [
{
"type": "{ href: string; text: string; description?: string; }",
"name": "HeaderSearchResult",
"ts": "interface HeaderSearchResult { href: string; text: string; description?: string; }"
}
],
"rest_props": { "type": "Element", "name": "input" }
},
{
"moduleName": "UnorderedList",
"filePath": "/src/UnorderedList/UnorderedList.svelte",