@primer/components 30.3.0-rc.2010c7d4 → 30.3.0-rc.9dbc85a9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -2
- package/dist/browser.esm.js +717 -718
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +320 -321
- package/dist/browser.umd.js.map +1 -1
- package/docs/content/Autocomplete.mdx +627 -0
- package/docs/content/TextInputTokens.mdx +89 -0
- package/docs/src/@primer/gatsby-theme-doctocat/nav.yml +2 -0
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +2 -1
- package/lib/AnchoredOverlay/AnchoredOverlay.js +11 -3
- package/lib/Autocomplete/Autocomplete.d.ts +304 -0
- package/lib/Autocomplete/Autocomplete.js +145 -0
- package/lib/Autocomplete/AutocompleteContext.d.ts +17 -0
- package/lib/Autocomplete/AutocompleteContext.js +11 -0
- package/lib/Autocomplete/AutocompleteInput.d.ts +292 -0
- package/lib/Autocomplete/AutocompleteInput.js +157 -0
- package/lib/Autocomplete/AutocompleteMenu.d.ts +72 -0
- package/lib/Autocomplete/AutocompleteMenu.js +224 -0
- package/lib/Autocomplete/AutocompleteOverlay.d.ts +20 -0
- package/lib/Autocomplete/AutocompleteOverlay.js +80 -0
- package/lib/Autocomplete/index.d.ts +2 -0
- package/lib/Autocomplete/index.js +15 -0
- package/lib/FilteredActionList/FilteredActionList.js +5 -31
- package/lib/Overlay.d.ts +1 -0
- package/lib/Overlay.js +3 -1
- package/lib/__tests__/Autocomplete.test.d.ts +1 -0
- package/lib/__tests__/Autocomplete.test.js +528 -0
- package/lib/__tests__/behaviors/scrollIntoViewingArea.test.d.ts +1 -0
- package/lib/__tests__/behaviors/scrollIntoViewingArea.test.js +226 -0
- package/lib/behaviors/scrollIntoViewingArea.d.ts +1 -0
- package/lib/behaviors/scrollIntoViewingArea.js +39 -0
- package/lib/hooks/useOpenAndCloseFocus.d.ts +2 -1
- package/lib/hooks/useOpenAndCloseFocus.js +7 -2
- package/lib/hooks/useOverlay.d.ts +2 -1
- package/lib/hooks/useOverlay.js +4 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.js +8 -0
- package/lib/stories/Autocomplete.stories.js +608 -0
- package/lib/utils/types/MandateProps.d.ts +3 -0
- package/lib/utils/types/MandateProps.js +1 -0
- package/lib/utils/types/index.d.ts +1 -0
- package/lib/utils/types/index.js +13 -0
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +2 -1
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +11 -3
- package/lib-esm/Autocomplete/Autocomplete.d.ts +304 -0
- package/lib-esm/Autocomplete/Autocomplete.js +123 -0
- package/lib-esm/Autocomplete/AutocompleteContext.d.ts +17 -0
- package/lib-esm/Autocomplete/AutocompleteContext.js +2 -0
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +292 -0
- package/lib-esm/Autocomplete/AutocompleteInput.js +138 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +72 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.js +205 -0
- package/lib-esm/Autocomplete/AutocompleteOverlay.d.ts +20 -0
- package/lib-esm/Autocomplete/AutocompleteOverlay.js +62 -0
- package/lib-esm/Autocomplete/index.d.ts +2 -0
- package/lib-esm/Autocomplete/index.js +1 -0
- package/lib-esm/FilteredActionList/FilteredActionList.js +3 -31
- package/lib-esm/Overlay.d.ts +1 -0
- package/lib-esm/Overlay.js +3 -1
- package/lib-esm/__tests__/Autocomplete.test.d.ts +1 -0
- package/lib-esm/__tests__/Autocomplete.test.js +494 -0
- package/lib-esm/__tests__/behaviors/scrollIntoViewingArea.test.d.ts +1 -0
- package/lib-esm/__tests__/behaviors/scrollIntoViewingArea.test.js +224 -0
- package/lib-esm/behaviors/scrollIntoViewingArea.d.ts +1 -0
- package/lib-esm/behaviors/scrollIntoViewingArea.js +30 -0
- package/lib-esm/hooks/useOpenAndCloseFocus.d.ts +2 -1
- package/lib-esm/hooks/useOpenAndCloseFocus.js +7 -2
- package/lib-esm/hooks/useOverlay.d.ts +2 -1
- package/lib-esm/hooks/useOverlay.js +4 -2
- package/lib-esm/index.d.ts +2 -0
- package/lib-esm/index.js +1 -0
- package/lib-esm/stories/Autocomplete.stories.js +549 -0
- package/lib-esm/utils/types/MandateProps.d.ts +3 -0
- package/lib-esm/utils/types/MandateProps.js +1 -0
- package/lib-esm/utils/types/index.d.ts +1 -0
- package/lib-esm/utils/types/index.js +2 -1
- package/package.json +1 -1
- package/src/AnchoredOverlay/AnchoredOverlay.tsx +14 -3
- package/src/Autocomplete/Autocomplete.tsx +103 -0
- package/src/Autocomplete/AutocompleteContext.tsx +19 -0
- package/src/Autocomplete/AutocompleteInput.tsx +179 -0
- package/src/Autocomplete/AutocompleteMenu.tsx +341 -0
- package/src/Autocomplete/AutocompleteOverlay.tsx +68 -0
- package/src/Autocomplete/index.ts +2 -0
- package/src/FilteredActionList/FilteredActionList.tsx +10 -25
- package/src/Overlay.tsx +4 -1
- package/src/__tests__/Autocomplete.test.tsx +444 -0
- package/src/__tests__/__snapshots__/Autocomplete.test.tsx.snap +3414 -0
- package/src/__tests__/behaviors/scrollIntoViewingArea.test.ts +195 -0
- package/src/behaviors/scrollIntoViewingArea.ts +27 -0
- package/src/hooks/useOpenAndCloseFocus.ts +7 -2
- package/src/hooks/useOverlay.tsx +4 -2
- package/src/index.ts +2 -0
- package/src/stories/Autocomplete.stories.tsx +572 -0
- package/src/utils/types/MandateProps.ts +19 -0
- package/src/utils/types/index.ts +1 -0
- package/stats.html +1 -1
@@ -0,0 +1,89 @@
|
|
1
|
+
---
|
2
|
+
title: TextInputWithTokens
|
3
|
+
status: Alpha
|
4
|
+
source: https://github.com/primer/react/tree/main/src/TextInputWithTokens.tsx
|
5
|
+
---
|
6
|
+
|
7
|
+
import {Props} from '../src/props'
|
8
|
+
import {TextInputWithTokens} from '@primer/components'
|
9
|
+
|
10
|
+
A `TextInputWithTokens` component is used to show multiple values in one field.
|
11
|
+
|
12
|
+
It supports all of the features of a [TextInput](/TextInput) component, but it can render a list of [Tokens](/Token) next to the area a user types in.
|
13
|
+
|
14
|
+
## Basic Example
|
15
|
+
|
16
|
+
```javascript live noinline
|
17
|
+
const BasicExample = () => {
|
18
|
+
const [tokens, setTokens] = React.useState([
|
19
|
+
{text: 'zero', id: 0},
|
20
|
+
{text: 'one', id: 1},
|
21
|
+
{text: 'two', id: 2}
|
22
|
+
])
|
23
|
+
const onTokenRemove = tokenId => {
|
24
|
+
setTokens(tokens.filter(token => token.id !== tokenId))
|
25
|
+
}
|
26
|
+
|
27
|
+
return (
|
28
|
+
<>
|
29
|
+
<Box as="label" display="block" htmlFor="inputWithTokens-basic">
|
30
|
+
Basic example tokens
|
31
|
+
</Box>
|
32
|
+
<TextInputWithTokens tokens={tokens} onTokenRemove={onTokenRemove} id="inputWithTokens-basic" />
|
33
|
+
</>
|
34
|
+
)
|
35
|
+
}
|
36
|
+
|
37
|
+
render(BasicExample)
|
38
|
+
```
|
39
|
+
|
40
|
+
## Component Props
|
41
|
+
|
42
|
+
<Props of={TextInputWithTokens} />
|
43
|
+
|
44
|
+
## Adding and removing tokens
|
45
|
+
|
46
|
+
The array passed to the `tokens` prop needs to be manually updated to add and remove tokens.
|
47
|
+
|
48
|
+
The function passed to the `onRemoveToken` prop is called when:
|
49
|
+
|
50
|
+
- Clicking the remove button in the token
|
51
|
+
- Pressing the `Backspace` key when the input is empty
|
52
|
+
- Selecting a token using the arrow keys or by clicking on a token and then pressing the `Backspace` key
|
53
|
+
|
54
|
+
There is no function that gets called to "add" a token, so the user needs to be provided with a UI to select tokens.
|
55
|
+
|
56
|
+
## Custom token rendering
|
57
|
+
|
58
|
+
By default, the `Token` component is used to render the tokens in the input. If this component does not make sense for the kinds of tokens you're rendering, you can pass a component to the `tokenComponent` prop
|
59
|
+
|
60
|
+
Example: a `TextInputWithTokens` that renders tokens as `IssueLabelToken`:
|
61
|
+
|
62
|
+
```javascript live noinline
|
63
|
+
const UsingIssueLabelTokens = () => {
|
64
|
+
const [tokens, setTokens] = React.useState([
|
65
|
+
{text: 'enhancement', id: 1, fillColor: '#a2eeef'},
|
66
|
+
{text: 'bug', id: 2, fillColor: '#d73a4a'},
|
67
|
+
{text: 'good first issue', id: 3, fillColor: '#0cf478'}
|
68
|
+
])
|
69
|
+
const onTokenRemove = tokenId => {
|
70
|
+
setTokens(tokens.filter(token => token.id !== tokenId))
|
71
|
+
}
|
72
|
+
|
73
|
+
return (
|
74
|
+
<>
|
75
|
+
<Box as="label" display="block" htmlFor="inputWithTokens-issueLabels">
|
76
|
+
Issue labels
|
77
|
+
</Box>
|
78
|
+
<TextInputWithTokens
|
79
|
+
tokenComponent={IssueLabelToken}
|
80
|
+
tokens={tokens}
|
81
|
+
onTokenRemove={onTokenRemove}
|
82
|
+
id="inputWithTokens-issueLabels"
|
83
|
+
/>
|
84
|
+
</>
|
85
|
+
)
|
86
|
+
}
|
87
|
+
|
88
|
+
render(<UsingIssueLabelTokens />)
|
89
|
+
```
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
2
2
|
import { OverlayProps } from '../Overlay';
|
3
3
|
import { FocusTrapHookSettings } from '../hooks/useFocusTrap';
|
4
4
|
import { FocusZoneHookSettings } from '../hooks/useFocusZone';
|
5
|
+
import { PositionSettings } from '../behaviors/anchoredPosition';
|
5
6
|
interface AnchoredOverlayPropsWithAnchor {
|
6
7
|
/**
|
7
8
|
* A custom function component used to render the anchor element.
|
@@ -52,7 +53,7 @@ interface AnchoredOverlayBaseProps extends Pick<OverlayProps, 'height' | 'width'
|
|
52
53
|
*/
|
53
54
|
focusZoneSettings?: Partial<FocusZoneHookSettings>;
|
54
55
|
}
|
55
|
-
export declare type AnchoredOverlayProps = AnchoredOverlayBaseProps & (AnchoredOverlayPropsWithAnchor | AnchoredOverlayPropsWithoutAnchor)
|
56
|
+
export declare type AnchoredOverlayProps = AnchoredOverlayBaseProps & (AnchoredOverlayPropsWithAnchor | AnchoredOverlayPropsWithoutAnchor) & Partial<Pick<PositionSettings, 'align' | 'side'>>;
|
56
57
|
/**
|
57
58
|
* An `AnchoredOverlay` provides an anchor that will open a floating overlay positioned relative to the anchor.
|
58
59
|
* The overlay can be opened and navigated using keyboard or mouse.
|
@@ -40,7 +40,9 @@ const AnchoredOverlay = ({
|
|
40
40
|
width,
|
41
41
|
overlayProps,
|
42
42
|
focusTrapSettings,
|
43
|
-
focusZoneSettings
|
43
|
+
focusZoneSettings,
|
44
|
+
side,
|
45
|
+
align
|
44
46
|
}) => {
|
45
47
|
const anchorRef = (0, _hooks.useProvidedRefOrCreate)(externalAnchorRef);
|
46
48
|
const [overlayRef, updateOverlayRef] = (0, _hooks.useRenderForcingRef)();
|
@@ -70,7 +72,9 @@ const AnchoredOverlay = ({
|
|
70
72
|
position
|
71
73
|
} = (0, _hooks.useAnchoredPosition)({
|
72
74
|
anchorElementRef: anchorRef,
|
73
|
-
floatingElementRef: overlayRef
|
75
|
+
floatingElementRef: overlayRef,
|
76
|
+
side,
|
77
|
+
align
|
74
78
|
}, [overlayRef.current]);
|
75
79
|
(0, _react.useEffect)(() => {
|
76
80
|
// ensure overlay ref gets cleared when closed, so position can reset between closing/re-opening
|
@@ -113,4 +117,8 @@ const AnchoredOverlay = ({
|
|
113
117
|
};
|
114
118
|
|
115
119
|
exports.AnchoredOverlay = AnchoredOverlay;
|
116
|
-
AnchoredOverlay.displayName = 'AnchoredOverlay';
|
120
|
+
AnchoredOverlay.displayName = 'AnchoredOverlay';
|
121
|
+
AnchoredOverlay.defaultProps = {
|
122
|
+
side: 'outside-bottom',
|
123
|
+
align: 'start'
|
124
|
+
};
|
@@ -0,0 +1,304 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ComponentProps } from '../utils/types';
|
3
|
+
import AutocompleteMenu from './AutocompleteMenu';
|
4
|
+
import AutocompleteOverlay from './AutocompleteOverlay';
|
5
|
+
declare const Autocomplete: React.FC<{
|
6
|
+
id?: string;
|
7
|
+
}>;
|
8
|
+
export declare type AutocompleteProps = ComponentProps<typeof Autocomplete>;
|
9
|
+
export type { AutocompleteInputProps } from './AutocompleteInput';
|
10
|
+
export type { AutocompleteMenuProps } from './AutocompleteMenu';
|
11
|
+
export type { AutocompleteOverlayProps } from './AutocompleteOverlay';
|
12
|
+
declare const _default: React.FC<{
|
13
|
+
id?: string | undefined;
|
14
|
+
}> & {
|
15
|
+
Input: import("@radix-ui/react-polymorphic").ForwardRefComponent<React.ForwardRefExoticComponent<Pick<Omit<Pick<{
|
16
|
+
[x: string]: any;
|
17
|
+
[x: number]: any;
|
18
|
+
} & {
|
19
|
+
theme?: any;
|
20
|
+
} & {
|
21
|
+
as?: string | React.ComponentType<any> | undefined;
|
22
|
+
forwardedAs?: string | React.ComponentType<any> | undefined;
|
23
|
+
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast"> & {
|
24
|
+
className?: string | undefined;
|
25
|
+
icon?: React.ComponentType<{
|
26
|
+
className?: string | undefined;
|
27
|
+
}> | undefined;
|
28
|
+
} & Pick<{
|
29
|
+
color?: string | undefined;
|
30
|
+
maxWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
31
|
+
minWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
32
|
+
translate?: "yes" | "no" | undefined;
|
33
|
+
width?: import("styled-system").ResponsiveValue<import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
34
|
+
hidden?: boolean | undefined;
|
35
|
+
children?: React.ReactNode;
|
36
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
37
|
+
slot?: string | undefined;
|
38
|
+
style?: React.CSSProperties | undefined;
|
39
|
+
title?: string | undefined;
|
40
|
+
key?: React.Key | null | undefined;
|
41
|
+
defaultChecked?: boolean | undefined;
|
42
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
43
|
+
suppressContentEditableWarning?: boolean | undefined;
|
44
|
+
suppressHydrationWarning?: boolean | undefined;
|
45
|
+
accessKey?: string | undefined;
|
46
|
+
className?: string | undefined;
|
47
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
48
|
+
contextMenu?: string | undefined;
|
49
|
+
dir?: string | undefined;
|
50
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
51
|
+
id?: string | undefined;
|
52
|
+
lang?: string | undefined;
|
53
|
+
placeholder?: string | undefined;
|
54
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
55
|
+
tabIndex?: number | undefined;
|
56
|
+
radioGroup?: string | undefined;
|
57
|
+
role?: React.AriaRole | undefined;
|
58
|
+
about?: string | undefined;
|
59
|
+
datatype?: string | undefined;
|
60
|
+
inlist?: any;
|
61
|
+
prefix?: string | undefined;
|
62
|
+
property?: string | undefined;
|
63
|
+
resource?: string | undefined;
|
64
|
+
typeof?: string | undefined;
|
65
|
+
vocab?: string | undefined;
|
66
|
+
autoCapitalize?: string | undefined;
|
67
|
+
autoCorrect?: string | undefined;
|
68
|
+
autoSave?: string | undefined;
|
69
|
+
itemProp?: string | undefined;
|
70
|
+
itemScope?: boolean | undefined;
|
71
|
+
itemType?: string | undefined;
|
72
|
+
itemID?: string | undefined;
|
73
|
+
itemRef?: string | undefined;
|
74
|
+
results?: number | undefined;
|
75
|
+
security?: string | undefined;
|
76
|
+
unselectable?: "on" | "off" | undefined;
|
77
|
+
inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
78
|
+
is?: string | undefined;
|
79
|
+
'aria-activedescendant'?: string | undefined;
|
80
|
+
'aria-atomic'?: boolean | "true" | "false" | undefined;
|
81
|
+
'aria-autocomplete'?: "none" | "list" | "inline" | "both" | undefined;
|
82
|
+
'aria-busy'?: boolean | "true" | "false" | undefined;
|
83
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
84
|
+
'aria-colcount'?: number | undefined;
|
85
|
+
'aria-colindex'?: number | undefined;
|
86
|
+
'aria-colspan'?: number | undefined;
|
87
|
+
'aria-controls'?: string | undefined;
|
88
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
89
|
+
'aria-describedby'?: string | undefined;
|
90
|
+
'aria-details'?: string | undefined;
|
91
|
+
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
92
|
+
'aria-dropeffect'?: "none" | "link" | "copy" | "execute" | "move" | "popup" | undefined;
|
93
|
+
'aria-errormessage'?: string | undefined;
|
94
|
+
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
95
|
+
'aria-flowto'?: string | undefined;
|
96
|
+
'aria-grabbed'?: boolean | "true" | "false" | undefined;
|
97
|
+
'aria-haspopup'?: boolean | "grid" | "dialog" | "menu" | "listbox" | "tree" | "true" | "false" | undefined;
|
98
|
+
'aria-hidden'?: boolean | "true" | "false" | undefined;
|
99
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
100
|
+
'aria-keyshortcuts'?: string | undefined;
|
101
|
+
'aria-label'?: string | undefined;
|
102
|
+
'aria-labelledby'?: string | undefined;
|
103
|
+
'aria-level'?: number | undefined;
|
104
|
+
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
105
|
+
'aria-modal'?: boolean | "true" | "false" | undefined;
|
106
|
+
'aria-multiline'?: boolean | "true" | "false" | undefined;
|
107
|
+
'aria-multiselectable'?: boolean | "true" | "false" | undefined;
|
108
|
+
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
109
|
+
'aria-owns'?: string | undefined;
|
110
|
+
'aria-placeholder'?: string | undefined;
|
111
|
+
'aria-posinset'?: number | undefined;
|
112
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
113
|
+
'aria-readonly'?: boolean | "true" | "false" | undefined;
|
114
|
+
'aria-relevant'?: "all" | "text" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
115
|
+
'aria-required'?: boolean | "true" | "false" | undefined;
|
116
|
+
'aria-roledescription'?: string | undefined;
|
117
|
+
'aria-rowcount'?: number | undefined;
|
118
|
+
'aria-rowindex'?: number | undefined;
|
119
|
+
'aria-rowspan'?: number | undefined;
|
120
|
+
'aria-selected'?: boolean | "true" | "false" | undefined;
|
121
|
+
'aria-setsize'?: number | undefined;
|
122
|
+
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
123
|
+
'aria-valuemax'?: number | undefined;
|
124
|
+
'aria-valuemin'?: number | undefined;
|
125
|
+
'aria-valuenow'?: number | undefined;
|
126
|
+
'aria-valuetext'?: string | undefined;
|
127
|
+
dangerouslySetInnerHTML?: {
|
128
|
+
__html: string;
|
129
|
+
} | undefined;
|
130
|
+
onCopy?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
131
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
132
|
+
onCut?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
133
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
134
|
+
onPaste?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
135
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLSpanElement> | undefined;
|
136
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
137
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
138
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
139
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
140
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
141
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLSpanElement> | undefined;
|
142
|
+
onFocus?: React.FocusEventHandler<HTMLSpanElement> | undefined;
|
143
|
+
onFocusCapture?: React.FocusEventHandler<HTMLSpanElement> | undefined;
|
144
|
+
onBlur?: React.FocusEventHandler<HTMLSpanElement> | undefined;
|
145
|
+
onBlurCapture?: React.FocusEventHandler<HTMLSpanElement> | undefined;
|
146
|
+
onChange?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
147
|
+
onChangeCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
148
|
+
onBeforeInput?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
149
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
150
|
+
onInput?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
151
|
+
onInputCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
152
|
+
onReset?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
153
|
+
onResetCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
154
|
+
onSubmit?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
155
|
+
onSubmitCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
156
|
+
onInvalid?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
157
|
+
onInvalidCapture?: React.FormEventHandler<HTMLSpanElement> | undefined;
|
158
|
+
onLoad?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
159
|
+
onLoadCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
160
|
+
onError?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
161
|
+
onErrorCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
162
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
163
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
164
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
165
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
166
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
167
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLSpanElement> | undefined;
|
168
|
+
onAbort?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
169
|
+
onAbortCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
170
|
+
onCanPlay?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
171
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
172
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
173
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
174
|
+
onDurationChange?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
175
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
176
|
+
onEmptied?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
177
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
178
|
+
onEncrypted?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
179
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
180
|
+
onEnded?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
181
|
+
onEndedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
182
|
+
onLoadedData?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
183
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
184
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
185
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
186
|
+
onLoadStart?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
187
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
188
|
+
onPause?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
189
|
+
onPauseCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
190
|
+
onPlay?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
191
|
+
onPlayCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
192
|
+
onPlaying?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
193
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
194
|
+
onProgress?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
195
|
+
onProgressCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
196
|
+
onRateChange?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
197
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
198
|
+
onSeeked?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
199
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
200
|
+
onSeeking?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
201
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
202
|
+
onStalled?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
203
|
+
onStalledCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
204
|
+
onSuspend?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
205
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
206
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
207
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
208
|
+
onVolumeChange?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
209
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
210
|
+
onWaiting?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
211
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
212
|
+
onAuxClick?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
213
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
214
|
+
onClick?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
215
|
+
onClickCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
216
|
+
onContextMenu?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
217
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
218
|
+
onDoubleClick?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
219
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
220
|
+
onDrag?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
221
|
+
onDragCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
222
|
+
onDragEnd?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
223
|
+
onDragEndCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
224
|
+
onDragEnter?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
225
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
226
|
+
onDragExit?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
227
|
+
onDragExitCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
228
|
+
onDragLeave?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
229
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
230
|
+
onDragOver?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
231
|
+
onDragOverCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
232
|
+
onDragStart?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
233
|
+
onDragStartCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
234
|
+
onDrop?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
235
|
+
onDropCapture?: React.DragEventHandler<HTMLSpanElement> | undefined;
|
236
|
+
onMouseDown?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
237
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
238
|
+
onMouseEnter?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
239
|
+
onMouseLeave?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
240
|
+
onMouseMove?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
241
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
242
|
+
onMouseOut?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
243
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
244
|
+
onMouseOver?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
245
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
246
|
+
onMouseUp?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
247
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLSpanElement> | undefined;
|
248
|
+
onSelect?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
249
|
+
onSelectCapture?: React.ReactEventHandler<HTMLSpanElement> | undefined;
|
250
|
+
onTouchCancel?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
251
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
252
|
+
onTouchEnd?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
253
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
254
|
+
onTouchMove?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
255
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
256
|
+
onTouchStart?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
257
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLSpanElement> | undefined;
|
258
|
+
onPointerDown?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
259
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
260
|
+
onPointerMove?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
261
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
262
|
+
onPointerUp?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
263
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
264
|
+
onPointerCancel?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
265
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
266
|
+
onPointerEnter?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
267
|
+
onPointerEnterCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
268
|
+
onPointerLeave?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
269
|
+
onPointerLeaveCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
270
|
+
onPointerOver?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
271
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
272
|
+
onPointerOut?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
273
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
274
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
275
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
276
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
277
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLSpanElement> | undefined;
|
278
|
+
onScroll?: React.UIEventHandler<HTMLSpanElement> | undefined;
|
279
|
+
onScrollCapture?: React.UIEventHandler<HTMLSpanElement> | undefined;
|
280
|
+
onWheel?: React.WheelEventHandler<HTMLSpanElement> | undefined;
|
281
|
+
onWheelCapture?: React.WheelEventHandler<HTMLSpanElement> | undefined;
|
282
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
283
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
284
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
285
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
286
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
287
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
288
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
|
289
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
|
290
|
+
block?: boolean | undefined;
|
291
|
+
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
292
|
+
disabled?: boolean | undefined;
|
293
|
+
variant?: "large" | "small" | undefined;
|
294
|
+
hasIcon?: boolean | undefined;
|
295
|
+
contrast?: boolean | undefined;
|
296
|
+
} & {
|
297
|
+
theme?: any;
|
298
|
+
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>>, {
|
299
|
+
as?: React.ComponentType<any> | undefined;
|
300
|
+
}>;
|
301
|
+
Menu: typeof AutocompleteMenu;
|
302
|
+
Overlay: typeof AutocompleteOverlay;
|
303
|
+
};
|
304
|
+
export default _default;
|
@@ -0,0 +1,145 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
9
|
+
|
10
|
+
var _ssr = require("@react-aria/ssr");
|
11
|
+
|
12
|
+
var _AutocompleteContext = require("./AutocompleteContext");
|
13
|
+
|
14
|
+
var _AutocompleteInput = _interopRequireDefault(require("./AutocompleteInput"));
|
15
|
+
|
16
|
+
var _AutocompleteMenu = _interopRequireDefault(require("./AutocompleteMenu"));
|
17
|
+
|
18
|
+
var _AutocompleteOverlay = _interopRequireDefault(require("./AutocompleteOverlay"));
|
19
|
+
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
|
+
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
23
|
+
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
25
|
+
|
26
|
+
const initialState = {
|
27
|
+
inputValue: '',
|
28
|
+
showMenu: false,
|
29
|
+
isMenuDirectlyActivated: false,
|
30
|
+
autocompleteSuggestion: '',
|
31
|
+
selectedItemLength: 0
|
32
|
+
};
|
33
|
+
|
34
|
+
const reducer = (state, action) => {
|
35
|
+
const {
|
36
|
+
type,
|
37
|
+
payload
|
38
|
+
} = action;
|
39
|
+
|
40
|
+
switch (type) {
|
41
|
+
case 'inputValue':
|
42
|
+
return { ...state,
|
43
|
+
inputValue: payload
|
44
|
+
};
|
45
|
+
|
46
|
+
case 'showMenu':
|
47
|
+
return { ...state,
|
48
|
+
showMenu: payload
|
49
|
+
};
|
50
|
+
|
51
|
+
case 'isMenuDirectlyActivated':
|
52
|
+
return { ...state,
|
53
|
+
isMenuDirectlyActivated: payload
|
54
|
+
};
|
55
|
+
|
56
|
+
case 'autocompleteSuggestion':
|
57
|
+
return { ...state,
|
58
|
+
autocompleteSuggestion: payload
|
59
|
+
};
|
60
|
+
|
61
|
+
case 'selectedItemLength':
|
62
|
+
return { ...state,
|
63
|
+
selectedItemLength: payload
|
64
|
+
};
|
65
|
+
|
66
|
+
default:
|
67
|
+
return state;
|
68
|
+
}
|
69
|
+
};
|
70
|
+
|
71
|
+
const Autocomplete = ({
|
72
|
+
children,
|
73
|
+
id: idProp
|
74
|
+
}) => {
|
75
|
+
const activeDescendantRef = (0, _react.useRef)(null);
|
76
|
+
const scrollContainerRef = (0, _react.useRef)(null);
|
77
|
+
const inputRef = (0, _react.useRef)(null);
|
78
|
+
const [state, dispatch] = (0, _react.useReducer)(reducer, initialState);
|
79
|
+
const {
|
80
|
+
inputValue,
|
81
|
+
showMenu,
|
82
|
+
autocompleteSuggestion,
|
83
|
+
isMenuDirectlyActivated,
|
84
|
+
selectedItemLength
|
85
|
+
} = state;
|
86
|
+
const setInputValue = (0, _react.useCallback)(value => {
|
87
|
+
dispatch({
|
88
|
+
type: 'inputValue',
|
89
|
+
payload: value
|
90
|
+
});
|
91
|
+
}, []);
|
92
|
+
const setShowMenu = (0, _react.useCallback)(value => {
|
93
|
+
dispatch({
|
94
|
+
type: 'showMenu',
|
95
|
+
payload: value
|
96
|
+
});
|
97
|
+
}, []);
|
98
|
+
const setAutocompleteSuggestion = (0, _react.useCallback)(value => {
|
99
|
+
dispatch({
|
100
|
+
type: 'autocompleteSuggestion',
|
101
|
+
payload: value
|
102
|
+
});
|
103
|
+
}, []);
|
104
|
+
const setIsMenuDirectlyActivated = (0, _react.useCallback)(value => {
|
105
|
+
dispatch({
|
106
|
+
type: 'isMenuDirectlyActivated',
|
107
|
+
payload: value
|
108
|
+
});
|
109
|
+
}, []);
|
110
|
+
const setSelectedItemLength = (0, _react.useCallback)(value => {
|
111
|
+
dispatch({
|
112
|
+
type: 'selectedItemLength',
|
113
|
+
payload: value
|
114
|
+
});
|
115
|
+
}, []);
|
116
|
+
const id = (0, _ssr.useSSRSafeId)(idProp);
|
117
|
+
return /*#__PURE__*/_react.default.createElement(_AutocompleteContext.AutocompleteContext.Provider, {
|
118
|
+
value: {
|
119
|
+
activeDescendantRef,
|
120
|
+
autocompleteSuggestion,
|
121
|
+
id,
|
122
|
+
inputRef,
|
123
|
+
inputValue,
|
124
|
+
isMenuDirectlyActivated,
|
125
|
+
scrollContainerRef,
|
126
|
+
selectedItemLength,
|
127
|
+
setAutocompleteSuggestion,
|
128
|
+
setInputValue,
|
129
|
+
setIsMenuDirectlyActivated,
|
130
|
+
setShowMenu,
|
131
|
+
setSelectedItemLength,
|
132
|
+
showMenu
|
133
|
+
}
|
134
|
+
}, children);
|
135
|
+
};
|
136
|
+
|
137
|
+
Autocomplete.displayName = "Autocomplete";
|
138
|
+
|
139
|
+
var _default = Object.assign(Autocomplete, {
|
140
|
+
Input: _AutocompleteInput.default,
|
141
|
+
Menu: _AutocompleteMenu.default,
|
142
|
+
Overlay: _AutocompleteOverlay.default
|
143
|
+
});
|
144
|
+
|
145
|
+
exports.default = _default;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare const AutocompleteContext: import("react").Context<{
|
3
|
+
activeDescendantRef: React.MutableRefObject<HTMLElement | null>;
|
4
|
+
autocompleteSuggestion: string;
|
5
|
+
id: string;
|
6
|
+
inputRef: React.MutableRefObject<HTMLInputElement | null>;
|
7
|
+
inputValue: string;
|
8
|
+
isMenuDirectlyActivated: boolean;
|
9
|
+
scrollContainerRef: React.MutableRefObject<HTMLElement | null>;
|
10
|
+
selectedItemLength: number;
|
11
|
+
setAutocompleteSuggestion: (value: string) => void;
|
12
|
+
setInputValue: (value: string) => void;
|
13
|
+
setIsMenuDirectlyActivated: (value: boolean) => void;
|
14
|
+
setSelectedItemLength: (value: number) => void;
|
15
|
+
setShowMenu: (value: boolean) => void;
|
16
|
+
showMenu: boolean;
|
17
|
+
} | null>;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.AutocompleteContext = void 0;
|
7
|
+
|
8
|
+
var _react = require("react");
|
9
|
+
|
10
|
+
const AutocompleteContext = /*#__PURE__*/(0, _react.createContext)(null);
|
11
|
+
exports.AutocompleteContext = AutocompleteContext;
|