@atlaskit/quick-search 8.1.0 → 8.1.2
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 +12 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/QuickSearch.d.ts +4 -4
- package/dist/types/components/ResultItem/ResultItem.d.ts +1 -1
- package/dist/types/components/ResultItem/ResultItemGroup.d.ts +1 -1
- package/dist/types/components/Results/ContainerResult.d.ts +1 -1
- package/dist/types/components/Results/ObjectResult.d.ts +1 -1
- package/dist/types/components/Results/PersonResult.d.ts +1 -1
- package/dist/types/components/Results/ResultBase.d.ts +2 -2
- package/dist/types/components/Results/types.d.ts +6 -6
- package/dist/types/components/Search/Search.d.ts +1 -1
- package/dist/types/components/context.d.ts +1 -1
- package/dist/types/components/isReactElement.d.ts +1 -1
- package/dist/types-ts4.5/components/QuickSearch.d.ts +122 -0
- package/dist/types-ts4.5/components/ResultItem/ResultItem.d.ts +38 -0
- package/dist/types-ts4.5/components/ResultItem/ResultItemGroup.d.ts +11 -0
- package/dist/types-ts4.5/components/ResultItem/styled.d.ts +13 -0
- package/dist/types-ts4.5/components/Results/ContainerResult.d.ts +19 -0
- package/dist/types-ts4.5/components/Results/ObjectResult.d.ts +22 -0
- package/dist/types-ts4.5/components/Results/PersonResult.d.ts +20 -0
- package/dist/types-ts4.5/components/Results/ResultBase.d.ts +37 -0
- package/dist/types-ts4.5/components/Results/index.d.ts +4 -0
- package/dist/types-ts4.5/components/Results/types.d.ts +34 -0
- package/dist/types-ts4.5/components/Search/Search.d.ts +31 -0
- package/dist/types-ts4.5/components/Search/styled.d.ts +10 -0
- package/dist/types-ts4.5/components/constants.d.ts +6 -0
- package/dist/types-ts4.5/components/context.d.ts +22 -0
- package/dist/types-ts4.5/components/decorateWithAnalyticsData.d.ts +3 -0
- package/dist/types-ts4.5/components/isReactElement.d.ts +6 -0
- package/dist/types-ts4.5/index.d.ts +17 -0
- package/package.json +11 -3
- package/report.api.md +1 -1
- package/tmp/api-report-tmp.d.ts +263 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/quick-search
|
|
2
2
|
|
|
3
|
+
## 8.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
8
|
+
|
|
9
|
+
## 8.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
14
|
+
|
|
3
15
|
## 8.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ResultData, SelectedResultId } from './Results/types';
|
|
3
3
|
import { ResultContextType } from './context';
|
|
4
4
|
import { ResultBase } from './Results/ResultBase';
|
|
5
|
-
export
|
|
5
|
+
export type Props = {
|
|
6
6
|
/** Search results in the form of ResultItemGroups containing Result components */
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
/** Set search loading state */
|
|
@@ -31,7 +31,7 @@ export declare type Props = {
|
|
|
31
31
|
/** One string that is used to autocomplete the current search query */
|
|
32
32
|
autocompleteText?: string;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type State = {
|
|
35
35
|
selectedResultId: SelectedResultId;
|
|
36
36
|
context: ResultContextType;
|
|
37
37
|
value?: string;
|
|
@@ -107,16 +107,16 @@ export declare class QuickSearch extends React.Component<Props, State> {
|
|
|
107
107
|
* Tab / ArrowRight - Accept autocomplete
|
|
108
108
|
*/
|
|
109
109
|
handleSearchKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
110
|
-
acceptAutocomplete: (event: React.KeyboardEvent<HTMLInputElement>, text?: string
|
|
110
|
+
acceptAutocomplete: (event: React.KeyboardEvent<HTMLInputElement>, text?: string) => void;
|
|
111
111
|
setSearchInputRef: (refs: any) => void;
|
|
112
112
|
focusSearchInput: () => void;
|
|
113
113
|
render(): JSX.Element;
|
|
114
114
|
}
|
|
115
|
-
declare const _default: React.ComponentClass<Props, any>;
|
|
116
115
|
/**
|
|
117
116
|
* HOCs:
|
|
118
117
|
* `decorateWithAnalyticsData` - Wrapper that decorates analytics events with additional data.
|
|
119
118
|
* `withAnalytics` - Injects analytics firing methods that are picked up by
|
|
120
119
|
* @atlaskit/analytics/AnalyticsListener.
|
|
121
120
|
*/
|
|
121
|
+
declare const _default: React.ComponentClass<Props, any>;
|
|
122
122
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type Props = {
|
|
3
3
|
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
4
4
|
caption?: string;
|
|
5
5
|
/** Location to link out to on click. This is passed down to the custom link component if one is provided. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type Props = {
|
|
3
3
|
/** Text to appear as heading above group. Will be auto-capitalised. */
|
|
4
4
|
title: React.ReactNode;
|
|
5
5
|
/** React Elements to be displayed within the group. This should generally be a collection of ResultItems. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CommonResultProps } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type Props = CommonResultProps & {
|
|
4
4
|
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
5
|
name: React.ReactNode;
|
|
6
6
|
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CommonResultProps } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type Props = CommonResultProps & {
|
|
4
4
|
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
5
|
name: React.ReactNode;
|
|
6
6
|
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CommonResultProps } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type Props = CommonResultProps & {
|
|
4
4
|
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
5
|
name: React.ReactNode;
|
|
6
6
|
/** A user's custom handle. Appears to the right of their `name`. It has a lower font-weight. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnalyticsData, CommonResultProps } from './types';
|
|
3
3
|
import { ResultContextType } from '../context';
|
|
4
|
-
export
|
|
4
|
+
export type Props = CommonResultProps & {
|
|
5
5
|
/** Type of the result. This is passed as a parameter to certain callbacks. */
|
|
6
6
|
type: string;
|
|
7
7
|
/** Main text to be displayed as the item. */
|
|
@@ -15,7 +15,7 @@ export declare type Props = CommonResultProps & {
|
|
|
15
15
|
/** The context provided by QuickSearch. */
|
|
16
16
|
context?: ResultContextType;
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
type DefaultProps = {
|
|
19
19
|
context: ResultContextType;
|
|
20
20
|
};
|
|
21
21
|
export declare class ResultBase extends React.PureComponent<DefaultProps & Props> {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
2
|
+
export type AnalyticsData = Object;
|
|
3
|
+
export type ResultId = string | number;
|
|
4
|
+
export type SelectedResultId = ResultId | null;
|
|
5
|
+
export type CancelableEvent = KeyboardEvent | MouseEvent | React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLElement>;
|
|
6
|
+
export type ResultData = {
|
|
7
7
|
resultId: ResultId;
|
|
8
8
|
type: string;
|
|
9
9
|
event: CancelableEvent;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type CommonResultProps = {
|
|
12
12
|
/** Unique ID of the result. This is passed as a parameter to certain callbacks */
|
|
13
13
|
resultId: string | number;
|
|
14
14
|
/** Type of the result. This is passed as a parameter to certain callbacks. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const controlKeys: string[];
|
|
3
|
-
|
|
3
|
+
type Props = {
|
|
4
4
|
/** The elements to render as options to search from. */
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
/** The elements to render to the right of the search input. */
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
3
|
import { ResultData, ResultId, SelectedResultId } from './Results/types';
|
|
4
4
|
import { ResultBase } from './Results/ResultBase';
|
|
5
|
-
export
|
|
5
|
+
export type ResultContextType = {
|
|
6
6
|
/** Register result as keyboard navigation target */
|
|
7
7
|
registerResult: (result: ResultBase) => void;
|
|
8
8
|
/** Unregister result as keyboard navigation target */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const _default: (element: any) => boolean;
|
|
2
1
|
/**
|
|
3
2
|
* Heuristically check whether an element is a react element or not.
|
|
4
3
|
* React elements have constructors for their type property but native elements use strings.
|
|
5
4
|
*/
|
|
5
|
+
declare const _default: (element: any) => boolean;
|
|
6
6
|
export default _default;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ResultData, SelectedResultId } from './Results/types';
|
|
3
|
+
import { ResultContextType } from './context';
|
|
4
|
+
import { ResultBase } from './Results/ResultBase';
|
|
5
|
+
export type Props = {
|
|
6
|
+
/** Search results in the form of ResultItemGroups containing Result components */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/** Set search loading state */
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
/** onBlur callback for search input */
|
|
11
|
+
onSearchBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
12
|
+
/** onInput callback for search input */
|
|
13
|
+
onSearchInput?: (event: React.FormEvent<HTMLInputElement>, isAutocompleted?: boolean) => void;
|
|
14
|
+
/** onKeyDown callback for search input */
|
|
15
|
+
onSearchKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
16
|
+
/** Called when the user submits the search form without selecting a result */
|
|
17
|
+
onSearchSubmit?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
18
|
+
/** Placeholder text for search input field */
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
/** Value of the search input field */
|
|
21
|
+
value?: string;
|
|
22
|
+
/** Corresponds to the `resultId` of the selected result */
|
|
23
|
+
selectedResultId?: SelectedResultId;
|
|
24
|
+
/** Optional way of being notified when the selected result changes due to keyboard nav */
|
|
25
|
+
onSelectedResultIdChanged?: (id: SelectedResultId) => void;
|
|
26
|
+
firePrivateAnalyticsEvent?: (eventName: string, eventData: Object) => void;
|
|
27
|
+
/** React component to be used for rendering links */
|
|
28
|
+
linkComponent?: React.ComponentType<any>;
|
|
29
|
+
/** The elements to render to the right of the search input. */
|
|
30
|
+
inputControls?: React.ReactNode;
|
|
31
|
+
/** One string that is used to autocomplete the current search query */
|
|
32
|
+
autocompleteText?: string;
|
|
33
|
+
};
|
|
34
|
+
export type State = {
|
|
35
|
+
selectedResultId: SelectedResultId;
|
|
36
|
+
context: ResultContextType;
|
|
37
|
+
value?: string;
|
|
38
|
+
};
|
|
39
|
+
export declare class QuickSearch extends React.Component<Props, State> {
|
|
40
|
+
static defaultProps: {
|
|
41
|
+
children: never[];
|
|
42
|
+
firePrivateAnalyticsEvent: (_: any) => void;
|
|
43
|
+
isLoading: boolean;
|
|
44
|
+
onSearchBlur: (_: any) => void;
|
|
45
|
+
onSearchKeyDown: (_: any) => void;
|
|
46
|
+
onSearchSubmit: (_: any) => void;
|
|
47
|
+
placeholder: string;
|
|
48
|
+
value: string;
|
|
49
|
+
};
|
|
50
|
+
inputSearchRef?: React.Ref<any>;
|
|
51
|
+
flatResults: Array<ResultBase>;
|
|
52
|
+
hasSearchQueryEventFired: boolean;
|
|
53
|
+
hasKeyDownEventFired: boolean;
|
|
54
|
+
lastKeyPressed: string;
|
|
55
|
+
constructor(props: Props);
|
|
56
|
+
componentDidMount(): void;
|
|
57
|
+
componentWillUnmount(): void;
|
|
58
|
+
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
59
|
+
fireKeyboardControlEvent(selectedResultId: SelectedResultId): void;
|
|
60
|
+
/**
|
|
61
|
+
* Uses the virtual list, this.flatResults, to move the selection across grouped results as if
|
|
62
|
+
* results were in a single, circular list.
|
|
63
|
+
*
|
|
64
|
+
* Process:
|
|
65
|
+
* 1. Finds the index of the selected result in the flatResults array,
|
|
66
|
+
* 2. Increments or decrements this index by the supplied adjustment amount,
|
|
67
|
+
* 3. Sets the new selectedResultId based on the modifed index
|
|
68
|
+
*/
|
|
69
|
+
adjustSelectedResultIndex: (adjustment: number) => void;
|
|
70
|
+
/** Select next result */
|
|
71
|
+
selectNext: () => void;
|
|
72
|
+
/** Select previous result */
|
|
73
|
+
selectPrevious: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Callback for register results in flatResults
|
|
76
|
+
*/
|
|
77
|
+
handleRegisterResult: (result: ResultBase) => void;
|
|
78
|
+
/**
|
|
79
|
+
* Callback for unregister results in flatResults
|
|
80
|
+
* It will reconcile a list of results for keyboard navigation after every update.
|
|
81
|
+
* 1. Component starts with an empty list of results
|
|
82
|
+
* 2. componentDidMount / componentDidUpdate lifecycle methods in ResultBase will be invoked
|
|
83
|
+
* 3. All ResultBase components call registerResult() in order to register itself in quick search
|
|
84
|
+
* 4. All ResultBase components call unregisterResult() in order to unregister itself in quick search
|
|
85
|
+
*/
|
|
86
|
+
handleUnregisterResult: (result: ResultBase) => void;
|
|
87
|
+
/**
|
|
88
|
+
* Callback for mouseEnter events on individual results
|
|
89
|
+
* Move selection to hovered result
|
|
90
|
+
*/
|
|
91
|
+
handleResultMouseEnter: (resultData: ResultData) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Callback for mouseLeave events on individual results
|
|
94
|
+
* Clear result selection
|
|
95
|
+
*/
|
|
96
|
+
handleResultMouseLeave: () => void;
|
|
97
|
+
/**
|
|
98
|
+
* Clear result selection when search input is blurred
|
|
99
|
+
*/
|
|
100
|
+
handleSearchBlur: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
101
|
+
onInput: (event: React.FormEvent<HTMLInputElement>) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Keyboard controls
|
|
104
|
+
* Up - Select previous result
|
|
105
|
+
* Down - Select next result
|
|
106
|
+
* Enter - Submit selected result
|
|
107
|
+
* Tab / ArrowRight - Accept autocomplete
|
|
108
|
+
*/
|
|
109
|
+
handleSearchKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
110
|
+
acceptAutocomplete: (event: React.KeyboardEvent<HTMLInputElement>, text?: string) => void;
|
|
111
|
+
setSearchInputRef: (refs: any) => void;
|
|
112
|
+
focusSearchInput: () => void;
|
|
113
|
+
render(): JSX.Element;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* HOCs:
|
|
117
|
+
* `decorateWithAnalyticsData` - Wrapper that decorates analytics events with additional data.
|
|
118
|
+
* `withAnalytics` - Injects analytics firing methods that are picked up by
|
|
119
|
+
* @atlaskit/analytics/AnalyticsListener.
|
|
120
|
+
*/
|
|
121
|
+
declare const _default: React.ComponentClass<Props, any>;
|
|
122
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
4
|
+
caption?: string;
|
|
5
|
+
/** Location to link out to on click. This is passed down to the custom link component if one is provided. */
|
|
6
|
+
href?: string;
|
|
7
|
+
/** Target frame for item `href` link to be aimed at. */
|
|
8
|
+
target?: string;
|
|
9
|
+
/** React element to appear to the left of the text. This should be an @atlaskit/icon component. */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
/** Makes the navigation item appear with reduced padding and font size. */
|
|
12
|
+
isCompact?: boolean;
|
|
13
|
+
/** Set whether the item should be highlighted as selected. Selected items have a different background color. */
|
|
14
|
+
isSelected?: boolean;
|
|
15
|
+
/** Set whether the item has been highlighted using mouse navigation. Mouse selected items will not display the selectedIcon. */
|
|
16
|
+
isMouseSelected?: boolean;
|
|
17
|
+
/** Function to be called on click. This is passed down to a custom link component, if one is provided. */
|
|
18
|
+
onClick?(e: MouseEvent): void;
|
|
19
|
+
/** Standard onmouseenter event */
|
|
20
|
+
onMouseEnter?: (e: MouseEvent) => void;
|
|
21
|
+
/** Standard onmouseleave event */
|
|
22
|
+
onMouseLeave?: (e: MouseEvent) => void;
|
|
23
|
+
/** Text to be shown alongside the main `text`. */
|
|
24
|
+
subText?: React.ReactNode;
|
|
25
|
+
/** Main text to be displayed as the item. Accepts a react component but in most cases this should just be a string. */
|
|
26
|
+
text?: React.ReactNode;
|
|
27
|
+
/** React component to be placed to the right of the main text. */
|
|
28
|
+
textAfter?: React.ReactNode;
|
|
29
|
+
/** React component to be placed to the right of the main text when the item is selected with keyboard navigation. */
|
|
30
|
+
selectedIcon?: React.ReactNode;
|
|
31
|
+
/** React component to be used for rendering links */
|
|
32
|
+
linkComponent?: React.ComponentType;
|
|
33
|
+
};
|
|
34
|
+
declare class ResultItem extends React.PureComponent<Props> {
|
|
35
|
+
static defaultProps: Partial<Props>;
|
|
36
|
+
render(): JSX.Element;
|
|
37
|
+
}
|
|
38
|
+
export default ResultItem;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** Text to appear as heading above group. Will be auto-capitalised. */
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
/** React Elements to be displayed within the group. This should generally be a collection of ResultItems. */
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export default class ResultItemGroup extends React.Component<Props> {
|
|
9
|
+
render(): JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ResultItemGroupHeader: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const ResultItemGroupTitle: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const ResultItemAfter: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
shouldTakeSpace: boolean;
|
|
6
|
+
}, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
shouldTakeSpace: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const ResultItemAfterWrapper: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const ResultItemCaption: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>, any, import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>>;
|
|
11
|
+
export declare const ResultItemSubText: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>, any, import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>>;
|
|
12
|
+
export declare const ResultItemIcon: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const ResultItemTextAfter: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonResultProps } from './types';
|
|
3
|
+
export type Props = CommonResultProps & {
|
|
4
|
+
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
|
+
name: React.ReactNode;
|
|
6
|
+
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
7
|
+
caption?: string;
|
|
8
|
+
/** Set whether to display a lock on the result's icon */
|
|
9
|
+
isPrivate?: boolean;
|
|
10
|
+
/** Text to be shown alongside the main `text`. */
|
|
11
|
+
subText?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Generic result type for Atlassian containers.
|
|
15
|
+
*/
|
|
16
|
+
export default class ContainerResult extends React.PureComponent<Props> {
|
|
17
|
+
getAvatar: () => {};
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonResultProps } from './types';
|
|
3
|
+
export type Props = CommonResultProps & {
|
|
4
|
+
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
|
+
name: React.ReactNode;
|
|
6
|
+
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
7
|
+
caption?: string;
|
|
8
|
+
/** Name of the container to which the object belongs. Displayed alongside the name */
|
|
9
|
+
containerName?: React.ReactNode;
|
|
10
|
+
/** Set whether to display a lock on the result's icon */
|
|
11
|
+
isPrivate?: boolean;
|
|
12
|
+
/** A key or identifier of the object. Ajoined to the `containerName` when provided. */
|
|
13
|
+
objectKey?: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Generic result type for Atlassian objects.
|
|
17
|
+
*/
|
|
18
|
+
export default class ObjectResult extends React.PureComponent<Props> {
|
|
19
|
+
getAvatar: () => {};
|
|
20
|
+
getSubtext(): {} | null | undefined;
|
|
21
|
+
render(): JSX.Element;
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommonResultProps } from './types';
|
|
3
|
+
export type Props = CommonResultProps & {
|
|
4
|
+
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
5
|
+
name: React.ReactNode;
|
|
6
|
+
/** A user's custom handle. Appears to the right of their `name`. It has a lower font-weight. */
|
|
7
|
+
mentionName?: string;
|
|
8
|
+
/** A character with which to prefix the `mentionName`. Defaults to '@' */
|
|
9
|
+
mentionPrefix?: string;
|
|
10
|
+
/** Text to be shown alongside the main `text`. */
|
|
11
|
+
presenceMessage?: React.ReactNode;
|
|
12
|
+
/** Sets the appearance of the presence indicator */
|
|
13
|
+
presenceState?: 'online' | 'busy' | 'offline' | null;
|
|
14
|
+
};
|
|
15
|
+
export default class PersonResult extends React.PureComponent<Props> {
|
|
16
|
+
static defaultProps: Partial<Props>;
|
|
17
|
+
getMention: () => string | undefined;
|
|
18
|
+
getAvatar: () => {};
|
|
19
|
+
render(): JSX.Element;
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsData, CommonResultProps } from './types';
|
|
3
|
+
import { ResultContextType } from '../context';
|
|
4
|
+
export type Props = CommonResultProps & {
|
|
5
|
+
/** Type of the result. This is passed as a parameter to certain callbacks. */
|
|
6
|
+
type: string;
|
|
7
|
+
/** Main text to be displayed as the item. */
|
|
8
|
+
text: React.ReactNode;
|
|
9
|
+
/** Text to be shown alongside the main `text`. */
|
|
10
|
+
subText?: React.ReactNode;
|
|
11
|
+
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
12
|
+
caption?: string;
|
|
13
|
+
/** React element to appear to the left of the text. */
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
/** The context provided by QuickSearch. */
|
|
16
|
+
context?: ResultContextType;
|
|
17
|
+
};
|
|
18
|
+
type DefaultProps = {
|
|
19
|
+
context: ResultContextType;
|
|
20
|
+
};
|
|
21
|
+
export declare class ResultBase extends React.PureComponent<DefaultProps & Props> {
|
|
22
|
+
static defaultProps: Partial<Props>;
|
|
23
|
+
state: {
|
|
24
|
+
isMouseSelected: boolean;
|
|
25
|
+
};
|
|
26
|
+
registerResult(): void;
|
|
27
|
+
componentDidMount(): void;
|
|
28
|
+
componentDidUpdate(): void;
|
|
29
|
+
componentWillUnmount(): void;
|
|
30
|
+
getAnalyticsData(): AnalyticsData;
|
|
31
|
+
handleClick: (e: MouseEvent) => void;
|
|
32
|
+
handleMouseEnter: (event: MouseEvent) => void;
|
|
33
|
+
handleMouseLeave: () => void;
|
|
34
|
+
render(): JSX.Element;
|
|
35
|
+
}
|
|
36
|
+
declare const _default: (props: Props) => JSX.Element;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type AnalyticsData = Object;
|
|
3
|
+
export type ResultId = string | number;
|
|
4
|
+
export type SelectedResultId = ResultId | null;
|
|
5
|
+
export type CancelableEvent = KeyboardEvent | MouseEvent | React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLElement>;
|
|
6
|
+
export type ResultData = {
|
|
7
|
+
resultId: ResultId;
|
|
8
|
+
type: string;
|
|
9
|
+
event: CancelableEvent;
|
|
10
|
+
};
|
|
11
|
+
export type CommonResultProps = {
|
|
12
|
+
/** Unique ID of the result. This is passed as a parameter to certain callbacks */
|
|
13
|
+
resultId: string | number;
|
|
14
|
+
/** Type of the result. This is passed as a parameter to certain callbacks. */
|
|
15
|
+
type?: string;
|
|
16
|
+
/** Src URL of the image to be used as the result's icon, overriden by avatar prop */
|
|
17
|
+
avatarUrl?: string;
|
|
18
|
+
/** React Component of the image to be used as the result's icon, takes precedence over avatarUrl */
|
|
19
|
+
avatar?: ReactNode;
|
|
20
|
+
/** Content to be shown after the main content. Shown to the right of content (or to the left in RTL mode). */
|
|
21
|
+
elemAfter?: ReactNode;
|
|
22
|
+
/** Icon to be shown after the main content when the result is selected */
|
|
23
|
+
selectedIcon?: ReactNode;
|
|
24
|
+
/** Location to link out to on click. */
|
|
25
|
+
href?: string;
|
|
26
|
+
/** Target to open the link in. */
|
|
27
|
+
target?: string;
|
|
28
|
+
/** Reduces padding and font size. */
|
|
29
|
+
isCompact?: boolean;
|
|
30
|
+
/** Triggered by mouseClick event. */
|
|
31
|
+
onClick?: (resultData: ResultData) => void;
|
|
32
|
+
/** key/value pairs of attributes to be send in analytics events. */
|
|
33
|
+
analyticsData?: AnalyticsData | (() => AnalyticsData);
|
|
34
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const controlKeys: string[];
|
|
3
|
+
type Props = {
|
|
4
|
+
/** The elements to render as options to search from. */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** The elements to render to the right of the search input. */
|
|
7
|
+
inputControls?: React.ReactNode;
|
|
8
|
+
/** Set whether the loading state should be shown. */
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
/** Function to be called when the search input loses focus. */
|
|
11
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
12
|
+
/** Function to be called when a input action occurs (native `oninput` event). */
|
|
13
|
+
onInput?: (event: React.FormEvent<HTMLInputElement>) => void;
|
|
14
|
+
/** Function to be called when the user hits the escape key. */
|
|
15
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
16
|
+
/** Placeholder text for search field. */
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** Current value of search field. */
|
|
19
|
+
value?: string;
|
|
20
|
+
/** Autocomplete information */
|
|
21
|
+
autocompleteText?: string;
|
|
22
|
+
};
|
|
23
|
+
export default class Search extends React.PureComponent<Props> {
|
|
24
|
+
static defaultProps: Partial<Props>;
|
|
25
|
+
onInputKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
26
|
+
setInputRef: (ref: React.Ref<any>) => void;
|
|
27
|
+
renderInputControls: () => JSX.Element | null;
|
|
28
|
+
inputRef?: React.Ref<any>;
|
|
29
|
+
render(): JSX.Element;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SearchBox: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const SearchFieldBaseOuter: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const SearchFieldBaseInner: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const SearchInner: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, any, import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const getPlaceholderStyle: (style: any) => import("styled-components").InterpolationValue[];
|
|
7
|
+
export declare const getPlaceholderColor: import("styled-components").InterpolationValue[];
|
|
8
|
+
export declare const SearchInput: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>, any, import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>>;
|
|
9
|
+
export declare const SearchInputTypeAhead: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>, any, import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement>>;
|
|
10
|
+
export declare const SearchInputControlsContainer: import("styled-components").StyledComponentClass<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>, any, import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const ATLASKIT_QUICKSEARCH_NS = "atlaskit.navigation.quick-search";
|
|
2
|
+
export declare const QS_ANALYTICS_EV_CLOSE: string;
|
|
3
|
+
export declare const QS_ANALYTICS_EV_KB_CTRLS_USED: string;
|
|
4
|
+
export declare const QS_ANALYTICS_EV_OPEN: string;
|
|
5
|
+
export declare const QS_ANALYTICS_EV_QUERY_ENTERED: string;
|
|
6
|
+
export declare const QS_ANALYTICS_EV_SUBMIT: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
import { ResultData, ResultId, SelectedResultId } from './Results/types';
|
|
4
|
+
import { ResultBase } from './Results/ResultBase';
|
|
5
|
+
export type ResultContextType = {
|
|
6
|
+
/** Register result as keyboard navigation target */
|
|
7
|
+
registerResult: (result: ResultBase) => void;
|
|
8
|
+
/** Unregister result as keyboard navigation target */
|
|
9
|
+
unregisterResult: (result: ResultBase) => void;
|
|
10
|
+
/** Triggered by mouseEnter event. */
|
|
11
|
+
onMouseEnter: (resultData: ResultData) => void;
|
|
12
|
+
/** Standard onMouseLeave event. */
|
|
13
|
+
onMouseLeave: () => void;
|
|
14
|
+
/** Fires an analytics event */
|
|
15
|
+
sendAnalytics?: (eventName: string, eventData: Object) => void;
|
|
16
|
+
/** get the index of the search result in the list of result */
|
|
17
|
+
getIndex: (resultId: ResultId) => number | null;
|
|
18
|
+
/** React component to be used for rendering links */
|
|
19
|
+
linkComponent?: ComponentType;
|
|
20
|
+
};
|
|
21
|
+
export declare const ResultContext: React.Context<ResultContextType>;
|
|
22
|
+
export declare const SelectedResultIdContext: React.Context<SelectedResultId>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as resultTypes from './components/Results';
|
|
2
|
+
export { default as AkNavigationItemGroup } from './components/ResultItem/ResultItemGroup';
|
|
3
|
+
export { default as AkNavigationItem } from './components/ResultItem/ResultItem';
|
|
4
|
+
export { default as AkQuickSearch } from './components/QuickSearch';
|
|
5
|
+
export { default as AkSearch } from './components/Search/Search';
|
|
6
|
+
export { resultTypes as quickSearchResultTypes };
|
|
7
|
+
export { default as QuickSearch } from './components/QuickSearch';
|
|
8
|
+
export { default as ResultItemGroup } from './components/ResultItem/ResultItemGroup';
|
|
9
|
+
export { default as ObjectResult } from './components/Results/ObjectResult';
|
|
10
|
+
export type { Props as ObjectResultProps } from './components/Results/ObjectResult';
|
|
11
|
+
export { default as PersonResult } from './components/Results/PersonResult';
|
|
12
|
+
export type { Props as PersonResultProps } from './components/Results/PersonResult';
|
|
13
|
+
export { default as ContainerResult } from './components/Results/ContainerResult';
|
|
14
|
+
export type { Props as ContainerResultProps } from './components/Results/ContainerResult';
|
|
15
|
+
export { default as ResultBase } from './components/Results/ResultBase';
|
|
16
|
+
export type { Props as ResultBaseProps } from './components/Results/ResultBase';
|
|
17
|
+
export type { CancelableEvent, ResultData } from './components/Results/types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/quick-search",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.2",
|
|
4
4
|
"description": "A quick-search component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
15
23
|
"atlaskit:src": "src/index.ts",
|
|
16
24
|
"atlassian": {
|
|
17
25
|
"team": "Search Platform: Search Experience",
|
|
@@ -27,7 +35,7 @@
|
|
|
27
35
|
"@atlaskit/item": "^12.1.0",
|
|
28
36
|
"@atlaskit/spinner": "^15.5.0",
|
|
29
37
|
"@atlaskit/theme": "^12.5.0",
|
|
30
|
-
"@atlaskit/tokens": "^1.
|
|
38
|
+
"@atlaskit/tokens": "^1.4.0",
|
|
31
39
|
"@babel/runtime": "^7.0.0",
|
|
32
40
|
"keycode": "^2.1.7"
|
|
33
41
|
},
|
|
@@ -46,7 +54,7 @@
|
|
|
46
54
|
"prop-types": "^15.5.10",
|
|
47
55
|
"react": "^16.8.0",
|
|
48
56
|
"sinon": "^2.2.0",
|
|
49
|
-
"typescript": "4.
|
|
57
|
+
"typescript": "~4.9.5",
|
|
50
58
|
"uuid": "^3.1.0"
|
|
51
59
|
},
|
|
52
60
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
package/report.api.md
CHANGED
|
@@ -84,7 +84,7 @@ export type ContainerResultProps = CommonResultProps & {
|
|
|
84
84
|
subText?: React_2.ReactNode;
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
// @public
|
|
87
|
+
// @public
|
|
88
88
|
const _default: React_2.ComponentClass<Props_3, any>;
|
|
89
89
|
export { _default as AkQuickSearch };
|
|
90
90
|
export { _default as QuickSearch };
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/quick-search"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { ComponentType } from 'react';
|
|
8
|
+
import { default as React_2 } from 'react';
|
|
9
|
+
import { ReactNode } from 'react';
|
|
10
|
+
|
|
11
|
+
// @public (undocumented)
|
|
12
|
+
export class AkNavigationItem extends React_2.PureComponent<Props_2> {
|
|
13
|
+
// (undocumented)
|
|
14
|
+
static defaultProps: Partial<Props_2>;
|
|
15
|
+
// (undocumented)
|
|
16
|
+
render(): JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// @public (undocumented)
|
|
20
|
+
export class AkSearch extends React_2.PureComponent<Props_4> {
|
|
21
|
+
// (undocumented)
|
|
22
|
+
static defaultProps: Partial<Props_4>;
|
|
23
|
+
// (undocumented)
|
|
24
|
+
inputRef?: React_2.Ref<any>;
|
|
25
|
+
// (undocumented)
|
|
26
|
+
onInputKeyDown: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
|
|
27
|
+
// (undocumented)
|
|
28
|
+
render(): JSX.Element;
|
|
29
|
+
// (undocumented)
|
|
30
|
+
renderInputControls: () => JSX.Element | null;
|
|
31
|
+
// (undocumented)
|
|
32
|
+
setInputRef: (ref: React_2.Ref<any>) => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// @public (undocumented)
|
|
36
|
+
type AnalyticsData = Object;
|
|
37
|
+
|
|
38
|
+
// @public (undocumented)
|
|
39
|
+
export type CancelableEvent = KeyboardEvent | MouseEvent | React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLElement>;
|
|
40
|
+
|
|
41
|
+
// @public (undocumented)
|
|
42
|
+
type CommonResultProps = {
|
|
43
|
+
resultId: number | string;
|
|
44
|
+
type?: string;
|
|
45
|
+
avatarUrl?: string;
|
|
46
|
+
avatar?: ReactNode;
|
|
47
|
+
elemAfter?: ReactNode;
|
|
48
|
+
selectedIcon?: ReactNode;
|
|
49
|
+
href?: string;
|
|
50
|
+
target?: string;
|
|
51
|
+
isCompact?: boolean;
|
|
52
|
+
onClick?: (resultData: ResultData) => void;
|
|
53
|
+
analyticsData?: (() => AnalyticsData) | AnalyticsData;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// @public
|
|
57
|
+
export class ContainerResult extends React_2.PureComponent<ContainerResultProps> {
|
|
58
|
+
// (undocumented)
|
|
59
|
+
getAvatar: () => {};
|
|
60
|
+
// (undocumented)
|
|
61
|
+
render(): JSX.Element;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// @public (undocumented)
|
|
65
|
+
export type ContainerResultProps = CommonResultProps & {
|
|
66
|
+
name: React_2.ReactNode;
|
|
67
|
+
caption?: string;
|
|
68
|
+
isPrivate?: boolean;
|
|
69
|
+
subText?: React_2.ReactNode;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// @public
|
|
73
|
+
const _default: React_2.ComponentClass<Props_3, any>;
|
|
74
|
+
export { _default as AkQuickSearch }
|
|
75
|
+
export { _default as QuickSearch }
|
|
76
|
+
|
|
77
|
+
// @public (undocumented)
|
|
78
|
+
type DefaultProps = {
|
|
79
|
+
context: ResultContextType;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// @public
|
|
83
|
+
export class ObjectResult extends React_2.PureComponent<ObjectResultProps> {
|
|
84
|
+
// (undocumented)
|
|
85
|
+
getAvatar: () => {};
|
|
86
|
+
// (undocumented)
|
|
87
|
+
getSubtext(): null | undefined | {};
|
|
88
|
+
// (undocumented)
|
|
89
|
+
render(): JSX.Element;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// @public (undocumented)
|
|
93
|
+
export type ObjectResultProps = CommonResultProps & {
|
|
94
|
+
name: React_2.ReactNode;
|
|
95
|
+
caption?: string;
|
|
96
|
+
containerName?: React_2.ReactNode;
|
|
97
|
+
isPrivate?: boolean;
|
|
98
|
+
objectKey?: React_2.ReactNode;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// @public (undocumented)
|
|
102
|
+
export class PersonResult extends React_2.PureComponent<PersonResultProps> {
|
|
103
|
+
// (undocumented)
|
|
104
|
+
static defaultProps: Partial<PersonResultProps>;
|
|
105
|
+
// (undocumented)
|
|
106
|
+
getAvatar: () => {};
|
|
107
|
+
// (undocumented)
|
|
108
|
+
getMention: () => string | undefined;
|
|
109
|
+
// (undocumented)
|
|
110
|
+
render(): JSX.Element;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// @public (undocumented)
|
|
114
|
+
export type PersonResultProps = CommonResultProps & {
|
|
115
|
+
name: React_2.ReactNode;
|
|
116
|
+
mentionName?: string;
|
|
117
|
+
mentionPrefix?: string;
|
|
118
|
+
presenceMessage?: React_2.ReactNode;
|
|
119
|
+
presenceState?: 'busy' | 'offline' | 'online' | null;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// @public (undocumented)
|
|
123
|
+
type Props = {
|
|
124
|
+
title: React_2.ReactNode;
|
|
125
|
+
children?: React_2.ReactNode;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// @public (undocumented)
|
|
129
|
+
type Props_2 = {
|
|
130
|
+
caption?: string;
|
|
131
|
+
href?: string;
|
|
132
|
+
target?: string;
|
|
133
|
+
icon?: React_2.ReactNode;
|
|
134
|
+
isCompact?: boolean;
|
|
135
|
+
isSelected?: boolean;
|
|
136
|
+
isMouseSelected?: boolean;
|
|
137
|
+
onClick?(e: MouseEvent): void;
|
|
138
|
+
onMouseEnter?: (e: MouseEvent) => void;
|
|
139
|
+
onMouseLeave?: (e: MouseEvent) => void;
|
|
140
|
+
subText?: React_2.ReactNode;
|
|
141
|
+
text?: React_2.ReactNode;
|
|
142
|
+
textAfter?: React_2.ReactNode;
|
|
143
|
+
selectedIcon?: React_2.ReactNode;
|
|
144
|
+
linkComponent?: React_2.ComponentType;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// @public (undocumented)
|
|
148
|
+
type Props_3 = {
|
|
149
|
+
children: React_2.ReactNode;
|
|
150
|
+
isLoading?: boolean;
|
|
151
|
+
onSearchBlur?: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
152
|
+
onSearchInput?: (event: React_2.FormEvent<HTMLInputElement>, isAutocompleted?: boolean) => void;
|
|
153
|
+
onSearchKeyDown?: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
|
|
154
|
+
onSearchSubmit?: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
|
|
155
|
+
placeholder?: string;
|
|
156
|
+
value?: string;
|
|
157
|
+
selectedResultId?: SelectedResultId;
|
|
158
|
+
onSelectedResultIdChanged?: (id: SelectedResultId) => void;
|
|
159
|
+
firePrivateAnalyticsEvent?: (eventName: string, eventData: Object) => void;
|
|
160
|
+
linkComponent?: React_2.ComponentType<any>;
|
|
161
|
+
inputControls?: React_2.ReactNode;
|
|
162
|
+
autocompleteText?: string;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// @public (undocumented)
|
|
166
|
+
type Props_4 = {
|
|
167
|
+
children?: React_2.ReactNode;
|
|
168
|
+
inputControls?: React_2.ReactNode;
|
|
169
|
+
isLoading?: boolean;
|
|
170
|
+
onBlur?: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
171
|
+
onInput?: (event: React_2.FormEvent<HTMLInputElement>) => void;
|
|
172
|
+
onKeyDown?: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
|
|
173
|
+
placeholder?: string;
|
|
174
|
+
value?: string;
|
|
175
|
+
autocompleteText?: string;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
declare namespace quickSearchResultTypes {
|
|
179
|
+
export {
|
|
180
|
+
ContainerResult,
|
|
181
|
+
ObjectResult,
|
|
182
|
+
PersonResult,
|
|
183
|
+
ResultBase
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
export { quickSearchResultTypes }
|
|
187
|
+
|
|
188
|
+
// @public (undocumented)
|
|
189
|
+
export const ResultBase: (props: ResultBaseProps) => JSX.Element;
|
|
190
|
+
|
|
191
|
+
// @public (undocumented)
|
|
192
|
+
class ResultBase_2 extends React_2.PureComponent<DefaultProps & ResultBaseProps> {
|
|
193
|
+
// (undocumented)
|
|
194
|
+
componentDidMount(): void;
|
|
195
|
+
// (undocumented)
|
|
196
|
+
componentDidUpdate(): void;
|
|
197
|
+
// (undocumented)
|
|
198
|
+
componentWillUnmount(): void;
|
|
199
|
+
// (undocumented)
|
|
200
|
+
static defaultProps: Partial<ResultBaseProps>;
|
|
201
|
+
// (undocumented)
|
|
202
|
+
getAnalyticsData(): AnalyticsData;
|
|
203
|
+
// (undocumented)
|
|
204
|
+
handleClick: (e: MouseEvent) => void;
|
|
205
|
+
// (undocumented)
|
|
206
|
+
handleMouseEnter: (event: MouseEvent) => void;
|
|
207
|
+
// (undocumented)
|
|
208
|
+
handleMouseLeave: () => void;
|
|
209
|
+
// (undocumented)
|
|
210
|
+
registerResult(): void;
|
|
211
|
+
// (undocumented)
|
|
212
|
+
render(): JSX.Element;
|
|
213
|
+
// (undocumented)
|
|
214
|
+
state: {
|
|
215
|
+
isMouseSelected: boolean;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// @public (undocumented)
|
|
220
|
+
export type ResultBaseProps = CommonResultProps & {
|
|
221
|
+
type: string;
|
|
222
|
+
text: React_2.ReactNode;
|
|
223
|
+
subText?: React_2.ReactNode;
|
|
224
|
+
caption?: string;
|
|
225
|
+
icon?: React_2.ReactNode;
|
|
226
|
+
context?: ResultContextType;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
// @public (undocumented)
|
|
230
|
+
type ResultContextType = {
|
|
231
|
+
registerResult: (result: ResultBase_2) => void;
|
|
232
|
+
unregisterResult: (result: ResultBase_2) => void;
|
|
233
|
+
onMouseEnter: (resultData: ResultData) => void;
|
|
234
|
+
onMouseLeave: () => void;
|
|
235
|
+
sendAnalytics?: (eventName: string, eventData: Object) => void;
|
|
236
|
+
getIndex: (resultId: ResultId) => null | number;
|
|
237
|
+
linkComponent?: ComponentType;
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// @public (undocumented)
|
|
241
|
+
export type ResultData = {
|
|
242
|
+
resultId: ResultId;
|
|
243
|
+
type: string;
|
|
244
|
+
event: CancelableEvent;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
// @public (undocumented)
|
|
248
|
+
type ResultId = number | string;
|
|
249
|
+
|
|
250
|
+
// @public (undocumented)
|
|
251
|
+
class ResultItemGroup extends React_2.Component<Props> {
|
|
252
|
+
// (undocumented)
|
|
253
|
+
render(): JSX.Element;
|
|
254
|
+
}
|
|
255
|
+
export { ResultItemGroup as AkNavigationItemGroup }
|
|
256
|
+
export { ResultItemGroup }
|
|
257
|
+
|
|
258
|
+
// @public (undocumented)
|
|
259
|
+
type SelectedResultId = ResultId | null;
|
|
260
|
+
|
|
261
|
+
// (No @packageDocumentation comment for this package)
|
|
262
|
+
|
|
263
|
+
```
|