@atlaskit/user-picker 9.4.1 → 9.5.1
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 +12 -0
- package/dist/cjs/components/AvatarItemOption.js +20 -13
- package/dist/cjs/components/EmailOption/main.js +3 -2
- package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +16 -11
- package/dist/cjs/components/ExternalUserOption/main.js +1 -0
- package/dist/cjs/components/GroupOption/main.js +4 -3
- package/dist/cjs/components/TeamOption/main.js +7 -6
- package/dist/cjs/components/UserOption.js +3 -2
- package/dist/cjs/components/UserPicker.js +1 -1
- package/dist/cjs/components/creatable.js +1 -1
- package/dist/cjs/components/creatableEmailSuggestion.js +1 -1
- package/dist/cjs/components/utils.js +7 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/AvatarItemOption.js +10 -5
- package/dist/es2019/components/EmailOption/main.js +3 -2
- package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +7 -3
- package/dist/es2019/components/ExternalUserOption/main.js +1 -0
- package/dist/es2019/components/GroupOption/main.js +4 -3
- package/dist/es2019/components/TeamOption/main.js +7 -6
- package/dist/es2019/components/UserOption.js +3 -2
- package/dist/es2019/components/UserPicker.js +1 -1
- package/dist/es2019/components/creatable.js +1 -1
- package/dist/es2019/components/creatableEmailSuggestion.js +1 -1
- package/dist/es2019/components/utils.js +7 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/AvatarItemOption.js +20 -13
- package/dist/esm/components/EmailOption/main.js +3 -2
- package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +17 -11
- package/dist/esm/components/ExternalUserOption/main.js +1 -0
- package/dist/esm/components/GroupOption/main.js +4 -3
- package/dist/esm/components/TeamOption/main.js +7 -6
- package/dist/esm/components/UserOption.js +3 -2
- package/dist/esm/components/UserPicker.js +1 -1
- package/dist/esm/components/creatable.js +1 -1
- package/dist/esm/components/creatableEmailSuggestion.js +1 -1
- package/dist/esm/components/utils.js +7 -5
- package/dist/esm/version.json +1 -1
- package/dist/types/components/AvatarItemOption.d.ts +3 -2
- package/dist/types/components/BaseUserPicker.d.ts +1 -1
- package/dist/types/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +2 -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 +6 -4
- package/dist/types-ts4.0/components/AvatarItemOption.d.ts +3 -2
- package/dist/types-ts4.0/components/BaseUserPicker.d.ts +1 -1
- package/dist/types-ts4.0/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +2 -1
- package/dist/types-ts4.0/components/PopupUserPicker.d.ts +1 -1
- package/dist/types-ts4.0/components/UserPicker.d.ts +1 -1
- package/dist/types-ts4.0/types.d.ts +6 -4
- package/package.json +13 -12
- package/report.api.md +108 -98
- package/tmp/api-report-tmp.d.ts +365 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 9.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c522aeea1da`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c522aeea1da) - bumped up @atlaskit/tokens version to ^0.10.19
|
|
8
|
+
|
|
9
|
+
## 9.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`a4d4f93b480`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a4d4f93b480) - [ux] UserPicker now supports disabling option items through a new optional `isDisabled` field on data passed to the `options` prop.
|
|
14
|
+
|
|
3
15
|
## 9.4.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -19,6 +19,8 @@ var _core = require("@emotion/core");
|
|
|
19
19
|
|
|
20
20
|
var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
|
|
21
21
|
|
|
22
|
+
var _tokens = require("@atlaskit/tokens");
|
|
23
|
+
|
|
22
24
|
var _utils = require("./utils");
|
|
23
25
|
|
|
24
26
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -39,16 +41,20 @@ var AsyncTooltip = /*#__PURE__*/_react.default.lazy(function () {
|
|
|
39
41
|
});
|
|
40
42
|
});
|
|
41
43
|
|
|
42
|
-
var wrapper = (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
var wrapper = function wrapper(isDisabled) {
|
|
45
|
+
return (0, _core.css)({
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
boxSizing: 'border-box',
|
|
48
|
+
display: 'flex',
|
|
49
|
+
lineHeight: 1,
|
|
50
|
+
outline: 'none',
|
|
51
|
+
margin: 0,
|
|
52
|
+
width: '100%',
|
|
53
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
54
|
+
opacity: isDisabled ? (0, _tokens.token)('opacity.disabled', '0.4') : undefined
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
52
58
|
var optionWrapper = (0, _core.css)({
|
|
53
59
|
maxWidth: '100%',
|
|
54
60
|
minWidth: 0,
|
|
@@ -86,9 +92,10 @@ exports.textWrapper = textWrapper;
|
|
|
86
92
|
|
|
87
93
|
var AvatarItemOption = function AvatarItemOption(_ref) {
|
|
88
94
|
var avatar = _ref.avatar,
|
|
95
|
+
isDisabled = _ref.isDisabled,
|
|
96
|
+
lozenge = _ref.lozenge,
|
|
89
97
|
primaryText = _ref.primaryText,
|
|
90
|
-
secondaryText = _ref.secondaryText
|
|
91
|
-
lozenge = _ref.lozenge;
|
|
98
|
+
secondaryText = _ref.secondaryText;
|
|
92
99
|
|
|
93
100
|
var renderLozenge = function renderLozenge() {
|
|
94
101
|
if ((0, _utils.isLozengeText)(lozenge)) {
|
|
@@ -109,7 +116,7 @@ var AvatarItemOption = function AvatarItemOption(_ref) {
|
|
|
109
116
|
};
|
|
110
117
|
|
|
111
118
|
return (0, _core.jsx)("span", {
|
|
112
|
-
css: wrapper
|
|
119
|
+
css: wrapper(isDisabled)
|
|
113
120
|
}, avatar, (0, _core.jsx)("div", {
|
|
114
121
|
css: optionWrapper
|
|
115
122
|
}, (0, _core.jsx)("div", null, (0, _core.jsx)("div", {
|
|
@@ -82,9 +82,10 @@ var EmailOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
82
82
|
avatar: (0, _core.jsx)(_AddOptionAvatar.AddOptionAvatar, {
|
|
83
83
|
label: label
|
|
84
84
|
}),
|
|
85
|
+
lozenge: _this.getLozengeProps(),
|
|
86
|
+
isDisabled: _this.props.email.isDisabled,
|
|
85
87
|
primaryText: _this.renderPrimaryText(),
|
|
86
|
-
secondaryText: _this.renderSecondaryText(label)
|
|
87
|
-
lozenge: _this.getLozengeProps()
|
|
88
|
+
secondaryText: _this.renderSecondaryText(label)
|
|
88
89
|
});
|
|
89
90
|
});
|
|
90
91
|
return _this;
|
|
@@ -19,16 +19,20 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
19
19
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
22
|
-
var outerWrapper = (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
var outerWrapper = function outerWrapper(isDisabled) {
|
|
23
|
+
return (0, _core.css)({
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
boxSizing: 'border-box',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
lineHeight: 1,
|
|
28
|
+
outline: 'none',
|
|
29
|
+
margin: 0,
|
|
30
|
+
width: '100%',
|
|
31
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
32
|
+
opacity: isDisabled ? (0, _tokens.token)('opacity.disabled', '0.4') : undefined
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
32
36
|
var detailsWrapper = (0, _core.css)({
|
|
33
37
|
display: 'flex',
|
|
34
38
|
maxWidth: '100%',
|
|
@@ -65,11 +69,12 @@ var getTextStyle = function getTextStyle(isSecondary) {
|
|
|
65
69
|
|
|
66
70
|
var ExternalAvatarItemOption = function ExternalAvatarItemOption(_ref) {
|
|
67
71
|
var avatar = _ref.avatar,
|
|
72
|
+
isDisabled = _ref.isDisabled,
|
|
68
73
|
primaryText = _ref.primaryText,
|
|
69
74
|
secondaryText = _ref.secondaryText,
|
|
70
75
|
sourcesInfoTooltip = _ref.sourcesInfoTooltip;
|
|
71
76
|
return (0, _core.jsx)("div", {
|
|
72
|
-
css: outerWrapper
|
|
77
|
+
css: outerWrapper(isDisabled)
|
|
73
78
|
}, avatar, (0, _core.jsx)("div", {
|
|
74
79
|
css: detailsWrapper
|
|
75
80
|
}, (0, _core.jsx)("div", {
|
|
@@ -152,6 +152,7 @@ var ExternalUserOptionImpl = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
152
152
|
value: function render() {
|
|
153
153
|
return (0, _core.jsx)(_ExternalAvatarItemOption.ExternalAvatarItemOption, {
|
|
154
154
|
avatar: this.renderAvatar(),
|
|
155
|
+
isDisabled: this.props.user.isDisabled,
|
|
155
156
|
primaryText: this.getPrimaryText(),
|
|
156
157
|
secondaryText: this.renderSecondaryText(),
|
|
157
158
|
sourcesInfoTooltip: this.getSourcesInfoTooltip()
|
|
@@ -35,7 +35,7 @@ var _people = _interopRequireDefault(require("@atlaskit/icon/glyph/people"));
|
|
|
35
35
|
|
|
36
36
|
var _AvatarItemOption = require("../AvatarItemOption");
|
|
37
37
|
|
|
38
|
-
var _i18n = require("
|
|
38
|
+
var _i18n = require("../i18n");
|
|
39
39
|
|
|
40
40
|
var _HighlightText = require("../HighlightText");
|
|
41
41
|
|
|
@@ -108,9 +108,10 @@ var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
108
108
|
value: function render() {
|
|
109
109
|
return (0, _core.jsx)(_AvatarItemOption.AvatarItemOption, {
|
|
110
110
|
avatar: this.renderAvatar(),
|
|
111
|
-
|
|
111
|
+
isDisabled: this.props.group.isDisabled,
|
|
112
|
+
lozenge: this.getLozengeProps(),
|
|
112
113
|
primaryText: this.getPrimaryText(),
|
|
113
|
-
|
|
114
|
+
secondaryText: this.renderByline()
|
|
114
115
|
});
|
|
115
116
|
}
|
|
116
117
|
}]);
|
|
@@ -33,13 +33,13 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
33
33
|
|
|
34
34
|
var _reactIntlNext = require("react-intl-next");
|
|
35
35
|
|
|
36
|
-
var _AvatarItemOption = require("
|
|
36
|
+
var _AvatarItemOption = require("../AvatarItemOption");
|
|
37
37
|
|
|
38
|
-
var _HighlightText = require("
|
|
38
|
+
var _HighlightText = require("../HighlightText");
|
|
39
39
|
|
|
40
|
-
var _i18n = require("
|
|
40
|
+
var _i18n = require("../i18n");
|
|
41
41
|
|
|
42
|
-
var _SizeableAvatar = require("
|
|
42
|
+
var _SizeableAvatar = require("../SizeableAvatar");
|
|
43
43
|
|
|
44
44
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
45
45
|
|
|
@@ -143,9 +143,10 @@ var TeamOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
143
143
|
value: function render() {
|
|
144
144
|
return (0, _core.jsx)(_AvatarItemOption.AvatarItemOption, {
|
|
145
145
|
avatar: this.renderAvatar(),
|
|
146
|
-
|
|
146
|
+
isDisabled: this.props.team.isDisabled,
|
|
147
|
+
lozenge: this.getLozengeProps(),
|
|
147
148
|
primaryText: this.getPrimaryText(),
|
|
148
|
-
|
|
149
|
+
secondaryText: this.renderCustomByLine() || this.renderByline()
|
|
149
150
|
});
|
|
150
151
|
}
|
|
151
152
|
}]);
|
|
@@ -111,9 +111,10 @@ var UserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
111
111
|
value: function render() {
|
|
112
112
|
return (0, _core.jsx)(_AvatarItemOption.AvatarItemOption, {
|
|
113
113
|
avatar: this.renderAvatar(),
|
|
114
|
+
lozenge: this.getLozengeProps(),
|
|
115
|
+
isDisabled: this.props.user.isDisabled,
|
|
114
116
|
primaryText: this.getPrimaryText(),
|
|
115
|
-
secondaryText: this.renderSecondaryText()
|
|
116
|
-
lozenge: this.getLozengeProps()
|
|
117
|
+
secondaryText: this.renderSecondaryText()
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
120
|
}]);
|
|
@@ -43,7 +43,7 @@ var _creatableEmailSuggestion = require("./creatableEmailSuggestion");
|
|
|
43
43
|
|
|
44
44
|
var _MessagesIntlProvider = _interopRequireDefault(require("./MessagesIntlProvider"));
|
|
45
45
|
|
|
46
|
-
var _UserSourceProvider = require("
|
|
46
|
+
var _UserSourceProvider = require("../clients/UserSourceProvider");
|
|
47
47
|
|
|
48
48
|
var _ufoExperiences = require("../util/ufoExperiences");
|
|
49
49
|
|
|
@@ -61,7 +61,7 @@ var isOptionDisabled = function isOptionDisabled() {
|
|
|
61
61
|
return isValidEmail(option.data.id) !== 'VALID';
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
return
|
|
64
|
+
return !!option.isDisabled;
|
|
65
65
|
};
|
|
66
66
|
}; // Generates user picker props to always create an email item visible
|
|
67
67
|
// to the user as a suggested option when they are typing in a value
|
|
@@ -64,17 +64,19 @@ var isOptionData = function isOptionData(option) {
|
|
|
64
64
|
var optionToSelectableOption = function optionToSelectableOption(option) {
|
|
65
65
|
if (isOptionData(option)) {
|
|
66
66
|
return {
|
|
67
|
+
data: option,
|
|
68
|
+
isDisabled: option.isDisabled,
|
|
67
69
|
label: option.name,
|
|
68
|
-
value: option.id
|
|
69
|
-
data: option
|
|
70
|
+
value: option.id
|
|
70
71
|
};
|
|
71
72
|
} else {
|
|
72
73
|
return {
|
|
73
|
-
label: option.id,
|
|
74
|
-
value: option.id,
|
|
75
74
|
data: _objectSpread(_objectSpread({}, option), {}, {
|
|
76
75
|
name: option.id
|
|
77
|
-
})
|
|
76
|
+
}),
|
|
77
|
+
isDisabled: option.isDisabled,
|
|
78
|
+
label: option.id,
|
|
79
|
+
value: option.id
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
};
|
package/dist/cjs/version.json
CHANGED
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
4
4
|
import { css, jsx } from '@emotion/core';
|
|
5
5
|
import Lozenge from '@atlaskit/lozenge';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
6
7
|
import { isLozengeText } from './utils';
|
|
7
8
|
const AsyncTooltip = /*#__PURE__*/React.lazy(() => import(
|
|
8
9
|
/* webpackChunkName: "@atlaskit-internal_@atlaskit/tooltip" */
|
|
@@ -11,7 +12,8 @@ const AsyncTooltip = /*#__PURE__*/React.lazy(() => import(
|
|
|
11
12
|
default: module.default
|
|
12
13
|
};
|
|
13
14
|
}));
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
const wrapper = isDisabled => css({
|
|
15
17
|
alignItems: 'center',
|
|
16
18
|
boxSizing: 'border-box',
|
|
17
19
|
display: 'flex',
|
|
@@ -19,8 +21,10 @@ const wrapper = css({
|
|
|
19
21
|
outline: 'none',
|
|
20
22
|
margin: 0,
|
|
21
23
|
width: '100%',
|
|
22
|
-
cursor: 'pointer'
|
|
24
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
25
|
+
opacity: isDisabled ? token('opacity.disabled', '0.4') : undefined
|
|
23
26
|
});
|
|
27
|
+
|
|
24
28
|
const optionWrapper = css({
|
|
25
29
|
maxWidth: '100%',
|
|
26
30
|
minWidth: 0,
|
|
@@ -53,9 +57,10 @@ export const textWrapper = color => css({
|
|
|
53
57
|
});
|
|
54
58
|
export const AvatarItemOption = ({
|
|
55
59
|
avatar,
|
|
60
|
+
isDisabled,
|
|
61
|
+
lozenge,
|
|
56
62
|
primaryText,
|
|
57
|
-
secondaryText
|
|
58
|
-
lozenge
|
|
63
|
+
secondaryText
|
|
59
64
|
}) => {
|
|
60
65
|
const renderLozenge = () => {
|
|
61
66
|
if (isLozengeText(lozenge)) {
|
|
@@ -76,7 +81,7 @@ export const AvatarItemOption = ({
|
|
|
76
81
|
};
|
|
77
82
|
|
|
78
83
|
return jsx("span", {
|
|
79
|
-
css: wrapper
|
|
84
|
+
css: wrapper(isDisabled)
|
|
80
85
|
}, avatar, jsx("div", {
|
|
81
86
|
css: optionWrapper
|
|
82
87
|
}, jsx("div", null, jsx("div", {
|
|
@@ -42,9 +42,10 @@ export class EmailOption extends React.PureComponent {
|
|
|
42
42
|
avatar: jsx(AddOptionAvatar, {
|
|
43
43
|
label: label
|
|
44
44
|
}),
|
|
45
|
+
lozenge: this.getLozengeProps(),
|
|
46
|
+
isDisabled: this.props.email.isDisabled,
|
|
45
47
|
primaryText: this.renderPrimaryText(),
|
|
46
|
-
secondaryText: this.renderSecondaryText(label)
|
|
47
|
-
lozenge: this.getLozengeProps()
|
|
48
|
+
secondaryText: this.renderSecondaryText(label)
|
|
48
49
|
}));
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { css, jsx } from '@emotion/core';
|
|
3
3
|
import { B400 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { token } from '@atlaskit/tokens';
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
const outerWrapper = isDisabled => css({
|
|
6
7
|
alignItems: 'center',
|
|
7
8
|
boxSizing: 'border-box',
|
|
8
9
|
display: 'flex',
|
|
@@ -10,8 +11,10 @@ const outerWrapper = css({
|
|
|
10
11
|
outline: 'none',
|
|
11
12
|
margin: 0,
|
|
12
13
|
width: '100%',
|
|
13
|
-
cursor: 'pointer'
|
|
14
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
15
|
+
opacity: isDisabled ? token('opacity.disabled', '0.4') : undefined
|
|
14
16
|
});
|
|
17
|
+
|
|
15
18
|
const detailsWrapper = css({
|
|
16
19
|
display: 'flex',
|
|
17
20
|
maxWidth: '100%',
|
|
@@ -48,11 +51,12 @@ const getTextStyle = isSecondary => {
|
|
|
48
51
|
|
|
49
52
|
export const ExternalAvatarItemOption = ({
|
|
50
53
|
avatar,
|
|
54
|
+
isDisabled,
|
|
51
55
|
primaryText,
|
|
52
56
|
secondaryText,
|
|
53
57
|
sourcesInfoTooltip
|
|
54
58
|
}) => jsx("div", {
|
|
55
|
-
css: outerWrapper
|
|
59
|
+
css: outerWrapper(isDisabled)
|
|
56
60
|
}, avatar, jsx("div", {
|
|
57
61
|
css: detailsWrapper
|
|
58
62
|
}, jsx("div", {
|
|
@@ -103,6 +103,7 @@ class ExternalUserOptionImpl extends React.PureComponent {
|
|
|
103
103
|
render() {
|
|
104
104
|
return jsx(ExternalAvatarItemOption, {
|
|
105
105
|
avatar: this.renderAvatar(),
|
|
106
|
+
isDisabled: this.props.user.isDisabled,
|
|
106
107
|
primaryText: this.getPrimaryText(),
|
|
107
108
|
secondaryText: this.renderSecondaryText(),
|
|
108
109
|
sourcesInfoTooltip: this.getSourcesInfoTooltip()
|
|
@@ -8,7 +8,7 @@ import { N20, B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
|
8
8
|
import { token } from '@atlaskit/tokens';
|
|
9
9
|
import PeopleIcon from '@atlaskit/icon/glyph/people';
|
|
10
10
|
import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
|
|
11
|
-
import { messages } from '
|
|
11
|
+
import { messages } from '../i18n';
|
|
12
12
|
import { HighlightText } from '../HighlightText';
|
|
13
13
|
export const groupOptionIconWrapper = css({
|
|
14
14
|
padding: '2px',
|
|
@@ -62,9 +62,10 @@ export class GroupOption extends React.PureComponent {
|
|
|
62
62
|
render() {
|
|
63
63
|
return jsx(AvatarItemOption, {
|
|
64
64
|
avatar: this.renderAvatar(),
|
|
65
|
-
|
|
65
|
+
isDisabled: this.props.group.isDisabled,
|
|
66
|
+
lozenge: this.getLozengeProps(),
|
|
66
67
|
primaryText: this.getPrimaryText(),
|
|
67
|
-
|
|
68
|
+
secondaryText: this.renderByline()
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
71
|
|
|
@@ -7,10 +7,10 @@ import { token } from '@atlaskit/tokens';
|
|
|
7
7
|
import { jsx } from '@emotion/core';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
10
|
-
import { AvatarItemOption, textWrapper } from '
|
|
11
|
-
import { HighlightText } from '
|
|
12
|
-
import { messages } from '
|
|
13
|
-
import { SizeableAvatar } from '
|
|
10
|
+
import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
|
|
11
|
+
import { HighlightText } from '../HighlightText';
|
|
12
|
+
import { messages } from '../i18n';
|
|
13
|
+
import { SizeableAvatar } from '../SizeableAvatar';
|
|
14
14
|
export class TeamOption extends React.PureComponent {
|
|
15
15
|
constructor(...args) {
|
|
16
16
|
super(...args);
|
|
@@ -104,9 +104,10 @@ export class TeamOption extends React.PureComponent {
|
|
|
104
104
|
render() {
|
|
105
105
|
return jsx(AvatarItemOption, {
|
|
106
106
|
avatar: this.renderAvatar(),
|
|
107
|
-
|
|
107
|
+
isDisabled: this.props.team.isDisabled,
|
|
108
|
+
lozenge: this.getLozengeProps(),
|
|
108
109
|
primaryText: this.getPrimaryText(),
|
|
109
|
-
|
|
110
|
+
secondaryText: this.renderCustomByLine() || this.renderByline()
|
|
110
111
|
});
|
|
111
112
|
}
|
|
112
113
|
|
|
@@ -69,9 +69,10 @@ export class UserOption extends React.PureComponent {
|
|
|
69
69
|
render() {
|
|
70
70
|
return jsx(AvatarItemOption, {
|
|
71
71
|
avatar: this.renderAvatar(),
|
|
72
|
+
lozenge: this.getLozengeProps(),
|
|
73
|
+
isDisabled: this.props.user.isDisabled,
|
|
72
74
|
primaryText: this.getPrimaryText(),
|
|
73
|
-
secondaryText: this.renderSecondaryText()
|
|
74
|
-
lozenge: this.getLozengeProps()
|
|
75
|
+
secondaryText: this.renderSecondaryText()
|
|
75
76
|
});
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -10,7 +10,7 @@ import { getComponents } from './components';
|
|
|
10
10
|
import { getCreatableProps } from './creatable';
|
|
11
11
|
import { getCreatableSuggestedEmailProps } from './creatableEmailSuggestion';
|
|
12
12
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
13
|
-
import { ExusUserSourceProvider } from '
|
|
13
|
+
import { ExusUserSourceProvider } from '../clients/UserSourceProvider';
|
|
14
14
|
import { userPickerRenderedUfoExperience as experience, UfoErrorBoundary } from '../util/ufoExperiences';
|
|
15
15
|
import { v4 as uuidv4 } from 'uuid';
|
|
16
16
|
export class UserPickerWithoutAnalytics extends React.Component {
|
|
@@ -40,7 +40,7 @@ const isOptionDisabled = (isValidEmail = defaultIsValidEmail) => option => {
|
|
|
40
40
|
return isValidEmail(option.data.id) !== 'VALID';
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
return
|
|
43
|
+
return !!option.isDisabled;
|
|
44
44
|
}; // Generates user picker props to always create an email item visible
|
|
45
45
|
// to the user as a suggested option when they are typing in a value
|
|
46
46
|
|
|
@@ -13,17 +13,19 @@ const isOptionData = option => option.name !== undefined;
|
|
|
13
13
|
export const optionToSelectableOption = option => {
|
|
14
14
|
if (isOptionData(option)) {
|
|
15
15
|
return {
|
|
16
|
+
data: option,
|
|
17
|
+
isDisabled: option.isDisabled,
|
|
16
18
|
label: option.name,
|
|
17
|
-
value: option.id
|
|
18
|
-
data: option
|
|
19
|
+
value: option.id
|
|
19
20
|
};
|
|
20
21
|
} else {
|
|
21
22
|
return {
|
|
22
|
-
label: option.id,
|
|
23
|
-
value: option.id,
|
|
24
23
|
data: { ...option,
|
|
25
24
|
name: option.id
|
|
26
|
-
}
|
|
25
|
+
},
|
|
26
|
+
isDisabled: option.isDisabled,
|
|
27
|
+
label: option.id,
|
|
28
|
+
value: option.id
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -9,6 +9,7 @@ import React from 'react';
|
|
|
9
9
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
10
10
|
import { css, jsx } from '@emotion/core';
|
|
11
11
|
import Lozenge from '@atlaskit/lozenge';
|
|
12
|
+
import { token } from '@atlaskit/tokens';
|
|
12
13
|
import { isLozengeText } from './utils';
|
|
13
14
|
var AsyncTooltip = /*#__PURE__*/React.lazy(function () {
|
|
14
15
|
return import(
|
|
@@ -19,16 +20,21 @@ var AsyncTooltip = /*#__PURE__*/React.lazy(function () {
|
|
|
19
20
|
};
|
|
20
21
|
});
|
|
21
22
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
|
|
24
|
+
var wrapper = function wrapper(isDisabled) {
|
|
25
|
+
return css({
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
boxSizing: 'border-box',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
lineHeight: 1,
|
|
30
|
+
outline: 'none',
|
|
31
|
+
margin: 0,
|
|
32
|
+
width: '100%',
|
|
33
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
34
|
+
opacity: isDisabled ? token('opacity.disabled', '0.4') : undefined
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
32
38
|
var optionWrapper = css({
|
|
33
39
|
maxWidth: '100%',
|
|
34
40
|
minWidth: 0,
|
|
@@ -62,9 +68,10 @@ export var textWrapper = function textWrapper(color) {
|
|
|
62
68
|
};
|
|
63
69
|
export var AvatarItemOption = function AvatarItemOption(_ref) {
|
|
64
70
|
var avatar = _ref.avatar,
|
|
71
|
+
isDisabled = _ref.isDisabled,
|
|
72
|
+
lozenge = _ref.lozenge,
|
|
65
73
|
primaryText = _ref.primaryText,
|
|
66
|
-
secondaryText = _ref.secondaryText
|
|
67
|
-
lozenge = _ref.lozenge;
|
|
74
|
+
secondaryText = _ref.secondaryText;
|
|
68
75
|
|
|
69
76
|
var renderLozenge = function renderLozenge() {
|
|
70
77
|
if (isLozengeText(lozenge)) {
|
|
@@ -85,7 +92,7 @@ export var AvatarItemOption = function AvatarItemOption(_ref) {
|
|
|
85
92
|
};
|
|
86
93
|
|
|
87
94
|
return jsx("span", {
|
|
88
|
-
css: wrapper
|
|
95
|
+
css: wrapper(isDisabled)
|
|
89
96
|
}, avatar, jsx("div", {
|
|
90
97
|
css: optionWrapper
|
|
91
98
|
}, jsx("div", null, jsx("div", {
|
|
@@ -65,9 +65,10 @@ export var EmailOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
65
65
|
avatar: jsx(AddOptionAvatar, {
|
|
66
66
|
label: label
|
|
67
67
|
}),
|
|
68
|
+
lozenge: _this.getLozengeProps(),
|
|
69
|
+
isDisabled: _this.props.email.isDisabled,
|
|
68
70
|
primaryText: _this.renderPrimaryText(),
|
|
69
|
-
secondaryText: _this.renderSecondaryText(label)
|
|
70
|
-
lozenge: _this.getLozengeProps()
|
|
71
|
+
secondaryText: _this.renderSecondaryText(label)
|
|
71
72
|
});
|
|
72
73
|
});
|
|
73
74
|
|
|
@@ -8,16 +8,21 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
import { css, jsx } from '@emotion/core';
|
|
9
9
|
import { B400 } from '@atlaskit/theme/colors';
|
|
10
10
|
import { token } from '@atlaskit/tokens';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
|
|
12
|
+
var outerWrapper = function outerWrapper(isDisabled) {
|
|
13
|
+
return css({
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
boxSizing: 'border-box',
|
|
16
|
+
display: 'flex',
|
|
17
|
+
lineHeight: 1,
|
|
18
|
+
outline: 'none',
|
|
19
|
+
margin: 0,
|
|
20
|
+
width: '100%',
|
|
21
|
+
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
22
|
+
opacity: isDisabled ? token('opacity.disabled', '0.4') : undefined
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
21
26
|
var detailsWrapper = css({
|
|
22
27
|
display: 'flex',
|
|
23
28
|
maxWidth: '100%',
|
|
@@ -54,11 +59,12 @@ var getTextStyle = function getTextStyle(isSecondary) {
|
|
|
54
59
|
|
|
55
60
|
export var ExternalAvatarItemOption = function ExternalAvatarItemOption(_ref) {
|
|
56
61
|
var avatar = _ref.avatar,
|
|
62
|
+
isDisabled = _ref.isDisabled,
|
|
57
63
|
primaryText = _ref.primaryText,
|
|
58
64
|
secondaryText = _ref.secondaryText,
|
|
59
65
|
sourcesInfoTooltip = _ref.sourcesInfoTooltip;
|
|
60
66
|
return jsx("div", {
|
|
61
|
-
css: outerWrapper
|
|
67
|
+
css: outerWrapper(isDisabled)
|
|
62
68
|
}, avatar, jsx("div", {
|
|
63
69
|
css: detailsWrapper
|
|
64
70
|
}, jsx("div", {
|
|
@@ -129,6 +129,7 @@ var ExternalUserOptionImpl = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
129
129
|
value: function render() {
|
|
130
130
|
return jsx(ExternalAvatarItemOption, {
|
|
131
131
|
avatar: this.renderAvatar(),
|
|
132
|
+
isDisabled: this.props.user.isDisabled,
|
|
132
133
|
primaryText: this.getPrimaryText(),
|
|
133
134
|
secondaryText: this.renderSecondaryText(),
|
|
134
135
|
sourcesInfoTooltip: this.getSourcesInfoTooltip()
|