@spectrum-web-components/combobox
Version:
Web component implementation of a Spectrum design Combobox
517 lines (516 loc) • 14.5 kB
JSON
{
"schemaVersion": "1.0.0",
"readme": "",
"modules": [
{
"kind": "javascript-module",
"path": "sp-combobox.js",
"declarations": [],
"exports": [
{
"kind": "custom-element-definition",
"name": "sp-combobox",
"declaration": {
"name": "Combobox",
"module": "/src/Combobox.js"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/Combobox.js",
"declarations": [
{
"kind": "class",
"description": "",
"name": "Combobox",
"slots": [
{
"description": "Supply Menu Item elements to the default slot in order to populate the available options",
"name": ""
},
{
"description": "Tooltip to to be applied to the the Picker Button",
"name": "tooltip"
}
],
"members": [
{
"kind": "field",
"name": "activeDescendant",
"type": {
"text": "ComboboxOption | MenuItem | undefined"
},
"privacy": "private",
"description": "The currently active ComboboxItem descendant, when available."
},
{
"kind": "field",
"name": "autocomplete",
"type": {
"text": "'list' | 'none'"
},
"privacy": "public",
"default": "'none'",
"attribute": "autocomplete"
},
{
"kind": "field",
"name": "availableOptions",
"type": {
"text": "(ComboboxOption | MenuItem)[]"
},
"privacy": "private",
"default": "[]"
},
{
"kind": "field",
"name": "open",
"type": {
"text": "boolean"
},
"privacy": "public",
"default": "false",
"description": "Whether the listbox is visible.",
"attribute": "open",
"reflects": true
},
{
"kind": "field",
"name": "pending",
"type": {
"text": "boolean"
},
"privacy": "public",
"default": "false",
"description": "Whether the items are currently loading.",
"attribute": "pending",
"reflects": true
},
{
"kind": "field",
"name": "pendingLabel",
"type": {
"text": "string"
},
"privacy": "public",
"default": "'Pending'",
"description": "Defines a string value that labels the Combobox while it is in pending state.",
"attribute": "pending-label"
},
{
"kind": "field",
"name": "pendingStateController",
"type": {
"text": "PendingStateController<this>"
},
"privacy": "public",
"default": "new PendingStateController(this)"
},
{
"kind": "field",
"name": "optionSlot",
"type": {
"text": "HTMLSlotElement"
},
"privacy": "private"
},
{
"kind": "field",
"name": "overlayOpen",
"type": {
"text": "boolean"
},
"default": "false"
},
{
"kind": "field",
"name": "input",
"type": {
"text": "HTMLInputElement"
},
"privacy": "private"
},
{
"kind": "field",
"name": "itemValue",
"type": {
"text": "string"
},
"privacy": "private",
"default": "''"
},
{
"kind": "field",
"name": "options",
"type": {
"text": "(ComboboxOption | MenuItem)[] | undefined"
},
"privacy": "public",
"description": "An array of options to present in the Menu provided while typing into the input",
"attribute": "options"
},
{
"kind": "field",
"name": "optionEls",
"type": {
"text": "MenuItem[]"
},
"privacy": "protected",
"default": "[]",
"description": "The array of the children of the combobox, ie ComboboxItems."
},
{
"kind": "field",
"name": "tooltipEl",
"type": {
"text": "Tooltip | undefined"
},
"privacy": "private"
},
{
"kind": "method",
"name": "focus",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "click",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "scrollToActiveDescendant",
"privacy": "private",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "handleComboboxKeydown",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
},
"parameters": [
{
"name": "event",
"type": {
"text": "KeyboardEvent"
}
}
]
},
{
"kind": "method",
"name": "handleSlotchange",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
},
"description": "Convert the flattened array of assigned elements of `slot[name='option']` to\nan array of `ComboboxOptions` for use in rendering options in the shadow DOM.s"
},
{
"kind": "method",
"name": "handleTooltipSlotchange",
"privacy": "protected",
"return": {
"type": {
"text": "void"
}
},
"parameters": [
{
"name": "event",
"type": {
"text": "Event & { target: HTMLSlotElement }"
}
}
]
},
{
"kind": "method",
"name": "setOptionsFromSlottedItems",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "activateNextDescendant",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "activatePreviousDescendant",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "selectDescendant",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "filterAvailableOptions",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "handleInput",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
},
"parameters": [
{
"name": "event",
"type": {
"text": "Event"
}
}
]
},
{
"kind": "method",
"name": "handleMenuChange",
"privacy": "protected",
"return": {
"type": {
"text": "void"
}
},
"parameters": [
{
"name": "event",
"type": {
"text": "PointerEvent & { target: Menu }"
}
}
]
},
{
"kind": "method",
"name": "handleClosed",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "handleOpened",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "toggleOpen",
"privacy": "public",
"return": {
"type": {
"text": "void"
}
}
},
{
"kind": "method",
"name": "onBlur",
"privacy": "protected",
"return": {
"type": {
"text": "void"
}
},
"parameters": [
{
"name": "event",
"type": {
"text": "FocusEvent"
}
}
]
},
{
"kind": "method",
"name": "renderAppliedLabel",
"privacy": "protected",
"return": {
"type": {
"text": "TemplateResult"
}
}
},
{
"kind": "method",
"name": "renderLoader",
"privacy": "protected",
"return": {
"type": {
"text": "TemplateResult"
}
}
},
{
"kind": "method",
"name": "renderField",
"privacy": "protected",
"return": {
"type": {
"text": "TemplateResult"
}
}
},
{
"kind": "field",
"name": "applyFocusElementLabel"
},
{
"kind": "field",
"name": "_returnItems",
"privacy": "private"
},
{
"kind": "method",
"name": "manageListOverlay",
"privacy": "protected",
"return": {
"type": {
"text": "Promise<void>"
}
}
},
{
"kind": "method",
"name": "getUpdateComplete",
"privacy": "protected",
"return": {
"type": {
"text": "Promise<boolean>"
}
}
},
{
"kind": "field",
"name": "itemObserver",
"type": {
"text": "MutationObserver"
},
"privacy": "private"
}
],
"attributes": [
{
"name": "autocomplete",
"type": {
"text": "'list' | 'none'"
},
"default": "'none'",
"fieldName": "autocomplete"
},
{
"name": "open",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Whether the listbox is visible.",
"fieldName": "open"
},
{
"name": "pending",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Whether the items are currently loading.",
"fieldName": "pending"
},
{
"name": "pending-label",
"type": {
"text": "string"
},
"default": "'Pending'",
"description": "Defines a string value that labels the Combobox while it is in pending state.",
"fieldName": "pendingLabel"
},
{
"name": "options",
"type": {
"text": "(ComboboxOption | MenuItem)[] | undefined"
},
"description": "An array of options to present in the Menu provided while typing into the input",
"fieldName": "options"
}
],
"superclass": {
"name": "Textfield",
"package": "@spectrum-web-components/textfield"
},
"tagName": "sp-combobox",
"customElement": true
}
],
"exports": [
{
"kind": "js",
"name": "Combobox",
"declaration": {
"name": "Combobox",
"module": "src/Combobox.js"
}
}
]
}
]
}