@atlaskit/quick-search 8.0.13 → 8.0.14
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 +6 -0
- package/README.md +1 -0
- package/dist/cjs/components/QuickSearch.js +26 -91
- package/dist/cjs/components/ResultItem/ResultItem.js +0 -22
- package/dist/cjs/components/ResultItem/ResultItemGroup.js +2 -20
- package/dist/cjs/components/ResultItem/styled.js +4 -27
- package/dist/cjs/components/Results/ContainerResult.js +6 -31
- package/dist/cjs/components/Results/ObjectResult.js +9 -36
- package/dist/cjs/components/Results/PersonResult.js +8 -34
- package/dist/cjs/components/Results/ResultBase.js +20 -52
- package/dist/cjs/components/Results/index.js +0 -5
- package/dist/cjs/components/Search/Search.js +7 -36
- package/dist/cjs/components/Search/styled.js +5 -30
- package/dist/cjs/components/constants.js +0 -1
- package/dist/cjs/components/context.js +0 -7
- package/dist/cjs/components/decorateWithAnalyticsData.js +0 -22
- package/dist/cjs/components/isReactElement.js +0 -2
- package/dist/cjs/index.js +0 -14
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/QuickSearch.js +32 -85
- package/dist/es2019/components/ResultItem/ResultItem.js +0 -4
- package/dist/es2019/components/ResultItem/ResultItemGroup.js +0 -1
- package/dist/es2019/components/ResultItem/styled.js +6 -7
- package/dist/es2019/components/Results/ContainerResult.js +0 -5
- package/dist/es2019/components/Results/ObjectResult.js +0 -8
- package/dist/es2019/components/Results/PersonResult.js +0 -7
- package/dist/es2019/components/Results/ResultBase.js +2 -16
- package/dist/es2019/components/Search/Search.js +0 -9
- package/dist/es2019/components/Search/styled.js +5 -6
- package/dist/es2019/components/decorateWithAnalyticsData.js +0 -4
- package/dist/es2019/index.js +6 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/QuickSearch.js +27 -95
- package/dist/esm/components/ResultItem/ResultItem.js +0 -11
- package/dist/esm/components/ResultItem/ResultItemGroup.js +2 -12
- package/dist/esm/components/ResultItem/styled.js +4 -7
- package/dist/esm/components/Results/ContainerResult.js +6 -22
- package/dist/esm/components/Results/ObjectResult.js +9 -27
- package/dist/esm/components/Results/PersonResult.js +8 -27
- package/dist/esm/components/Results/ResultBase.js +20 -44
- package/dist/esm/components/Search/Search.js +7 -28
- package/dist/esm/components/Search/styled.js +5 -8
- package/dist/esm/components/decorateWithAnalyticsData.js +0 -13
- package/dist/esm/index.js +6 -3
- package/dist/esm/version.json +1 -1
- package/package.json +8 -14
- package/report.api.md +33 -14
- package/tmp/api-report-tmp.d.ts +263 -0
- package/dist/types-ts4.0/components/QuickSearch.d.ts +0 -122
- package/dist/types-ts4.0/components/ResultItem/ResultItem.d.ts +0 -38
- package/dist/types-ts4.0/components/ResultItem/ResultItemGroup.d.ts +0 -11
- package/dist/types-ts4.0/components/ResultItem/styled.d.ts +0 -13
- package/dist/types-ts4.0/components/Results/ContainerResult.d.ts +0 -19
- package/dist/types-ts4.0/components/Results/ObjectResult.d.ts +0 -22
- package/dist/types-ts4.0/components/Results/PersonResult.d.ts +0 -20
- package/dist/types-ts4.0/components/Results/ResultBase.d.ts +0 -37
- package/dist/types-ts4.0/components/Results/index.d.ts +0 -4
- package/dist/types-ts4.0/components/Results/types.d.ts +0 -34
- package/dist/types-ts4.0/components/Search/Search.d.ts +0 -31
- package/dist/types-ts4.0/components/Search/styled.d.ts +0 -10
- package/dist/types-ts4.0/components/constants.d.ts +0 -6
- package/dist/types-ts4.0/components/context.d.ts +0 -22
- package/dist/types-ts4.0/components/decorateWithAnalyticsData.d.ts +0 -3
- package/dist/types-ts4.0/components/isReactElement.d.ts +0 -6
- package/dist/types-ts4.0/index.d.ts +0 -17
package/report.api.md
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
|
+
|
|
1
3
|
## API Report File for "@atlaskit/quick-search"
|
|
2
4
|
|
|
3
|
-
> Do not edit this file.
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
9
|
+
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
4
12
|
|
|
5
|
-
|
|
6
|
-
Generated API Report version: 2.0
|
|
7
|
-
-->
|
|
13
|
+
### Main Entry Types
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
<!--SECTION START: Main Entry Types-->
|
|
10
16
|
|
|
11
17
|
```ts
|
|
12
18
|
import { ComponentType } from 'react';
|
|
@@ -49,7 +55,7 @@ export type CancelableEvent =
|
|
|
49
55
|
|
|
50
56
|
// @public (undocumented)
|
|
51
57
|
type CommonResultProps = {
|
|
52
|
-
resultId:
|
|
58
|
+
resultId: number | string;
|
|
53
59
|
type?: string;
|
|
54
60
|
avatarUrl?: string;
|
|
55
61
|
avatar?: ReactNode;
|
|
@@ -59,13 +65,11 @@ type CommonResultProps = {
|
|
|
59
65
|
target?: string;
|
|
60
66
|
isCompact?: boolean;
|
|
61
67
|
onClick?: (resultData: ResultData) => void;
|
|
62
|
-
analyticsData?:
|
|
68
|
+
analyticsData?: (() => AnalyticsData) | AnalyticsData;
|
|
63
69
|
};
|
|
64
70
|
|
|
65
71
|
// @public
|
|
66
|
-
export class ContainerResult extends React_2.PureComponent<
|
|
67
|
-
ContainerResultProps
|
|
68
|
-
> {
|
|
72
|
+
export class ContainerResult extends React_2.PureComponent<ContainerResultProps> {
|
|
69
73
|
// (undocumented)
|
|
70
74
|
getAvatar: () => {};
|
|
71
75
|
// (undocumented)
|
|
@@ -95,7 +99,7 @@ export class ObjectResult extends React_2.PureComponent<ObjectResultProps> {
|
|
|
95
99
|
// (undocumented)
|
|
96
100
|
getAvatar: () => {};
|
|
97
101
|
// (undocumented)
|
|
98
|
-
getSubtext():
|
|
102
|
+
getSubtext(): null | undefined | {};
|
|
99
103
|
// (undocumented)
|
|
100
104
|
render(): JSX.Element;
|
|
101
105
|
}
|
|
@@ -127,7 +131,7 @@ export type PersonResultProps = CommonResultProps & {
|
|
|
127
131
|
mentionName?: string;
|
|
128
132
|
mentionPrefix?: string;
|
|
129
133
|
presenceMessage?: React_2.ReactNode;
|
|
130
|
-
presenceState?: '
|
|
134
|
+
presenceState?: 'busy' | 'offline' | 'online' | null;
|
|
131
135
|
};
|
|
132
136
|
|
|
133
137
|
// @public (undocumented)
|
|
@@ -244,7 +248,7 @@ type ResultContextType = {
|
|
|
244
248
|
onMouseEnter: (resultData: ResultData) => void;
|
|
245
249
|
onMouseLeave: () => void;
|
|
246
250
|
sendAnalytics?: (eventName: string, eventData: Object) => void;
|
|
247
|
-
getIndex: (resultId: ResultId) =>
|
|
251
|
+
getIndex: (resultId: ResultId) => null | number;
|
|
248
252
|
linkComponent?: ComponentType;
|
|
249
253
|
};
|
|
250
254
|
|
|
@@ -256,7 +260,7 @@ export type ResultData = {
|
|
|
256
260
|
};
|
|
257
261
|
|
|
258
262
|
// @public (undocumented)
|
|
259
|
-
type ResultId =
|
|
263
|
+
type ResultId = number | string;
|
|
260
264
|
|
|
261
265
|
// @public (undocumented)
|
|
262
266
|
class ResultItemGroup extends React_2.Component<Props> {
|
|
@@ -271,3 +275,18 @@ type SelectedResultId = ResultId | null;
|
|
|
271
275
|
|
|
272
276
|
// (No @packageDocumentation comment for this package)
|
|
273
277
|
```
|
|
278
|
+
|
|
279
|
+
<!--SECTION END: Main Entry Types-->
|
|
280
|
+
|
|
281
|
+
### Peer Dependencies
|
|
282
|
+
|
|
283
|
+
<!--SECTION START: Peer Dependencies-->
|
|
284
|
+
|
|
285
|
+
```json
|
|
286
|
+
{
|
|
287
|
+
"react": "^16.8.0",
|
|
288
|
+
"styled-components": "^3.2.6"
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
<!--SECTION END: Peer Dependencies-->
|
|
@@ -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 (undocumented)
|
|
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
|
+
```
|
|
@@ -1,122 +0,0 @@
|
|
|
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 declare 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 declare 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 | undefined) => void;
|
|
111
|
-
setSearchInputRef: (refs: any) => void;
|
|
112
|
-
focusSearchInput: () => void;
|
|
113
|
-
render(): JSX.Element;
|
|
114
|
-
}
|
|
115
|
-
declare const _default: React.ComponentClass<Props, any>;
|
|
116
|
-
/**
|
|
117
|
-
* HOCs:
|
|
118
|
-
* `decorateWithAnalyticsData` - Wrapper that decorates analytics events with additional data.
|
|
119
|
-
* `withAnalytics` - Injects analytics firing methods that are picked up by
|
|
120
|
-
* @atlaskit/analytics/AnalyticsListener.
|
|
121
|
-
*/
|
|
122
|
-
export default _default;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare 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;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare 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 {};
|
|
@@ -1,13 +0,0 @@
|
|
|
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>>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CommonResultProps } from './types';
|
|
3
|
-
export declare 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
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CommonResultProps } from './types';
|
|
3
|
-
export declare 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
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CommonResultProps } from './types';
|
|
3
|
-
export declare 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
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AnalyticsData, CommonResultProps } from './types';
|
|
3
|
-
import { ResultContextType } from '../context';
|
|
4
|
-
export declare 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
|
-
declare 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;
|