@atlaskit/user-picker 9.2.1 → 9.2.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 +6 -0
- package/dist/cjs/components/styles.js +2 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/styles.js +2 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/styles.js +2 -0
- package/dist/esm/version.json +1 -1
- package/package.json +3 -3
- package/report.api.md +207 -145
package/CHANGELOG.md
CHANGED
|
@@ -39,6 +39,7 @@ var INDICATOR_WIDTH = 39;
|
|
|
39
39
|
exports.INDICATOR_WIDTH = INDICATOR_WIDTH;
|
|
40
40
|
var TOTAL_PADDING_TAG_TO_CONTAINER = 10;
|
|
41
41
|
var TAG_MARGIN_WIDTH = 4;
|
|
42
|
+
var PLACEHOLDER_MARGIN = 2;
|
|
42
43
|
var getStyles = (0, _memoizeOne.default)(function (width, isMulti, overrideStyles) {
|
|
43
44
|
var styles = {
|
|
44
45
|
menu: function menu(css, state) {
|
|
@@ -171,6 +172,7 @@ var getStyles = (0, _memoizeOne.default)(function (width, isMulti, overrideStyle
|
|
|
171
172
|
/* Necessary to make input height and tag height the same. */
|
|
172
173
|
marginBottom: TAG_MARGIN_WIDTH,
|
|
173
174
|
marginTop: TAG_MARGIN_WIDTH,
|
|
175
|
+
marginLeft: PLACEHOLDER_MARGIN,
|
|
174
176
|
|
|
175
177
|
/* Padding top and bottom of 2 is set by default. */
|
|
176
178
|
paddingTop: 0,
|
package/dist/cjs/version.json
CHANGED
|
@@ -9,6 +9,7 @@ export const AVATAR_PADDING = 6;
|
|
|
9
9
|
export const INDICATOR_WIDTH = 39;
|
|
10
10
|
const TOTAL_PADDING_TAG_TO_CONTAINER = 10;
|
|
11
11
|
const TAG_MARGIN_WIDTH = 4;
|
|
12
|
+
const PLACEHOLDER_MARGIN = 2;
|
|
12
13
|
export const getStyles = memoizeOne((width, isMulti, overrideStyles) => {
|
|
13
14
|
let styles = {
|
|
14
15
|
menu: (css, state) => ({ ...css,
|
|
@@ -129,6 +130,7 @@ export const getStyles = memoizeOne((width, isMulti, overrideStyles) => {
|
|
|
129
130
|
/* Necessary to make input height and tag height the same. */
|
|
130
131
|
marginBottom: TAG_MARGIN_WIDTH,
|
|
131
132
|
marginTop: TAG_MARGIN_WIDTH,
|
|
133
|
+
marginLeft: PLACEHOLDER_MARGIN,
|
|
132
134
|
|
|
133
135
|
/* Padding top and bottom of 2 is set by default. */
|
|
134
136
|
paddingTop: 0,
|
package/dist/es2019/version.json
CHANGED
|
@@ -19,6 +19,7 @@ export var AVATAR_PADDING = 6;
|
|
|
19
19
|
export var INDICATOR_WIDTH = 39;
|
|
20
20
|
var TOTAL_PADDING_TAG_TO_CONTAINER = 10;
|
|
21
21
|
var TAG_MARGIN_WIDTH = 4;
|
|
22
|
+
var PLACEHOLDER_MARGIN = 2;
|
|
22
23
|
export var getStyles = memoizeOne(function (width, isMulti, overrideStyles) {
|
|
23
24
|
var styles = {
|
|
24
25
|
menu: function menu(css, state) {
|
|
@@ -154,6 +155,7 @@ export var getStyles = memoizeOne(function (width, isMulti, overrideStyles) {
|
|
|
154
155
|
/* Necessary to make input height and tag height the same. */
|
|
155
156
|
marginBottom: TAG_MARGIN_WIDTH,
|
|
156
157
|
marginTop: TAG_MARGIN_WIDTH,
|
|
158
|
+
marginLeft: PLACEHOLDER_MARGIN,
|
|
157
159
|
|
|
158
160
|
/* Padding top and bottom of 2 is set by default. */
|
|
159
161
|
paddingTop: 0,
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/user-picker",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.2",
|
|
4
4
|
"description": "Fabric component for display a dropdown to select a user from",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
30
30
|
"@atlaskit/avatar": "^21.0.0",
|
|
31
31
|
"@atlaskit/icon": "^21.10.0",
|
|
32
|
-
"@atlaskit/logo": "^13.
|
|
32
|
+
"@atlaskit/logo": "^13.8.0",
|
|
33
33
|
"@atlaskit/lozenge": "^11.0.0",
|
|
34
34
|
"@atlaskit/popper": "^5.0.0",
|
|
35
35
|
"@atlaskit/select": "^15.3.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/range": "^6.0.0",
|
|
60
60
|
"@atlaskit/section-message": "^6.0.0",
|
|
61
61
|
"@atlaskit/textfield": "^5.0.0",
|
|
62
|
-
"@atlaskit/util-data-test": "^17.
|
|
62
|
+
"@atlaskit/util-data-test": "^17.5.0",
|
|
63
63
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
64
64
|
"@emotion/styled": "^10.0.7",
|
|
65
65
|
"@testing-library/dom": "^7.7.3",
|
package/report.api.md
CHANGED
|
@@ -9,8 +9,7 @@ import { ReactNode } from 'react';
|
|
|
9
9
|
import { StylesConfig } from '@atlaskit/select';
|
|
10
10
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
export type ActionTypes =
|
|
12
|
+
export declare type ActionTypes =
|
|
14
13
|
| 'select-option'
|
|
15
14
|
| 'deselect-option'
|
|
16
15
|
| 'remove-value'
|
|
@@ -19,11 +18,9 @@ export type ActionTypes =
|
|
|
19
18
|
| 'clear'
|
|
20
19
|
| 'create-option';
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
export type Appearance = 'normal' | 'compact';
|
|
21
|
+
export declare type Appearance = 'normal' | 'compact';
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
export type AtlasKitSelectChange = (
|
|
23
|
+
export declare type AtlasKitSelectChange = (
|
|
27
24
|
value: AtlaskitSelectValue,
|
|
28
25
|
extraInfo: {
|
|
29
26
|
removedValue?: Option_2;
|
|
@@ -32,89 +29,77 @@ export type AtlasKitSelectChange = (
|
|
|
32
29
|
},
|
|
33
30
|
) => void;
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
export declare type AtlaskitSelectValue =
|
|
33
|
+
| Option_2
|
|
34
|
+
| Array<Option_2>
|
|
35
|
+
| null
|
|
36
|
+
| undefined;
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
declare type BoundariesElement =
|
|
39
|
+
| 'scrollParent'
|
|
40
|
+
| 'window'
|
|
41
|
+
| 'viewport'
|
|
42
|
+
| HTMLElement;
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
export declare type DefaultValue =
|
|
45
|
+
| Value
|
|
46
|
+
| OptionIdentifier
|
|
47
|
+
| OptionIdentifier[];
|
|
48
|
+
|
|
49
|
+
export declare interface Email extends OptionData {
|
|
46
50
|
type: 'email';
|
|
51
|
+
suggestion?: boolean;
|
|
47
52
|
}
|
|
48
53
|
|
|
49
|
-
|
|
50
|
-
export const EmailType = 'email';
|
|
54
|
+
export declare const EmailType = 'email';
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
export type EmailValidationResponse = 'INVALID' | 'POTENTIAL' | 'VALID';
|
|
56
|
+
export declare type EmailValidationResponse = 'INVALID' | 'POTENTIAL' | 'VALID';
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
export declare type EmailValidator = (
|
|
59
|
+
inputText: string,
|
|
60
|
+
) => EmailValidationResponse;
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
export interface ExternalUser extends User {
|
|
60
|
-
// (undocumented)
|
|
62
|
+
export declare interface ExternalUser extends User {
|
|
61
63
|
externalUserType?: 'crossSite' | 'thirdParty';
|
|
62
|
-
// (undocumented)
|
|
63
64
|
requiresSourceHydration?: boolean;
|
|
64
|
-
// (undocumented)
|
|
65
65
|
sources: UserSource[];
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
export interface Group extends OptionData {
|
|
70
|
-
// (undocumented)
|
|
68
|
+
export declare interface Group extends OptionData {
|
|
71
69
|
highlight?: GroupHighlight;
|
|
72
|
-
// (undocumented)
|
|
73
70
|
type: 'group';
|
|
74
71
|
}
|
|
75
72
|
|
|
76
|
-
|
|
77
|
-
export interface GroupHighlight {
|
|
78
|
-
// (undocumented)
|
|
73
|
+
export declare interface GroupHighlight {
|
|
79
74
|
name: HighlightRange[];
|
|
80
75
|
}
|
|
81
76
|
|
|
82
|
-
|
|
83
|
-
export const GroupType = 'group';
|
|
77
|
+
export declare const GroupType = 'group';
|
|
84
78
|
|
|
85
|
-
|
|
86
|
-
export interface HighlightRange {
|
|
87
|
-
// (undocumented)
|
|
88
|
-
end: number;
|
|
89
|
-
// (undocumented)
|
|
79
|
+
export declare interface HighlightRange {
|
|
90
80
|
start: number;
|
|
81
|
+
end: number;
|
|
91
82
|
}
|
|
92
83
|
|
|
93
|
-
|
|
94
|
-
export type InputActionTypes =
|
|
84
|
+
export declare type InputActionTypes =
|
|
95
85
|
| 'set-value'
|
|
96
86
|
| 'input-change'
|
|
97
87
|
| 'input-blur'
|
|
98
88
|
| 'menu-close';
|
|
99
89
|
|
|
100
|
-
|
|
101
|
-
export const isEmail: (option: OptionData) => option is Email;
|
|
90
|
+
export declare const isEmail: (option: OptionData) => option is Email;
|
|
102
91
|
|
|
103
|
-
|
|
104
|
-
|
|
92
|
+
export declare const isExternalUser: (
|
|
93
|
+
option: OptionData,
|
|
94
|
+
) => option is ExternalUser;
|
|
105
95
|
|
|
106
|
-
|
|
107
|
-
export const isTeam: (option: OptionData) => option is Team;
|
|
96
|
+
export declare const isTeam: (option: OptionData) => option is Team;
|
|
108
97
|
|
|
109
|
-
|
|
110
|
-
export const isUser: (option: OptionData) => option is User;
|
|
98
|
+
export declare const isUser: (option: OptionData) => option is User;
|
|
111
99
|
|
|
112
|
-
|
|
113
|
-
export const isValidEmail: EmailValidator;
|
|
100
|
+
export declare const isValidEmail: EmailValidator;
|
|
114
101
|
|
|
115
|
-
|
|
116
|
-
export interface LoadOptions {
|
|
117
|
-
// (undocumented)
|
|
102
|
+
export declare interface LoadOptions {
|
|
118
103
|
(searchText?: string, sessionId?: string):
|
|
119
104
|
| Promisable<OptionData | OptionData[]>
|
|
120
105
|
| Iterable<
|
|
@@ -122,59 +107,55 @@ export interface LoadOptions {
|
|
|
122
107
|
>;
|
|
123
108
|
}
|
|
124
109
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
110
|
+
declare interface LoadUserSource {
|
|
111
|
+
(accountId: string, signal?: AbortSignal): Promise<UserSourceResult[]>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare type LozengeColor =
|
|
115
|
+
| 'default'
|
|
116
|
+
| 'success'
|
|
117
|
+
| 'removed'
|
|
118
|
+
| 'inprogress'
|
|
119
|
+
| 'new'
|
|
120
|
+
| 'moved';
|
|
121
|
+
|
|
122
|
+
export declare interface LozengeProps {
|
|
132
123
|
text: string;
|
|
133
|
-
// (undocumented)
|
|
134
124
|
tooltip?: string;
|
|
125
|
+
appearance?: LozengeColor;
|
|
126
|
+
isBold?: boolean;
|
|
135
127
|
}
|
|
136
128
|
|
|
137
|
-
|
|
138
|
-
export type OnChange = (value: Value, action: ActionTypes) => void;
|
|
129
|
+
export declare type OnChange = (value: Value, action: ActionTypes) => void;
|
|
139
130
|
|
|
140
|
-
|
|
141
|
-
|
|
131
|
+
export declare type OnInputChange = (
|
|
132
|
+
query?: string,
|
|
133
|
+
sessionId?: string,
|
|
134
|
+
) => void;
|
|
142
135
|
|
|
143
|
-
|
|
144
|
-
export type OnOption = (value: Value, sessionId?: string) => void;
|
|
136
|
+
export declare type OnOption = (value: Value, sessionId?: string) => void;
|
|
145
137
|
|
|
146
|
-
|
|
147
|
-
export type OnPicker = (sessionId?: string) => void;
|
|
138
|
+
export declare type OnPicker = (sessionId?: string) => void;
|
|
148
139
|
|
|
149
|
-
|
|
150
|
-
type Option_2<Data = OptionData> = {
|
|
140
|
+
declare type Option_2<Data = OptionData> = {
|
|
151
141
|
label: string;
|
|
152
142
|
value: string;
|
|
153
143
|
data: Data;
|
|
154
144
|
};
|
|
155
145
|
export { Option_2 as Option };
|
|
156
146
|
|
|
157
|
-
|
|
158
|
-
export interface OptionData {
|
|
159
|
-
// (undocumented)
|
|
147
|
+
export declare interface OptionData {
|
|
160
148
|
avatarUrl?: any;
|
|
161
|
-
// (undocumented)
|
|
162
|
-
fixed?: boolean;
|
|
163
|
-
// (undocumented)
|
|
164
149
|
id: string;
|
|
165
|
-
// (undocumented)
|
|
166
|
-
lozenge?: string | LozengeProps;
|
|
167
|
-
// (undocumented)
|
|
168
150
|
name: string;
|
|
169
|
-
// (undocumented)
|
|
170
151
|
type?: 'user' | 'team' | 'email' | 'group';
|
|
152
|
+
fixed?: boolean;
|
|
153
|
+
lozenge?: string | LozengeProps;
|
|
171
154
|
}
|
|
172
155
|
|
|
173
|
-
|
|
174
|
-
export type OptionIdentifier = Pick<OptionData, 'id' | 'type'>;
|
|
156
|
+
export declare type OptionIdentifier = Pick<OptionData, 'id' | 'type'>;
|
|
175
157
|
|
|
176
|
-
|
|
177
|
-
export const PopupUserPicker: React_2.ForwardRefExoticComponent<
|
|
158
|
+
export declare const PopupUserPicker: React_2.ForwardRefExoticComponent<
|
|
178
159
|
Pick<
|
|
179
160
|
Omit<PopupUserPickerProps, keyof WithAnalyticsEventsProps>,
|
|
180
161
|
| 'target'
|
|
@@ -254,88 +235,86 @@ export const PopupUserPicker: React_2.ForwardRefExoticComponent<
|
|
|
254
235
|
React_2.RefAttributes<any>
|
|
255
236
|
>;
|
|
256
237
|
|
|
257
|
-
|
|
258
|
-
|
|
238
|
+
export declare type PopupUserPickerProps = UserPickerProps & {
|
|
239
|
+
/** Whether to use the popup version of the single picker */
|
|
259
240
|
target: Target;
|
|
241
|
+
/** Optional title assigned to popup picker */
|
|
260
242
|
popupTitle?: string;
|
|
243
|
+
/**
|
|
244
|
+
* The boundary element that the popup will check for overflow.
|
|
245
|
+
* Defaults to `"viewport"` which are parent scroll containers,
|
|
246
|
+
* but can be set to any element.
|
|
247
|
+
*/
|
|
261
248
|
boundariesElement?: BoundariesElement;
|
|
249
|
+
/**
|
|
250
|
+
* Distance the popup should be offset from the reference in the format of [along, away] (units in px).
|
|
251
|
+
*/
|
|
262
252
|
offset?: [number, number];
|
|
253
|
+
/**
|
|
254
|
+
* Placement of where the popup should be displayed relative to the trigger element.
|
|
255
|
+
* Defaults to `"auto"`.
|
|
256
|
+
*/
|
|
263
257
|
placement?: Placement;
|
|
258
|
+
/**
|
|
259
|
+
* The root boundary that the popup will check for overflow.
|
|
260
|
+
* Defaults to `"viewport"` but can be set to `"document"`.
|
|
261
|
+
* See `@atlaskit/popper` for further details.
|
|
262
|
+
*/
|
|
264
263
|
rootBoundary?: RootBoundary;
|
|
264
|
+
/**
|
|
265
|
+
* Allows the dropdown menu to be placed on the opposite side of its trigger if it does not
|
|
266
|
+
* fit in the viewport.
|
|
267
|
+
*/
|
|
265
268
|
shouldFlip?: boolean;
|
|
266
269
|
};
|
|
267
270
|
|
|
268
|
-
|
|
269
|
-
export type Promisable<T> = T | PromiseLike<T>;
|
|
271
|
+
export declare type Promisable<T> = T | PromiseLike<T>;
|
|
270
272
|
|
|
271
|
-
|
|
272
|
-
export type Target = (options: { ref: any; isOpen: boolean }) => ReactNode;
|
|
273
|
+
declare type RootBoundary = 'viewport' | 'document';
|
|
273
274
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
export declare type Target = (options: {
|
|
276
|
+
ref: any;
|
|
277
|
+
isOpen: boolean;
|
|
278
|
+
}) => ReactNode;
|
|
279
|
+
|
|
280
|
+
export declare interface Team extends OptionData {
|
|
277
281
|
avatarUrl?: string;
|
|
278
|
-
// (undocumented)
|
|
279
282
|
description?: string;
|
|
280
|
-
// (undocumented)
|
|
281
|
-
highlight?: TeamHighlight;
|
|
282
|
-
// (undocumented)
|
|
283
|
-
includesYou?: boolean;
|
|
284
|
-
// (undocumented)
|
|
285
283
|
memberCount?: number;
|
|
286
|
-
// (undocumented)
|
|
287
284
|
members?: TeamMember[];
|
|
288
|
-
|
|
285
|
+
includesYou?: boolean;
|
|
286
|
+
highlight?: TeamHighlight;
|
|
289
287
|
type: 'team';
|
|
290
288
|
}
|
|
291
289
|
|
|
292
|
-
|
|
293
|
-
export interface TeamHighlight {
|
|
294
|
-
// (undocumented)
|
|
295
|
-
description?: HighlightRange[];
|
|
296
|
-
// (undocumented)
|
|
290
|
+
export declare interface TeamHighlight {
|
|
297
291
|
name: HighlightRange[];
|
|
292
|
+
description?: HighlightRange[];
|
|
298
293
|
}
|
|
299
294
|
|
|
300
|
-
|
|
301
|
-
export interface TeamMember {
|
|
302
|
-
// (undocumented)
|
|
303
|
-
id: string;
|
|
304
|
-
// (undocumented)
|
|
295
|
+
export declare interface TeamMember {
|
|
305
296
|
name: string;
|
|
297
|
+
id: string;
|
|
306
298
|
}
|
|
307
299
|
|
|
308
|
-
|
|
309
|
-
export const TeamType = 'team';
|
|
300
|
+
export declare const TeamType = 'team';
|
|
310
301
|
|
|
311
|
-
|
|
312
|
-
export interface User extends OptionData {
|
|
313
|
-
// (undocumented)
|
|
302
|
+
export declare interface User extends OptionData {
|
|
314
303
|
avatarUrl?: string;
|
|
315
|
-
|
|
304
|
+
publicName?: string;
|
|
305
|
+
highlight?: UserHighlight;
|
|
316
306
|
byline?: string;
|
|
317
|
-
|
|
307
|
+
type?: 'user';
|
|
318
308
|
email?: string;
|
|
319
|
-
// (undocumented)
|
|
320
|
-
highlight?: UserHighlight;
|
|
321
|
-
// (undocumented)
|
|
322
309
|
isExternal?: boolean;
|
|
323
|
-
// (undocumented)
|
|
324
|
-
publicName?: string;
|
|
325
|
-
// (undocumented)
|
|
326
|
-
type?: 'user';
|
|
327
310
|
}
|
|
328
311
|
|
|
329
|
-
|
|
330
|
-
export interface UserHighlight {
|
|
331
|
-
// (undocumented)
|
|
312
|
+
export declare interface UserHighlight {
|
|
332
313
|
name: HighlightRange[];
|
|
333
|
-
// (undocumented)
|
|
334
314
|
publicName: HighlightRange[];
|
|
335
315
|
}
|
|
336
316
|
|
|
337
|
-
|
|
338
|
-
const UserPicker: React_2.ForwardRefExoticComponent<
|
|
317
|
+
declare const UserPicker: React_2.ForwardRefExoticComponent<
|
|
339
318
|
Pick<
|
|
340
319
|
Omit<UserPickerProps, keyof WithAnalyticsEventsProps>,
|
|
341
320
|
| 'autoFocus'
|
|
@@ -403,62 +382,143 @@ const UserPicker: React_2.ForwardRefExoticComponent<
|
|
|
403
382
|
>;
|
|
404
383
|
export default UserPicker;
|
|
405
384
|
|
|
406
|
-
|
|
407
|
-
|
|
385
|
+
export declare type UserPickerProps = WithAnalyticsEventsProps & {
|
|
386
|
+
/**
|
|
387
|
+
* Used to configure additional information regarding where the
|
|
388
|
+
* user picker has been mounted.
|
|
389
|
+
*
|
|
390
|
+
* The purpose is to give more context as to where user picker events
|
|
391
|
+
* are being fired from, as the current data may not uniquely identify
|
|
392
|
+
* which field is the source.
|
|
393
|
+
*
|
|
394
|
+
* The value will be passed as a data attribute for analytics.
|
|
395
|
+
* Examples include "assignee", "watchers" and "share".
|
|
396
|
+
*
|
|
397
|
+
* A second usage for the fieldId is for server side rendering (SSR) where it must be a unique id per UserPicker
|
|
398
|
+
* instance contained in the serialized SSR content. E.g. a SPA page rendered through SSR that has multiple user pickers.
|
|
399
|
+
*
|
|
400
|
+
* fieldId can be set to null if the integrator is not listening
|
|
401
|
+
* for the analytic events or does not care about SSR.
|
|
402
|
+
*/
|
|
408
403
|
fieldId: string | null;
|
|
404
|
+
/** List of users or teams to be used as options by the user picker. */
|
|
409
405
|
options?: OptionData[];
|
|
406
|
+
/** Width of the user picker field. It can be the amount of pixels as numbers or a string with the percentage. */
|
|
410
407
|
width?: number | string;
|
|
408
|
+
/** Sets the minimum width for the menu. If not set, menu will always have the same width of the field. */
|
|
411
409
|
menuMinWidth?: number;
|
|
410
|
+
/** Sets max height of the user picker. If not set, the height will grow based on number of picked users. */
|
|
412
411
|
maxPickerHeight?: number;
|
|
412
|
+
/** Sets the background color to be the same color as a textfield (Atlaskit N10) */
|
|
413
413
|
textFieldBackgroundColor?: boolean;
|
|
414
|
+
/**
|
|
415
|
+
* Function used to load options asynchronously.
|
|
416
|
+
* accepts two optional params:
|
|
417
|
+
* searchText?: optional text to filter results
|
|
418
|
+
* sessionId?: user picker session identifier, used to track success metric for users providers
|
|
419
|
+
*/
|
|
414
420
|
loadOptions?: LoadOptions;
|
|
421
|
+
/**
|
|
422
|
+
* Function used to load user source if they are an external user.
|
|
423
|
+
* accepts two params:
|
|
424
|
+
* accountId: account ID of the user to lookup sources
|
|
425
|
+
* signal: AbortController signal to abort the request if the tooltip is closed
|
|
426
|
+
*/
|
|
415
427
|
loadUserSource?: LoadUserSource;
|
|
428
|
+
/** Callback for value change events fired whenever a selection is inserted or removed. */
|
|
416
429
|
onChange?: OnChange;
|
|
430
|
+
/** To enable multi user picker. */
|
|
417
431
|
isMulti?: boolean;
|
|
432
|
+
/** Input text value. */
|
|
418
433
|
search?: string;
|
|
434
|
+
/** Anchor for the user picker popup. */
|
|
419
435
|
anchor?: React_2.ComponentType<any>;
|
|
436
|
+
/** Controls if user picker menu is open or not. If not provided, UserPicker will control menu state internally. */
|
|
420
437
|
open?: boolean;
|
|
438
|
+
/** Show the loading indicator. */
|
|
421
439
|
isLoading?: boolean;
|
|
440
|
+
/** Callback for search input text change events. */
|
|
422
441
|
onInputChange?: OnInputChange;
|
|
442
|
+
/** Callback for when a selection is made. */
|
|
423
443
|
onSelection?: OnOption;
|
|
444
|
+
/** Callback for when the field gains focus. */
|
|
424
445
|
onFocus?: OnPicker;
|
|
446
|
+
/** Callback for when the field loses focus. */
|
|
425
447
|
onBlur?: OnPicker;
|
|
448
|
+
/** Callback for when the value/s in the picker is cleared. */
|
|
426
449
|
onClear?: OnPicker;
|
|
450
|
+
/** Callback that is triggered when popup picker is closed */
|
|
427
451
|
onClose?: OnPicker;
|
|
452
|
+
/** Appearance of the user picker. */
|
|
428
453
|
appearance?: Appearance;
|
|
454
|
+
/** Display the picker with a subtle style. */
|
|
429
455
|
subtle?: boolean;
|
|
456
|
+
/** Display the picker with no border. */
|
|
430
457
|
noBorder?: boolean;
|
|
458
|
+
/**
|
|
459
|
+
* You may pass through a `StylesConfig` to be merged with the picker default styles if a custom override is required.
|
|
460
|
+
* Consider using noBorder, subtle before customising further.
|
|
461
|
+
* See https://react-select.com/styles
|
|
462
|
+
*/
|
|
431
463
|
styles?: StylesConfig;
|
|
464
|
+
/** Default value for the field to be used on initial render.
|
|
465
|
+
* `defaultValue` differs from `value` in that it sets the initial value then leaves the component 'uncontrolled'
|
|
466
|
+
* whereas setting the `value` prop delegates responsibility for maintaining the value to the caller
|
|
467
|
+
* (i.e. listen to `onChange`) */
|
|
432
468
|
defaultValue?: DefaultValue;
|
|
469
|
+
/** Placeholder text to be shown when there is no value in the field. */
|
|
433
470
|
placeholder?: React_2.ReactNode;
|
|
471
|
+
/** Message to encourage the user to add more items to user picker. */
|
|
434
472
|
addMoreMessage?: string;
|
|
473
|
+
/** Message to be shown when the menu is open but no options are provided.
|
|
474
|
+
* If message is null, no message will be displayed.
|
|
475
|
+
* If message is undefined, default message will be displayed.
|
|
476
|
+
*/
|
|
435
477
|
noOptionsMessage?:
|
|
436
478
|
| ((value: { inputValue: string }) => string | null)
|
|
437
479
|
| string
|
|
438
480
|
| null;
|
|
481
|
+
/** Controls if the user picker has a value or not. If not provided, UserPicker will control the value internally. */
|
|
439
482
|
value?: Value;
|
|
483
|
+
/** Disable all interactions with the picker, putting it in a read-only state. */
|
|
440
484
|
isDisabled?: boolean;
|
|
485
|
+
/** Display a remove button on the single picker. True by default. */
|
|
441
486
|
isClearable?: boolean;
|
|
487
|
+
/** Optional tooltip to display on hover over the clear indicator. */
|
|
442
488
|
clearValueLabel?: string;
|
|
489
|
+
/** React-select prop for controlling menu position */
|
|
443
490
|
menuPosition?: 'absolute' | 'fixed';
|
|
491
|
+
/** React-select prop for blocking menu scroll on container when menu scrolled to the very top/bottom of the menu */
|
|
444
492
|
captureMenuScroll?: boolean;
|
|
493
|
+
/** Whether the menu should use a portal, and where it should attach. */
|
|
445
494
|
menuPortalTarget?: HTMLElement;
|
|
495
|
+
/** Whether the user is allowed to enter emails as a value. */
|
|
446
496
|
allowEmail?: boolean;
|
|
497
|
+
/** Setting this with allowEmail will cause the picker to constantly show an email option at the bottom for the supplied email domain/an email the user types in */
|
|
447
498
|
suggestEmailsForDomain?: string;
|
|
499
|
+
/** Email option label */
|
|
448
500
|
emailLabel?: string;
|
|
501
|
+
/** Whether to disable interaction with the input */
|
|
449
502
|
disableInput?: boolean;
|
|
503
|
+
/** Override default email validation function. */
|
|
450
504
|
isValidEmail?: EmailValidator;
|
|
505
|
+
/** Override the internal behaviour to automatically focus the control when the picker is open */
|
|
451
506
|
autoFocus?: boolean;
|
|
507
|
+
/** The maximum number options to be displayed in the dropdown menu during any state of search. The value should be non-negative. */
|
|
452
508
|
maxOptions?: number;
|
|
509
|
+
/** Allows clicking on a label with the same id to open user picker. */
|
|
453
510
|
inputId?: string;
|
|
511
|
+
/** Whether to close menu on scroll */
|
|
454
512
|
closeMenuOnScroll?: boolean | EventListener;
|
|
513
|
+
/** Whether to block scrolling actions */
|
|
455
514
|
menuShouldBlockScroll?: boolean;
|
|
515
|
+
/** Accessibility: Identifies the element (or elements) that labels the current element.*/
|
|
456
516
|
ariaLabelledBy?: string;
|
|
517
|
+
/** Accessibility: Used to set the priority with which screen reader should treat updates to live regions.*/
|
|
457
518
|
ariaLive?: 'polite' | 'off' | 'assertive';
|
|
458
519
|
};
|
|
459
520
|
|
|
460
|
-
|
|
461
|
-
export type UserPickerState = {
|
|
521
|
+
export declare type UserPickerState = {
|
|
462
522
|
options: OptionData[];
|
|
463
523
|
value?: AtlaskitSelectValue;
|
|
464
524
|
isDefaultSet: boolean;
|
|
@@ -470,8 +530,7 @@ export type UserPickerState = {
|
|
|
470
530
|
resolving: boolean;
|
|
471
531
|
};
|
|
472
532
|
|
|
473
|
-
|
|
474
|
-
export type UserSource =
|
|
533
|
+
export declare type UserSource =
|
|
475
534
|
| 'google'
|
|
476
535
|
| 'slack'
|
|
477
536
|
| 'microsoft'
|
|
@@ -480,11 +539,14 @@ export type UserSource =
|
|
|
480
539
|
| 'confluence'
|
|
481
540
|
| 'other-atlassian';
|
|
482
541
|
|
|
483
|
-
|
|
484
|
-
|
|
542
|
+
declare interface UserSourceResult {
|
|
543
|
+
sourceId: string;
|
|
544
|
+
sourceType: UserSource;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export declare const UserType = 'user';
|
|
485
548
|
|
|
486
|
-
|
|
487
|
-
export type Value = OptionData | OptionData[] | null | undefined;
|
|
549
|
+
export declare type Value = OptionData | OptionData[] | null | undefined;
|
|
488
550
|
|
|
489
|
-
|
|
551
|
+
export {};
|
|
490
552
|
```
|