@atlaskit/user-picker 11.16.1 → 11.17.0
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 +11 -0
- package/dist/cjs/components/BaseUserPicker.js +45 -8
- package/dist/cjs/components/MultiValue.js +4 -2
- package/dist/cjs/components/SingleValue.js +4 -2
- package/dist/cjs/components/UserPicker.js +3 -1
- package/dist/es2019/components/BaseUserPicker.js +41 -8
- package/dist/es2019/components/MultiValue.js +4 -2
- package/dist/es2019/components/SingleValue.js +5 -3
- package/dist/es2019/components/UserPicker.js +3 -1
- package/dist/esm/components/BaseUserPicker.js +45 -8
- package/dist/esm/components/MultiValue.js +4 -2
- package/dist/esm/components/SingleValue.js +5 -3
- package/dist/esm/components/UserPicker.js +3 -1
- package/dist/types/components/BaseUserPicker.d.ts +8 -3
- package/dist/types/components/PopupUserPicker.d.ts +6 -0
- package/dist/types/components/UserPicker.d.ts +4 -1
- package/dist/types/types.d.ts +6 -0
- package/dist/types-ts4.5/components/BaseUserPicker.d.ts +8 -3
- package/dist/types-ts4.5/components/PopupUserPicker.d.ts +6 -0
- package/dist/types-ts4.5/components/UserPicker.d.ts +4 -1
- package/dist/types-ts4.5/types.d.ts +6 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 11.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`bef521afc400f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bef521afc400f) -
|
|
8
|
+
Adds prop to set user picker & smart user picker as open/closed
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 11.16.1
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -25,6 +25,7 @@ var _i18n = require("./i18n");
|
|
|
25
25
|
var _utils = require("./utils");
|
|
26
26
|
var _groupOptionsByType = require("../util/group-options-by-type");
|
|
27
27
|
var _ufoExperiences = require("../util/ufoExperiences");
|
|
28
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
28
29
|
var _excluded = ["aria-labelledby", "aria-describedby"];
|
|
29
30
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
31
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -245,7 +246,16 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
245
246
|
});
|
|
246
247
|
(0, _utils.callCallback)(_this.props.onInputChange, '', _this.getSessionId());
|
|
247
248
|
});
|
|
249
|
+
(0, _defineProperty2.default)(_this, "handleOpen", function () {
|
|
250
|
+
(0, _utils.callCallback)(_this.props.onOpen, _this.getSessionId());
|
|
251
|
+
_this.setState({
|
|
252
|
+
menuIsOpen: true
|
|
253
|
+
});
|
|
254
|
+
});
|
|
248
255
|
(0, _defineProperty2.default)(_this, "handleBlur", function () {
|
|
256
|
+
if (_this.isCreateTeamA11yEnabled && _this.props.isFooterFocused) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
249
259
|
(0, _utils.callCallback)(_this.props.onBlur, _this.getSessionId());
|
|
250
260
|
if ((0, _utils.isPopupUserPickerByComponent)(_this.props.SelectComponent)) {
|
|
251
261
|
return;
|
|
@@ -258,13 +268,10 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
258
268
|
options: []
|
|
259
269
|
});
|
|
260
270
|
});
|
|
261
|
-
(0, _defineProperty2.default)(_this, "handleOpen", function () {
|
|
262
|
-
(0, _utils.callCallback)(_this.props.onOpen, _this.getSessionId());
|
|
263
|
-
_this.setState({
|
|
264
|
-
menuIsOpen: true
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
271
|
(0, _defineProperty2.default)(_this, "handleClose", function () {
|
|
272
|
+
if (_this.isCreateTeamA11yEnabled && _this.props.isFooterFocused) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
268
275
|
_this.resetInputState();
|
|
269
276
|
(0, _utils.callCallback)(_this.props.onClose, _this.getSessionId());
|
|
270
277
|
_this.setState({
|
|
@@ -325,6 +332,18 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
325
332
|
}
|
|
326
333
|
}
|
|
327
334
|
_this.props.onKeyDown && _this.props.onKeyDown(event);
|
|
335
|
+
if (_this.isCreateTeamA11yEnabled) {
|
|
336
|
+
if (event.key === 'Escape') {
|
|
337
|
+
_this.setState({
|
|
338
|
+
menuIsOpen: false,
|
|
339
|
+
options: []
|
|
340
|
+
});
|
|
341
|
+
_this.props.setIsFooterFocused && _this.props.setIsFooterFocused(false);
|
|
342
|
+
}
|
|
343
|
+
if (event.key === 'Tab' && _this.props.setIsFooterFocused && _this.props.footer) {
|
|
344
|
+
_this.props.setIsFooterFocused(true);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
328
347
|
});
|
|
329
348
|
(0, _defineProperty2.default)(_this, "handleClearIndicatorHover", function (hoveringClearIndicator) {
|
|
330
349
|
_this.setState({
|
|
@@ -381,6 +400,9 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
381
400
|
});
|
|
382
401
|
}
|
|
383
402
|
});
|
|
403
|
+
(0, _defineProperty2.default)(_this, "shouldKeepMenuOpen", function () {
|
|
404
|
+
return Boolean(!!_this.props.footer) && Boolean(_this.props.isFooterFocused);
|
|
405
|
+
});
|
|
384
406
|
_this.state = {
|
|
385
407
|
options: [],
|
|
386
408
|
isDefaultSet: false,
|
|
@@ -415,6 +437,11 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
415
437
|
get: function get() {
|
|
416
438
|
return this.props.openMenuOnClick && !this.props.isMulti;
|
|
417
439
|
}
|
|
440
|
+
}, {
|
|
441
|
+
key: "isCreateTeamA11yEnabled",
|
|
442
|
+
get: function get() {
|
|
443
|
+
return (0, _platformFeatureFlags.fg)('a11y-create-team-is-not-focusable-and-has-no-btn');
|
|
444
|
+
}
|
|
418
445
|
}, {
|
|
419
446
|
key: "componentDidMount",
|
|
420
447
|
value: function componentDidMount() {
|
|
@@ -431,7 +458,7 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
431
458
|
}
|
|
432
459
|
}, {
|
|
433
460
|
key: "componentDidUpdate",
|
|
434
|
-
value: function componentDidUpdate(
|
|
461
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
435
462
|
var _this$state2 = this.state,
|
|
436
463
|
menuIsOpen = _this$state2.menuIsOpen,
|
|
437
464
|
options = _this$state2.options,
|
|
@@ -439,6 +466,16 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
439
466
|
count = _this$state2.count,
|
|
440
467
|
inputValue = _this$state2.inputValue;
|
|
441
468
|
|
|
469
|
+
// Close menu when isFooterFocused changes from true to false
|
|
470
|
+
if (this.isCreateTeamA11yEnabled && menuIsOpen && prevProps.isFooterFocused === true && this.props.isFooterFocused === false && !this.shouldKeepMenuOpen()) {
|
|
471
|
+
this.resetInputState();
|
|
472
|
+
(0, _utils.callCallback)(this.props.onClose, this.getSessionId());
|
|
473
|
+
this.setState({
|
|
474
|
+
menuIsOpen: false,
|
|
475
|
+
options: []
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
|
|
442
479
|
// Create a new session when the menu is opened and there is no session
|
|
443
480
|
if (menuIsOpen && !prevState.menuIsOpen && !this.session) {
|
|
444
481
|
this.startSession();
|
|
@@ -460,7 +497,7 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
460
497
|
this.session.inputChangeTime = Date.now();
|
|
461
498
|
}
|
|
462
499
|
}
|
|
463
|
-
if (menuIsOpen && (!
|
|
500
|
+
if (menuIsOpen && (!prevProps.loadOptions || prevState.menuIsOpen) && count === 0 && !resolving && [_ufo.UFOExperienceState.STARTED.id, _ufo.UFOExperienceState.IN_PROGRESS.id].includes(this.optionsShownUfoExperienceInstance.state.id)) {
|
|
464
501
|
this.optionsShownUfoExperienceInstance.success();
|
|
465
502
|
}
|
|
466
503
|
}
|
|
@@ -83,8 +83,10 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
83
83
|
});
|
|
84
84
|
(0, _defineProperty2.default)(_this, "getElemAfter", function () {
|
|
85
85
|
var data = _this.props.data.data;
|
|
86
|
-
if ((0, _utils.isTeam)(data) && data.verified) {
|
|
87
|
-
return (0, _react2.jsx)(_verifiedTeamIcon.VerifiedTeamIcon,
|
|
86
|
+
if ((0, _utils.isGroup)(data) && data.includeTeamsUpdates || (0, _utils.isTeam)(data) && data.verified) {
|
|
87
|
+
return (0, _react2.jsx)(_verifiedTeamIcon.VerifiedTeamIcon, {
|
|
88
|
+
size: data.includeTeamsUpdates ? 'small' : 'medium'
|
|
89
|
+
});
|
|
88
90
|
}
|
|
89
91
|
return null;
|
|
90
92
|
});
|
|
@@ -25,9 +25,11 @@ var styles = {
|
|
|
25
25
|
var ElementAfter = function ElementAfter(props) {
|
|
26
26
|
var data = props.data.data,
|
|
27
27
|
shouldShowVerifiedIcon = props.shouldShowVerifiedIcon;
|
|
28
|
-
var showIcon = shouldShowVerifiedIcon ? shouldShowVerifiedIcon(data) : (0, _utils.isTeam)(data) && data.verified;
|
|
28
|
+
var showIcon = shouldShowVerifiedIcon ? shouldShowVerifiedIcon(data) : (0, _utils.isTeam)(data) && data.verified || (0, _utils.isGroup)(data) && data.includeTeamsUpdates;
|
|
29
29
|
if (showIcon) {
|
|
30
|
-
return /*#__PURE__*/React.createElement(_verifiedTeamIcon.VerifiedTeamIcon,
|
|
30
|
+
return /*#__PURE__*/React.createElement(_verifiedTeamIcon.VerifiedTeamIcon, {
|
|
31
|
+
size: data.includeTeamsUpdates ? 'small' : 'medium'
|
|
32
|
+
});
|
|
31
33
|
}
|
|
32
34
|
return null;
|
|
33
35
|
};
|
|
@@ -75,6 +75,7 @@ var UserPickerWithoutAnalytics = exports.UserPickerWithoutAnalytics = /*#__PURE_
|
|
|
75
75
|
captureMenuScroll = _this$props.captureMenuScroll,
|
|
76
76
|
closeMenuOnScroll = _this$props.closeMenuOnScroll,
|
|
77
77
|
loadUserSource = _this$props.loadUserSource,
|
|
78
|
+
menuIsOpen = _this$props.menuIsOpen,
|
|
78
79
|
_this$props$required = _this$props.required,
|
|
79
80
|
required = _this$props$required === void 0 ? false : _this$props$required,
|
|
80
81
|
_this$props$showClear = _this$props.showClearIndicator,
|
|
@@ -91,7 +92,8 @@ var UserPickerWithoutAnalytics = exports.UserPickerWithoutAnalytics = /*#__PURE_
|
|
|
91
92
|
menuShouldBlockScroll: menuShouldBlockScroll,
|
|
92
93
|
captureMenuScroll: captureMenuScroll,
|
|
93
94
|
required: required,
|
|
94
|
-
includeTeamsUpdates: includeTeamsUpdates
|
|
95
|
+
includeTeamsUpdates: includeTeamsUpdates,
|
|
96
|
+
menuIsOpen: menuIsOpen
|
|
95
97
|
};
|
|
96
98
|
var pickerProps = allowEmail ? _objectSpread(_objectSpread(_objectSpread({}, defaultPickerProps), creatableProps), {}, {
|
|
97
99
|
emailLabel: emailLabel
|
|
@@ -13,6 +13,7 @@ import { messages } from './i18n';
|
|
|
13
13
|
import { callCallback, extractOptionValue, getOptions, isIterable, isPopupUserPickerByComponent, isDefaultValuePopulated, isSingleValue, optionToSelectableOptions } from './utils';
|
|
14
14
|
import { groupOptionsByType } from '../util/group-options-by-type';
|
|
15
15
|
import { userPickerOptionsShownUfoExperience } from '../util/ufoExperiences';
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
17
|
const loadingMessage = () => null;
|
|
17
18
|
const classNamePrefix = 'fabric-user-picker';
|
|
18
19
|
export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
@@ -235,7 +236,16 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
235
236
|
});
|
|
236
237
|
callCallback(this.props.onInputChange, '', this.getSessionId());
|
|
237
238
|
});
|
|
239
|
+
_defineProperty(this, "handleOpen", () => {
|
|
240
|
+
callCallback(this.props.onOpen, this.getSessionId());
|
|
241
|
+
this.setState({
|
|
242
|
+
menuIsOpen: true
|
|
243
|
+
});
|
|
244
|
+
});
|
|
238
245
|
_defineProperty(this, "handleBlur", () => {
|
|
246
|
+
if (this.isCreateTeamA11yEnabled && this.props.isFooterFocused) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
239
249
|
callCallback(this.props.onBlur, this.getSessionId());
|
|
240
250
|
if (isPopupUserPickerByComponent(this.props.SelectComponent)) {
|
|
241
251
|
return;
|
|
@@ -248,13 +258,10 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
248
258
|
options: []
|
|
249
259
|
});
|
|
250
260
|
});
|
|
251
|
-
_defineProperty(this, "handleOpen", () => {
|
|
252
|
-
callCallback(this.props.onOpen, this.getSessionId());
|
|
253
|
-
this.setState({
|
|
254
|
-
menuIsOpen: true
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
261
|
_defineProperty(this, "handleClose", () => {
|
|
262
|
+
if (this.isCreateTeamA11yEnabled && this.props.isFooterFocused) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
258
265
|
this.resetInputState();
|
|
259
266
|
callCallback(this.props.onClose, this.getSessionId());
|
|
260
267
|
this.setState({
|
|
@@ -315,6 +322,18 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
315
322
|
}
|
|
316
323
|
}
|
|
317
324
|
this.props.onKeyDown && this.props.onKeyDown(event);
|
|
325
|
+
if (this.isCreateTeamA11yEnabled) {
|
|
326
|
+
if (event.key === 'Escape') {
|
|
327
|
+
this.setState({
|
|
328
|
+
menuIsOpen: false,
|
|
329
|
+
options: []
|
|
330
|
+
});
|
|
331
|
+
this.props.setIsFooterFocused && this.props.setIsFooterFocused(false);
|
|
332
|
+
}
|
|
333
|
+
if (event.key === 'Tab' && this.props.setIsFooterFocused && this.props.footer) {
|
|
334
|
+
this.props.setIsFooterFocused(true);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
318
337
|
});
|
|
319
338
|
_defineProperty(this, "handleClearIndicatorHover", hoveringClearIndicator => {
|
|
320
339
|
this.setState({
|
|
@@ -366,6 +385,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
366
385
|
}));
|
|
367
386
|
}
|
|
368
387
|
});
|
|
388
|
+
_defineProperty(this, "shouldKeepMenuOpen", () => Boolean(!!this.props.footer) && Boolean(this.props.isFooterFocused));
|
|
369
389
|
this.state = {
|
|
370
390
|
options: [],
|
|
371
391
|
isDefaultSet: false,
|
|
@@ -396,6 +416,9 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
396
416
|
get isMenuOpenOnClickForSingleSelect() {
|
|
397
417
|
return this.props.openMenuOnClick && !this.props.isMulti;
|
|
398
418
|
}
|
|
419
|
+
get isCreateTeamA11yEnabled() {
|
|
420
|
+
return fg('a11y-create-team-is-not-focusable-and-has-no-btn');
|
|
421
|
+
}
|
|
399
422
|
componentDidMount() {
|
|
400
423
|
const {
|
|
401
424
|
open,
|
|
@@ -409,7 +432,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
409
432
|
this.executeLoadOptions(search);
|
|
410
433
|
}
|
|
411
434
|
}
|
|
412
|
-
componentDidUpdate(
|
|
435
|
+
componentDidUpdate(prevProps, prevState) {
|
|
413
436
|
const {
|
|
414
437
|
menuIsOpen,
|
|
415
438
|
options,
|
|
@@ -418,6 +441,16 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
418
441
|
inputValue
|
|
419
442
|
} = this.state;
|
|
420
443
|
|
|
444
|
+
// Close menu when isFooterFocused changes from true to false
|
|
445
|
+
if (this.isCreateTeamA11yEnabled && menuIsOpen && prevProps.isFooterFocused === true && this.props.isFooterFocused === false && !this.shouldKeepMenuOpen()) {
|
|
446
|
+
this.resetInputState();
|
|
447
|
+
callCallback(this.props.onClose, this.getSessionId());
|
|
448
|
+
this.setState({
|
|
449
|
+
menuIsOpen: false,
|
|
450
|
+
options: []
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
|
|
421
454
|
// Create a new session when the menu is opened and there is no session
|
|
422
455
|
if (menuIsOpen && !prevState.menuIsOpen && !this.session) {
|
|
423
456
|
this.startSession();
|
|
@@ -439,7 +472,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
439
472
|
this.session.inputChangeTime = Date.now();
|
|
440
473
|
}
|
|
441
474
|
}
|
|
442
|
-
if (menuIsOpen && (!
|
|
475
|
+
if (menuIsOpen && (!prevProps.loadOptions || prevState.menuIsOpen) && count === 0 && !resolving && [UFOExperienceState.STARTED.id, UFOExperienceState.IN_PROGRESS.id].includes(this.optionsShownUfoExperienceInstance.state.id)) {
|
|
443
476
|
this.optionsShownUfoExperienceInstance.success();
|
|
444
477
|
}
|
|
445
478
|
}
|
|
@@ -77,8 +77,10 @@ export class MultiValue extends React.Component {
|
|
|
77
77
|
data
|
|
78
78
|
}
|
|
79
79
|
} = this.props;
|
|
80
|
-
if (isTeam(data) && data.verified) {
|
|
81
|
-
return jsx(VerifiedTeamIcon,
|
|
80
|
+
if (isGroup(data) && data.includeTeamsUpdates || isTeam(data) && data.verified) {
|
|
81
|
+
return jsx(VerifiedTeamIcon, {
|
|
82
|
+
size: data.includeTeamsUpdates ? 'small' : 'medium'
|
|
83
|
+
});
|
|
82
84
|
}
|
|
83
85
|
return null;
|
|
84
86
|
});
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { components } from '@atlaskit/select';
|
|
6
6
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
7
|
-
import { getAvatarUrl, isTeam } from './utils';
|
|
7
|
+
import { getAvatarUrl, isTeam, isGroup } from './utils';
|
|
8
8
|
import { getAppearanceForAppType } from '@atlaskit/avatar';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
@@ -21,9 +21,11 @@ const ElementAfter = props => {
|
|
|
21
21
|
},
|
|
22
22
|
shouldShowVerifiedIcon
|
|
23
23
|
} = props;
|
|
24
|
-
const showIcon = shouldShowVerifiedIcon ? shouldShowVerifiedIcon(data) : isTeam(data) && data.verified;
|
|
24
|
+
const showIcon = shouldShowVerifiedIcon ? shouldShowVerifiedIcon(data) : isTeam(data) && data.verified || isGroup(data) && data.includeTeamsUpdates;
|
|
25
25
|
if (showIcon) {
|
|
26
|
-
return /*#__PURE__*/React.createElement(VerifiedTeamIcon,
|
|
26
|
+
return /*#__PURE__*/React.createElement(VerifiedTeamIcon, {
|
|
27
|
+
size: data.includeTeamsUpdates ? 'small' : 'medium'
|
|
28
|
+
});
|
|
27
29
|
}
|
|
28
30
|
return null;
|
|
29
31
|
};
|
|
@@ -50,6 +50,7 @@ export class UserPickerWithoutAnalytics extends React.Component {
|
|
|
50
50
|
captureMenuScroll,
|
|
51
51
|
closeMenuOnScroll,
|
|
52
52
|
loadUserSource,
|
|
53
|
+
menuIsOpen,
|
|
53
54
|
required = false,
|
|
54
55
|
showClearIndicator = false,
|
|
55
56
|
includeTeamsUpdates = false
|
|
@@ -64,7 +65,8 @@ export class UserPickerWithoutAnalytics extends React.Component {
|
|
|
64
65
|
menuShouldBlockScroll,
|
|
65
66
|
captureMenuScroll,
|
|
66
67
|
required,
|
|
67
|
-
includeTeamsUpdates
|
|
68
|
+
includeTeamsUpdates,
|
|
69
|
+
menuIsOpen
|
|
68
70
|
};
|
|
69
71
|
const pickerProps = allowEmail ? {
|
|
70
72
|
...defaultPickerProps,
|
|
@@ -27,6 +27,7 @@ import { messages } from './i18n';
|
|
|
27
27
|
import { callCallback, extractOptionValue, getOptions, isIterable, isPopupUserPickerByComponent, isDefaultValuePopulated, isSingleValue, optionToSelectableOptions } from './utils';
|
|
28
28
|
import { groupOptionsByType } from '../util/group-options-by-type';
|
|
29
29
|
import { userPickerOptionsShownUfoExperience } from '../util/ufoExperiences';
|
|
30
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
30
31
|
var loadingMessage = function loadingMessage() {
|
|
31
32
|
return null;
|
|
32
33
|
};
|
|
@@ -239,7 +240,16 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
239
240
|
});
|
|
240
241
|
callCallback(_this.props.onInputChange, '', _this.getSessionId());
|
|
241
242
|
});
|
|
243
|
+
_defineProperty(_this, "handleOpen", function () {
|
|
244
|
+
callCallback(_this.props.onOpen, _this.getSessionId());
|
|
245
|
+
_this.setState({
|
|
246
|
+
menuIsOpen: true
|
|
247
|
+
});
|
|
248
|
+
});
|
|
242
249
|
_defineProperty(_this, "handleBlur", function () {
|
|
250
|
+
if (_this.isCreateTeamA11yEnabled && _this.props.isFooterFocused) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
243
253
|
callCallback(_this.props.onBlur, _this.getSessionId());
|
|
244
254
|
if (isPopupUserPickerByComponent(_this.props.SelectComponent)) {
|
|
245
255
|
return;
|
|
@@ -252,13 +262,10 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
252
262
|
options: []
|
|
253
263
|
});
|
|
254
264
|
});
|
|
255
|
-
_defineProperty(_this, "handleOpen", function () {
|
|
256
|
-
callCallback(_this.props.onOpen, _this.getSessionId());
|
|
257
|
-
_this.setState({
|
|
258
|
-
menuIsOpen: true
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
265
|
_defineProperty(_this, "handleClose", function () {
|
|
266
|
+
if (_this.isCreateTeamA11yEnabled && _this.props.isFooterFocused) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
262
269
|
_this.resetInputState();
|
|
263
270
|
callCallback(_this.props.onClose, _this.getSessionId());
|
|
264
271
|
_this.setState({
|
|
@@ -319,6 +326,18 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
319
326
|
}
|
|
320
327
|
}
|
|
321
328
|
_this.props.onKeyDown && _this.props.onKeyDown(event);
|
|
329
|
+
if (_this.isCreateTeamA11yEnabled) {
|
|
330
|
+
if (event.key === 'Escape') {
|
|
331
|
+
_this.setState({
|
|
332
|
+
menuIsOpen: false,
|
|
333
|
+
options: []
|
|
334
|
+
});
|
|
335
|
+
_this.props.setIsFooterFocused && _this.props.setIsFooterFocused(false);
|
|
336
|
+
}
|
|
337
|
+
if (event.key === 'Tab' && _this.props.setIsFooterFocused && _this.props.footer) {
|
|
338
|
+
_this.props.setIsFooterFocused(true);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
322
341
|
});
|
|
323
342
|
_defineProperty(_this, "handleClearIndicatorHover", function (hoveringClearIndicator) {
|
|
324
343
|
_this.setState({
|
|
@@ -375,6 +394,9 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
375
394
|
});
|
|
376
395
|
}
|
|
377
396
|
});
|
|
397
|
+
_defineProperty(_this, "shouldKeepMenuOpen", function () {
|
|
398
|
+
return Boolean(!!_this.props.footer) && Boolean(_this.props.isFooterFocused);
|
|
399
|
+
});
|
|
378
400
|
_this.state = {
|
|
379
401
|
options: [],
|
|
380
402
|
isDefaultSet: false,
|
|
@@ -409,6 +431,11 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
409
431
|
get: function get() {
|
|
410
432
|
return this.props.openMenuOnClick && !this.props.isMulti;
|
|
411
433
|
}
|
|
434
|
+
}, {
|
|
435
|
+
key: "isCreateTeamA11yEnabled",
|
|
436
|
+
get: function get() {
|
|
437
|
+
return fg('a11y-create-team-is-not-focusable-and-has-no-btn');
|
|
438
|
+
}
|
|
412
439
|
}, {
|
|
413
440
|
key: "componentDidMount",
|
|
414
441
|
value: function componentDidMount() {
|
|
@@ -425,7 +452,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
425
452
|
}
|
|
426
453
|
}, {
|
|
427
454
|
key: "componentDidUpdate",
|
|
428
|
-
value: function componentDidUpdate(
|
|
455
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
429
456
|
var _this$state2 = this.state,
|
|
430
457
|
menuIsOpen = _this$state2.menuIsOpen,
|
|
431
458
|
options = _this$state2.options,
|
|
@@ -433,6 +460,16 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
433
460
|
count = _this$state2.count,
|
|
434
461
|
inputValue = _this$state2.inputValue;
|
|
435
462
|
|
|
463
|
+
// Close menu when isFooterFocused changes from true to false
|
|
464
|
+
if (this.isCreateTeamA11yEnabled && menuIsOpen && prevProps.isFooterFocused === true && this.props.isFooterFocused === false && !this.shouldKeepMenuOpen()) {
|
|
465
|
+
this.resetInputState();
|
|
466
|
+
callCallback(this.props.onClose, this.getSessionId());
|
|
467
|
+
this.setState({
|
|
468
|
+
menuIsOpen: false,
|
|
469
|
+
options: []
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
|
|
436
473
|
// Create a new session when the menu is opened and there is no session
|
|
437
474
|
if (menuIsOpen && !prevState.menuIsOpen && !this.session) {
|
|
438
475
|
this.startSession();
|
|
@@ -454,7 +491,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
454
491
|
this.session.inputChangeTime = Date.now();
|
|
455
492
|
}
|
|
456
493
|
}
|
|
457
|
-
if (menuIsOpen && (!
|
|
494
|
+
if (menuIsOpen && (!prevProps.loadOptions || prevState.menuIsOpen) && count === 0 && !resolving && [UFOExperienceState.STARTED.id, UFOExperienceState.IN_PROGRESS.id].includes(this.optionsShownUfoExperienceInstance.state.id)) {
|
|
458
495
|
this.optionsShownUfoExperienceInstance.success();
|
|
459
496
|
}
|
|
460
497
|
}
|
|
@@ -78,8 +78,10 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
78
78
|
});
|
|
79
79
|
_defineProperty(_this, "getElemAfter", function () {
|
|
80
80
|
var data = _this.props.data.data;
|
|
81
|
-
if (isTeam(data) && data.verified) {
|
|
82
|
-
return jsx(VerifiedTeamIcon,
|
|
81
|
+
if (isGroup(data) && data.includeTeamsUpdates || isTeam(data) && data.verified) {
|
|
82
|
+
return jsx(VerifiedTeamIcon, {
|
|
83
|
+
size: data.includeTeamsUpdates ? 'small' : 'medium'
|
|
84
|
+
});
|
|
83
85
|
}
|
|
84
86
|
return null;
|
|
85
87
|
});
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { components } from '@atlaskit/select';
|
|
6
6
|
import { SizeableAvatar } from './SizeableAvatar';
|
|
7
|
-
import { getAvatarUrl, isTeam } from './utils';
|
|
7
|
+
import { getAvatarUrl, isTeam, isGroup } from './utils';
|
|
8
8
|
import { getAppearanceForAppType } from '@atlaskit/avatar';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
@@ -17,9 +17,11 @@ var styles = {
|
|
|
17
17
|
var ElementAfter = function ElementAfter(props) {
|
|
18
18
|
var data = props.data.data,
|
|
19
19
|
shouldShowVerifiedIcon = props.shouldShowVerifiedIcon;
|
|
20
|
-
var showIcon = shouldShowVerifiedIcon ? shouldShowVerifiedIcon(data) : isTeam(data) && data.verified;
|
|
20
|
+
var showIcon = shouldShowVerifiedIcon ? shouldShowVerifiedIcon(data) : isTeam(data) && data.verified || isGroup(data) && data.includeTeamsUpdates;
|
|
21
21
|
if (showIcon) {
|
|
22
|
-
return /*#__PURE__*/React.createElement(VerifiedTeamIcon,
|
|
22
|
+
return /*#__PURE__*/React.createElement(VerifiedTeamIcon, {
|
|
23
|
+
size: data.includeTeamsUpdates ? 'small' : 'medium'
|
|
24
|
+
});
|
|
23
25
|
}
|
|
24
26
|
return null;
|
|
25
27
|
};
|
|
@@ -67,6 +67,7 @@ export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component)
|
|
|
67
67
|
captureMenuScroll = _this$props.captureMenuScroll,
|
|
68
68
|
closeMenuOnScroll = _this$props.closeMenuOnScroll,
|
|
69
69
|
loadUserSource = _this$props.loadUserSource,
|
|
70
|
+
menuIsOpen = _this$props.menuIsOpen,
|
|
70
71
|
_this$props$required = _this$props.required,
|
|
71
72
|
required = _this$props$required === void 0 ? false : _this$props$required,
|
|
72
73
|
_this$props$showClear = _this$props.showClearIndicator,
|
|
@@ -83,7 +84,8 @@ export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component)
|
|
|
83
84
|
menuShouldBlockScroll: menuShouldBlockScroll,
|
|
84
85
|
captureMenuScroll: captureMenuScroll,
|
|
85
86
|
required: required,
|
|
86
|
-
includeTeamsUpdates: includeTeamsUpdates
|
|
87
|
+
includeTeamsUpdates: includeTeamsUpdates,
|
|
88
|
+
menuIsOpen: menuIsOpen
|
|
87
89
|
};
|
|
88
90
|
var pickerProps = allowEmail ? _objectSpread(_objectSpread(_objectSpread({}, defaultPickerProps), creatableProps), {}, {
|
|
89
91
|
emailLabel: emailLabel
|
|
@@ -46,23 +46,25 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
|
|
|
46
46
|
private get isMenuOpenOnClickForSingleSelect();
|
|
47
47
|
abortOptionsShownUfoExperience: () => void;
|
|
48
48
|
startOptionsShownUfoExperience: () => void;
|
|
49
|
+
private get isCreateTeamA11yEnabled();
|
|
49
50
|
private executeLoadOptions;
|
|
50
51
|
private handleFocus;
|
|
51
52
|
private resetInputState;
|
|
52
|
-
private handleBlur;
|
|
53
53
|
private handleOpen;
|
|
54
|
+
private handleBlur;
|
|
54
55
|
private handleClose;
|
|
55
56
|
private handleInputChange;
|
|
56
57
|
private fireEvent;
|
|
57
58
|
private startSession;
|
|
58
59
|
componentDidMount(): void;
|
|
59
|
-
componentDidUpdate(
|
|
60
|
+
componentDidUpdate(prevProps: UserPickerProps, prevState: UserPickerState): void;
|
|
60
61
|
private handleKeyDown;
|
|
61
62
|
handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
|
|
62
63
|
private getOptions;
|
|
63
64
|
private getAppearance;
|
|
64
65
|
get ariaProps(): Partial<AriaAttributes>;
|
|
65
66
|
private handleClickDraggableParentComponent;
|
|
67
|
+
private shouldKeepMenuOpen;
|
|
66
68
|
render(): React.JSX.Element;
|
|
67
69
|
}
|
|
68
70
|
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
@@ -102,6 +104,7 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
102
104
|
}) => React.ReactNode;
|
|
103
105
|
loadUserSource?: import("../types").LoadUserSource;
|
|
104
106
|
maxOptions?: number;
|
|
107
|
+
menuIsOpen?: boolean;
|
|
105
108
|
maxPickerHeight?: number;
|
|
106
109
|
menuMinWidth?: number;
|
|
107
110
|
menuPortalTarget?: HTMLElement;
|
|
@@ -138,6 +141,8 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
138
141
|
UNSAFE_hasDraggableParentComponent?: boolean;
|
|
139
142
|
value?: import("../types").Value;
|
|
140
143
|
width?: number | string;
|
|
144
|
+
isFooterFocused?: boolean;
|
|
145
|
+
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
141
146
|
} & {
|
|
142
147
|
components: any;
|
|
143
148
|
name?: string;
|
|
@@ -151,7 +156,7 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
151
156
|
*/
|
|
152
157
|
UNSAFE_hasDraggableParentComponent?: boolean;
|
|
153
158
|
width: string | number;
|
|
154
|
-
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "placeholder" | "isDisabled" | "onChange" | "onInputChange" | "value" | "appearance" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onFocus" | "onKeyDown" | "options" | "styles" | "required" | "footer" | "defaultValue" | "search" | "anchor" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "clearValueLabel" | "disableInput" | "emailLabel" | "fieldId" | "forwardedRef" | "groupByTypeOrder" | "header" | "height" | "includeTeamsUpdates" | "isValidEmail" | "loadOptions" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "onClear" | "onClose" | "onOpen" | "onSelection" | "open" | "placeholderAvatar" | "popupSelectProps" | "showClearIndicator" | "strategy" | "suggestEmailsForDomain" | "UNSAFE_hasDraggableParentComponent" | "width" | "pickerProps" | "SelectComponent"> & {
|
|
159
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "placeholder" | "isDisabled" | "onChange" | "onInputChange" | "value" | "appearance" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuIsOpen" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onFocus" | "onKeyDown" | "options" | "styles" | "required" | "footer" | "defaultValue" | "search" | "anchor" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "clearValueLabel" | "disableInput" | "emailLabel" | "fieldId" | "forwardedRef" | "groupByTypeOrder" | "header" | "height" | "includeTeamsUpdates" | "isValidEmail" | "loadOptions" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "onClear" | "onClose" | "onOpen" | "onSelection" | "open" | "placeholderAvatar" | "popupSelectProps" | "showClearIndicator" | "strategy" | "suggestEmailsForDomain" | "UNSAFE_hasDraggableParentComponent" | "width" | "isFooterFocused" | "setIsFooterFocused" | "pickerProps" | "SelectComponent"> & {
|
|
155
160
|
isClearable?: boolean | undefined;
|
|
156
161
|
isMulti?: boolean | undefined;
|
|
157
162
|
openMenuOnClick?: boolean | undefined;
|
|
@@ -56,6 +56,7 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
|
|
|
56
56
|
}) => React.ReactNode;
|
|
57
57
|
loadUserSource?: import("../types").LoadUserSource;
|
|
58
58
|
maxOptions?: number;
|
|
59
|
+
menuIsOpen?: boolean;
|
|
59
60
|
maxPickerHeight?: number;
|
|
60
61
|
menuMinWidth?: number;
|
|
61
62
|
menuPortalTarget?: HTMLElement;
|
|
@@ -92,6 +93,8 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
|
|
|
92
93
|
UNSAFE_hasDraggableParentComponent?: boolean;
|
|
93
94
|
value?: import("../types").Value;
|
|
94
95
|
width?: number | string;
|
|
96
|
+
isFooterFocused?: boolean;
|
|
97
|
+
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
95
98
|
} & {
|
|
96
99
|
boundariesElement?: import("../types").BoundariesElement;
|
|
97
100
|
offset?: [number, number];
|
|
@@ -117,6 +120,7 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
|
|
|
117
120
|
isInvalid?: boolean | undefined;
|
|
118
121
|
isLoading?: boolean | undefined;
|
|
119
122
|
isMulti?: boolean | undefined;
|
|
123
|
+
menuIsOpen?: boolean | undefined;
|
|
120
124
|
menuPosition?: "absolute" | "fixed" | undefined;
|
|
121
125
|
menuPortalTarget?: HTMLElement | undefined;
|
|
122
126
|
menuShouldBlockScroll?: boolean | undefined;
|
|
@@ -175,6 +179,8 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
|
|
|
175
179
|
textFieldBackgroundColor?: boolean | undefined;
|
|
176
180
|
UNSAFE_hasDraggableParentComponent?: boolean | undefined;
|
|
177
181
|
width?: number | string | undefined;
|
|
182
|
+
isFooterFocused?: boolean | undefined;
|
|
183
|
+
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
178
184
|
popupTitle?: string | undefined;
|
|
179
185
|
placement?: import("@popperjs/core").Placement | undefined;
|
|
180
186
|
rootBoundary?: import("../types").RootBoundary | undefined;
|
|
@@ -47,6 +47,7 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
47
47
|
}) => React.ReactNode;
|
|
48
48
|
loadUserSource?: import("../types").LoadUserSource;
|
|
49
49
|
maxOptions?: number;
|
|
50
|
+
menuIsOpen?: boolean;
|
|
50
51
|
maxPickerHeight?: number;
|
|
51
52
|
menuMinWidth?: number;
|
|
52
53
|
menuPortalTarget?: HTMLElement;
|
|
@@ -83,7 +84,9 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
83
84
|
UNSAFE_hasDraggableParentComponent?: boolean;
|
|
84
85
|
value?: import("../types").Value;
|
|
85
86
|
width?: number | string;
|
|
86
|
-
|
|
87
|
+
isFooterFocused?: boolean;
|
|
88
|
+
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
89
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "placeholder" | "isDisabled" | "onChange" | "onInputChange" | "value" | "appearance" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isInvalid" | "isLoading" | "menuIsOpen" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onFocus" | "onKeyDown" | "openMenuOnClick" | "options" | "styles" | "required" | "footer" | "defaultValue" | "search" | "anchor" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "clearValueLabel" | "disableInput" | "emailLabel" | "fieldId" | "forwardedRef" | "groupByTypeOrder" | "header" | "height" | "includeTeamsUpdates" | "isValidEmail" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "noBorder" | "onClear" | "onClose" | "onOpen" | "onSelection" | "open" | "placeholderAvatar" | "popupSelectProps" | "showClearIndicator" | "strategy" | "subtle" | "suggestEmailsForDomain" | "textFieldBackgroundColor" | "UNSAFE_hasDraggableParentComponent" | "isFooterFocused" | "setIsFooterFocused"> & {
|
|
87
90
|
isMulti?: boolean | undefined;
|
|
88
91
|
width?: number | string | undefined;
|
|
89
92
|
} & {} & React.RefAttributes<any>>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -109,6 +109,8 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
|
|
|
109
109
|
loadUserSource?: LoadUserSource;
|
|
110
110
|
/** The maximum number options to be displayed in the dropdown menu during any state of search. The value should be non-negative. */
|
|
111
111
|
maxOptions?: number;
|
|
112
|
+
/** Whether the menu is open or not. */
|
|
113
|
+
menuIsOpen?: boolean;
|
|
112
114
|
/** Sets max height of the user picker. If not set, the height will grow based on number of picked users. */
|
|
113
115
|
maxPickerHeight?: number;
|
|
114
116
|
/** Sets the minimum width for the menu. If not set, menu will always have the same width of the field. */
|
|
@@ -190,6 +192,10 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
|
|
|
190
192
|
value?: Value;
|
|
191
193
|
/** Width of the user picker field. It can be the amount of pixels as numbers or a string with the percentage. */
|
|
192
194
|
width?: number | string;
|
|
195
|
+
/** Checks if the footer is focused or not. This is needed to keep the menu open when the footer is focused */
|
|
196
|
+
isFooterFocused?: boolean;
|
|
197
|
+
/** Sets if the footer is focused or not. This is needed to keep the menu open when the footer is focused */
|
|
198
|
+
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
193
199
|
};
|
|
194
200
|
export type UserPickerRef = {
|
|
195
201
|
blur: () => void;
|
|
@@ -46,23 +46,25 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
|
|
|
46
46
|
private get isMenuOpenOnClickForSingleSelect();
|
|
47
47
|
abortOptionsShownUfoExperience: () => void;
|
|
48
48
|
startOptionsShownUfoExperience: () => void;
|
|
49
|
+
private get isCreateTeamA11yEnabled();
|
|
49
50
|
private executeLoadOptions;
|
|
50
51
|
private handleFocus;
|
|
51
52
|
private resetInputState;
|
|
52
|
-
private handleBlur;
|
|
53
53
|
private handleOpen;
|
|
54
|
+
private handleBlur;
|
|
54
55
|
private handleClose;
|
|
55
56
|
private handleInputChange;
|
|
56
57
|
private fireEvent;
|
|
57
58
|
private startSession;
|
|
58
59
|
componentDidMount(): void;
|
|
59
|
-
componentDidUpdate(
|
|
60
|
+
componentDidUpdate(prevProps: UserPickerProps, prevState: UserPickerState): void;
|
|
60
61
|
private handleKeyDown;
|
|
61
62
|
handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
|
|
62
63
|
private getOptions;
|
|
63
64
|
private getAppearance;
|
|
64
65
|
get ariaProps(): Partial<AriaAttributes>;
|
|
65
66
|
private handleClickDraggableParentComponent;
|
|
67
|
+
private shouldKeepMenuOpen;
|
|
66
68
|
render(): React.JSX.Element;
|
|
67
69
|
}
|
|
68
70
|
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
@@ -102,6 +104,7 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
102
104
|
}) => React.ReactNode;
|
|
103
105
|
loadUserSource?: import("../types").LoadUserSource;
|
|
104
106
|
maxOptions?: number;
|
|
107
|
+
menuIsOpen?: boolean;
|
|
105
108
|
maxPickerHeight?: number;
|
|
106
109
|
menuMinWidth?: number;
|
|
107
110
|
menuPortalTarget?: HTMLElement;
|
|
@@ -138,6 +141,8 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
138
141
|
UNSAFE_hasDraggableParentComponent?: boolean;
|
|
139
142
|
value?: import("../types").Value;
|
|
140
143
|
width?: number | string;
|
|
144
|
+
isFooterFocused?: boolean;
|
|
145
|
+
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
141
146
|
} & {
|
|
142
147
|
components: any;
|
|
143
148
|
name?: string;
|
|
@@ -151,7 +156,7 @@ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
151
156
|
*/
|
|
152
157
|
UNSAFE_hasDraggableParentComponent?: boolean;
|
|
153
158
|
width: string | number;
|
|
154
|
-
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "placeholder" | "isDisabled" | "onChange" | "onInputChange" | "value" | "appearance" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onFocus" | "onKeyDown" | "options" | "styles" | "required" | "footer" | "defaultValue" | "search" | "anchor" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "clearValueLabel" | "disableInput" | "emailLabel" | "fieldId" | "forwardedRef" | "groupByTypeOrder" | "header" | "height" | "includeTeamsUpdates" | "isValidEmail" | "loadOptions" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "onClear" | "onClose" | "onOpen" | "onSelection" | "open" | "placeholderAvatar" | "popupSelectProps" | "showClearIndicator" | "strategy" | "suggestEmailsForDomain" | "UNSAFE_hasDraggableParentComponent" | "width" | "pickerProps" | "SelectComponent"> & {
|
|
159
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "placeholder" | "isDisabled" | "onChange" | "onInputChange" | "value" | "appearance" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isInvalid" | "isLoading" | "menuIsOpen" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onFocus" | "onKeyDown" | "options" | "styles" | "required" | "footer" | "defaultValue" | "search" | "anchor" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "clearValueLabel" | "disableInput" | "emailLabel" | "fieldId" | "forwardedRef" | "groupByTypeOrder" | "header" | "height" | "includeTeamsUpdates" | "isValidEmail" | "loadOptions" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "onClear" | "onClose" | "onOpen" | "onSelection" | "open" | "placeholderAvatar" | "popupSelectProps" | "showClearIndicator" | "strategy" | "suggestEmailsForDomain" | "UNSAFE_hasDraggableParentComponent" | "width" | "isFooterFocused" | "setIsFooterFocused" | "pickerProps" | "SelectComponent"> & {
|
|
155
160
|
isClearable?: boolean | undefined;
|
|
156
161
|
isMulti?: boolean | undefined;
|
|
157
162
|
openMenuOnClick?: boolean | undefined;
|
|
@@ -56,6 +56,7 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
|
|
|
56
56
|
}) => React.ReactNode;
|
|
57
57
|
loadUserSource?: import("../types").LoadUserSource;
|
|
58
58
|
maxOptions?: number;
|
|
59
|
+
menuIsOpen?: boolean;
|
|
59
60
|
maxPickerHeight?: number;
|
|
60
61
|
menuMinWidth?: number;
|
|
61
62
|
menuPortalTarget?: HTMLElement;
|
|
@@ -92,6 +93,8 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
|
|
|
92
93
|
UNSAFE_hasDraggableParentComponent?: boolean;
|
|
93
94
|
value?: import("../types").Value;
|
|
94
95
|
width?: number | string;
|
|
96
|
+
isFooterFocused?: boolean;
|
|
97
|
+
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
95
98
|
} & {
|
|
96
99
|
boundariesElement?: import("../types").BoundariesElement;
|
|
97
100
|
offset?: [
|
|
@@ -123,6 +126,7 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
|
|
|
123
126
|
isInvalid?: boolean | undefined;
|
|
124
127
|
isLoading?: boolean | undefined;
|
|
125
128
|
isMulti?: boolean | undefined;
|
|
129
|
+
menuIsOpen?: boolean | undefined;
|
|
126
130
|
menuPosition?: "absolute" | "fixed" | undefined;
|
|
127
131
|
menuPortalTarget?: HTMLElement | undefined;
|
|
128
132
|
menuShouldBlockScroll?: boolean | undefined;
|
|
@@ -181,6 +185,8 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
|
|
|
181
185
|
textFieldBackgroundColor?: boolean | undefined;
|
|
182
186
|
UNSAFE_hasDraggableParentComponent?: boolean | undefined;
|
|
183
187
|
width?: number | string | undefined;
|
|
188
|
+
isFooterFocused?: boolean | undefined;
|
|
189
|
+
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
184
190
|
popupTitle?: string | undefined;
|
|
185
191
|
placement?: import("@popperjs/core").Placement | undefined;
|
|
186
192
|
rootBoundary?: import("../types").RootBoundary | undefined;
|
|
@@ -47,6 +47,7 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
47
47
|
}) => React.ReactNode;
|
|
48
48
|
loadUserSource?: import("../types").LoadUserSource;
|
|
49
49
|
maxOptions?: number;
|
|
50
|
+
menuIsOpen?: boolean;
|
|
50
51
|
maxPickerHeight?: number;
|
|
51
52
|
menuMinWidth?: number;
|
|
52
53
|
menuPortalTarget?: HTMLElement;
|
|
@@ -83,7 +84,9 @@ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<{
|
|
|
83
84
|
UNSAFE_hasDraggableParentComponent?: boolean;
|
|
84
85
|
value?: import("../types").Value;
|
|
85
86
|
width?: number | string;
|
|
86
|
-
|
|
87
|
+
isFooterFocused?: boolean;
|
|
88
|
+
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
89
|
+
}, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "placeholder" | "isDisabled" | "onChange" | "onInputChange" | "value" | "appearance" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isInvalid" | "isLoading" | "menuIsOpen" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onFocus" | "onKeyDown" | "openMenuOnClick" | "options" | "styles" | "required" | "footer" | "defaultValue" | "search" | "anchor" | "addMoreMessage" | "allowEmail" | "ariaDescribedBy" | "ariaLabel" | "ariaLabelledBy" | "ariaLive" | "clearValueLabel" | "disableInput" | "emailLabel" | "fieldId" | "forwardedRef" | "groupByTypeOrder" | "header" | "height" | "includeTeamsUpdates" | "isValidEmail" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "maxOptions" | "maxPickerHeight" | "menuMinWidth" | "noBorder" | "onClear" | "onClose" | "onOpen" | "onSelection" | "open" | "placeholderAvatar" | "popupSelectProps" | "showClearIndicator" | "strategy" | "subtle" | "suggestEmailsForDomain" | "textFieldBackgroundColor" | "UNSAFE_hasDraggableParentComponent" | "isFooterFocused" | "setIsFooterFocused"> & {
|
|
87
90
|
isMulti?: boolean | undefined;
|
|
88
91
|
width?: number | string | undefined;
|
|
89
92
|
} & {} & React.RefAttributes<any>>;
|
|
@@ -109,6 +109,8 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
|
|
|
109
109
|
loadUserSource?: LoadUserSource;
|
|
110
110
|
/** The maximum number options to be displayed in the dropdown menu during any state of search. The value should be non-negative. */
|
|
111
111
|
maxOptions?: number;
|
|
112
|
+
/** Whether the menu is open or not. */
|
|
113
|
+
menuIsOpen?: boolean;
|
|
112
114
|
/** Sets max height of the user picker. If not set, the height will grow based on number of picked users. */
|
|
113
115
|
maxPickerHeight?: number;
|
|
114
116
|
/** Sets the minimum width for the menu. If not set, menu will always have the same width of the field. */
|
|
@@ -190,6 +192,10 @@ export type UserPickerProps = WithAnalyticsEventsProps & {
|
|
|
190
192
|
value?: Value;
|
|
191
193
|
/** Width of the user picker field. It can be the amount of pixels as numbers or a string with the percentage. */
|
|
192
194
|
width?: number | string;
|
|
195
|
+
/** Checks if the footer is focused or not. This is needed to keep the menu open when the footer is focused */
|
|
196
|
+
isFooterFocused?: boolean;
|
|
197
|
+
/** Sets if the footer is focused or not. This is needed to keep the menu open when the footer is focused */
|
|
198
|
+
setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
193
199
|
};
|
|
194
200
|
export type UserPickerRef = {
|
|
195
201
|
blur: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/user-picker",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.17.0",
|
|
4
4
|
"description": "Fabric component for display a dropdown to select a user from",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"@atlaskit/people-teams-ui-public": "^3.7.0",
|
|
52
52
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
53
53
|
"@atlaskit/popper": "^7.1.0",
|
|
54
|
-
"@atlaskit/primitives": "^16.
|
|
54
|
+
"@atlaskit/primitives": "^16.4.0",
|
|
55
55
|
"@atlaskit/select": "^21.4.0",
|
|
56
56
|
"@atlaskit/spinner": "^19.0.0",
|
|
57
57
|
"@atlaskit/teams-avatar": "^2.4.0",
|
|
58
58
|
"@atlaskit/theme": "^21.0.0",
|
|
59
|
-
"@atlaskit/tokens": "^8.
|
|
59
|
+
"@atlaskit/tokens": "^8.4.0",
|
|
60
60
|
"@atlaskit/tooltip": "^20.10.0",
|
|
61
61
|
"@atlaskit/ufo": "^0.4.0",
|
|
62
62
|
"@babel/runtime": "^7.0.0",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"jira_ai_agent_avatar_user_picker_user_option": {
|
|
122
122
|
"type": "boolean"
|
|
123
123
|
},
|
|
124
|
-
"
|
|
124
|
+
"a11y-create-team-is-not-focusable-and-has-no-btn": {
|
|
125
125
|
"type": "boolean"
|
|
126
126
|
}
|
|
127
127
|
}
|