@atlaskit/user-picker 10.20.3 → 10.21.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 +1117 -1104
- package/afm-cc/tsconfig.json +0 -3
- package/dist/cjs/analytics.js +1 -1
- package/dist/cjs/components/BaseUserPicker.js +0 -59
- package/dist/es2019/analytics.js +1 -1
- package/dist/es2019/components/BaseUserPicker.js +0 -50
- package/dist/esm/analytics.js +1 -1
- package/dist/esm/components/BaseUserPicker.js +0 -59
- package/dist/types/components/BaseUserPicker.d.ts +0 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types-ts4.5/components/BaseUserPicker.d.ts +0 -2
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/docs/0-intro.tsx +30 -36
- package/docs/1-smart-user-picker.tsx +12 -12
- package/docs/2-popup-user-picker.tsx +16 -22
- package/package.json +8 -16
- package/report.api.md +416 -429
package/afm-cc/tsconfig.json
CHANGED
package/dist/cjs/analytics.js
CHANGED
|
@@ -12,7 +12,7 @@ var _utils = require("./components/utils");
|
|
|
12
12
|
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; }
|
|
13
13
|
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; }
|
|
14
14
|
var packageName = "@atlaskit/user-picker";
|
|
15
|
-
var packageVersion = "10.
|
|
15
|
+
var packageVersion = "10.21.0";
|
|
16
16
|
var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
17
17
|
var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
18
18
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -24,7 +24,6 @@ var _batch = require("./batch");
|
|
|
24
24
|
var _i18n = require("./i18n");
|
|
25
25
|
var _utils = require("./utils");
|
|
26
26
|
var _ufoExperiences = require("../util/ufoExperiences");
|
|
27
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
28
27
|
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; }
|
|
29
28
|
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; }
|
|
30
29
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
@@ -35,13 +34,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
35
34
|
var loadingMessage = function loadingMessage() {
|
|
36
35
|
return null;
|
|
37
36
|
};
|
|
38
|
-
var observerOptions = {
|
|
39
|
-
subtree: true,
|
|
40
|
-
attributes: true,
|
|
41
|
-
attributeFilter: ['class']
|
|
42
|
-
};
|
|
43
37
|
var classNamePrefix = 'fabric-user-picker';
|
|
44
|
-
var optionFocusedClass = "".concat(classNamePrefix, "__option--is-focused");
|
|
45
38
|
var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
46
39
|
(0, _inherits2.default)(BaseUserPickerWithoutAnalytics, _React$Component);
|
|
47
40
|
var _super = _createSuper(BaseUserPickerWithoutAnalytics);
|
|
@@ -306,31 +299,6 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
306
299
|
_this.journeyId = _this.getSessionId();
|
|
307
300
|
_this.fireEvent(_analytics.focusEvent);
|
|
308
301
|
});
|
|
309
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "focusedOptionObserverCallback", function (mutationList) {
|
|
310
|
-
var _iterator2 = _createForOfIteratorHelper(mutationList),
|
|
311
|
-
_step2;
|
|
312
|
-
try {
|
|
313
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
314
|
-
var mutation = _step2.value;
|
|
315
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
316
|
-
var target = mutation.target;
|
|
317
|
-
if (target.classList.contains(optionFocusedClass)) {
|
|
318
|
-
var _this$selectRef$selec;
|
|
319
|
-
(_this$selectRef$selec = _this.selectRef.select.inputRef) === null || _this$selectRef$selec === void 0 || _this$selectRef$selec.setAttribute('aria-activedescendant', target.id);
|
|
320
|
-
break;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
} catch (err) {
|
|
325
|
-
_iterator2.e(err);
|
|
326
|
-
} finally {
|
|
327
|
-
_iterator2.f();
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
// Create a MutationObserver which will observe the menu list for changes. In
|
|
331
|
-
// node environments such as SSR, MutationObserver doesn't exist and this
|
|
332
|
-
// variable will be falsy.
|
|
333
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "focusedOptionObserver", typeof MutationObserver === 'function' && new MutationObserver(_this.focusedOptionObserverCallback));
|
|
334
302
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleKeyDown", function (event) {
|
|
335
303
|
if (!_this.isMenuOpenOnClickForSingleSelect) {
|
|
336
304
|
// Escape
|
|
@@ -463,33 +431,6 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
|
|
|
463
431
|
if (menuIsOpen && !prevState.menuIsOpen && !this.session) {
|
|
464
432
|
this.startSession();
|
|
465
433
|
}
|
|
466
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.select-aria-activedescendant_psxzq')) {
|
|
467
|
-
var _this$selectRef, _this$selectRef2, _this$selectRef3;
|
|
468
|
-
// When the menu is opened, set aria-activedescendant attribute on the
|
|
469
|
-
// input and instrument a mutation observer. On the first opening of the
|
|
470
|
-
// menu, menuIsOpen is true but the menu isn't actually in the DOM yet.
|
|
471
|
-
// For this reason, we the use the existence of the attribute.
|
|
472
|
-
var inputHasAriaActiveDecendant = (_this$selectRef = this.selectRef) === null || _this$selectRef === void 0 || (_this$selectRef = _this$selectRef.select) === null || _this$selectRef === void 0 || (_this$selectRef = _this$selectRef.inputRef) === null || _this$selectRef === void 0 ? void 0 : _this$selectRef.getAttribute('aria-activedescendant');
|
|
473
|
-
var inputRef = (_this$selectRef2 = this.selectRef) === null || _this$selectRef2 === void 0 || (_this$selectRef2 = _this$selectRef2.select) === null || _this$selectRef2 === void 0 ? void 0 : _this$selectRef2.inputRef;
|
|
474
|
-
var menuRef = (_this$selectRef3 = this.selectRef) === null || _this$selectRef3 === void 0 || (_this$selectRef3 = _this$selectRef3.select) === null || _this$selectRef3 === void 0 ? void 0 : _this$selectRef3.menuListRef;
|
|
475
|
-
if (menuIsOpen && menuRef && !inputHasAriaActiveDecendant) {
|
|
476
|
-
var _menuRef$children$;
|
|
477
|
-
// Set the aria-activedescendant attribute on the input element
|
|
478
|
-
// to the first menu item
|
|
479
|
-
((_menuRef$children$ = menuRef.children[0]) === null || _menuRef$children$ === void 0 ? void 0 : _menuRef$children$.classList.contains(optionFocusedClass)) && inputRef && inputRef.setAttribute('aria-activedescendant', menuRef.children[0].id);
|
|
480
|
-
|
|
481
|
-
// Setup MutationObserver so when the selected option changes, update
|
|
482
|
-
// the aria-activedescendant attribute on the input element
|
|
483
|
-
this.focusedOptionObserver && this.focusedOptionObserver.observe(menuRef, observerOptions);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
// Rewmoe the aria-active-descendant attribute and disconnect the observer
|
|
487
|
-
// when the menu is closed
|
|
488
|
-
if (!menuIsOpen && prevState.menuIsOpen) {
|
|
489
|
-
inputRef && inputRef.removeAttribute('aria-activedescendant');
|
|
490
|
-
this.focusedOptionObserver && this.focusedOptionObserver.disconnect();
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
434
|
|
|
494
435
|
// Load options when user picker opens or when input value changes
|
|
495
436
|
if (menuIsOpen && !prevState.menuIsOpen || inputValue !== prevState.inputValue) {
|
package/dist/es2019/analytics.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
3
|
import { isCustom, isExternalUser } from './components/utils';
|
|
4
4
|
const packageName = "@atlaskit/user-picker";
|
|
5
|
-
const packageVersion = "10.
|
|
5
|
+
const packageVersion = "10.21.0";
|
|
6
6
|
const UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
7
7
|
const UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
8
8
|
const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -11,15 +11,8 @@ import { batchByKey } from './batch';
|
|
|
11
11
|
import { messages } from './i18n';
|
|
12
12
|
import { callCallback, extractOptionValue, getOptions, isIterable, isPopupUserPickerByComponent, isDefaultValuePopulated, isSingleValue, optionToSelectableOptions } from './utils';
|
|
13
13
|
import { userPickerOptionsShownUfoExperience } from '../util/ufoExperiences';
|
|
14
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
const loadingMessage = () => null;
|
|
16
|
-
const observerOptions = {
|
|
17
|
-
subtree: true,
|
|
18
|
-
attributes: true,
|
|
19
|
-
attributeFilter: ['class']
|
|
20
|
-
};
|
|
21
15
|
const classNamePrefix = 'fabric-user-picker';
|
|
22
|
-
const optionFocusedClass = `${classNamePrefix}__option--is-focused`;
|
|
23
16
|
export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
24
17
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
25
18
|
const derivedState = {};
|
|
@@ -295,22 +288,6 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
295
288
|
this.journeyId = this.getSessionId();
|
|
296
289
|
this.fireEvent(focusEvent);
|
|
297
290
|
});
|
|
298
|
-
_defineProperty(this, "focusedOptionObserverCallback", mutationList => {
|
|
299
|
-
for (const mutation of mutationList) {
|
|
300
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
301
|
-
const target = mutation.target;
|
|
302
|
-
if (target.classList.contains(optionFocusedClass)) {
|
|
303
|
-
var _this$selectRef$selec;
|
|
304
|
-
(_this$selectRef$selec = this.selectRef.select.inputRef) === null || _this$selectRef$selec === void 0 ? void 0 : _this$selectRef$selec.setAttribute('aria-activedescendant', target.id);
|
|
305
|
-
break;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
// Create a MutationObserver which will observe the menu list for changes. In
|
|
311
|
-
// node environments such as SSR, MutationObserver doesn't exist and this
|
|
312
|
-
// variable will be falsy.
|
|
313
|
-
_defineProperty(this, "focusedOptionObserver", typeof MutationObserver === 'function' && new MutationObserver(this.focusedOptionObserverCallback));
|
|
314
291
|
_defineProperty(this, "handleKeyDown", event => {
|
|
315
292
|
if (!this.isMenuOpenOnClickForSingleSelect) {
|
|
316
293
|
// Escape
|
|
@@ -433,33 +410,6 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
433
410
|
if (menuIsOpen && !prevState.menuIsOpen && !this.session) {
|
|
434
411
|
this.startSession();
|
|
435
412
|
}
|
|
436
|
-
if (getBooleanFF('platform.design-system-team.select-aria-activedescendant_psxzq')) {
|
|
437
|
-
var _this$selectRef, _this$selectRef$selec2, _this$selectRef$selec3, _this$selectRef2, _this$selectRef2$sele, _this$selectRef3, _this$selectRef3$sele;
|
|
438
|
-
// When the menu is opened, set aria-activedescendant attribute on the
|
|
439
|
-
// input and instrument a mutation observer. On the first opening of the
|
|
440
|
-
// menu, menuIsOpen is true but the menu isn't actually in the DOM yet.
|
|
441
|
-
// For this reason, we the use the existence of the attribute.
|
|
442
|
-
const inputHasAriaActiveDecendant = (_this$selectRef = this.selectRef) === null || _this$selectRef === void 0 ? void 0 : (_this$selectRef$selec2 = _this$selectRef.select) === null || _this$selectRef$selec2 === void 0 ? void 0 : (_this$selectRef$selec3 = _this$selectRef$selec2.inputRef) === null || _this$selectRef$selec3 === void 0 ? void 0 : _this$selectRef$selec3.getAttribute('aria-activedescendant');
|
|
443
|
-
const inputRef = (_this$selectRef2 = this.selectRef) === null || _this$selectRef2 === void 0 ? void 0 : (_this$selectRef2$sele = _this$selectRef2.select) === null || _this$selectRef2$sele === void 0 ? void 0 : _this$selectRef2$sele.inputRef;
|
|
444
|
-
const menuRef = (_this$selectRef3 = this.selectRef) === null || _this$selectRef3 === void 0 ? void 0 : (_this$selectRef3$sele = _this$selectRef3.select) === null || _this$selectRef3$sele === void 0 ? void 0 : _this$selectRef3$sele.menuListRef;
|
|
445
|
-
if (menuIsOpen && menuRef && !inputHasAriaActiveDecendant) {
|
|
446
|
-
var _menuRef$children$;
|
|
447
|
-
// Set the aria-activedescendant attribute on the input element
|
|
448
|
-
// to the first menu item
|
|
449
|
-
((_menuRef$children$ = menuRef.children[0]) === null || _menuRef$children$ === void 0 ? void 0 : _menuRef$children$.classList.contains(optionFocusedClass)) && inputRef && inputRef.setAttribute('aria-activedescendant', menuRef.children[0].id);
|
|
450
|
-
|
|
451
|
-
// Setup MutationObserver so when the selected option changes, update
|
|
452
|
-
// the aria-activedescendant attribute on the input element
|
|
453
|
-
this.focusedOptionObserver && this.focusedOptionObserver.observe(menuRef, observerOptions);
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
// Rewmoe the aria-active-descendant attribute and disconnect the observer
|
|
457
|
-
// when the menu is closed
|
|
458
|
-
if (!menuIsOpen && prevState.menuIsOpen) {
|
|
459
|
-
inputRef && inputRef.removeAttribute('aria-activedescendant');
|
|
460
|
-
this.focusedOptionObserver && this.focusedOptionObserver.disconnect();
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
413
|
|
|
464
414
|
// Load options when user picker opens or when input value changes
|
|
465
415
|
if (menuIsOpen && !prevState.menuIsOpen || inputValue !== prevState.inputValue) {
|
package/dist/esm/analytics.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
|
5
5
|
import { v4 as uuidv4 } from 'uuid';
|
|
6
6
|
import { isCustom, isExternalUser } from './components/utils';
|
|
7
7
|
var packageName = "@atlaskit/user-picker";
|
|
8
|
-
var packageVersion = "10.
|
|
8
|
+
var packageVersion = "10.21.0";
|
|
9
9
|
var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
10
10
|
var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
|
|
11
11
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -24,17 +24,10 @@ import { batchByKey } from './batch';
|
|
|
24
24
|
import { messages } from './i18n';
|
|
25
25
|
import { callCallback, extractOptionValue, getOptions, isIterable, isPopupUserPickerByComponent, isDefaultValuePopulated, isSingleValue, optionToSelectableOptions } from './utils';
|
|
26
26
|
import { userPickerOptionsShownUfoExperience } from '../util/ufoExperiences';
|
|
27
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
28
27
|
var loadingMessage = function loadingMessage() {
|
|
29
28
|
return null;
|
|
30
29
|
};
|
|
31
|
-
var observerOptions = {
|
|
32
|
-
subtree: true,
|
|
33
|
-
attributes: true,
|
|
34
|
-
attributeFilter: ['class']
|
|
35
|
-
};
|
|
36
30
|
var classNamePrefix = 'fabric-user-picker';
|
|
37
|
-
var optionFocusedClass = "".concat(classNamePrefix, "__option--is-focused");
|
|
38
31
|
export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
39
32
|
_inherits(BaseUserPickerWithoutAnalytics, _React$Component);
|
|
40
33
|
var _super = _createSuper(BaseUserPickerWithoutAnalytics);
|
|
@@ -299,31 +292,6 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
299
292
|
_this.journeyId = _this.getSessionId();
|
|
300
293
|
_this.fireEvent(focusEvent);
|
|
301
294
|
});
|
|
302
|
-
_defineProperty(_assertThisInitialized(_this), "focusedOptionObserverCallback", function (mutationList) {
|
|
303
|
-
var _iterator2 = _createForOfIteratorHelper(mutationList),
|
|
304
|
-
_step2;
|
|
305
|
-
try {
|
|
306
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
307
|
-
var mutation = _step2.value;
|
|
308
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
309
|
-
var target = mutation.target;
|
|
310
|
-
if (target.classList.contains(optionFocusedClass)) {
|
|
311
|
-
var _this$selectRef$selec;
|
|
312
|
-
(_this$selectRef$selec = _this.selectRef.select.inputRef) === null || _this$selectRef$selec === void 0 || _this$selectRef$selec.setAttribute('aria-activedescendant', target.id);
|
|
313
|
-
break;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
} catch (err) {
|
|
318
|
-
_iterator2.e(err);
|
|
319
|
-
} finally {
|
|
320
|
-
_iterator2.f();
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
// Create a MutationObserver which will observe the menu list for changes. In
|
|
324
|
-
// node environments such as SSR, MutationObserver doesn't exist and this
|
|
325
|
-
// variable will be falsy.
|
|
326
|
-
_defineProperty(_assertThisInitialized(_this), "focusedOptionObserver", typeof MutationObserver === 'function' && new MutationObserver(_this.focusedOptionObserverCallback));
|
|
327
295
|
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
|
|
328
296
|
if (!_this.isMenuOpenOnClickForSingleSelect) {
|
|
329
297
|
// Escape
|
|
@@ -456,33 +424,6 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
456
424
|
if (menuIsOpen && !prevState.menuIsOpen && !this.session) {
|
|
457
425
|
this.startSession();
|
|
458
426
|
}
|
|
459
|
-
if (getBooleanFF('platform.design-system-team.select-aria-activedescendant_psxzq')) {
|
|
460
|
-
var _this$selectRef, _this$selectRef2, _this$selectRef3;
|
|
461
|
-
// When the menu is opened, set aria-activedescendant attribute on the
|
|
462
|
-
// input and instrument a mutation observer. On the first opening of the
|
|
463
|
-
// menu, menuIsOpen is true but the menu isn't actually in the DOM yet.
|
|
464
|
-
// For this reason, we the use the existence of the attribute.
|
|
465
|
-
var inputHasAriaActiveDecendant = (_this$selectRef = this.selectRef) === null || _this$selectRef === void 0 || (_this$selectRef = _this$selectRef.select) === null || _this$selectRef === void 0 || (_this$selectRef = _this$selectRef.inputRef) === null || _this$selectRef === void 0 ? void 0 : _this$selectRef.getAttribute('aria-activedescendant');
|
|
466
|
-
var inputRef = (_this$selectRef2 = this.selectRef) === null || _this$selectRef2 === void 0 || (_this$selectRef2 = _this$selectRef2.select) === null || _this$selectRef2 === void 0 ? void 0 : _this$selectRef2.inputRef;
|
|
467
|
-
var menuRef = (_this$selectRef3 = this.selectRef) === null || _this$selectRef3 === void 0 || (_this$selectRef3 = _this$selectRef3.select) === null || _this$selectRef3 === void 0 ? void 0 : _this$selectRef3.menuListRef;
|
|
468
|
-
if (menuIsOpen && menuRef && !inputHasAriaActiveDecendant) {
|
|
469
|
-
var _menuRef$children$;
|
|
470
|
-
// Set the aria-activedescendant attribute on the input element
|
|
471
|
-
// to the first menu item
|
|
472
|
-
((_menuRef$children$ = menuRef.children[0]) === null || _menuRef$children$ === void 0 ? void 0 : _menuRef$children$.classList.contains(optionFocusedClass)) && inputRef && inputRef.setAttribute('aria-activedescendant', menuRef.children[0].id);
|
|
473
|
-
|
|
474
|
-
// Setup MutationObserver so when the selected option changes, update
|
|
475
|
-
// the aria-activedescendant attribute on the input element
|
|
476
|
-
this.focusedOptionObserver && this.focusedOptionObserver.observe(menuRef, observerOptions);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
// Rewmoe the aria-active-descendant attribute and disconnect the observer
|
|
480
|
-
// when the menu is closed
|
|
481
|
-
if (!menuIsOpen && prevState.menuIsOpen) {
|
|
482
|
-
inputRef && inputRef.removeAttribute('aria-activedescendant');
|
|
483
|
-
this.focusedOptionObserver && this.focusedOptionObserver.disconnect();
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
427
|
|
|
487
428
|
// Load options when user picker opens or when input value changes
|
|
488
429
|
if (menuIsOpen && !prevState.menuIsOpen || inputValue !== prevState.inputValue) {
|
|
@@ -55,8 +55,6 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
|
|
|
55
55
|
private fireEvent;
|
|
56
56
|
private startSession;
|
|
57
57
|
componentDidMount(): void;
|
|
58
|
-
private focusedOptionObserverCallback;
|
|
59
|
-
private focusedOptionObserver;
|
|
60
58
|
componentDidUpdate(_: UserPickerProps, prevState: UserPickerState): void;
|
|
61
59
|
private handleKeyDown;
|
|
62
60
|
handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { isValidEmail } from './components/emailValidation';
|
|
2
|
-
export type { EmailValidationResponse, EmailValidator
|
|
2
|
+
export type { EmailValidationResponse, EmailValidator } from './components/emailValidation';
|
|
3
3
|
export { UserPicker as default } from './components/UserPicker';
|
|
4
4
|
export { PopupUserPicker } from './components/PopupUserPicker';
|
|
5
5
|
export { isEmail, isExternalUser, isTeam, isUser } from './components/utils';
|
|
@@ -55,8 +55,6 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
|
|
|
55
55
|
private fireEvent;
|
|
56
56
|
private startSession;
|
|
57
57
|
componentDidMount(): void;
|
|
58
|
-
private focusedOptionObserverCallback;
|
|
59
|
-
private focusedOptionObserver;
|
|
60
58
|
componentDidUpdate(_: UserPickerProps, prevState: UserPickerState): void;
|
|
61
59
|
private handleKeyDown;
|
|
62
60
|
handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { isValidEmail } from './components/emailValidation';
|
|
2
|
-
export type { EmailValidationResponse, EmailValidator
|
|
2
|
+
export type { EmailValidationResponse, EmailValidator } from './components/emailValidation';
|
|
3
3
|
export { UserPicker as default } from './components/UserPicker';
|
|
4
4
|
export { PopupUserPicker } from './components/PopupUserPicker';
|
|
5
5
|
export { isEmail, isExternalUser, isTeam, isUser } from './components/utils';
|
package/docs/0-intro.tsx
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
code,
|
|
4
|
-
Example,
|
|
5
|
-
md,
|
|
6
|
-
Props,
|
|
7
|
-
AtlassianInternalWarning,
|
|
8
|
-
} from '@atlaskit/docs';
|
|
2
|
+
import { code, Example, md, Props, AtlassianInternalWarning } from '@atlaskit/docs';
|
|
9
3
|
|
|
10
4
|
export default md`
|
|
11
5
|
${(<AtlassianInternalWarning />)}
|
|
@@ -26,39 +20,39 @@ export default md`
|
|
|
26
20
|
${code`import UserPicker from '@atlaskit/user-picker';`}
|
|
27
21
|
|
|
28
22
|
${(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
<Example
|
|
24
|
+
packageName="@atlaskit/user-picker"
|
|
25
|
+
Component={require('../examples/00-single').default}
|
|
26
|
+
title="Single User Picker"
|
|
27
|
+
source={require('!!raw-loader!../examples/00-single')}
|
|
28
|
+
/>
|
|
29
|
+
)}
|
|
36
30
|
|
|
37
31
|
${(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
<Example
|
|
33
|
+
packageName="@atlaskit/user-picker"
|
|
34
|
+
Component={require('../examples/01-multi').default}
|
|
35
|
+
title="Multi User Picker"
|
|
36
|
+
source={require('!!raw-loader!../examples/01-multi')}
|
|
37
|
+
/>
|
|
38
|
+
)}
|
|
45
39
|
|
|
46
40
|
${(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
<Example
|
|
42
|
+
packageName="@atlaskit/user-picker"
|
|
43
|
+
Component={require('../examples/11-watchers').default}
|
|
44
|
+
title="Watchers"
|
|
45
|
+
source={require('!!raw-loader!../examples/11-watchers')}
|
|
46
|
+
/>
|
|
47
|
+
)}
|
|
54
48
|
|
|
55
49
|
${(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
<Props
|
|
51
|
+
heading="User Picker Props"
|
|
52
|
+
props={require('!!extract-react-types-loader!../src/components/UserPicker')}
|
|
53
|
+
overrides={{
|
|
54
|
+
createAnalyticsEvent: () => null,
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
64
58
|
`;
|
|
@@ -4,16 +4,16 @@ import SectionMessage from '@atlaskit/section-message';
|
|
|
4
4
|
|
|
5
5
|
export default md`
|
|
6
6
|
${(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
<SectionMessage
|
|
8
|
+
appearance="warning"
|
|
9
|
+
title="Note: @atlaskit/user-picker/smart-user-picker is deprecated."
|
|
10
|
+
>
|
|
11
|
+
SmartUserPicker has moved packages! Please use{' '}
|
|
12
|
+
<a href="https://statlas.prod.atl-paas.net/atlassian-frontend/master#packages/smart-experiences/smart-user-picker">
|
|
13
|
+
@atlaskit/smart-user-picker
|
|
14
|
+
</a>{' '}
|
|
15
|
+
instead. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact
|
|
16
|
+
#help-smart-experiences for further details.
|
|
17
|
+
</SectionMessage>
|
|
18
|
+
)}
|
|
19
19
|
`;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
code,
|
|
4
|
-
Example,
|
|
5
|
-
md,
|
|
6
|
-
Props,
|
|
7
|
-
AtlassianInternalWarning,
|
|
8
|
-
} from '@atlaskit/docs';
|
|
2
|
+
import { code, Example, md, Props, AtlassianInternalWarning } from '@atlaskit/docs';
|
|
9
3
|
|
|
10
4
|
export default md`
|
|
11
5
|
${(<AtlassianInternalWarning />)}
|
|
@@ -19,21 +13,21 @@ export default md`
|
|
|
19
13
|
${code`import { PopupUserPicker } from '@atlaskit/user-picker';`}
|
|
20
14
|
|
|
21
15
|
${(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
<Example
|
|
17
|
+
packageName="@atlaskit/user-picker"
|
|
18
|
+
Component={require('../examples/19-popup-config').default}
|
|
19
|
+
title="Modal"
|
|
20
|
+
source={require('!!raw-loader!../examples/19-popup-config')}
|
|
21
|
+
/>
|
|
22
|
+
)}
|
|
29
23
|
|
|
30
24
|
${(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
<Props
|
|
26
|
+
heading="Popup User Picker Props"
|
|
27
|
+
props={require('!!extract-react-types-loader!../src/components/PopupUserPicker')}
|
|
28
|
+
overrides={{
|
|
29
|
+
createAnalyticsEvent: () => null,
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
)}
|
|
39
33
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/user-picker",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.21.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/"
|
|
@@ -45,15 +45,14 @@
|
|
|
45
45
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
46
46
|
"@atlaskit/avatar": "^21.9.0",
|
|
47
47
|
"@atlaskit/icon": "^22.3.0",
|
|
48
|
-
"@atlaskit/logo": "^
|
|
48
|
+
"@atlaskit/logo": "^14.0.0",
|
|
49
49
|
"@atlaskit/lozenge": "^11.7.0",
|
|
50
|
-
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
51
50
|
"@atlaskit/popper": "^6.0.0",
|
|
52
|
-
"@atlaskit/primitives": "^
|
|
53
|
-
"@atlaskit/select": "^17.
|
|
51
|
+
"@atlaskit/primitives": "^7.0.0",
|
|
52
|
+
"@atlaskit/select": "^17.10.0",
|
|
54
53
|
"@atlaskit/spinner": "^16.1.0",
|
|
55
54
|
"@atlaskit/teams-avatar": "^1.0.0",
|
|
56
|
-
"@atlaskit/theme": "^12.
|
|
55
|
+
"@atlaskit/theme": "^12.9.0",
|
|
57
56
|
"@atlaskit/tokens": "^1.49.0",
|
|
58
57
|
"@atlaskit/tooltip": "^18.4.0",
|
|
59
58
|
"@atlaskit/ufo": "^0.2.0",
|
|
@@ -69,14 +68,13 @@
|
|
|
69
68
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
70
69
|
},
|
|
71
70
|
"devDependencies": {
|
|
72
|
-
"@atlaskit/analytics-viewer": "^0.
|
|
71
|
+
"@atlaskit/analytics-viewer": "^0.6.0",
|
|
73
72
|
"@atlaskit/elements-test-helpers": "^0.7.0",
|
|
74
73
|
"@atlaskit/heading": "^2.3.0",
|
|
75
74
|
"@atlaskit/visual-regression": "*",
|
|
76
|
-
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
77
75
|
"@emotion/styled": "^11.0.0",
|
|
78
76
|
"@testing-library/dom": "^8.17.1",
|
|
79
|
-
"@testing-library/jest-dom": "^
|
|
77
|
+
"@testing-library/jest-dom": "^6.4.5",
|
|
80
78
|
"@testing-library/react": "^12.1.5",
|
|
81
79
|
"@testing-library/react-hooks": "^8.0.1",
|
|
82
80
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -98,11 +96,5 @@
|
|
|
98
96
|
"keywords": [
|
|
99
97
|
"fabric",
|
|
100
98
|
"ui"
|
|
101
|
-
]
|
|
102
|
-
"platform-feature-flags": {
|
|
103
|
-
"platform.design-system-team.select-aria-activedescendant_psxzq": {
|
|
104
|
-
"type": "boolean"
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
99
|
+
]
|
|
108
100
|
}
|