Type id as any in ComboBox, Dropdown, MultiSelect (#1019)

Loosen the prop type for `id`, `selectedId` to be `any` instead of a `string`.
This commit is contained in:
Eric Liu 2022-01-20 18:50:36 -08:00 committed by GitHub
commit 1f7b5560a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 68 additions and 49 deletions

View file

@ -1398,7 +1398,7 @@
"name": "selectedId",
"kind": "let",
"description": "Set the selected item by value id",
"type": "string",
"type": "ComboBoxItemId",
"isFunction": false,
"isFunctionDeclaration": false,
"constant": false,
@ -1627,7 +1627,7 @@
{
"type": "dispatched",
"name": "select",
"detail": "{ selectedId: string; selectedItem: ComboBoxItem }"
"detail": "{ selectedId: ComboBoxItemId; selectedItem: ComboBoxItem }"
},
{ "type": "forwarded", "name": "keydown", "element": "input" },
{ "type": "forwarded", "name": "keyup", "element": "input" },
@ -1638,9 +1638,14 @@
],
"typedefs": [
{
"type": "{ id: string; text: string; }",
"type": "any",
"name": "ComboBoxItemId",
"ts": "type ComboBoxItemId = any"
},
{
"type": "{ id: ComboBoxItemId; text: string; }",
"name": "ComboBoxItem",
"ts": "interface ComboBoxItem { id: string; text: string; }"
"ts": "interface ComboBoxItem { id: ComboBoxItemId; text: string; }"
}
],
"rest_props": { "type": "Element", "name": "input" }
@ -3254,9 +3259,9 @@
],
"typedefs": [
{
"type": "string",
"type": "any",
"name": "DropdownItemId",
"ts": "type DropdownItemId = string"
"ts": "type DropdownItemId = any"
},
{
"type": "string",
@ -6404,7 +6409,7 @@
"name": "itemToString",
"kind": "let",
"description": "Override the display of a multiselect item",
"type": "(item: MultiSelectItem) => string",
"type": "(item: MultiSelectItem) => any",
"value": "(item) => item.text || item.id",
"isFunction": true,
"isFunctionDeclaration": false,
@ -6744,7 +6749,7 @@
{
"type": "dispatched",
"name": "select",
"detail": "{ selectedIds: string[]; selected: MultiSelectItem[]; unselected: MultiSelectItem[]; }"
"detail": "{ selectedIds: MultiSelectItemId[]; selected: MultiSelectItem[]; unselected: MultiSelectItem[]; }"
},
{ "type": "dispatched", "name": "clear", "detail": "any" },
{ "type": "forwarded", "name": "keydown", "element": "input" },
@ -6754,9 +6759,9 @@
],
"typedefs": [
{
"type": "string",
"type": "any",
"name": "MultiSelectItemId",
"ts": "type MultiSelectItemId = string"
"ts": "type MultiSelectItemId = any"
},
{
"type": "string",