react-aria-components
Version:
A library of styleable components built using React Aria
92 lines (78 loc) • 4.02 kB
JavaScript
var $1bcfcef5af644e13$exports = require("./Input.main.js");
var $c5ccf687772c0422$exports = require("./utils.main.js");
var $a83c69b310385d53$exports = require("./SearchField.main.js");
var $3f2c5af9d7d8905b$exports = require("./TextField.main.js");
var $5lGAV$reactariaautocomplete = require("@react-aria/autocomplete");
var $5lGAV$reactstatelyautocomplete = require("@react-stately/autocomplete");
var $5lGAV$reactariautils = require("@react-aria/utils");
var $5lGAV$react = require("react");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "AutocompleteContext", () => $33f48720060787fa$export$36e687af51cd0967);
$parcel$export(module.exports, "AutocompleteStateContext", () => $33f48720060787fa$export$68ee3368b6d68148);
$parcel$export(module.exports, "UNSTABLE_InternalAutocompleteContext", () => $33f48720060787fa$export$65d2a03b8800d6e3);
$parcel$export(module.exports, "Autocomplete", () => $33f48720060787fa$export$2f2b9559550c7bbc);
/*
* Copyright 2024 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
const $33f48720060787fa$export$36e687af51cd0967 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
const $33f48720060787fa$export$68ee3368b6d68148 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
const $33f48720060787fa$export$65d2a03b8800d6e3 = /*#__PURE__*/ (0, $5lGAV$react.createContext)(null);
function $33f48720060787fa$export$2f2b9559550c7bbc(props) {
let ctx = (0, $c5ccf687772c0422$exports.useSlottedContext)($33f48720060787fa$export$36e687af51cd0967, props.slot);
props = (0, $5lGAV$reactariautils.mergeProps)(ctx, props);
let { filter: filter, disableAutoFocusFirst: disableAutoFocusFirst } = props;
let state = (0, $5lGAV$reactstatelyautocomplete.useAutocompleteState)(props);
let inputRef = (0, $5lGAV$react.useRef)(null);
let collectionRef = (0, $5lGAV$react.useRef)(null);
let { textFieldProps: textFieldProps, collectionProps: collectionProps, collectionRef: mergedCollectionRef, filter: filterFn } = (0, $5lGAV$reactariaautocomplete.useAutocomplete)({
...(0, $c5ccf687772c0422$exports.removeDataAttributes)(props),
filter: filter,
disableAutoFocusFirst: disableAutoFocusFirst,
inputRef: inputRef,
collectionRef: collectionRef
}, state);
return /*#__PURE__*/ (0, ($parcel$interopDefault($5lGAV$react))).createElement((0, $c5ccf687772c0422$exports.Provider), {
values: [
[
$33f48720060787fa$export$68ee3368b6d68148,
state
],
[
(0, $a83c69b310385d53$exports.SearchFieldContext),
textFieldProps
],
[
(0, $3f2c5af9d7d8905b$exports.TextFieldContext),
textFieldProps
],
[
(0, $1bcfcef5af644e13$exports.InputContext),
{
ref: inputRef
}
],
[
$33f48720060787fa$export$65d2a03b8800d6e3,
{
filter: filterFn,
collectionProps: collectionProps,
collectionRef: mergedCollectionRef
}
]
]
}, props.children);
}
//# sourceMappingURL=Autocomplete.main.js.map