1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.useTypeaheadContext = exports.defaultContext = exports.TypeaheadContext = void 0;
|
7 |
|
8 | var _react = require("react");
|
9 |
|
10 | var _utils = require("../utils");
|
11 |
|
12 | var defaultContext = {
|
13 | activeIndex: -1,
|
14 | hintText: '',
|
15 | id: '',
|
16 | initialItem: null,
|
17 | inputNode: null,
|
18 | isOnlyResult: false,
|
19 | onActiveItemChange: _utils.noop,
|
20 | onAdd: _utils.noop,
|
21 | onInitialItemChange: _utils.noop,
|
22 | onMenuItemClick: _utils.noop,
|
23 | setItem: _utils.noop
|
24 | };
|
25 | exports.defaultContext = defaultContext;
|
26 | var TypeaheadContext = (0, _react.createContext)(defaultContext);
|
27 | exports.TypeaheadContext = TypeaheadContext;
|
28 |
|
29 | var useTypeaheadContext = function useTypeaheadContext() {
|
30 | return (0, _react.useContext)(TypeaheadContext);
|
31 | };
|
32 |
|
33 | exports.useTypeaheadContext = useTypeaheadContext; |
\ | No newline at end of file |