@atlaskit/user-picker 9.1.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 +18 -0
- package/dist/cjs/analytics.js +5 -3
- package/dist/cjs/components/BaseUserPicker.js +5 -1
- package/dist/cjs/components/MultiValueContainer.js +10 -1
- package/dist/cjs/components/styles.js +2 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.js +3 -1
- package/dist/es2019/components/BaseUserPicker.js +5 -1
- package/dist/es2019/components/MultiValueContainer.js +12 -1
- package/dist/es2019/components/styles.js +2 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +3 -1
- package/dist/esm/components/BaseUserPicker.js +5 -1
- package/dist/esm/components/MultiValueContainer.js +10 -1
- package/dist/esm/components/styles.js +2 -0
- package/dist/esm/util/i18n-util.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/BaseUserPicker.d.ts +1 -1
- package/dist/types/components/PopupUserPicker.d.ts +1 -1
- package/dist/types/components/UserPicker.d.ts +1 -1
- package/dist/types/types.d.ts +4 -0
- package/package.json +3 -3
- package/report.api.md +552 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 9.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d27d65448a2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d27d65448a2) - [ux] Add margin-left to addMoreText field
|
|
8
|
+
|
|
9
|
+
## 9.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`607b182bb8a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/607b182bb8a) - Add typecasting to prevent type errors during multivaluecontainer placeholder translations. Also fix warnings for importing json attributes from version.json for analytics.
|
|
14
|
+
|
|
15
|
+
## 9.2.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [`64dc40c32bc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/64dc40c32bc) - Add support for aria-labelledby and aria-live
|
|
20
|
+
|
|
3
21
|
## 9.1.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/analytics.js
CHANGED
|
@@ -13,7 +13,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
13
13
|
|
|
14
14
|
var _uuid = require("uuid");
|
|
15
15
|
|
|
16
|
-
var _version = require("./version.json");
|
|
16
|
+
var _version = _interopRequireDefault(require("./version.json"));
|
|
17
17
|
|
|
18
18
|
var _utils = require("./components/utils");
|
|
19
19
|
|
|
@@ -21,6 +21,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
21
21
|
|
|
22
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
23
|
|
|
24
|
+
var packageName = _version.default.name;
|
|
25
|
+
var packageVersion = _version.default.version;
|
|
24
26
|
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}$/;
|
|
25
27
|
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}$/;
|
|
26
28
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -47,8 +49,8 @@ var createEvent = function createEvent(eventType, action, actionSubject) {
|
|
|
47
49
|
action: action,
|
|
48
50
|
actionSubject: actionSubject,
|
|
49
51
|
attributes: _objectSpread({
|
|
50
|
-
packageName:
|
|
51
|
-
packageVersion:
|
|
52
|
+
packageName: packageName,
|
|
53
|
+
packageVersion: packageVersion
|
|
52
54
|
}, attributes)
|
|
53
55
|
};
|
|
54
56
|
};
|
|
@@ -516,7 +516,9 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
|
516
516
|
fieldId = _this$props4.fieldId,
|
|
517
517
|
inputId = _this$props4.inputId,
|
|
518
518
|
maxPickerHeight = _this$props4.maxPickerHeight,
|
|
519
|
-
textFieldBackgroundColor = _this$props4.textFieldBackgroundColor
|
|
519
|
+
textFieldBackgroundColor = _this$props4.textFieldBackgroundColor,
|
|
520
|
+
ariaLabelledBy = _this$props4.ariaLabelledBy,
|
|
521
|
+
ariaLive = _this$props4.ariaLive;
|
|
520
522
|
var _this$state3 = this.state,
|
|
521
523
|
count = _this$state3.count,
|
|
522
524
|
hoveringClearIndicator = _this$state3.hoveringClearIndicator,
|
|
@@ -528,6 +530,8 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
|
528
530
|
return /*#__PURE__*/_react.default.createElement(SelectComponent, (0, _extends2.default)({
|
|
529
531
|
value: value,
|
|
530
532
|
autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
|
|
533
|
+
"aria-labelledby": ariaLabelledBy,
|
|
534
|
+
"aria-live": ariaLive,
|
|
531
535
|
ref: this.handleSelectRef,
|
|
532
536
|
isMulti: isMulti,
|
|
533
537
|
options: this.getOptions(),
|
|
@@ -95,7 +95,16 @@ var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
95
95
|
|
|
96
96
|
if (addMoreMessage === undefined) {
|
|
97
97
|
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.addMore, function (addMore) {
|
|
98
|
-
|
|
98
|
+
var _join, _addMoreMessages;
|
|
99
|
+
|
|
100
|
+
var addMoreMessages = addMore;
|
|
101
|
+
|
|
102
|
+
if (addMore && typeof addMore === 'string') {
|
|
103
|
+
addMoreMessages = [addMore];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
var placeholder = (_join = (_addMoreMessages = addMoreMessages) === null || _addMoreMessages === void 0 ? void 0 : _addMoreMessages.join('')) !== null && _join !== void 0 ? _join : '';
|
|
107
|
+
return _this.addPlaceholder(placeholder);
|
|
99
108
|
});
|
|
100
109
|
}
|
|
101
110
|
|
|
@@ -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
package/dist/es2019/analytics.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
-
import
|
|
3
|
+
import versionJson from './version.json';
|
|
4
4
|
import { isExternalUser } from './components/utils';
|
|
5
|
+
const packageName = versionJson.name;
|
|
6
|
+
const packageVersion = versionJson.version;
|
|
5
7
|
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}$/;
|
|
6
8
|
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}$/;
|
|
7
9
|
const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -470,7 +470,9 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
470
470
|
fieldId,
|
|
471
471
|
inputId,
|
|
472
472
|
maxPickerHeight,
|
|
473
|
-
textFieldBackgroundColor
|
|
473
|
+
textFieldBackgroundColor,
|
|
474
|
+
ariaLabelledBy,
|
|
475
|
+
ariaLive
|
|
474
476
|
} = this.props;
|
|
475
477
|
const {
|
|
476
478
|
count,
|
|
@@ -484,6 +486,8 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
|
|
|
484
486
|
return /*#__PURE__*/React.createElement(SelectComponent, _extends({
|
|
485
487
|
value: value,
|
|
486
488
|
autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
|
|
489
|
+
"aria-labelledby": ariaLabelledBy,
|
|
490
|
+
"aria-live": ariaLive,
|
|
487
491
|
ref: this.handleSelectRef,
|
|
488
492
|
isMulti: isMulti,
|
|
489
493
|
options: this.getOptions(),
|
|
@@ -67,7 +67,18 @@ export class MultiValueContainer extends React.PureComponent {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
if (addMoreMessage === undefined) {
|
|
70
|
-
return /*#__PURE__*/React.createElement(FormattedMessage, messages.addMore, addMore =>
|
|
70
|
+
return /*#__PURE__*/React.createElement(FormattedMessage, messages.addMore, addMore => {
|
|
71
|
+
var _join, _addMoreMessages;
|
|
72
|
+
|
|
73
|
+
let addMoreMessages = addMore;
|
|
74
|
+
|
|
75
|
+
if (addMore && typeof addMore === 'string') {
|
|
76
|
+
addMoreMessages = [addMore];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const placeholder = (_join = (_addMoreMessages = addMoreMessages) === null || _addMoreMessages === void 0 ? void 0 : _addMoreMessages.join('')) !== null && _join !== void 0 ? _join : '';
|
|
80
|
+
return this.addPlaceholder(placeholder);
|
|
81
|
+
});
|
|
71
82
|
}
|
|
72
83
|
|
|
73
84
|
return this.addPlaceholder(addMoreMessage);
|
|
@@ -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
package/dist/esm/analytics.js
CHANGED
|
@@ -6,8 +6,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
8
8
|
import { v4 as uuidv4 } from 'uuid';
|
|
9
|
-
import
|
|
9
|
+
import versionJson from './version.json';
|
|
10
10
|
import { isExternalUser } from './components/utils';
|
|
11
|
+
var packageName = versionJson.name;
|
|
12
|
+
var packageVersion = versionJson.version;
|
|
11
13
|
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}$/;
|
|
12
14
|
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}$/;
|
|
13
15
|
var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
|
|
@@ -518,7 +518,9 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
518
518
|
fieldId = _this$props4.fieldId,
|
|
519
519
|
inputId = _this$props4.inputId,
|
|
520
520
|
maxPickerHeight = _this$props4.maxPickerHeight,
|
|
521
|
-
textFieldBackgroundColor = _this$props4.textFieldBackgroundColor
|
|
521
|
+
textFieldBackgroundColor = _this$props4.textFieldBackgroundColor,
|
|
522
|
+
ariaLabelledBy = _this$props4.ariaLabelledBy,
|
|
523
|
+
ariaLive = _this$props4.ariaLive;
|
|
522
524
|
var _this$state3 = this.state,
|
|
523
525
|
count = _this$state3.count,
|
|
524
526
|
hoveringClearIndicator = _this$state3.hoveringClearIndicator,
|
|
@@ -530,6 +532,8 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
|
|
|
530
532
|
return /*#__PURE__*/React.createElement(SelectComponent, _extends({
|
|
531
533
|
value: value,
|
|
532
534
|
autoFocus: autoFocus !== undefined ? autoFocus : menuIsOpen,
|
|
535
|
+
"aria-labelledby": ariaLabelledBy,
|
|
536
|
+
"aria-live": ariaLive,
|
|
533
537
|
ref: this.handleSelectRef,
|
|
534
538
|
isMulti: isMulti,
|
|
535
539
|
options: this.getOptions(),
|
|
@@ -77,7 +77,16 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
77
77
|
|
|
78
78
|
if (addMoreMessage === undefined) {
|
|
79
79
|
return /*#__PURE__*/React.createElement(FormattedMessage, messages.addMore, function (addMore) {
|
|
80
|
-
|
|
80
|
+
var _join, _addMoreMessages;
|
|
81
|
+
|
|
82
|
+
var addMoreMessages = addMore;
|
|
83
|
+
|
|
84
|
+
if (addMore && typeof addMore === 'string') {
|
|
85
|
+
addMoreMessages = [addMore];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var placeholder = (_join = (_addMoreMessages = addMoreMessages) === null || _addMoreMessages === void 0 ? void 0 : _addMoreMessages.join('')) !== null && _join !== void 0 ? _join : '';
|
|
89
|
+
return _this.addPlaceholder(placeholder);
|
|
81
90
|
});
|
|
82
91
|
}
|
|
83
92
|
|
|
@@ -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,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Tries to get the most specific messages bundle for a given locale.
|
package/dist/esm/version.json
CHANGED
|
@@ -51,7 +51,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
|
|
|
51
51
|
private getAppearance;
|
|
52
52
|
render(): JSX.Element;
|
|
53
53
|
}
|
|
54
|
-
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps"> & Partial<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "subtle" | "noBorder">> & Partial<Pick<{
|
|
54
|
+
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive" | "SelectComponent" | "pickerProps"> & Partial<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "subtle" | "noBorder">> & Partial<Pick<{
|
|
55
55
|
isMulti: boolean;
|
|
56
56
|
subtle: boolean;
|
|
57
57
|
noBorder: boolean;
|
|
@@ -27,7 +27,7 @@ export declare class PopupUserPickerWithoutAnalytics extends React.Component<Pop
|
|
|
27
27
|
};
|
|
28
28
|
render(): JSX.Element;
|
|
29
29
|
}
|
|
30
|
-
export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle"> & Partial<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isMulti" | "width" | "offset" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">> & Partial<Pick<{
|
|
30
|
+
export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive" | "popupTitle"> & Partial<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isMulti" | "width" | "offset" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">> & Partial<Pick<{
|
|
31
31
|
boundariesElement: string;
|
|
32
32
|
width: number;
|
|
33
33
|
isMulti: boolean;
|
|
@@ -10,7 +10,7 @@ export declare class UserPickerWithoutAnalytics extends React.Component<UserPick
|
|
|
10
10
|
componentDidMount(): void;
|
|
11
11
|
render(): JSX.Element;
|
|
12
12
|
}
|
|
13
|
-
export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions"> & Partial<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isMulti" | "width">> & Partial<Pick<{
|
|
13
|
+
export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "placeholder" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive"> & Partial<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isMulti" | "width">> & Partial<Pick<{
|
|
14
14
|
width: number;
|
|
15
15
|
isMulti: boolean;
|
|
16
16
|
}, never>> & React.RefAttributes<any>>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -132,6 +132,10 @@ export declare type UserPickerProps = WithAnalyticsEventsProps & {
|
|
|
132
132
|
closeMenuOnScroll?: boolean | EventListener;
|
|
133
133
|
/** Whether to block scrolling actions */
|
|
134
134
|
menuShouldBlockScroll?: boolean;
|
|
135
|
+
/** Accessibility: Identifies the element (or elements) that labels the current element.*/
|
|
136
|
+
ariaLabelledBy?: string;
|
|
137
|
+
/** Accessibility: Used to set the priority with which screen reader should treat updates to live regions.*/
|
|
138
|
+
ariaLive?: 'polite' | 'off' | 'assertive';
|
|
135
139
|
};
|
|
136
140
|
export declare type PopupUserPickerProps = UserPickerProps & {
|
|
137
141
|
/** Whether to use the popup version of the single picker */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/user-picker",
|
|
3
|
-
"version": "9.
|
|
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
ADDED
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/user-picker"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { Placement } from '@atlaskit/popper';
|
|
7
|
+
import { default as React_2 } from 'react';
|
|
8
|
+
import { ReactNode } from 'react';
|
|
9
|
+
import { StylesConfig } from '@atlaskit/select';
|
|
10
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
11
|
+
|
|
12
|
+
export declare type ActionTypes =
|
|
13
|
+
| 'select-option'
|
|
14
|
+
| 'deselect-option'
|
|
15
|
+
| 'remove-value'
|
|
16
|
+
| 'pop-value'
|
|
17
|
+
| 'set-value'
|
|
18
|
+
| 'clear'
|
|
19
|
+
| 'create-option';
|
|
20
|
+
|
|
21
|
+
export declare type Appearance = 'normal' | 'compact';
|
|
22
|
+
|
|
23
|
+
export declare type AtlasKitSelectChange = (
|
|
24
|
+
value: AtlaskitSelectValue,
|
|
25
|
+
extraInfo: {
|
|
26
|
+
removedValue?: Option_2;
|
|
27
|
+
option?: Option_2;
|
|
28
|
+
action: ActionTypes;
|
|
29
|
+
},
|
|
30
|
+
) => void;
|
|
31
|
+
|
|
32
|
+
export declare type AtlaskitSelectValue =
|
|
33
|
+
| Option_2
|
|
34
|
+
| Array<Option_2>
|
|
35
|
+
| null
|
|
36
|
+
| undefined;
|
|
37
|
+
|
|
38
|
+
declare type BoundariesElement =
|
|
39
|
+
| 'scrollParent'
|
|
40
|
+
| 'window'
|
|
41
|
+
| 'viewport'
|
|
42
|
+
| HTMLElement;
|
|
43
|
+
|
|
44
|
+
export declare type DefaultValue =
|
|
45
|
+
| Value
|
|
46
|
+
| OptionIdentifier
|
|
47
|
+
| OptionIdentifier[];
|
|
48
|
+
|
|
49
|
+
export declare interface Email extends OptionData {
|
|
50
|
+
type: 'email';
|
|
51
|
+
suggestion?: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export declare const EmailType = 'email';
|
|
55
|
+
|
|
56
|
+
export declare type EmailValidationResponse = 'INVALID' | 'POTENTIAL' | 'VALID';
|
|
57
|
+
|
|
58
|
+
export declare type EmailValidator = (
|
|
59
|
+
inputText: string,
|
|
60
|
+
) => EmailValidationResponse;
|
|
61
|
+
|
|
62
|
+
export declare interface ExternalUser extends User {
|
|
63
|
+
externalUserType?: 'crossSite' | 'thirdParty';
|
|
64
|
+
requiresSourceHydration?: boolean;
|
|
65
|
+
sources: UserSource[];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export declare interface Group extends OptionData {
|
|
69
|
+
highlight?: GroupHighlight;
|
|
70
|
+
type: 'group';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export declare interface GroupHighlight {
|
|
74
|
+
name: HighlightRange[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export declare const GroupType = 'group';
|
|
78
|
+
|
|
79
|
+
export declare interface HighlightRange {
|
|
80
|
+
start: number;
|
|
81
|
+
end: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export declare type InputActionTypes =
|
|
85
|
+
| 'set-value'
|
|
86
|
+
| 'input-change'
|
|
87
|
+
| 'input-blur'
|
|
88
|
+
| 'menu-close';
|
|
89
|
+
|
|
90
|
+
export declare const isEmail: (option: OptionData) => option is Email;
|
|
91
|
+
|
|
92
|
+
export declare const isExternalUser: (
|
|
93
|
+
option: OptionData,
|
|
94
|
+
) => option is ExternalUser;
|
|
95
|
+
|
|
96
|
+
export declare const isTeam: (option: OptionData) => option is Team;
|
|
97
|
+
|
|
98
|
+
export declare const isUser: (option: OptionData) => option is User;
|
|
99
|
+
|
|
100
|
+
export declare const isValidEmail: EmailValidator;
|
|
101
|
+
|
|
102
|
+
export declare interface LoadOptions {
|
|
103
|
+
(searchText?: string, sessionId?: string):
|
|
104
|
+
| Promisable<OptionData | OptionData[]>
|
|
105
|
+
| Iterable<
|
|
106
|
+
Promisable<OptionData[] | OptionData> | OptionData | OptionData[]
|
|
107
|
+
>;
|
|
108
|
+
}
|
|
109
|
+
|
|
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 {
|
|
123
|
+
text: string;
|
|
124
|
+
tooltip?: string;
|
|
125
|
+
appearance?: LozengeColor;
|
|
126
|
+
isBold?: boolean;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export declare type OnChange = (value: Value, action: ActionTypes) => void;
|
|
130
|
+
|
|
131
|
+
export declare type OnInputChange = (
|
|
132
|
+
query?: string,
|
|
133
|
+
sessionId?: string,
|
|
134
|
+
) => void;
|
|
135
|
+
|
|
136
|
+
export declare type OnOption = (value: Value, sessionId?: string) => void;
|
|
137
|
+
|
|
138
|
+
export declare type OnPicker = (sessionId?: string) => void;
|
|
139
|
+
|
|
140
|
+
declare type Option_2<Data = OptionData> = {
|
|
141
|
+
label: string;
|
|
142
|
+
value: string;
|
|
143
|
+
data: Data;
|
|
144
|
+
};
|
|
145
|
+
export { Option_2 as Option };
|
|
146
|
+
|
|
147
|
+
export declare interface OptionData {
|
|
148
|
+
avatarUrl?: any;
|
|
149
|
+
id: string;
|
|
150
|
+
name: string;
|
|
151
|
+
type?: 'user' | 'team' | 'email' | 'group';
|
|
152
|
+
fixed?: boolean;
|
|
153
|
+
lozenge?: string | LozengeProps;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export declare type OptionIdentifier = Pick<OptionData, 'id' | 'type'>;
|
|
157
|
+
|
|
158
|
+
export declare const PopupUserPicker: React_2.ForwardRefExoticComponent<
|
|
159
|
+
Pick<
|
|
160
|
+
Omit<PopupUserPickerProps, keyof WithAnalyticsEventsProps>,
|
|
161
|
+
| 'target'
|
|
162
|
+
| 'autoFocus'
|
|
163
|
+
| 'captureMenuScroll'
|
|
164
|
+
| 'closeMenuOnScroll'
|
|
165
|
+
| 'inputId'
|
|
166
|
+
| 'isClearable'
|
|
167
|
+
| 'isDisabled'
|
|
168
|
+
| 'isLoading'
|
|
169
|
+
| 'menuPosition'
|
|
170
|
+
| 'menuPortalTarget'
|
|
171
|
+
| 'menuShouldBlockScroll'
|
|
172
|
+
| 'noOptionsMessage'
|
|
173
|
+
| 'onBlur'
|
|
174
|
+
| 'onChange'
|
|
175
|
+
| 'onFocus'
|
|
176
|
+
| 'onInputChange'
|
|
177
|
+
| 'options'
|
|
178
|
+
| 'placeholder'
|
|
179
|
+
| 'styles'
|
|
180
|
+
| 'value'
|
|
181
|
+
| 'defaultValue'
|
|
182
|
+
| 'fieldId'
|
|
183
|
+
| 'menuMinWidth'
|
|
184
|
+
| 'maxPickerHeight'
|
|
185
|
+
| 'textFieldBackgroundColor'
|
|
186
|
+
| 'loadOptions'
|
|
187
|
+
| 'loadUserSource'
|
|
188
|
+
| 'search'
|
|
189
|
+
| 'anchor'
|
|
190
|
+
| 'open'
|
|
191
|
+
| 'onSelection'
|
|
192
|
+
| 'onClear'
|
|
193
|
+
| 'onClose'
|
|
194
|
+
| 'appearance'
|
|
195
|
+
| 'subtle'
|
|
196
|
+
| 'noBorder'
|
|
197
|
+
| 'addMoreMessage'
|
|
198
|
+
| 'clearValueLabel'
|
|
199
|
+
| 'allowEmail'
|
|
200
|
+
| 'suggestEmailsForDomain'
|
|
201
|
+
| 'emailLabel'
|
|
202
|
+
| 'disableInput'
|
|
203
|
+
| 'isValidEmail'
|
|
204
|
+
| 'maxOptions'
|
|
205
|
+
| 'ariaLabelledBy'
|
|
206
|
+
| 'ariaLive'
|
|
207
|
+
| 'popupTitle'
|
|
208
|
+
> &
|
|
209
|
+
Partial<
|
|
210
|
+
Pick<
|
|
211
|
+
Omit<PopupUserPickerProps, keyof WithAnalyticsEventsProps>,
|
|
212
|
+
| 'isMulti'
|
|
213
|
+
| 'width'
|
|
214
|
+
| 'offset'
|
|
215
|
+
| 'boundariesElement'
|
|
216
|
+
| 'placement'
|
|
217
|
+
| 'rootBoundary'
|
|
218
|
+
| 'shouldFlip'
|
|
219
|
+
>
|
|
220
|
+
> &
|
|
221
|
+
Partial<
|
|
222
|
+
Pick<
|
|
223
|
+
{
|
|
224
|
+
boundariesElement: string;
|
|
225
|
+
width: number;
|
|
226
|
+
isMulti: boolean;
|
|
227
|
+
offset: number[];
|
|
228
|
+
placement: string;
|
|
229
|
+
rootBoundary: string;
|
|
230
|
+
shouldFlip: boolean;
|
|
231
|
+
},
|
|
232
|
+
never
|
|
233
|
+
>
|
|
234
|
+
> &
|
|
235
|
+
React_2.RefAttributes<any>
|
|
236
|
+
>;
|
|
237
|
+
|
|
238
|
+
export declare type PopupUserPickerProps = UserPickerProps & {
|
|
239
|
+
/** Whether to use the popup version of the single picker */
|
|
240
|
+
target: Target;
|
|
241
|
+
/** Optional title assigned to popup picker */
|
|
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
|
+
*/
|
|
248
|
+
boundariesElement?: BoundariesElement;
|
|
249
|
+
/**
|
|
250
|
+
* Distance the popup should be offset from the reference in the format of [along, away] (units in px).
|
|
251
|
+
*/
|
|
252
|
+
offset?: [number, number];
|
|
253
|
+
/**
|
|
254
|
+
* Placement of where the popup should be displayed relative to the trigger element.
|
|
255
|
+
* Defaults to `"auto"`.
|
|
256
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
268
|
+
shouldFlip?: boolean;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
export declare type Promisable<T> = T | PromiseLike<T>;
|
|
272
|
+
|
|
273
|
+
declare type RootBoundary = 'viewport' | 'document';
|
|
274
|
+
|
|
275
|
+
export declare type Target = (options: {
|
|
276
|
+
ref: any;
|
|
277
|
+
isOpen: boolean;
|
|
278
|
+
}) => ReactNode;
|
|
279
|
+
|
|
280
|
+
export declare interface Team extends OptionData {
|
|
281
|
+
avatarUrl?: string;
|
|
282
|
+
description?: string;
|
|
283
|
+
memberCount?: number;
|
|
284
|
+
members?: TeamMember[];
|
|
285
|
+
includesYou?: boolean;
|
|
286
|
+
highlight?: TeamHighlight;
|
|
287
|
+
type: 'team';
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export declare interface TeamHighlight {
|
|
291
|
+
name: HighlightRange[];
|
|
292
|
+
description?: HighlightRange[];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export declare interface TeamMember {
|
|
296
|
+
name: string;
|
|
297
|
+
id: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export declare const TeamType = 'team';
|
|
301
|
+
|
|
302
|
+
export declare interface User extends OptionData {
|
|
303
|
+
avatarUrl?: string;
|
|
304
|
+
publicName?: string;
|
|
305
|
+
highlight?: UserHighlight;
|
|
306
|
+
byline?: string;
|
|
307
|
+
type?: 'user';
|
|
308
|
+
email?: string;
|
|
309
|
+
isExternal?: boolean;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export declare interface UserHighlight {
|
|
313
|
+
name: HighlightRange[];
|
|
314
|
+
publicName: HighlightRange[];
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
declare const UserPicker: React_2.ForwardRefExoticComponent<
|
|
318
|
+
Pick<
|
|
319
|
+
Omit<UserPickerProps, keyof WithAnalyticsEventsProps>,
|
|
320
|
+
| 'autoFocus'
|
|
321
|
+
| 'captureMenuScroll'
|
|
322
|
+
| 'closeMenuOnScroll'
|
|
323
|
+
| 'inputId'
|
|
324
|
+
| 'isClearable'
|
|
325
|
+
| 'isDisabled'
|
|
326
|
+
| 'isLoading'
|
|
327
|
+
| 'menuPosition'
|
|
328
|
+
| 'menuPortalTarget'
|
|
329
|
+
| 'menuShouldBlockScroll'
|
|
330
|
+
| 'noOptionsMessage'
|
|
331
|
+
| 'onBlur'
|
|
332
|
+
| 'onChange'
|
|
333
|
+
| 'onFocus'
|
|
334
|
+
| 'onInputChange'
|
|
335
|
+
| 'options'
|
|
336
|
+
| 'placeholder'
|
|
337
|
+
| 'styles'
|
|
338
|
+
| 'value'
|
|
339
|
+
| 'defaultValue'
|
|
340
|
+
| 'fieldId'
|
|
341
|
+
| 'menuMinWidth'
|
|
342
|
+
| 'maxPickerHeight'
|
|
343
|
+
| 'textFieldBackgroundColor'
|
|
344
|
+
| 'loadOptions'
|
|
345
|
+
| 'loadUserSource'
|
|
346
|
+
| 'search'
|
|
347
|
+
| 'anchor'
|
|
348
|
+
| 'open'
|
|
349
|
+
| 'onSelection'
|
|
350
|
+
| 'onClear'
|
|
351
|
+
| 'onClose'
|
|
352
|
+
| 'appearance'
|
|
353
|
+
| 'subtle'
|
|
354
|
+
| 'noBorder'
|
|
355
|
+
| 'addMoreMessage'
|
|
356
|
+
| 'clearValueLabel'
|
|
357
|
+
| 'allowEmail'
|
|
358
|
+
| 'suggestEmailsForDomain'
|
|
359
|
+
| 'emailLabel'
|
|
360
|
+
| 'disableInput'
|
|
361
|
+
| 'isValidEmail'
|
|
362
|
+
| 'maxOptions'
|
|
363
|
+
| 'ariaLabelledBy'
|
|
364
|
+
| 'ariaLive'
|
|
365
|
+
> &
|
|
366
|
+
Partial<
|
|
367
|
+
Pick<
|
|
368
|
+
Omit<UserPickerProps, keyof WithAnalyticsEventsProps>,
|
|
369
|
+
'isMulti' | 'width'
|
|
370
|
+
>
|
|
371
|
+
> &
|
|
372
|
+
Partial<
|
|
373
|
+
Pick<
|
|
374
|
+
{
|
|
375
|
+
width: number;
|
|
376
|
+
isMulti: boolean;
|
|
377
|
+
},
|
|
378
|
+
never
|
|
379
|
+
>
|
|
380
|
+
> &
|
|
381
|
+
React_2.RefAttributes<any>
|
|
382
|
+
>;
|
|
383
|
+
export default UserPicker;
|
|
384
|
+
|
|
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
|
+
*/
|
|
403
|
+
fieldId: string | null;
|
|
404
|
+
/** List of users or teams to be used as options by the user picker. */
|
|
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. */
|
|
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. */
|
|
409
|
+
menuMinWidth?: number;
|
|
410
|
+
/** Sets max height of the user picker. If not set, the height will grow based on number of picked users. */
|
|
411
|
+
maxPickerHeight?: number;
|
|
412
|
+
/** Sets the background color to be the same color as a textfield (Atlaskit N10) */
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
427
|
+
loadUserSource?: LoadUserSource;
|
|
428
|
+
/** Callback for value change events fired whenever a selection is inserted or removed. */
|
|
429
|
+
onChange?: OnChange;
|
|
430
|
+
/** To enable multi user picker. */
|
|
431
|
+
isMulti?: boolean;
|
|
432
|
+
/** Input text value. */
|
|
433
|
+
search?: string;
|
|
434
|
+
/** Anchor for the user picker popup. */
|
|
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. */
|
|
437
|
+
open?: boolean;
|
|
438
|
+
/** Show the loading indicator. */
|
|
439
|
+
isLoading?: boolean;
|
|
440
|
+
/** Callback for search input text change events. */
|
|
441
|
+
onInputChange?: OnInputChange;
|
|
442
|
+
/** Callback for when a selection is made. */
|
|
443
|
+
onSelection?: OnOption;
|
|
444
|
+
/** Callback for when the field gains focus. */
|
|
445
|
+
onFocus?: OnPicker;
|
|
446
|
+
/** Callback for when the field loses focus. */
|
|
447
|
+
onBlur?: OnPicker;
|
|
448
|
+
/** Callback for when the value/s in the picker is cleared. */
|
|
449
|
+
onClear?: OnPicker;
|
|
450
|
+
/** Callback that is triggered when popup picker is closed */
|
|
451
|
+
onClose?: OnPicker;
|
|
452
|
+
/** Appearance of the user picker. */
|
|
453
|
+
appearance?: Appearance;
|
|
454
|
+
/** Display the picker with a subtle style. */
|
|
455
|
+
subtle?: boolean;
|
|
456
|
+
/** Display the picker with no border. */
|
|
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
|
+
*/
|
|
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`) */
|
|
468
|
+
defaultValue?: DefaultValue;
|
|
469
|
+
/** Placeholder text to be shown when there is no value in the field. */
|
|
470
|
+
placeholder?: React_2.ReactNode;
|
|
471
|
+
/** Message to encourage the user to add more items to user picker. */
|
|
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
|
+
*/
|
|
477
|
+
noOptionsMessage?:
|
|
478
|
+
| ((value: { inputValue: string }) => string | null)
|
|
479
|
+
| string
|
|
480
|
+
| null;
|
|
481
|
+
/** Controls if the user picker has a value or not. If not provided, UserPicker will control the value internally. */
|
|
482
|
+
value?: Value;
|
|
483
|
+
/** Disable all interactions with the picker, putting it in a read-only state. */
|
|
484
|
+
isDisabled?: boolean;
|
|
485
|
+
/** Display a remove button on the single picker. True by default. */
|
|
486
|
+
isClearable?: boolean;
|
|
487
|
+
/** Optional tooltip to display on hover over the clear indicator. */
|
|
488
|
+
clearValueLabel?: string;
|
|
489
|
+
/** React-select prop for controlling menu position */
|
|
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 */
|
|
492
|
+
captureMenuScroll?: boolean;
|
|
493
|
+
/** Whether the menu should use a portal, and where it should attach. */
|
|
494
|
+
menuPortalTarget?: HTMLElement;
|
|
495
|
+
/** Whether the user is allowed to enter emails as a value. */
|
|
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 */
|
|
498
|
+
suggestEmailsForDomain?: string;
|
|
499
|
+
/** Email option label */
|
|
500
|
+
emailLabel?: string;
|
|
501
|
+
/** Whether to disable interaction with the input */
|
|
502
|
+
disableInput?: boolean;
|
|
503
|
+
/** Override default email validation function. */
|
|
504
|
+
isValidEmail?: EmailValidator;
|
|
505
|
+
/** Override the internal behaviour to automatically focus the control when the picker is open */
|
|
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. */
|
|
508
|
+
maxOptions?: number;
|
|
509
|
+
/** Allows clicking on a label with the same id to open user picker. */
|
|
510
|
+
inputId?: string;
|
|
511
|
+
/** Whether to close menu on scroll */
|
|
512
|
+
closeMenuOnScroll?: boolean | EventListener;
|
|
513
|
+
/** Whether to block scrolling actions */
|
|
514
|
+
menuShouldBlockScroll?: boolean;
|
|
515
|
+
/** Accessibility: Identifies the element (or elements) that labels the current element.*/
|
|
516
|
+
ariaLabelledBy?: string;
|
|
517
|
+
/** Accessibility: Used to set the priority with which screen reader should treat updates to live regions.*/
|
|
518
|
+
ariaLive?: 'polite' | 'off' | 'assertive';
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
export declare type UserPickerState = {
|
|
522
|
+
options: OptionData[];
|
|
523
|
+
value?: AtlaskitSelectValue;
|
|
524
|
+
isDefaultSet: boolean;
|
|
525
|
+
inflightRequest: number;
|
|
526
|
+
count: number;
|
|
527
|
+
hoveringClearIndicator: boolean;
|
|
528
|
+
menuIsOpen: boolean;
|
|
529
|
+
inputValue: string;
|
|
530
|
+
resolving: boolean;
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
export declare type UserSource =
|
|
534
|
+
| 'google'
|
|
535
|
+
| 'slack'
|
|
536
|
+
| 'microsoft'
|
|
537
|
+
| 'github'
|
|
538
|
+
| 'jira'
|
|
539
|
+
| 'confluence'
|
|
540
|
+
| 'other-atlassian';
|
|
541
|
+
|
|
542
|
+
declare interface UserSourceResult {
|
|
543
|
+
sourceId: string;
|
|
544
|
+
sourceType: UserSource;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export declare const UserType = 'user';
|
|
548
|
+
|
|
549
|
+
export declare type Value = OptionData | OptionData[] | null | undefined;
|
|
550
|
+
|
|
551
|
+
export {};
|
|
552
|
+
```
|