@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
14 lines (13 loc) • 880 B
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import { __rest } from "tslib";
import { h } from "@stencil/core";
import { getDefaultProps } from "../_helpers/getDefaultProps";
const ComboboxFc = (props) => {
const { open, ariaDescribedBy, hideLabel, label, focusedOptionIndex = -1 } = props, other = __rest(props, ["open", "ariaDescribedBy", "hideLabel", "label", "focusedOptionIndex"]);
const inputProps = Object.assign(Object.assign(Object.assign({}, other), getDefaultProps({ ariaDescribedBy, hideLabel, label })), { type: 'text', role: 'combobox', 'aria-selected': Boolean(open), 'aria-controls': 'listbox', 'aria-autocomplete': 'both', 'aria-activedescendant': open && focusedOptionIndex >= 0 ? `option-${focusedOptionIndex}` : undefined });
return h("input", Object.assign({}, inputProps));
};
export default ComboboxFc;
//# sourceMappingURL=Combobox.js.map