@atlaskit/quick-search 8.0.11 → 8.0.12
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/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/package.json +2 -2
- package/report.api.md +302 -0
- package/tsconfig.json +1 -2
package/CHANGELOG.md
CHANGED
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/quick-search",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.12",
|
|
4
4
|
"description": "A quick-search component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"prop-types": "^15.5.10",
|
|
46
46
|
"react": "^16.8.0",
|
|
47
47
|
"sinon": "^2.2.0",
|
|
48
|
-
"typescript": "4.
|
|
48
|
+
"typescript": "4.3.5",
|
|
49
49
|
"uuid": "^3.1.0"
|
|
50
50
|
},
|
|
51
51
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
package/report.api.md
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/quick-search".
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { ComponentType } from 'react';
|
|
9
|
+
import { default as React_2 } from 'react';
|
|
10
|
+
import { ReactNode } from 'react';
|
|
11
|
+
|
|
12
|
+
export declare class AkNavigationItem extends React_2.PureComponent<Props_2> {
|
|
13
|
+
static defaultProps: Partial<Props_2>;
|
|
14
|
+
render(): JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare class AkSearch extends React_2.PureComponent<Props_4> {
|
|
18
|
+
static defaultProps: Partial<Props_4>;
|
|
19
|
+
onInputKeyDown: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
|
|
20
|
+
setInputRef: (ref: React_2.Ref<any>) => void;
|
|
21
|
+
renderInputControls: () => JSX.Element | null;
|
|
22
|
+
inputRef?: React_2.Ref<any>;
|
|
23
|
+
render(): JSX.Element;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare type AnalyticsData = Object;
|
|
27
|
+
|
|
28
|
+
export declare type CancelableEvent =
|
|
29
|
+
| KeyboardEvent
|
|
30
|
+
| MouseEvent
|
|
31
|
+
| React.KeyboardEvent<HTMLInputElement>
|
|
32
|
+
| React.MouseEvent<HTMLElement>;
|
|
33
|
+
|
|
34
|
+
declare type CommonResultProps = {
|
|
35
|
+
/** Unique ID of the result. This is passed as a parameter to certain callbacks */
|
|
36
|
+
resultId: string | number;
|
|
37
|
+
/** Type of the result. This is passed as a parameter to certain callbacks. */
|
|
38
|
+
type?: string;
|
|
39
|
+
/** Src URL of the image to be used as the result's icon, overriden by avatar prop */
|
|
40
|
+
avatarUrl?: string;
|
|
41
|
+
/** React Component of the image to be used as the result's icon, takes precedence over avatarUrl */
|
|
42
|
+
avatar?: ReactNode;
|
|
43
|
+
/** Content to be shown after the main content. Shown to the right of content (or to the left in RTL mode). */
|
|
44
|
+
elemAfter?: ReactNode;
|
|
45
|
+
/** Icon to be shown after the main content when the result is selected */
|
|
46
|
+
selectedIcon?: ReactNode;
|
|
47
|
+
/** Location to link out to on click. */
|
|
48
|
+
href?: string;
|
|
49
|
+
/** Target to open the link in. */
|
|
50
|
+
target?: string;
|
|
51
|
+
/** Reduces padding and font size. */
|
|
52
|
+
isCompact?: boolean;
|
|
53
|
+
/** Triggered by mouseClick event. */
|
|
54
|
+
onClick?: (resultData: ResultData) => void;
|
|
55
|
+
/** key/value pairs of attributes to be send in analytics events. */
|
|
56
|
+
analyticsData?: AnalyticsData | (() => AnalyticsData);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Generic result type for Atlassian containers.
|
|
61
|
+
*/
|
|
62
|
+
export declare class ContainerResult extends React_2.PureComponent<
|
|
63
|
+
ContainerResultProps
|
|
64
|
+
> {
|
|
65
|
+
getAvatar: () => {};
|
|
66
|
+
render(): JSX.Element;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export declare type ContainerResultProps = CommonResultProps & {
|
|
70
|
+
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
71
|
+
name: React_2.ReactNode;
|
|
72
|
+
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
73
|
+
caption?: string;
|
|
74
|
+
/** Set whether to display a lock on the result's icon */
|
|
75
|
+
isPrivate?: boolean;
|
|
76
|
+
/** Text to be shown alongside the main `text`. */
|
|
77
|
+
subText?: React_2.ReactNode;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
declare const _default: React_2.ComponentClass<Props_3, any>;
|
|
81
|
+
export { _default as AkQuickSearch };
|
|
82
|
+
export { _default as QuickSearch };
|
|
83
|
+
|
|
84
|
+
declare type DefaultProps = {
|
|
85
|
+
context: ResultContextType;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Generic result type for Atlassian objects.
|
|
90
|
+
*/
|
|
91
|
+
export declare class ObjectResult extends React_2.PureComponent<
|
|
92
|
+
ObjectResultProps
|
|
93
|
+
> {
|
|
94
|
+
getAvatar: () => {};
|
|
95
|
+
getSubtext(): {} | null | undefined;
|
|
96
|
+
render(): JSX.Element;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export declare type ObjectResultProps = CommonResultProps & {
|
|
100
|
+
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
101
|
+
name: React_2.ReactNode;
|
|
102
|
+
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
103
|
+
caption?: string;
|
|
104
|
+
/** Name of the container to which the object belongs. Displayed alongside the name */
|
|
105
|
+
containerName?: React_2.ReactNode;
|
|
106
|
+
/** Set whether to display a lock on the result's icon */
|
|
107
|
+
isPrivate?: boolean;
|
|
108
|
+
/** A key or identifier of the object. Ajoined to the `containerName` when provided. */
|
|
109
|
+
objectKey?: React_2.ReactNode;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export declare class PersonResult extends React_2.PureComponent<
|
|
113
|
+
PersonResultProps
|
|
114
|
+
> {
|
|
115
|
+
static defaultProps: Partial<PersonResultProps>;
|
|
116
|
+
getMention: () => string | undefined;
|
|
117
|
+
getAvatar: () => {};
|
|
118
|
+
render(): JSX.Element;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export declare type PersonResultProps = CommonResultProps & {
|
|
122
|
+
/** Name of the container. Provides the main text to be displayed as the item. */
|
|
123
|
+
name: React_2.ReactNode;
|
|
124
|
+
/** A user's custom handle. Appears to the right of their `name`. It has a lower font-weight. */
|
|
125
|
+
mentionName?: string;
|
|
126
|
+
/** A character with which to prefix the `mentionName`. Defaults to '@' */
|
|
127
|
+
mentionPrefix?: string;
|
|
128
|
+
/** Text to be shown alongside the main `text`. */
|
|
129
|
+
presenceMessage?: React_2.ReactNode;
|
|
130
|
+
/** Sets the appearance of the presence indicator */
|
|
131
|
+
presenceState?: 'online' | 'busy' | 'offline' | null;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
declare type Props = {
|
|
135
|
+
/** Text to appear as heading above group. Will be auto-capitalised. */
|
|
136
|
+
title: React_2.ReactNode;
|
|
137
|
+
/** React Elements to be displayed within the group. This should generally be a collection of ResultItems. */
|
|
138
|
+
children?: React_2.ReactNode;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
declare type Props_2 = {
|
|
142
|
+
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
143
|
+
caption?: string;
|
|
144
|
+
/** Location to link out to on click. This is passed down to the custom link component if one is provided. */
|
|
145
|
+
href?: string;
|
|
146
|
+
/** Target frame for item `href` link to be aimed at. */
|
|
147
|
+
target?: string;
|
|
148
|
+
/** React element to appear to the left of the text. This should be an @atlaskit/icon component. */
|
|
149
|
+
icon?: React_2.ReactNode;
|
|
150
|
+
/** Makes the navigation item appear with reduced padding and font size. */
|
|
151
|
+
isCompact?: boolean;
|
|
152
|
+
/** Set whether the item should be highlighted as selected. Selected items have a different background color. */
|
|
153
|
+
isSelected?: boolean;
|
|
154
|
+
/** Set whether the item has been highlighted using mouse navigation. Mouse selected items will not display the selectedIcon. */
|
|
155
|
+
isMouseSelected?: boolean;
|
|
156
|
+
/** Function to be called on click. This is passed down to a custom link component, if one is provided. */
|
|
157
|
+
onClick?(e: MouseEvent): void;
|
|
158
|
+
/** Standard onmouseenter event */
|
|
159
|
+
onMouseEnter?: (e: MouseEvent) => void;
|
|
160
|
+
/** Standard onmouseleave event */
|
|
161
|
+
onMouseLeave?: (e: MouseEvent) => void;
|
|
162
|
+
/** Text to be shown alongside the main `text`. */
|
|
163
|
+
subText?: React_2.ReactNode;
|
|
164
|
+
/** Main text to be displayed as the item. Accepts a react component but in most cases this should just be a string. */
|
|
165
|
+
text?: React_2.ReactNode;
|
|
166
|
+
/** React component to be placed to the right of the main text. */
|
|
167
|
+
textAfter?: React_2.ReactNode;
|
|
168
|
+
/** React component to be placed to the right of the main text when the item is selected with keyboard navigation. */
|
|
169
|
+
selectedIcon?: React_2.ReactNode;
|
|
170
|
+
/** React component to be used for rendering links */
|
|
171
|
+
linkComponent?: React_2.ComponentType;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
declare type Props_3 = {
|
|
175
|
+
/** Search results in the form of ResultItemGroups containing Result components */
|
|
176
|
+
children: React_2.ReactNode;
|
|
177
|
+
/** Set search loading state */
|
|
178
|
+
isLoading?: boolean;
|
|
179
|
+
/** onBlur callback for search input */
|
|
180
|
+
onSearchBlur?: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
181
|
+
/** onInput callback for search input */
|
|
182
|
+
onSearchInput?: (
|
|
183
|
+
event: React_2.FormEvent<HTMLInputElement>,
|
|
184
|
+
isAutocompleted?: boolean,
|
|
185
|
+
) => void;
|
|
186
|
+
/** onKeyDown callback for search input */
|
|
187
|
+
onSearchKeyDown?: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
|
|
188
|
+
/** Called when the user submits the search form without selecting a result */
|
|
189
|
+
onSearchSubmit?: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
|
|
190
|
+
/** Placeholder text for search input field */
|
|
191
|
+
placeholder?: string;
|
|
192
|
+
/** Value of the search input field */
|
|
193
|
+
value?: string;
|
|
194
|
+
/** Corresponds to the `resultId` of the selected result */
|
|
195
|
+
selectedResultId?: SelectedResultId;
|
|
196
|
+
/** Optional way of being notified when the selected result changes due to keyboard nav */
|
|
197
|
+
onSelectedResultIdChanged?: (id: SelectedResultId) => void;
|
|
198
|
+
firePrivateAnalyticsEvent?: (eventName: string, eventData: Object) => void;
|
|
199
|
+
/** React component to be used for rendering links */
|
|
200
|
+
linkComponent?: React_2.ComponentType<any>;
|
|
201
|
+
/** The elements to render to the right of the search input. */
|
|
202
|
+
inputControls?: React_2.ReactNode;
|
|
203
|
+
/** One string that is used to autocomplete the current search query */
|
|
204
|
+
autocompleteText?: string;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
declare type Props_4 = {
|
|
208
|
+
/** The elements to render as options to search from. */
|
|
209
|
+
children?: React_2.ReactNode;
|
|
210
|
+
/** The elements to render to the right of the search input. */
|
|
211
|
+
inputControls?: React_2.ReactNode;
|
|
212
|
+
/** Set whether the loading state should be shown. */
|
|
213
|
+
isLoading?: boolean;
|
|
214
|
+
/** Function to be called when the search input loses focus. */
|
|
215
|
+
onBlur?: (event: React_2.FocusEvent<HTMLInputElement>) => void;
|
|
216
|
+
/** Function to be called when a input action occurs (native `oninput` event). */
|
|
217
|
+
onInput?: (event: React_2.FormEvent<HTMLInputElement>) => void;
|
|
218
|
+
/** Function to be called when the user hits the escape key. */
|
|
219
|
+
onKeyDown?: (event: React_2.KeyboardEvent<HTMLInputElement>) => void;
|
|
220
|
+
/** Placeholder text for search field. */
|
|
221
|
+
placeholder?: string;
|
|
222
|
+
/** Current value of search field. */
|
|
223
|
+
value?: string;
|
|
224
|
+
/** Autocomplete information */
|
|
225
|
+
autocompleteText?: string;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
declare namespace quickSearchResultTypes {
|
|
229
|
+
export { ContainerResult, ObjectResult, PersonResult, ResultBase };
|
|
230
|
+
}
|
|
231
|
+
export { quickSearchResultTypes };
|
|
232
|
+
|
|
233
|
+
export declare const ResultBase: (props: ResultBaseProps) => JSX.Element;
|
|
234
|
+
|
|
235
|
+
declare class ResultBase_2 extends React_2.PureComponent<
|
|
236
|
+
DefaultProps & ResultBaseProps
|
|
237
|
+
> {
|
|
238
|
+
static defaultProps: Partial<ResultBaseProps>;
|
|
239
|
+
state: {
|
|
240
|
+
isMouseSelected: boolean;
|
|
241
|
+
};
|
|
242
|
+
registerResult(): void;
|
|
243
|
+
componentDidMount(): void;
|
|
244
|
+
componentDidUpdate(): void;
|
|
245
|
+
componentWillUnmount(): void;
|
|
246
|
+
getAnalyticsData(): AnalyticsData;
|
|
247
|
+
handleClick: (e: MouseEvent) => void;
|
|
248
|
+
handleMouseEnter: (event: MouseEvent) => void;
|
|
249
|
+
handleMouseLeave: () => void;
|
|
250
|
+
render(): JSX.Element;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export declare type ResultBaseProps = CommonResultProps & {
|
|
254
|
+
/** Type of the result. This is passed as a parameter to certain callbacks. */
|
|
255
|
+
type: string;
|
|
256
|
+
/** Main text to be displayed as the item. */
|
|
257
|
+
text: React_2.ReactNode;
|
|
258
|
+
/** Text to be shown alongside the main `text`. */
|
|
259
|
+
subText?: React_2.ReactNode;
|
|
260
|
+
/** Text to appear to the right of the text. It has a lower font-weight. */
|
|
261
|
+
caption?: string;
|
|
262
|
+
/** React element to appear to the left of the text. */
|
|
263
|
+
icon?: React_2.ReactNode;
|
|
264
|
+
/** The context provided by QuickSearch. */
|
|
265
|
+
context?: ResultContextType;
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
declare type ResultContextType = {
|
|
269
|
+
/** Register result as keyboard navigation target */
|
|
270
|
+
registerResult: (result: ResultBase_2) => void;
|
|
271
|
+
/** Unregister result as keyboard navigation target */
|
|
272
|
+
unregisterResult: (result: ResultBase_2) => void;
|
|
273
|
+
/** Triggered by mouseEnter event. */
|
|
274
|
+
onMouseEnter: (resultData: ResultData) => void;
|
|
275
|
+
/** Standard onMouseLeave event. */
|
|
276
|
+
onMouseLeave: () => void;
|
|
277
|
+
/** Fires an analytics event */
|
|
278
|
+
sendAnalytics?: (eventName: string, eventData: Object) => void;
|
|
279
|
+
/** get the index of the search result in the list of result */
|
|
280
|
+
getIndex: (resultId: ResultId) => number | null;
|
|
281
|
+
/** React component to be used for rendering links */
|
|
282
|
+
linkComponent?: ComponentType;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
export declare type ResultData = {
|
|
286
|
+
resultId: ResultId;
|
|
287
|
+
type: string;
|
|
288
|
+
event: CancelableEvent;
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
declare type ResultId = string | number;
|
|
292
|
+
|
|
293
|
+
declare class ResultItemGroup extends React_2.Component<Props> {
|
|
294
|
+
render(): JSX.Element;
|
|
295
|
+
}
|
|
296
|
+
export { ResultItemGroup as AkNavigationItemGroup };
|
|
297
|
+
export { ResultItemGroup };
|
|
298
|
+
|
|
299
|
+
declare type SelectedResultId = ResultId | null;
|
|
300
|
+
|
|
301
|
+
export {};
|
|
302
|
+
```
|