@atlaskit/user-picker 10.0.0 → 10.0.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 +12 -0
- package/dist/cjs/analytics.js +2 -53
- package/dist/cjs/clients/UserSourceProvider.js +11 -33
- package/dist/cjs/components/AddOptionAvatar.js +2 -9
- package/dist/cjs/components/AvatarItemOption.js +4 -29
- package/dist/cjs/components/BaseUserPicker.js +61 -155
- package/dist/cjs/components/ClearIndicator.js +4 -35
- package/dist/cjs/components/CustomOption/index.js +0 -7
- package/dist/cjs/components/CustomOption/main.js +4 -30
- package/dist/cjs/components/EmailOption/index.js +0 -7
- package/dist/cjs/components/EmailOption/main.js +2 -29
- package/dist/cjs/components/ExternalUserOption/ExternalAvatarItemOption.js +4 -15
- package/dist/cjs/components/ExternalUserOption/InfoIcon.js +4 -13
- package/dist/cjs/components/ExternalUserOption/SourcesTooltipContent.js +4 -20
- package/dist/cjs/components/ExternalUserOption/index.js +0 -7
- package/dist/cjs/components/ExternalUserOption/main.js +10 -48
- package/dist/cjs/components/ExternalUserSourcesContainer.js +5 -13
- package/dist/cjs/components/GroupOption/index.js +0 -7
- package/dist/cjs/components/GroupOption/main.js +4 -31
- package/dist/cjs/components/HighlightText.js +3 -27
- package/dist/cjs/components/Input.js +0 -23
- package/dist/cjs/components/MessagesIntlProvider.js +3 -20
- package/dist/cjs/components/MultiValue.js +21 -57
- package/dist/cjs/components/MultiValueContainer.js +8 -47
- package/dist/cjs/components/Option.js +5 -27
- package/dist/cjs/components/PopupControl.js +0 -22
- package/dist/cjs/components/PopupInput.js +0 -22
- package/dist/cjs/components/PopupUserPicker.js +10 -39
- package/dist/cjs/components/SingleValue.js +6 -17
- package/dist/cjs/components/SingleValueContainer.js +8 -37
- package/dist/cjs/components/SizeableAvatar.js +4 -20
- package/dist/cjs/components/TeamOption/index.js +0 -7
- package/dist/cjs/components/TeamOption/main.js +9 -37
- package/dist/cjs/components/UserOption.js +7 -34
- package/dist/cjs/components/UserPicker.js +14 -50
- package/dist/cjs/components/assets/github.js +0 -4
- package/dist/cjs/components/assets/google.js +0 -4
- package/dist/cjs/components/assets/microsoft.js +0 -4
- package/dist/cjs/components/assets/slack.js +0 -4
- package/dist/cjs/components/batch.js +0 -3
- package/dist/cjs/components/components.js +0 -17
- package/dist/cjs/components/creatable.js +2 -15
- package/dist/cjs/components/creatableEmailSuggestion.js +7 -18
- package/dist/cjs/components/emailValidation.js +0 -4
- package/dist/cjs/components/i18n.js +0 -2
- package/dist/cjs/components/popup.js +0 -3
- package/dist/cjs/components/styles.js +10 -26
- package/dist/cjs/components/utils.js +0 -53
- package/dist/cjs/i18n/cs.js +1 -1
- package/dist/cjs/i18n/da.js +1 -1
- package/dist/cjs/i18n/de.js +1 -1
- package/dist/cjs/i18n/en.js +31 -4
- package/dist/cjs/i18n/en_GB.js +31 -4
- package/dist/cjs/i18n/en_ZZ.js +1 -1
- package/dist/cjs/i18n/es.js +1 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +1 -1
- package/dist/cjs/i18n/fr.js +1 -1
- package/dist/cjs/i18n/hu.js +1 -1
- package/dist/cjs/i18n/index.js +0 -31
- package/dist/cjs/i18n/it.js +1 -1
- package/dist/cjs/i18n/ja.js +1 -1
- package/dist/cjs/i18n/ko.js +1 -1
- package/dist/cjs/i18n/nb.js +1 -1
- package/dist/cjs/i18n/nl.js +1 -1
- package/dist/cjs/i18n/pl.js +1 -1
- package/dist/cjs/i18n/pt_BR.js +1 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +1 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +1 -1
- package/dist/cjs/i18n/th.js +1 -1
- package/dist/cjs/i18n/tr.js +1 -1
- package/dist/cjs/i18n/uk.js +1 -1
- package/dist/cjs/i18n/vi.js +1 -1
- package/dist/cjs/i18n/zh.js +1 -1
- package/dist/cjs/i18n/zh_TW.js +1 -1
- package/dist/cjs/index.js +0 -5
- package/dist/cjs/util/i18n-util.js +0 -43
- package/dist/cjs/util/ufoExperiences.js +0 -17
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.js +18 -35
- package/dist/es2019/clients/UserSourceProvider.js +0 -6
- package/dist/es2019/components/AddOptionAvatar.js +0 -2
- package/dist/es2019/components/AvatarItemOption.js +1 -10
- package/dist/es2019/components/BaseUserPicker.js +14 -83
- package/dist/es2019/components/ClearIndicator.js +5 -11
- package/dist/es2019/components/CustomOption/index.js +1 -3
- package/dist/es2019/components/CustomOption/main.js +0 -10
- package/dist/es2019/components/EmailOption/index.js +1 -3
- package/dist/es2019/components/EmailOption/main.js +0 -9
- package/dist/es2019/components/ExternalUserOption/ExternalAvatarItemOption.js +1 -4
- package/dist/es2019/components/ExternalUserOption/index.js +1 -3
- package/dist/es2019/components/ExternalUserOption/main.js +0 -15
- package/dist/es2019/components/ExternalUserSourcesContainer.js +0 -2
- package/dist/es2019/components/GroupOption/index.js +1 -3
- package/dist/es2019/components/GroupOption/main.js +0 -7
- package/dist/es2019/components/HighlightText.js +0 -11
- package/dist/es2019/components/Input.js +0 -5
- package/dist/es2019/components/MessagesIntlProvider.js +2 -4
- package/dist/es2019/components/MultiValue.js +3 -15
- package/dist/es2019/components/MultiValueContainer.js +4 -24
- package/dist/es2019/components/Option.js +0 -9
- package/dist/es2019/components/PopupControl.js +0 -4
- package/dist/es2019/components/PopupInput.js +0 -6
- package/dist/es2019/components/PopupUserPicker.js +0 -8
- package/dist/es2019/components/SingleValue.js +0 -1
- package/dist/es2019/components/SingleValueContainer.js +0 -8
- package/dist/es2019/components/SizeableAvatar.js +0 -1
- package/dist/es2019/components/TeamOption/index.js +1 -3
- package/dist/es2019/components/TeamOption/main.js +2 -12
- package/dist/es2019/components/UserOption.js +0 -9
- package/dist/es2019/components/UserPicker.js +6 -8
- package/dist/es2019/components/batch.js +0 -1
- package/dist/es2019/components/components.js +3 -4
- package/dist/es2019/components/creatable.js +2 -9
- package/dist/es2019/components/creatableEmailSuggestion.js +7 -12
- package/dist/es2019/components/emailValidation.js +0 -2
- package/dist/es2019/components/styles.js +30 -22
- package/dist/es2019/components/utils.js +2 -8
- package/dist/es2019/i18n/cs.js +1 -0
- package/dist/es2019/i18n/da.js +1 -0
- package/dist/es2019/i18n/de.js +1 -0
- package/dist/es2019/i18n/en.js +31 -4
- package/dist/es2019/i18n/en_GB.js +31 -4
- package/dist/es2019/i18n/en_ZZ.js +1 -0
- package/dist/es2019/i18n/es.js +1 -0
- package/dist/es2019/i18n/fi.js +1 -0
- package/dist/es2019/i18n/fr.js +1 -0
- package/dist/es2019/i18n/hu.js +1 -0
- package/dist/es2019/i18n/it.js +1 -0
- package/dist/es2019/i18n/ja.js +1 -0
- package/dist/es2019/i18n/ko.js +1 -0
- package/dist/es2019/i18n/nb.js +1 -0
- package/dist/es2019/i18n/nl.js +1 -0
- package/dist/es2019/i18n/pl.js +1 -0
- package/dist/es2019/i18n/pt_BR.js +1 -0
- package/dist/es2019/i18n/ru.js +1 -0
- package/dist/es2019/i18n/sv.js +1 -0
- package/dist/es2019/i18n/th.js +1 -0
- package/dist/es2019/i18n/tr.js +1 -0
- package/dist/es2019/i18n/uk.js +1 -0
- package/dist/es2019/i18n/vi.js +1 -0
- package/dist/es2019/i18n/zh.js +1 -0
- package/dist/es2019/i18n/zh_TW.js +1 -0
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/util/i18n-util.js +30 -120
- package/dist/es2019/util/ufoExperiences.js +0 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +2 -30
- package/dist/esm/clients/UserSourceProvider.js +11 -21
- package/dist/esm/components/AddOptionAvatar.js +1 -3
- package/dist/esm/components/AvatarItemOption.js +5 -18
- package/dist/esm/components/BaseUserPicker.js +61 -166
- package/dist/esm/components/ClearIndicator.js +5 -23
- package/dist/esm/components/CustomOption/index.js +1 -3
- package/dist/esm/components/CustomOption/main.js +4 -22
- package/dist/esm/components/EmailOption/index.js +1 -3
- package/dist/esm/components/EmailOption/main.js +2 -20
- package/dist/esm/components/ExternalUserOption/ExternalAvatarItemOption.js +5 -11
- package/dist/esm/components/ExternalUserOption/InfoIcon.js +3 -5
- package/dist/esm/components/ExternalUserOption/SourcesTooltipContent.js +3 -3
- package/dist/esm/components/ExternalUserOption/index.js +1 -3
- package/dist/esm/components/ExternalUserOption/main.js +10 -35
- package/dist/esm/components/ExternalUserSourcesContainer.js +5 -8
- package/dist/esm/components/GroupOption/index.js +1 -3
- package/dist/esm/components/GroupOption/main.js +4 -19
- package/dist/esm/components/HighlightText.js +3 -21
- package/dist/esm/components/Input.js +0 -14
- package/dist/esm/components/MessagesIntlProvider.js +3 -10
- package/dist/esm/components/MultiValue.js +21 -39
- package/dist/esm/components/MultiValueContainer.js +8 -37
- package/dist/esm/components/Option.js +5 -15
- package/dist/esm/components/PopupControl.js +0 -11
- package/dist/esm/components/PopupInput.js +0 -14
- package/dist/esm/components/PopupUserPicker.js +10 -28
- package/dist/esm/components/SingleValue.js +6 -8
- package/dist/esm/components/SingleValueContainer.js +8 -25
- package/dist/esm/components/SizeableAvatar.js +4 -12
- package/dist/esm/components/TeamOption/index.js +1 -3
- package/dist/esm/components/TeamOption/main.js +9 -27
- package/dist/esm/components/UserOption.js +7 -24
- package/dist/esm/components/UserPicker.js +14 -26
- package/dist/esm/components/batch.js +0 -2
- package/dist/esm/components/components.js +1 -6
- package/dist/esm/components/creatable.js +2 -9
- package/dist/esm/components/creatableEmailSuggestion.js +7 -12
- package/dist/esm/components/emailValidation.js +0 -2
- package/dist/esm/components/styles.js +10 -21
- package/dist/esm/components/utils.js +0 -11
- package/dist/esm/i18n/cs.js +1 -0
- package/dist/esm/i18n/da.js +1 -0
- package/dist/esm/i18n/de.js +1 -0
- package/dist/esm/i18n/en.js +31 -4
- package/dist/esm/i18n/en_GB.js +31 -4
- package/dist/esm/i18n/en_ZZ.js +1 -0
- package/dist/esm/i18n/es.js +1 -0
- package/dist/esm/i18n/fi.js +1 -0
- package/dist/esm/i18n/fr.js +1 -0
- package/dist/esm/i18n/hu.js +1 -0
- package/dist/esm/i18n/it.js +1 -0
- package/dist/esm/i18n/ja.js +1 -0
- package/dist/esm/i18n/ko.js +1 -0
- package/dist/esm/i18n/nb.js +1 -0
- package/dist/esm/i18n/nl.js +1 -0
- package/dist/esm/i18n/pl.js +1 -0
- package/dist/esm/i18n/pt_BR.js +1 -0
- package/dist/esm/i18n/ru.js +1 -0
- package/dist/esm/i18n/sv.js +1 -0
- package/dist/esm/i18n/th.js +1 -0
- package/dist/esm/i18n/tr.js +1 -0
- package/dist/esm/i18n/uk.js +1 -0
- package/dist/esm/i18n/vi.js +1 -0
- package/dist/esm/i18n/zh.js +1 -0
- package/dist/esm/i18n/zh_TW.js +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/util/i18n-util.js +30 -126
- package/dist/esm/util/ufoExperiences.js +0 -9
- package/dist/esm/version.json +1 -1
- package/dist/types/components/BaseUserPicker.d.ts +1 -0
- package/dist/types/i18n/cs.d.ts +1 -0
- package/dist/types/i18n/da.d.ts +1 -0
- package/dist/types/i18n/de.d.ts +1 -0
- package/dist/types/i18n/en.d.ts +28 -1
- package/dist/types/i18n/en_GB.d.ts +28 -1
- package/dist/types/i18n/en_ZZ.d.ts +1 -0
- package/dist/types/i18n/es.d.ts +1 -0
- package/dist/types/i18n/fi.d.ts +1 -0
- package/dist/types/i18n/fr.d.ts +1 -0
- package/dist/types/i18n/hu.d.ts +1 -0
- package/dist/types/i18n/it.d.ts +1 -0
- package/dist/types/i18n/ja.d.ts +1 -0
- package/dist/types/i18n/ko.d.ts +1 -0
- package/dist/types/i18n/nb.d.ts +1 -0
- package/dist/types/i18n/nl.d.ts +1 -0
- package/dist/types/i18n/pl.d.ts +1 -0
- package/dist/types/i18n/pt_BR.d.ts +1 -0
- package/dist/types/i18n/ru.d.ts +1 -0
- package/dist/types/i18n/sv.d.ts +1 -0
- package/dist/types/i18n/th.d.ts +1 -0
- package/dist/types/i18n/tr.d.ts +1 -0
- package/dist/types/i18n/uk.d.ts +1 -0
- package/dist/types/i18n/vi.d.ts +1 -0
- package/dist/types/i18n/zh.d.ts +1 -0
- package/dist/types/i18n/zh_TW.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
var AsyncCustomOption = /*#__PURE__*/React.lazy(function () {
|
|
3
|
-
return import(
|
|
4
|
-
/* webpackChunkName: "@atlaskit-internal_@atlassian/user-picker/custom-option" */
|
|
5
|
-
'./main').then(function (module) {
|
|
3
|
+
return import( /* webpackChunkName: "@atlaskit-internal_@atlassian/user-picker/custom-option" */'./main').then(function (module) {
|
|
6
4
|
return {
|
|
7
5
|
default: module.CustomOption
|
|
8
6
|
};
|
|
@@ -5,11 +5,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
/** @jsx jsx */
|
|
14
11
|
import { B400, N800, N200 } from '@atlaskit/theme/colors';
|
|
15
12
|
import { jsx } from '@emotion/react';
|
|
@@ -19,24 +16,18 @@ import { HighlightText } from '../HighlightText';
|
|
|
19
16
|
import { SizeableAvatar } from '../SizeableAvatar';
|
|
20
17
|
export var CustomOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
21
18
|
_inherits(CustomOption, _React$PureComponent);
|
|
22
|
-
|
|
23
19
|
var _super = _createSuper(CustomOption);
|
|
24
|
-
|
|
25
20
|
function CustomOption() {
|
|
26
21
|
var _this;
|
|
27
|
-
|
|
28
22
|
_classCallCheck(this, CustomOption);
|
|
29
|
-
|
|
30
23
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
24
|
args[_key] = arguments[_key];
|
|
32
25
|
}
|
|
33
|
-
|
|
34
26
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
35
|
-
|
|
36
27
|
_defineProperty(_assertThisInitialized(_this), "getPrimaryText", function () {
|
|
37
28
|
var _this$props$data = _this.props.data,
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
name = _this$props$data.name,
|
|
30
|
+
highlight = _this$props$data.highlight;
|
|
40
31
|
return [jsx("span", {
|
|
41
32
|
key: "name",
|
|
42
33
|
css: textWrapper(_this.props.isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text, ".concat(N800, ")"))
|
|
@@ -44,43 +35,35 @@ export var CustomOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
44
35
|
highlights: highlight && highlight.name
|
|
45
36
|
}, name))];
|
|
46
37
|
});
|
|
47
|
-
|
|
48
38
|
_defineProperty(_assertThisInitialized(_this), "getBylineComponent", function (isSelected, message) {
|
|
49
39
|
return jsx("span", {
|
|
50
40
|
css: textWrapper(isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text-subtlest, ".concat(N200, ")"))
|
|
51
41
|
}, message);
|
|
52
42
|
});
|
|
53
|
-
|
|
54
43
|
_defineProperty(_assertThisInitialized(_this), "renderByline", function () {
|
|
55
44
|
var _this$props$data2;
|
|
56
|
-
|
|
57
45
|
if (!((_this$props$data2 = _this.props.data) !== null && _this$props$data2 !== void 0 && _this$props$data2.byline)) {
|
|
58
46
|
return undefined;
|
|
59
47
|
}
|
|
60
|
-
|
|
61
48
|
return _this.getBylineComponent(_this.props.isSelected, _this.props.data.byline);
|
|
62
49
|
});
|
|
63
|
-
|
|
64
50
|
_defineProperty(_assertThisInitialized(_this), "renderAvatar", function () {
|
|
65
51
|
var _this$props$data3 = _this.props.data,
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
avatarUrl = _this$props$data3.avatarUrl,
|
|
53
|
+
name = _this$props$data3.name;
|
|
68
54
|
return jsx(SizeableAvatar, {
|
|
69
55
|
appearance: "big",
|
|
70
56
|
src: avatarUrl,
|
|
71
57
|
name: name
|
|
72
58
|
});
|
|
73
59
|
});
|
|
74
|
-
|
|
75
60
|
_defineProperty(_assertThisInitialized(_this), "getLozengeProps", function () {
|
|
76
61
|
return typeof _this.props.data.lozenge === 'string' ? {
|
|
77
62
|
text: _this.props.data.lozenge
|
|
78
63
|
} : _this.props.data.lozenge;
|
|
79
64
|
});
|
|
80
|
-
|
|
81
65
|
return _this;
|
|
82
66
|
}
|
|
83
|
-
|
|
84
67
|
_createClass(CustomOption, [{
|
|
85
68
|
key: "render",
|
|
86
69
|
value: function render() {
|
|
@@ -93,6 +76,5 @@ export var CustomOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
93
76
|
});
|
|
94
77
|
}
|
|
95
78
|
}]);
|
|
96
|
-
|
|
97
79
|
return CustomOption;
|
|
98
80
|
}(React.PureComponent);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
var AsyncEmailOption = /*#__PURE__*/React.lazy(function () {
|
|
3
|
-
return import(
|
|
4
|
-
/* webpackChunkName: "@atlaskit-internal_@atlassian/user-picker/email-option" */
|
|
5
|
-
'./main').then(function (module) {
|
|
3
|
+
return import( /* webpackChunkName: "@atlaskit-internal_@atlassian/user-picker/email-option" */'./main').then(function (module) {
|
|
6
4
|
return {
|
|
7
5
|
default: module.EmailOption
|
|
8
6
|
};
|
|
@@ -5,11 +5,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
/** @jsx jsx */
|
|
14
11
|
import React from 'react';
|
|
15
12
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -18,33 +15,24 @@ import { jsx } from '@emotion/react';
|
|
|
18
15
|
import { AddOptionAvatar } from '../AddOptionAvatar';
|
|
19
16
|
import { AvatarItemOption, textWrapper } from '../AvatarItemOption';
|
|
20
17
|
import { messages } from '../i18n';
|
|
21
|
-
|
|
22
18
|
var getAddEmailMessage = function getAddEmailMessage(validity) {
|
|
23
19
|
return validity === 'POTENTIAL' ? messages.continueToAddEmail : messages.selectToAddEmail;
|
|
24
20
|
};
|
|
25
|
-
|
|
26
21
|
export var EmailOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
27
22
|
_inherits(EmailOption, _React$PureComponent);
|
|
28
|
-
|
|
29
23
|
var _super = _createSuper(EmailOption);
|
|
30
|
-
|
|
31
24
|
function EmailOption() {
|
|
32
25
|
var _this;
|
|
33
|
-
|
|
34
26
|
_classCallCheck(this, EmailOption);
|
|
35
|
-
|
|
36
27
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
28
|
args[_key] = arguments[_key];
|
|
38
29
|
}
|
|
39
|
-
|
|
40
30
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
41
|
-
|
|
42
31
|
_defineProperty(_assertThisInitialized(_this), "getLozengeProps", function () {
|
|
43
32
|
return typeof _this.props.email.lozenge === 'string' ? {
|
|
44
33
|
text: _this.props.email.lozenge
|
|
45
34
|
} : _this.props.email.lozenge;
|
|
46
35
|
});
|
|
47
|
-
|
|
48
36
|
_defineProperty(_assertThisInitialized(_this), "renderPrimaryText", function () {
|
|
49
37
|
var id = _this.props.email.id;
|
|
50
38
|
return jsx("span", {
|
|
@@ -52,13 +40,11 @@ export var EmailOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
52
40
|
css: textWrapper(_this.props.isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text, ".concat(N800, ")"))
|
|
53
41
|
}, id);
|
|
54
42
|
});
|
|
55
|
-
|
|
56
43
|
_defineProperty(_assertThisInitialized(_this), "renderSecondaryText", function (label) {
|
|
57
44
|
return jsx("span", {
|
|
58
45
|
css: textWrapper(_this.props.isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text-subtlest, ".concat(N200, ")"))
|
|
59
46
|
}, label);
|
|
60
47
|
});
|
|
61
|
-
|
|
62
48
|
_defineProperty(_assertThisInitialized(_this), "renderOption", function (label) {
|
|
63
49
|
return jsx(AvatarItemOption, {
|
|
64
50
|
avatar: jsx(AddOptionAvatar, {
|
|
@@ -70,23 +56,19 @@ export var EmailOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
70
56
|
secondaryText: _this.renderSecondaryText(label)
|
|
71
57
|
});
|
|
72
58
|
});
|
|
73
|
-
|
|
74
59
|
return _this;
|
|
75
60
|
}
|
|
76
|
-
|
|
77
61
|
_createClass(EmailOption, [{
|
|
78
62
|
key: "render",
|
|
79
63
|
value: function render() {
|
|
80
64
|
var _this2 = this;
|
|
81
|
-
|
|
82
65
|
var _this$props = this.props,
|
|
83
|
-
|
|
84
|
-
|
|
66
|
+
label = _this$props.label,
|
|
67
|
+
emailValidity = _this$props.emailValidity;
|
|
85
68
|
return label !== undefined ? this.renderOption(label) : jsx(FormattedMessage, getAddEmailMessage(emailValidity), function (label) {
|
|
86
69
|
return _this2.renderOption(label);
|
|
87
70
|
});
|
|
88
71
|
}
|
|
89
72
|
}]);
|
|
90
|
-
|
|
91
73
|
return EmailOption;
|
|
92
74
|
}(React.PureComponent);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
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; }
|
|
4
|
-
|
|
5
3
|
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) { _defineProperty(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; }
|
|
6
|
-
|
|
7
4
|
/** @jsx jsx */
|
|
5
|
+
|
|
8
6
|
import { css, jsx } from '@emotion/react';
|
|
9
7
|
import { B400 } from '@atlaskit/theme/colors';
|
|
10
|
-
|
|
11
8
|
var outerWrapper = function outerWrapper(isDisabled) {
|
|
12
9
|
return css({
|
|
13
10
|
alignItems: 'center',
|
|
@@ -21,7 +18,6 @@ var outerWrapper = function outerWrapper(isDisabled) {
|
|
|
21
18
|
opacity: isDisabled ? "var(--ds-opacity-disabled, 0.4)" : undefined
|
|
22
19
|
});
|
|
23
20
|
};
|
|
24
|
-
|
|
25
21
|
var detailsWrapper = css({
|
|
26
22
|
display: 'flex',
|
|
27
23
|
maxWidth: '100%',
|
|
@@ -35,7 +31,6 @@ var textSection = css({
|
|
|
35
31
|
width: 'calc(100% - 32px)',
|
|
36
32
|
flex: 'auto'
|
|
37
33
|
});
|
|
38
|
-
|
|
39
34
|
var getTextStyle = function getTextStyle(isSecondary) {
|
|
40
35
|
var secondaryCssArgs = isSecondary ? {
|
|
41
36
|
color: "var(--ds-text-selected, ".concat(B400, ")"),
|
|
@@ -55,13 +50,12 @@ var getTextStyle = function getTextStyle(isSecondary) {
|
|
|
55
50
|
}
|
|
56
51
|
}));
|
|
57
52
|
};
|
|
58
|
-
|
|
59
53
|
export var ExternalAvatarItemOption = function ExternalAvatarItemOption(_ref) {
|
|
60
54
|
var avatar = _ref.avatar,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
isDisabled = _ref.isDisabled,
|
|
56
|
+
primaryText = _ref.primaryText,
|
|
57
|
+
secondaryText = _ref.secondaryText,
|
|
58
|
+
sourcesInfoTooltip = _ref.sourcesInfoTooltip;
|
|
65
59
|
return jsx("div", {
|
|
66
60
|
css: outerWrapper(isDisabled)
|
|
67
61
|
}, avatar, jsx("div", {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { useCallback, useState } from 'react';
|
|
5
4
|
import { css, jsx } from '@emotion/react';
|
|
@@ -10,10 +9,9 @@ var wrapper = css({
|
|
|
10
9
|
});
|
|
11
10
|
export default (function () {
|
|
12
11
|
var _useState = useState(false),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
isMouseHovered = _useState2[0],
|
|
14
|
+
setHoverState = _useState2[1];
|
|
17
15
|
var onMouseEnter = useCallback(function () {
|
|
18
16
|
return setHoverState(true);
|
|
19
17
|
}, [setHoverState]);
|
|
@@ -56,7 +56,7 @@ var SUPPORTED_SOURCES = [{
|
|
|
56
56
|
}];
|
|
57
57
|
export var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
58
58
|
var sources = _ref.sources,
|
|
59
|
-
|
|
59
|
+
sourcesLoading = _ref.sourcesLoading;
|
|
60
60
|
var sourcesToRender = React.useMemo(function () {
|
|
61
61
|
return SUPPORTED_SOURCES.filter(function (supportedSource) {
|
|
62
62
|
return sources.includes(supportedSource.sourceType);
|
|
@@ -69,8 +69,8 @@ export var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
|
69
69
|
appearance: "invert"
|
|
70
70
|
}), !sourcesLoading && sourcesToRender.map(function (_ref2) {
|
|
71
71
|
var sourceType = _ref2.sourceType,
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
icon = _ref2.icon,
|
|
73
|
+
label = _ref2.label;
|
|
74
74
|
return jsx("div", {
|
|
75
75
|
css: sourceWrapper,
|
|
76
76
|
key: sourceType
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
var AsyncExternalUserOption = /*#__PURE__*/React.lazy(function () {
|
|
3
|
-
return import(
|
|
4
|
-
/* webpackChunkName: "@atlaskit-internal_@atlassian/user-picker/external-user-option" */
|
|
5
|
-
'./main').then(function (module) {
|
|
3
|
+
return import( /* webpackChunkName: "@atlaskit-internal_@atlassian/user-picker/external-user-option" */'./main').then(function (module) {
|
|
6
4
|
return {
|
|
7
5
|
default: module.ExternalUserOption
|
|
8
6
|
};
|
|
@@ -6,11 +6,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
12
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
11
|
/** @jsx jsx */
|
|
15
12
|
import React from 'react';
|
|
16
13
|
import { css, jsx } from '@emotion/react';
|
|
@@ -35,23 +32,16 @@ export var imageContainer = css({
|
|
|
35
32
|
export var emailDomainWrapper = css({
|
|
36
33
|
fontWeight: 'bold'
|
|
37
34
|
});
|
|
38
|
-
|
|
39
35
|
var ExternalUserOptionImpl = /*#__PURE__*/function (_React$PureComponent) {
|
|
40
36
|
_inherits(ExternalUserOptionImpl, _React$PureComponent);
|
|
41
|
-
|
|
42
37
|
var _super = _createSuper(ExternalUserOptionImpl);
|
|
43
|
-
|
|
44
38
|
function ExternalUserOptionImpl() {
|
|
45
39
|
var _this;
|
|
46
|
-
|
|
47
40
|
_classCallCheck(this, ExternalUserOptionImpl);
|
|
48
|
-
|
|
49
41
|
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50
42
|
_args[_key] = arguments[_key];
|
|
51
43
|
}
|
|
52
|
-
|
|
53
44
|
_this = _super.call.apply(_super, [this].concat(_args));
|
|
54
|
-
|
|
55
45
|
_defineProperty(_assertThisInitialized(_this), "getPrimaryText", function () {
|
|
56
46
|
var name = _this.props.user.name;
|
|
57
47
|
return jsx("span", {
|
|
@@ -59,19 +49,15 @@ var ExternalUserOptionImpl = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
59
49
|
css: textWrapper(_this.props.isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text, ".concat(N800, ")"))
|
|
60
50
|
}, name);
|
|
61
51
|
});
|
|
62
|
-
|
|
63
52
|
_defineProperty(_assertThisInitialized(_this), "renderSecondaryText", function () {
|
|
64
53
|
var email = _this.props.user.email;
|
|
65
|
-
|
|
66
54
|
if (!email) {
|
|
67
55
|
return;
|
|
68
56
|
}
|
|
69
|
-
|
|
70
57
|
var _email$split = email.split('@'),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
_email$split2 = _slicedToArray(_email$split, 2),
|
|
59
|
+
emailUser = _email$split2[0],
|
|
60
|
+
emailDomain = _email$split2[1];
|
|
75
61
|
var emailDomainWithAt = "@".concat(emailDomain);
|
|
76
62
|
return jsx("span", {
|
|
77
63
|
css: textWrapper(_this.props.isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text-subtlest, ".concat(N200, ")"))
|
|
@@ -79,13 +65,12 @@ var ExternalUserOptionImpl = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
79
65
|
css: emailDomainWrapper
|
|
80
66
|
}, emailDomainWithAt));
|
|
81
67
|
});
|
|
82
|
-
|
|
83
68
|
_defineProperty(_assertThisInitialized(_this), "renderAvatar", function () {
|
|
84
69
|
var _this$props = _this.props,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
_this$props$user = _this$props.user,
|
|
71
|
+
avatarUrl = _this$props$user.avatarUrl,
|
|
72
|
+
name = _this$props$user.name,
|
|
73
|
+
status = _this$props.status;
|
|
89
74
|
return jsx(SizeableAvatar, {
|
|
90
75
|
appearance: "big",
|
|
91
76
|
src: avatarUrl,
|
|
@@ -93,25 +78,19 @@ var ExternalUserOptionImpl = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
93
78
|
name: name
|
|
94
79
|
});
|
|
95
80
|
});
|
|
96
|
-
|
|
97
81
|
_defineProperty(_assertThisInitialized(_this), "fireEvent", function (eventCreator) {
|
|
98
82
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
99
83
|
args[_key2 - 1] = arguments[_key2];
|
|
100
84
|
}
|
|
101
|
-
|
|
102
85
|
var createAnalyticsEvent = _this.props.createAnalyticsEvent;
|
|
103
|
-
|
|
104
86
|
if (createAnalyticsEvent) {
|
|
105
87
|
createAndFireEventInElementsChannel(eventCreator.apply(void 0, args))(createAnalyticsEvent);
|
|
106
88
|
}
|
|
107
89
|
});
|
|
108
|
-
|
|
109
90
|
_defineProperty(_assertThisInitialized(_this), "onShow", function () {
|
|
110
91
|
var user = _this.props.user;
|
|
111
|
-
|
|
112
92
|
_this.fireEvent(userInfoEvent, user.sources, user.id);
|
|
113
93
|
});
|
|
114
|
-
|
|
115
94
|
_defineProperty(_assertThisInitialized(_this), "getSourcesInfoTooltip", function () {
|
|
116
95
|
return _this.props.user.isExternal ? jsx(Tooltip, {
|
|
117
96
|
content: _this.formattedTooltipContent(),
|
|
@@ -119,10 +98,8 @@ var ExternalUserOptionImpl = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
119
98
|
onShow: _this.onShow
|
|
120
99
|
}, jsx(InfoIcon, null)) : undefined;
|
|
121
100
|
});
|
|
122
|
-
|
|
123
101
|
return _this;
|
|
124
102
|
}
|
|
125
|
-
|
|
126
103
|
_createClass(ExternalUserOptionImpl, [{
|
|
127
104
|
key: "render",
|
|
128
105
|
value: function render() {
|
|
@@ -138,9 +115,9 @@ var ExternalUserOptionImpl = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
138
115
|
key: "formattedTooltipContent",
|
|
139
116
|
value: function formattedTooltipContent() {
|
|
140
117
|
var _this$props$user2 = this.props.user,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
118
|
+
id = _this$props$user2.id,
|
|
119
|
+
requiresSourceHydration = _this$props$user2.requiresSourceHydration,
|
|
120
|
+
sources = _this$props$user2.sources;
|
|
144
121
|
return jsx(ExternalUserSourcesContainer, {
|
|
145
122
|
accountId: id,
|
|
146
123
|
shouldFetchSources: Boolean(requiresSourceHydration),
|
|
@@ -150,8 +127,6 @@ var ExternalUserOptionImpl = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
150
127
|
});
|
|
151
128
|
}
|
|
152
129
|
}]);
|
|
153
|
-
|
|
154
130
|
return ExternalUserOptionImpl;
|
|
155
131
|
}(React.PureComponent);
|
|
156
|
-
|
|
157
132
|
export var ExternalUserOption = withAnalyticsEvents()(ExternalUserOptionImpl);
|
|
@@ -2,21 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import { useUserSource } from '../clients/UserSourceProvider';
|
|
3
3
|
export var ExternalUserSourcesContainer = function ExternalUserSourcesContainer(_ref) {
|
|
4
4
|
var children = _ref.children,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
accountId = _ref.accountId,
|
|
6
|
+
shouldFetchSources = _ref.shouldFetchSources,
|
|
7
|
+
initialSources = _ref.initialSources;
|
|
9
8
|
var _useUserSource = useUserSource(accountId, shouldFetchSources, initialSources),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
sources = _useUserSource.sources,
|
|
10
|
+
sourcesLoading = _useUserSource.loading;
|
|
13
11
|
if (typeof children === 'function') {
|
|
14
12
|
return children({
|
|
15
13
|
sources: sources,
|
|
16
14
|
sourcesLoading: sourcesLoading
|
|
17
15
|
});
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
return React.Children.map(children, function (child) {
|
|
21
18
|
return (
|
|
22
19
|
/*#__PURE__*/
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
var AsyncGroupOption = /*#__PURE__*/React.lazy(function () {
|
|
3
|
-
return import(
|
|
4
|
-
/* webpackChunkName: "@atlaskit-internal_@atlassian/user-picker/group-option" */
|
|
5
|
-
'./main').then(function (module) {
|
|
3
|
+
return import( /* webpackChunkName: "@atlaskit-internal_@atlassian/user-picker/group-option" */'./main').then(function (module) {
|
|
6
4
|
return {
|
|
7
5
|
default: module.GroupOption
|
|
8
6
|
};
|
|
@@ -5,11 +5,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
/** @jsx jsx */
|
|
14
11
|
import React from 'react';
|
|
15
12
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -29,26 +26,20 @@ export var groupOptionIconWrapper = css({
|
|
|
29
26
|
});
|
|
30
27
|
export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
31
28
|
_inherits(GroupOption, _React$PureComponent);
|
|
32
|
-
|
|
33
29
|
var _super = _createSuper(GroupOption);
|
|
34
|
-
|
|
35
30
|
function GroupOption() {
|
|
36
31
|
var _this;
|
|
37
|
-
|
|
38
32
|
_classCallCheck(this, GroupOption);
|
|
39
|
-
|
|
40
33
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41
34
|
args[_key] = arguments[_key];
|
|
42
35
|
}
|
|
43
|
-
|
|
44
36
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
45
|
-
|
|
46
37
|
_defineProperty(_assertThisInitialized(_this), "getPrimaryText", function () {
|
|
47
38
|
var _this$props = _this.props,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
isSelected = _this$props.isSelected,
|
|
40
|
+
_this$props$group = _this$props.group,
|
|
41
|
+
name = _this$props$group.name,
|
|
42
|
+
highlight = _this$props$group.highlight;
|
|
52
43
|
return [jsx("span", {
|
|
53
44
|
key: "name",
|
|
54
45
|
css: textWrapper(isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text, ".concat(N800, ")"))
|
|
@@ -56,7 +47,6 @@ export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
56
47
|
highlights: highlight && highlight.name
|
|
57
48
|
}, name))];
|
|
58
49
|
});
|
|
59
|
-
|
|
60
50
|
_defineProperty(_assertThisInitialized(_this), "renderAvatar", function () {
|
|
61
51
|
return jsx("span", {
|
|
62
52
|
css: groupOptionIconWrapper
|
|
@@ -65,23 +55,19 @@ export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
65
55
|
size: "medium"
|
|
66
56
|
}));
|
|
67
57
|
});
|
|
68
|
-
|
|
69
58
|
_defineProperty(_assertThisInitialized(_this), "renderByline", function () {
|
|
70
59
|
var isSelected = _this.props.isSelected;
|
|
71
60
|
return jsx("span", {
|
|
72
61
|
css: textWrapper(isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : "var(--ds-text-subtlest, ".concat(N200, ")"))
|
|
73
62
|
}, jsx(FormattedMessage, messages.groupByline));
|
|
74
63
|
});
|
|
75
|
-
|
|
76
64
|
_defineProperty(_assertThisInitialized(_this), "getLozengeProps", function () {
|
|
77
65
|
return typeof _this.props.group.lozenge === 'string' ? {
|
|
78
66
|
text: _this.props.group.lozenge
|
|
79
67
|
} : _this.props.group.lozenge;
|
|
80
68
|
});
|
|
81
|
-
|
|
82
69
|
return _this;
|
|
83
70
|
}
|
|
84
|
-
|
|
85
71
|
_createClass(GroupOption, [{
|
|
86
72
|
key: "render",
|
|
87
73
|
value: function render() {
|
|
@@ -94,6 +80,5 @@ export var GroupOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
94
80
|
});
|
|
95
81
|
}
|
|
96
82
|
}]);
|
|
97
|
-
|
|
98
83
|
return GroupOption;
|
|
99
84
|
}(React.PureComponent);
|
|
@@ -3,62 +3,48 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
7
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
-
|
|
9
7
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
-
|
|
11
8
|
import React from 'react';
|
|
12
9
|
export var HighlightText = /*#__PURE__*/function (_React$PureComponent) {
|
|
13
10
|
_inherits(HighlightText, _React$PureComponent);
|
|
14
|
-
|
|
15
11
|
var _super = _createSuper(HighlightText);
|
|
16
|
-
|
|
17
12
|
function HighlightText() {
|
|
18
13
|
_classCallCheck(this, HighlightText);
|
|
19
|
-
|
|
20
14
|
return _super.apply(this, arguments);
|
|
21
15
|
}
|
|
22
|
-
|
|
23
16
|
_createClass(HighlightText, [{
|
|
24
17
|
key: "render",
|
|
25
18
|
value: function render() {
|
|
26
19
|
var _this$props = this.props,
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
children = _this$props.children,
|
|
21
|
+
highlights = _this$props.highlights;
|
|
29
22
|
var parts = [];
|
|
30
23
|
var lastIndex = 0;
|
|
31
|
-
|
|
32
24
|
if (highlights) {
|
|
33
25
|
highlights.sort(function (a, b) {
|
|
34
26
|
return a.start - b.start;
|
|
35
27
|
}).reduce(function (highlights, highlight) {
|
|
36
28
|
var lastHighlight = highlights[highlights.length - 1];
|
|
37
|
-
|
|
38
29
|
if (!lastHighlight || highlight.start > lastHighlight.end + 1) {
|
|
39
30
|
return highlights.concat(highlight);
|
|
40
31
|
}
|
|
41
|
-
|
|
42
32
|
if (highlight.end > lastHighlight.end) {
|
|
43
33
|
lastHighlight.end = highlight.end;
|
|
44
34
|
}
|
|
45
|
-
|
|
46
35
|
return highlights;
|
|
47
36
|
}, []).forEach(function (highlight) {
|
|
48
37
|
var start = highlight.start,
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
end = highlight.end;
|
|
51
39
|
if (start >= end) {
|
|
52
40
|
return;
|
|
53
41
|
}
|
|
54
|
-
|
|
55
42
|
if (start > lastIndex) {
|
|
56
43
|
parts.push({
|
|
57
44
|
value: children.substring(lastIndex, start),
|
|
58
45
|
matches: false
|
|
59
46
|
});
|
|
60
47
|
}
|
|
61
|
-
|
|
62
48
|
parts.push({
|
|
63
49
|
value: children.substring(start, end + 1),
|
|
64
50
|
matches: true
|
|
@@ -66,25 +52,21 @@ export var HighlightText = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
66
52
|
lastIndex = end + 1;
|
|
67
53
|
});
|
|
68
54
|
}
|
|
69
|
-
|
|
70
55
|
if (lastIndex < children.length) {
|
|
71
56
|
parts.push({
|
|
72
57
|
value: children.substring(lastIndex, children.length),
|
|
73
58
|
matches: false
|
|
74
59
|
});
|
|
75
60
|
}
|
|
76
|
-
|
|
77
61
|
return parts.map(function (part, index) {
|
|
78
62
|
if (part.matches) {
|
|
79
63
|
return /*#__PURE__*/React.createElement("b", {
|
|
80
64
|
key: index
|
|
81
65
|
}, part.value);
|
|
82
66
|
}
|
|
83
|
-
|
|
84
67
|
return part.value;
|
|
85
68
|
});
|
|
86
69
|
}
|
|
87
70
|
}]);
|
|
88
|
-
|
|
89
71
|
return HighlightText;
|
|
90
72
|
}(React.PureComponent);
|