@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
|
@@ -6,44 +6,31 @@ 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
|
import React from 'react';
|
|
15
12
|
import { components } from '@atlaskit/select';
|
|
16
13
|
export var Input = /*#__PURE__*/function (_React$Component) {
|
|
17
14
|
_inherits(Input, _React$Component);
|
|
18
|
-
|
|
19
15
|
var _super = _createSuper(Input);
|
|
20
|
-
|
|
21
16
|
function Input() {
|
|
22
17
|
var _this;
|
|
23
|
-
|
|
24
18
|
_classCallCheck(this, Input);
|
|
25
|
-
|
|
26
19
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
27
20
|
args[_key] = arguments[_key];
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
31
|
-
|
|
32
23
|
_defineProperty(_assertThisInitialized(_this), "handleKeyPress", function (e) {
|
|
33
24
|
var _this$props$selectPro;
|
|
34
|
-
|
|
35
25
|
if (e.key === 'Enter') {
|
|
36
26
|
e.preventDefault();
|
|
37
27
|
}
|
|
38
|
-
|
|
39
28
|
if ((_this$props$selectPro = _this.props.selectProps) !== null && _this$props$selectPro !== void 0 && _this$props$selectPro.disableInput) {
|
|
40
29
|
e.preventDefault();
|
|
41
30
|
}
|
|
42
31
|
});
|
|
43
|
-
|
|
44
32
|
return _this;
|
|
45
33
|
}
|
|
46
|
-
|
|
47
34
|
_createClass(Input, [{
|
|
48
35
|
key: "render",
|
|
49
36
|
value: function render() {
|
|
@@ -53,6 +40,5 @@ export var Input = /*#__PURE__*/function (_React$Component) {
|
|
|
53
40
|
}));
|
|
54
41
|
}
|
|
55
42
|
}]);
|
|
56
|
-
|
|
57
43
|
return Input;
|
|
58
44
|
}(React.Component);
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
|
|
4
3
|
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; }
|
|
5
|
-
|
|
6
4
|
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; }
|
|
7
|
-
|
|
8
5
|
import React, { useMemo } from 'react';
|
|
9
6
|
import { useIntl, IntlProvider } from 'react-intl-next';
|
|
10
7
|
import { getMessagesForLocale } from '../util/i18n-util';
|
|
11
8
|
var EMPTY = {};
|
|
12
|
-
|
|
13
9
|
var useI18n = function useI18n(locale) {
|
|
14
10
|
var _React$useState = React.useState(EMPTY),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
12
|
+
messages = _React$useState2[0],
|
|
13
|
+
setMessages = _React$useState2[1];
|
|
19
14
|
React.useEffect(function () {
|
|
20
15
|
var aborted = false;
|
|
21
16
|
setMessages(EMPTY);
|
|
@@ -33,7 +28,6 @@ var useI18n = function useI18n(locale) {
|
|
|
33
28
|
}, [locale]);
|
|
34
29
|
return messages;
|
|
35
30
|
};
|
|
36
|
-
|
|
37
31
|
var MessagesIntlProvider = function MessagesIntlProvider(props) {
|
|
38
32
|
var intl = useIntl();
|
|
39
33
|
var children = props.children;
|
|
@@ -46,5 +40,4 @@ var MessagesIntlProvider = function MessagesIntlProvider(props) {
|
|
|
46
40
|
messages: mergedMessages
|
|
47
41
|
}, children);
|
|
48
42
|
};
|
|
49
|
-
|
|
50
43
|
export default MessagesIntlProvider;
|
|
@@ -8,11 +8,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
10
|
var _excluded = ["children", "innerProps"];
|
|
11
|
-
|
|
12
11
|
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); }; }
|
|
13
|
-
|
|
14
12
|
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; } }
|
|
15
|
-
|
|
16
13
|
/** @jsx jsx */
|
|
17
14
|
import React from 'react';
|
|
18
15
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -25,16 +22,13 @@ import { getAvatarUrl, isEmail, isGroup } from './utils';
|
|
|
25
22
|
import PeopleIcon from '@atlaskit/icon/glyph/people';
|
|
26
23
|
export var scrollToValue = function scrollToValue(valueContainer, control) {
|
|
27
24
|
var _valueContainer$getBo = valueContainer.getBoundingClientRect(),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
top = _valueContainer$getBo.top,
|
|
26
|
+
height = _valueContainer$getBo.height;
|
|
31
27
|
var _control$getBoundingC = control.getBoundingClientRect(),
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
controlHeight = _control$getBoundingC.height;
|
|
34
29
|
if (top - height < 0) {
|
|
35
30
|
valueContainer.scrollIntoView();
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
if (top + height > controlHeight) {
|
|
39
33
|
valueContainer.scrollIntoView(false);
|
|
40
34
|
}
|
|
@@ -47,23 +41,17 @@ var nameWrapper = css({
|
|
|
47
41
|
});
|
|
48
42
|
export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
49
43
|
_inherits(MultiValue, _React$Component);
|
|
50
|
-
|
|
51
44
|
var _super = _createSuper(MultiValue);
|
|
52
|
-
|
|
53
45
|
function MultiValue(props) {
|
|
54
46
|
var _this;
|
|
55
|
-
|
|
56
47
|
_classCallCheck(this, MultiValue);
|
|
57
|
-
|
|
58
48
|
_this = _super.call(this, props);
|
|
59
|
-
|
|
60
49
|
_defineProperty(_assertThisInitialized(_this), "getElemBefore", function () {
|
|
61
50
|
var _this$props = _this.props,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
_this$props$data = _this$props.data,
|
|
52
|
+
data = _this$props$data.data,
|
|
53
|
+
label = _this$props$data.label,
|
|
54
|
+
selectProps = _this$props.selectProps;
|
|
67
55
|
if (isEmail(data)) {
|
|
68
56
|
return selectProps.emailLabel ? jsx(AddOptionAvatar, {
|
|
69
57
|
isLozenge: true,
|
|
@@ -75,7 +63,6 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
75
63
|
});
|
|
76
64
|
});
|
|
77
65
|
}
|
|
78
|
-
|
|
79
66
|
if (isGroup(data)) {
|
|
80
67
|
return jsx("div", {
|
|
81
68
|
css: groupTagContainer
|
|
@@ -84,23 +71,19 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
84
71
|
size: "small"
|
|
85
72
|
}));
|
|
86
73
|
}
|
|
87
|
-
|
|
88
74
|
return jsx(SizeableAvatar, {
|
|
89
75
|
appearance: "multi",
|
|
90
76
|
src: getAvatarUrl(data),
|
|
91
77
|
name: label
|
|
92
78
|
});
|
|
93
79
|
});
|
|
94
|
-
|
|
95
80
|
_this.containerRef = /*#__PURE__*/React.createRef();
|
|
96
81
|
return _this;
|
|
97
82
|
}
|
|
98
|
-
|
|
99
83
|
_createClass(MultiValue, [{
|
|
100
84
|
key: "componentDidUpdate",
|
|
101
85
|
value: function componentDidUpdate() {
|
|
102
86
|
var isFocused = this.props.isFocused;
|
|
103
|
-
|
|
104
87
|
if (isFocused && this.containerRef.current && this.containerRef.current.parentElement && this.containerRef.current.parentElement.parentElement) {
|
|
105
88
|
scrollToValue(this.containerRef.current, this.containerRef.current.parentElement.parentElement);
|
|
106
89
|
}
|
|
@@ -109,28 +92,28 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
109
92
|
key: "shouldComponentUpdate",
|
|
110
93
|
value: function shouldComponentUpdate(nextProps) {
|
|
111
94
|
var _this$props2 = this.props,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
95
|
+
_this$props2$data = _this$props2.data,
|
|
96
|
+
label = _this$props2$data.label,
|
|
97
|
+
data = _this$props2$data.data,
|
|
98
|
+
innerProps = _this$props2.innerProps,
|
|
99
|
+
isFocused = _this$props2.isFocused;
|
|
117
100
|
var _nextProps$data = nextProps.data,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// that will be recreated every time but with the same implementation.
|
|
101
|
+
nextLabel = _nextProps$data.label,
|
|
102
|
+
nextData = _nextProps$data.data,
|
|
103
|
+
nextInnerProps = nextProps.innerProps,
|
|
104
|
+
nextIsFocused = nextProps.isFocused;
|
|
123
105
|
|
|
106
|
+
// We can ignore onRemove here because it is an anonymous function
|
|
107
|
+
// that will be recreated every time but with the same implementation.
|
|
124
108
|
return data !== nextData || label !== nextLabel || innerProps !== nextInnerProps || isFocused !== nextIsFocused;
|
|
125
109
|
}
|
|
126
110
|
}, {
|
|
127
111
|
key: "render",
|
|
128
112
|
value: function render() {
|
|
129
113
|
var _this$props3 = this.props,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
114
|
+
children = _this$props3.children,
|
|
115
|
+
innerProps = _this$props3.innerProps,
|
|
116
|
+
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
134
117
|
return jsx(components.MultiValue, _extends({}, rest, {
|
|
135
118
|
innerProps: {
|
|
136
119
|
ref: this.containerRef
|
|
@@ -141,6 +124,5 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
|
|
|
141
124
|
}, children));
|
|
142
125
|
}
|
|
143
126
|
}]);
|
|
144
|
-
|
|
145
127
|
return MultiValue;
|
|
146
128
|
}(React.Component);
|
|
@@ -7,15 +7,10 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
var _excluded = ["children", "innerProps"];
|
|
10
|
-
|
|
11
10
|
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; }
|
|
12
|
-
|
|
13
11
|
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; }
|
|
14
|
-
|
|
15
12
|
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); }; }
|
|
16
|
-
|
|
17
13
|
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; } }
|
|
18
|
-
|
|
19
14
|
import { components } from '@atlaskit/select';
|
|
20
15
|
import React from 'react';
|
|
21
16
|
import ReactDOM from 'react-dom';
|
|
@@ -24,39 +19,28 @@ import { messages } from './i18n';
|
|
|
24
19
|
import { isChildInput } from './utils';
|
|
25
20
|
export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
|
|
26
21
|
_inherits(MultiValueContainer, _React$PureComponent);
|
|
27
|
-
|
|
28
22
|
var _super = _createSuper(MultiValueContainer);
|
|
29
|
-
|
|
30
23
|
function MultiValueContainer(props) {
|
|
31
24
|
var _this;
|
|
32
|
-
|
|
33
25
|
_classCallCheck(this, MultiValueContainer);
|
|
34
|
-
|
|
35
26
|
_this = _super.call(this, props);
|
|
36
|
-
|
|
37
27
|
_defineProperty(_assertThisInitialized(_this), "timeoutId", null);
|
|
38
|
-
|
|
39
28
|
_defineProperty(_assertThisInitialized(_this), "scrollToBottom", function () {
|
|
40
29
|
_this.timeoutId = window.setTimeout(function () {
|
|
41
30
|
var current = _this.valueContainerInnerProps.ref.current;
|
|
42
|
-
|
|
43
31
|
if (current !== null) {
|
|
44
32
|
var container = ReactDOM.findDOMNode(current);
|
|
45
|
-
|
|
46
33
|
if (container instanceof HTMLDivElement) {
|
|
47
34
|
container.scrollTop = container.scrollHeight;
|
|
48
35
|
}
|
|
49
36
|
}
|
|
50
|
-
|
|
51
37
|
_this.timeoutId = null;
|
|
52
38
|
});
|
|
53
39
|
});
|
|
54
|
-
|
|
55
40
|
_defineProperty(_assertThisInitialized(_this), "showPlaceholder", function () {
|
|
56
41
|
var value = _this.props.selectProps.value;
|
|
57
42
|
return value && value.length > 0;
|
|
58
43
|
});
|
|
59
|
-
|
|
60
44
|
_defineProperty(_assertThisInitialized(_this), "addPlaceholder", function (placeholder) {
|
|
61
45
|
var children = React.Children.map(_this.props.children, function (child) {
|
|
62
46
|
return isChildInput(child) && _this.showPlaceholder() ? /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -65,34 +49,27 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
65
49
|
});
|
|
66
50
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
67
51
|
});
|
|
68
|
-
|
|
69
52
|
_defineProperty(_assertThisInitialized(_this), "renderChildren", function () {
|
|
70
53
|
var _this$props$selectPro = _this.props.selectProps,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
54
|
+
addMoreMessage = _this$props$selectPro.addMoreMessage,
|
|
55
|
+
isDisabled = _this$props$selectPro.isDisabled;
|
|
56
|
+
// Do not render "Add more..." message if picker is disabled
|
|
74
57
|
if (isDisabled) {
|
|
75
58
|
return _this.props.children;
|
|
76
59
|
}
|
|
77
|
-
|
|
78
60
|
if (addMoreMessage === undefined) {
|
|
79
61
|
return /*#__PURE__*/React.createElement(FormattedMessage, messages.addMore, function (addMore) {
|
|
80
62
|
var _join, _addMoreMessages;
|
|
81
|
-
|
|
82
63
|
var addMoreMessages = addMore;
|
|
83
|
-
|
|
84
64
|
if (addMore && typeof addMore === 'string') {
|
|
85
65
|
addMoreMessages = [addMore];
|
|
86
66
|
}
|
|
87
|
-
|
|
88
67
|
var placeholder = (_join = (_addMoreMessages = addMoreMessages) === null || _addMoreMessages === void 0 ? void 0 : _addMoreMessages.join('')) !== null && _join !== void 0 ? _join : '';
|
|
89
68
|
return _this.addPlaceholder(placeholder);
|
|
90
69
|
});
|
|
91
70
|
}
|
|
92
|
-
|
|
93
71
|
return _this.addPlaceholder(addMoreMessage);
|
|
94
72
|
});
|
|
95
|
-
|
|
96
73
|
_this.state = {
|
|
97
74
|
valueSize: 0,
|
|
98
75
|
previousValueSize: 0
|
|
@@ -102,21 +79,18 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
102
79
|
};
|
|
103
80
|
return _this;
|
|
104
81
|
}
|
|
105
|
-
|
|
106
82
|
_createClass(MultiValueContainer, [{
|
|
107
83
|
key: "componentDidUpdate",
|
|
108
84
|
value: function componentDidUpdate() {
|
|
109
85
|
var _this$state = this.state,
|
|
110
|
-
|
|
111
|
-
|
|
86
|
+
previousValueSize = _this$state.previousValueSize,
|
|
87
|
+
valueSize = _this$state.valueSize;
|
|
112
88
|
var isFocused = this.props.selectProps.isFocused;
|
|
113
|
-
|
|
114
89
|
if (valueSize > previousValueSize && isFocused) {
|
|
115
90
|
if (this.timeoutId) {
|
|
116
91
|
window.clearTimeout(this.timeoutId);
|
|
117
92
|
this.timeoutId = null;
|
|
118
93
|
}
|
|
119
|
-
|
|
120
94
|
this.scrollToBottom();
|
|
121
95
|
}
|
|
122
96
|
}
|
|
@@ -131,14 +105,12 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
131
105
|
key: "render",
|
|
132
106
|
value: function render() {
|
|
133
107
|
var _this$props = this.props,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
108
|
+
children = _this$props.children,
|
|
109
|
+
innerProps = _this$props.innerProps,
|
|
110
|
+
valueContainerProps = _objectWithoutProperties(_this$props, _excluded);
|
|
138
111
|
var props = _objectSpread(_objectSpread({}, valueContainerProps), {}, {
|
|
139
112
|
innerProps: this.valueContainerInnerProps
|
|
140
113
|
});
|
|
141
|
-
|
|
142
114
|
return /*#__PURE__*/React.createElement(components.ValueContainer, props, this.renderChildren());
|
|
143
115
|
}
|
|
144
116
|
}], [{
|
|
@@ -150,6 +122,5 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
150
122
|
};
|
|
151
123
|
}
|
|
152
124
|
}]);
|
|
153
|
-
|
|
154
125
|
return MultiValueContainer;
|
|
155
126
|
}(React.PureComponent);
|
|
@@ -8,11 +8,10 @@ import AsyncEmailOption from './EmailOption';
|
|
|
8
8
|
import AsyncCustomOption from './CustomOption';
|
|
9
9
|
import { isCustom, isEmail, isTeam, isUser, isGroup, isExternalUser } from './utils';
|
|
10
10
|
import { isValidEmail } from './emailValidation';
|
|
11
|
-
|
|
12
11
|
var defaultOption = function defaultOption(_ref) {
|
|
13
12
|
var data = _ref.data.data,
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
isSelected = _ref.isSelected,
|
|
14
|
+
status = _ref.status;
|
|
16
15
|
return (
|
|
17
16
|
/*#__PURE__*/
|
|
18
17
|
// @ts-expect-error - <UserOption> expects `data` to be of User interface, but data is OptionData interface by default. Check if the `user` props in UserOption should also accept OptionData or refactor this file to accept generics
|
|
@@ -23,13 +22,11 @@ var defaultOption = function defaultOption(_ref) {
|
|
|
23
22
|
})
|
|
24
23
|
);
|
|
25
24
|
};
|
|
26
|
-
|
|
27
25
|
var dataOption = function dataOption(_ref2) {
|
|
28
26
|
var data = _ref2.data.data,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
isSelected = _ref2.isSelected,
|
|
28
|
+
status = _ref2.status,
|
|
29
|
+
selectProps = _ref2.selectProps;
|
|
33
30
|
if (isExternalUser(data)) {
|
|
34
31
|
return /*#__PURE__*/React.createElement(AsyncExternalOption, {
|
|
35
32
|
user: data,
|
|
@@ -37,7 +34,6 @@ var dataOption = function dataOption(_ref2) {
|
|
|
37
34
|
isSelected: isSelected
|
|
38
35
|
});
|
|
39
36
|
}
|
|
40
|
-
|
|
41
37
|
if (isUser(data)) {
|
|
42
38
|
return /*#__PURE__*/React.createElement(UserOption, {
|
|
43
39
|
user: data,
|
|
@@ -45,7 +41,6 @@ var dataOption = function dataOption(_ref2) {
|
|
|
45
41
|
isSelected: isSelected
|
|
46
42
|
});
|
|
47
43
|
}
|
|
48
|
-
|
|
49
44
|
if (isEmail(data)) {
|
|
50
45
|
return /*#__PURE__*/React.createElement(AsyncEmailOption, {
|
|
51
46
|
email: data,
|
|
@@ -54,31 +49,26 @@ var dataOption = function dataOption(_ref2) {
|
|
|
54
49
|
label: selectProps.emailLabel
|
|
55
50
|
});
|
|
56
51
|
}
|
|
57
|
-
|
|
58
52
|
if (isTeam(data)) {
|
|
59
53
|
return /*#__PURE__*/React.createElement(AsyncTeamOption, {
|
|
60
54
|
team: data,
|
|
61
55
|
isSelected: isSelected
|
|
62
56
|
});
|
|
63
57
|
}
|
|
64
|
-
|
|
65
58
|
if (isGroup(data)) {
|
|
66
59
|
return /*#__PURE__*/React.createElement(AsyncGroupOption, {
|
|
67
60
|
group: data,
|
|
68
61
|
isSelected: isSelected
|
|
69
62
|
});
|
|
70
63
|
}
|
|
71
|
-
|
|
72
64
|
if (isCustom(data)) {
|
|
73
65
|
return /*#__PURE__*/React.createElement(AsyncCustomOption, {
|
|
74
66
|
data: data,
|
|
75
67
|
isSelected: isSelected
|
|
76
68
|
});
|
|
77
69
|
}
|
|
78
|
-
|
|
79
70
|
return null;
|
|
80
71
|
};
|
|
81
|
-
|
|
82
72
|
export var Option = function Option(props) {
|
|
83
73
|
return /*#__PURE__*/React.createElement(components.Option, props, /*#__PURE__*/React.createElement(React.Suspense, {
|
|
84
74
|
fallback: defaultOption(props)
|
|
@@ -3,11 +3,8 @@ 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
|
/** @jsx jsx */
|
|
12
9
|
import React from 'react';
|
|
13
10
|
import { themed } from '@atlaskit/theme/components';
|
|
@@ -18,7 +15,6 @@ import { N200, DN90 } from '@atlaskit/theme/colors';
|
|
|
18
15
|
var spacing = gridSize();
|
|
19
16
|
var fontSize = 12;
|
|
20
17
|
var innerHeight = spacing * 2; // 16px
|
|
21
|
-
|
|
22
18
|
var lineHeight = innerHeight / fontSize;
|
|
23
19
|
var controlWrapper = css({
|
|
24
20
|
display: 'flex',
|
|
@@ -29,7 +25,6 @@ var getColor = themed({
|
|
|
29
25
|
light: "var(--ds-text-subtlest, ".concat(N200, ")"),
|
|
30
26
|
dark: "var(--ds-text-subtlest, ".concat(DN90, ")")
|
|
31
27
|
});
|
|
32
|
-
|
|
33
28
|
var getLabelStyle = function getLabelStyle() {
|
|
34
29
|
var right = 0;
|
|
35
30
|
var bottom = spacing / 2;
|
|
@@ -44,18 +39,13 @@ var getLabelStyle = function getLabelStyle() {
|
|
|
44
39
|
padding: "".concat(top, "px ").concat(right, "px ").concat(bottom, "px ").concat(left, "px")
|
|
45
40
|
});
|
|
46
41
|
};
|
|
47
|
-
|
|
48
42
|
export var PopupControl = /*#__PURE__*/function (_React$PureComponent) {
|
|
49
43
|
_inherits(PopupControl, _React$PureComponent);
|
|
50
|
-
|
|
51
44
|
var _super = _createSuper(PopupControl);
|
|
52
|
-
|
|
53
45
|
function PopupControl() {
|
|
54
46
|
_classCallCheck(this, PopupControl);
|
|
55
|
-
|
|
56
47
|
return _super.apply(this, arguments);
|
|
57
48
|
}
|
|
58
|
-
|
|
59
49
|
_createClass(PopupControl, [{
|
|
60
50
|
key: "render",
|
|
61
51
|
value: function render() {
|
|
@@ -67,6 +57,5 @@ export var PopupControl = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
67
57
|
}, popupTitle), jsx(components.Control, this.props));
|
|
68
58
|
}
|
|
69
59
|
}]);
|
|
70
|
-
|
|
71
60
|
return PopupControl;
|
|
72
61
|
}(React.PureComponent);
|
|
@@ -6,42 +6,29 @@ 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
|
import React from 'react';
|
|
15
12
|
import { Input } from './Input';
|
|
16
13
|
export var PopupInput = /*#__PURE__*/function (_React$Component) {
|
|
17
14
|
_inherits(PopupInput, _React$Component);
|
|
18
|
-
|
|
19
15
|
var _super = _createSuper(PopupInput);
|
|
20
|
-
|
|
21
16
|
function PopupInput() {
|
|
22
17
|
var _this;
|
|
23
|
-
|
|
24
18
|
_classCallCheck(this, PopupInput);
|
|
25
|
-
|
|
26
19
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
27
20
|
args[_key] = arguments[_key];
|
|
28
21
|
}
|
|
29
|
-
|
|
30
22
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
31
|
-
|
|
32
23
|
_defineProperty(_assertThisInitialized(_this), "ref", null);
|
|
33
|
-
|
|
34
24
|
_defineProperty(_assertThisInitialized(_this), "handleInnerRef", function (ref) {
|
|
35
25
|
_this.ref = ref;
|
|
36
|
-
|
|
37
26
|
if (_this.props.innerRef) {
|
|
38
27
|
_this.props.innerRef(ref);
|
|
39
28
|
}
|
|
40
29
|
});
|
|
41
|
-
|
|
42
30
|
return _this;
|
|
43
31
|
}
|
|
44
|
-
|
|
45
32
|
_createClass(PopupInput, [{
|
|
46
33
|
key: "componentDidMount",
|
|
47
34
|
value: function componentDidMount() {
|
|
@@ -58,6 +45,5 @@ export var PopupInput = /*#__PURE__*/function (_React$Component) {
|
|
|
58
45
|
}));
|
|
59
46
|
}
|
|
60
47
|
}]);
|
|
61
|
-
|
|
62
48
|
return PopupInput;
|
|
63
49
|
}(React.Component);
|
|
@@ -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
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
15
12
|
import { PopupSelect } from '@atlaskit/select';
|
|
16
13
|
import React from 'react';
|
|
@@ -20,56 +17,44 @@ import { getPopupProps } from './popup';
|
|
|
20
17
|
import { BaseUserPickerWithoutAnalytics } from './BaseUserPicker';
|
|
21
18
|
export var PopupUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
|
|
22
19
|
_inherits(PopupUserPickerWithoutAnalytics, _React$Component);
|
|
23
|
-
|
|
24
20
|
var _super = _createSuper(PopupUserPickerWithoutAnalytics);
|
|
25
|
-
|
|
26
21
|
function PopupUserPickerWithoutAnalytics() {
|
|
27
22
|
var _this;
|
|
28
|
-
|
|
29
23
|
_classCallCheck(this, PopupUserPickerWithoutAnalytics);
|
|
30
|
-
|
|
31
24
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
25
|
args[_key] = arguments[_key];
|
|
33
26
|
}
|
|
34
|
-
|
|
35
27
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
36
|
-
|
|
37
28
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
38
29
|
flipped: false
|
|
39
30
|
});
|
|
40
|
-
|
|
41
31
|
_defineProperty(_assertThisInitialized(_this), "handleFlipStyle", function (data) {
|
|
42
32
|
var flipped = data.flipped,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
transform = data.styles.transform,
|
|
34
|
+
height = data.popper.height;
|
|
46
35
|
_this.setState({
|
|
47
36
|
flipped: flipped
|
|
48
37
|
});
|
|
49
|
-
|
|
50
38
|
if (!flipped) {
|
|
51
39
|
return data;
|
|
52
40
|
}
|
|
53
|
-
|
|
54
41
|
data.styles.transform = transform + "translate(0, ".concat(height, "px) translate(0, -100%)");
|
|
55
42
|
return data;
|
|
56
43
|
});
|
|
57
|
-
|
|
58
44
|
return _this;
|
|
59
45
|
}
|
|
60
|
-
|
|
61
46
|
_createClass(PopupUserPickerWithoutAnalytics, [{
|
|
62
47
|
key: "render",
|
|
63
48
|
value: function render() {
|
|
64
49
|
var _this$props = this.props,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
50
|
+
target = _this$props.target,
|
|
51
|
+
popupTitle = _this$props.popupTitle,
|
|
52
|
+
boundariesElement = _this$props.boundariesElement,
|
|
53
|
+
isMulti = _this$props.isMulti,
|
|
54
|
+
offset = _this$props.offset,
|
|
55
|
+
placement = _this$props.placement,
|
|
56
|
+
rootBoundary = _this$props.rootBoundary,
|
|
57
|
+
shouldFlip = _this$props.shouldFlip;
|
|
73
58
|
var flipped = this.state.flipped;
|
|
74
59
|
var width = this.props.width;
|
|
75
60
|
var styles = getPopupStyles(width, flipped, isMulti);
|
|
@@ -82,10 +67,8 @@ export var PopupUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compo
|
|
|
82
67
|
}));
|
|
83
68
|
}
|
|
84
69
|
}]);
|
|
85
|
-
|
|
86
70
|
return PopupUserPickerWithoutAnalytics;
|
|
87
71
|
}(React.Component);
|
|
88
|
-
|
|
89
72
|
_defineProperty(PopupUserPickerWithoutAnalytics, "defaultProps", {
|
|
90
73
|
boundariesElement: 'viewport',
|
|
91
74
|
width: 300,
|
|
@@ -95,5 +78,4 @@ _defineProperty(PopupUserPickerWithoutAnalytics, "defaultProps", {
|
|
|
95
78
|
rootBoundary: 'viewport',
|
|
96
79
|
shouldFlip: true
|
|
97
80
|
});
|
|
98
|
-
|
|
99
81
|
export var PopupUserPicker = withAnalyticsEvents()(PopupUserPickerWithoutAnalytics);
|