@atlaskit/quick-search 8.2.2 → 8.2.4
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 +14 -0
- package/dist/cjs/components/QuickSearch.js +22 -25
- package/dist/cjs/components/ResultItem/ResultItem.js +5 -7
- package/dist/cjs/components/ResultItem/ResultItemGroup.js +5 -7
- package/dist/cjs/components/ResultItem/styled.js +5 -4
- package/dist/cjs/components/Results/ContainerResult.js +6 -9
- package/dist/cjs/components/Results/ObjectResult.js +6 -9
- package/dist/cjs/components/Results/PersonResult.js +7 -10
- package/dist/cjs/components/Results/ResultBase.js +9 -12
- package/dist/cjs/components/Search/Search.js +8 -11
- package/dist/cjs/components/decorateWithAnalyticsData.js +10 -13
- package/dist/es2019/components/ResultItem/styled.js +5 -4
- package/dist/es2019/components/decorateWithAnalyticsData.js +4 -4
- package/dist/esm/components/QuickSearch.js +22 -25
- package/dist/esm/components/ResultItem/ResultItem.js +5 -7
- package/dist/esm/components/ResultItem/ResultItemGroup.js +5 -7
- package/dist/esm/components/ResultItem/styled.js +5 -4
- package/dist/esm/components/Results/ContainerResult.js +6 -9
- package/dist/esm/components/Results/ObjectResult.js +6 -9
- package/dist/esm/components/Results/PersonResult.js +7 -10
- package/dist/esm/components/Results/ResultBase.js +9 -12
- package/dist/esm/components/Search/Search.js +8 -11
- package/dist/esm/components/decorateWithAnalyticsData.js +10 -13
- package/package.json +4 -4
- package/tsconfig.json +0 -1
|
@@ -7,37 +7,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = decorateWithAnalyticsData;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
14
|
var _react = _interopRequireDefault(require("react"));
|
|
16
15
|
var _analytics = require("@atlaskit/analytics");
|
|
17
16
|
var _isReactElement = _interopRequireDefault(require("./isReactElement"));
|
|
18
17
|
var _constants = require("./constants");
|
|
19
|
-
function
|
|
18
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
20
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
20
|
function decorateWithAnalyticsData(WrappedQuickSearch) {
|
|
22
|
-
var
|
|
23
|
-
return
|
|
24
|
-
(0, _inherits2.default)(DecorateWithAnalyticsData, _React$Component);
|
|
25
|
-
var _super = _createSuper(DecorateWithAnalyticsData);
|
|
21
|
+
var _DecorateWithAnalyticsData;
|
|
22
|
+
return _DecorateWithAnalyticsData = /*#__PURE__*/function (_React$Component) {
|
|
26
23
|
function DecorateWithAnalyticsData() {
|
|
27
24
|
var _this;
|
|
28
25
|
(0, _classCallCheck2.default)(this, DecorateWithAnalyticsData);
|
|
29
26
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
27
|
args[_key] = arguments[_key];
|
|
31
28
|
}
|
|
32
|
-
_this =
|
|
33
|
-
(0, _defineProperty2.default)(
|
|
29
|
+
_this = _callSuper(this, DecorateWithAnalyticsData, [].concat(args));
|
|
30
|
+
(0, _defineProperty2.default)(_this, "countChildren", function () {
|
|
34
31
|
return _react.default.Children.toArray(_this.props.children).reduce(function (total, group) {
|
|
35
32
|
return (0, _isReactElement.default)(group) ? total + _react.default.Children.count(group.props.children) : total;
|
|
36
33
|
}, 0);
|
|
37
34
|
});
|
|
38
35
|
return _this;
|
|
39
36
|
}
|
|
40
|
-
(0,
|
|
37
|
+
(0, _inherits2.default)(DecorateWithAnalyticsData, _React$Component);
|
|
38
|
+
return (0, _createClass2.default)(DecorateWithAnalyticsData, [{
|
|
41
39
|
key: "render",
|
|
42
40
|
value: function render() {
|
|
43
41
|
return /*#__PURE__*/_react.default.createElement(_analytics.AnalyticsDecorator, {
|
|
@@ -50,9 +48,8 @@ function decorateWithAnalyticsData(WrappedQuickSearch) {
|
|
|
50
48
|
}, /*#__PURE__*/_react.default.createElement(WrappedQuickSearch, this.props));
|
|
51
49
|
}
|
|
52
50
|
}]);
|
|
53
|
-
|
|
54
|
-
}(_react.default.Component), (0, _defineProperty2.default)(_class, "defaultProps", {
|
|
51
|
+
}(_react.default.Component), (0, _defineProperty2.default)(_DecorateWithAnalyticsData, "defaultProps", {
|
|
55
52
|
children: [],
|
|
56
53
|
value: ''
|
|
57
|
-
}),
|
|
54
|
+
}), _DecorateWithAnalyticsData;
|
|
58
55
|
}
|
|
@@ -10,9 +10,10 @@ export const ResultItemGroupHeader = styled.div({
|
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
12
12
|
export const ResultItemGroupTitle = styled.div({
|
|
13
|
-
|
|
13
|
+
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
14
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
14
15
|
lineHeight: '16px',
|
|
15
|
-
fontWeight: 600
|
|
16
|
+
fontWeight: "var(--ds-font-weight-semibold, 600)"
|
|
16
17
|
});
|
|
17
18
|
|
|
18
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
@@ -29,13 +30,13 @@ export const ResultItemAfterWrapper = styled.div({
|
|
|
29
30
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
30
31
|
export const ResultItemCaption = styled.span({
|
|
31
32
|
color: N200,
|
|
32
|
-
|
|
33
|
+
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
33
34
|
marginLeft: "var(--ds-space-100, 8px)"
|
|
34
35
|
});
|
|
35
36
|
|
|
36
37
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
37
38
|
export const ResultItemSubText = styled.span({
|
|
38
|
-
|
|
39
|
+
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
39
40
|
color: N200
|
|
40
41
|
});
|
|
41
42
|
|
|
@@ -4,8 +4,8 @@ import { AnalyticsDecorator } from '@atlaskit/analytics';
|
|
|
4
4
|
import isReactElement from './isReactElement';
|
|
5
5
|
import { QS_ANALYTICS_EV_SUBMIT } from './constants';
|
|
6
6
|
export default function decorateWithAnalyticsData(WrappedQuickSearch) {
|
|
7
|
-
var
|
|
8
|
-
return
|
|
7
|
+
var _DecorateWithAnalyticsData;
|
|
8
|
+
return _DecorateWithAnalyticsData = class DecorateWithAnalyticsData extends React.Component {
|
|
9
9
|
constructor(...args) {
|
|
10
10
|
super(...args);
|
|
11
11
|
_defineProperty(this, "countChildren", () => {
|
|
@@ -22,8 +22,8 @@ export default function decorateWithAnalyticsData(WrappedQuickSearch) {
|
|
|
22
22
|
}
|
|
23
23
|
}, /*#__PURE__*/React.createElement(WrappedQuickSearch, this.props));
|
|
24
24
|
}
|
|
25
|
-
}, _defineProperty(
|
|
25
|
+
}, _defineProperty(_DecorateWithAnalyticsData, "defaultProps", {
|
|
26
26
|
children: [],
|
|
27
27
|
value: ''
|
|
28
|
-
}),
|
|
28
|
+
}), _DecorateWithAnalyticsData;
|
|
29
29
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
-
function
|
|
9
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
10
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
11
|
import React from 'react';
|
|
13
12
|
import keycode from 'keycode';
|
|
@@ -70,16 +69,14 @@ var adjustIndex = function adjustIndex(arrayLength, currentIndex, adjustment) {
|
|
|
70
69
|
return adjustedIndex >= 0 ? adjustedIndex : adjustedIndex + arrayLength;
|
|
71
70
|
};
|
|
72
71
|
export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
73
|
-
_inherits(QuickSearch, _React$Component);
|
|
74
|
-
var _super = _createSuper(QuickSearch);
|
|
75
72
|
function QuickSearch(props) {
|
|
76
73
|
var _this;
|
|
77
74
|
_classCallCheck(this, QuickSearch);
|
|
78
|
-
_this =
|
|
79
|
-
_defineProperty(
|
|
80
|
-
_defineProperty(
|
|
81
|
-
_defineProperty(
|
|
82
|
-
_defineProperty(
|
|
75
|
+
_this = _callSuper(this, QuickSearch, [props]);
|
|
76
|
+
_defineProperty(_this, "flatResults", []);
|
|
77
|
+
_defineProperty(_this, "hasSearchQueryEventFired", false);
|
|
78
|
+
_defineProperty(_this, "hasKeyDownEventFired", false);
|
|
79
|
+
_defineProperty(_this, "lastKeyPressed", '');
|
|
83
80
|
/**
|
|
84
81
|
* Uses the virtual list, this.flatResults, to move the selection across grouped results as if
|
|
85
82
|
* results were in a single, circular list.
|
|
@@ -89,7 +86,7 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
89
86
|
* 2. Increments or decrements this index by the supplied adjustment amount,
|
|
90
87
|
* 3. Sets the new selectedResultId based on the modifed index
|
|
91
88
|
*/
|
|
92
|
-
_defineProperty(
|
|
89
|
+
_defineProperty(_this, "adjustSelectedResultIndex", function (adjustment) {
|
|
93
90
|
var currentIndex = getResultIndexById(_this.flatResults, _this.state.selectedResultId);
|
|
94
91
|
var newIndex = adjustIndex(_this.flatResults.length, currentIndex, adjustment);
|
|
95
92
|
var selectedResultId = getResultIdByIndex(_this.flatResults, newIndex);
|
|
@@ -104,17 +101,17 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
104
101
|
}
|
|
105
102
|
});
|
|
106
103
|
/** Select next result */
|
|
107
|
-
_defineProperty(
|
|
104
|
+
_defineProperty(_this, "selectNext", function () {
|
|
108
105
|
_this.adjustSelectedResultIndex(+1);
|
|
109
106
|
});
|
|
110
107
|
/** Select previous result */
|
|
111
|
-
_defineProperty(
|
|
108
|
+
_defineProperty(_this, "selectPrevious", function () {
|
|
112
109
|
_this.adjustSelectedResultIndex(-1);
|
|
113
110
|
});
|
|
114
111
|
/**
|
|
115
112
|
* Callback for register results in flatResults
|
|
116
113
|
*/
|
|
117
|
-
_defineProperty(
|
|
114
|
+
_defineProperty(_this, "handleRegisterResult", function (result) {
|
|
118
115
|
if (!getResultById(_this.flatResults, result.props.resultId)) {
|
|
119
116
|
_this.flatResults.push(result);
|
|
120
117
|
}
|
|
@@ -127,7 +124,7 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
127
124
|
* 3. All ResultBase components call registerResult() in order to register itself in quick search
|
|
128
125
|
* 4. All ResultBase components call unregisterResult() in order to unregister itself in quick search
|
|
129
126
|
*/
|
|
130
|
-
_defineProperty(
|
|
127
|
+
_defineProperty(_this, "handleUnregisterResult", function (result) {
|
|
131
128
|
var resultIndex = getResultIndexById(_this.flatResults, result.props.resultId);
|
|
132
129
|
if (resultIndex !== null && +resultIndex >= 0) {
|
|
133
130
|
_this.flatResults.splice(resultIndex, 1);
|
|
@@ -137,7 +134,7 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
137
134
|
* Callback for mouseEnter events on individual results
|
|
138
135
|
* Move selection to hovered result
|
|
139
136
|
*/
|
|
140
|
-
_defineProperty(
|
|
137
|
+
_defineProperty(_this, "handleResultMouseEnter", function (resultData) {
|
|
141
138
|
_this.setState({
|
|
142
139
|
selectedResultId: resultData && resultData.resultId
|
|
143
140
|
});
|
|
@@ -146,7 +143,7 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
146
143
|
* Callback for mouseLeave events on individual results
|
|
147
144
|
* Clear result selection
|
|
148
145
|
*/
|
|
149
|
-
_defineProperty(
|
|
146
|
+
_defineProperty(_this, "handleResultMouseLeave", function () {
|
|
150
147
|
_this.setState({
|
|
151
148
|
selectedResultId: null
|
|
152
149
|
});
|
|
@@ -154,13 +151,13 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
154
151
|
/**
|
|
155
152
|
* Clear result selection when search input is blurred
|
|
156
153
|
*/
|
|
157
|
-
_defineProperty(
|
|
154
|
+
_defineProperty(_this, "handleSearchBlur", function (event) {
|
|
158
155
|
_this.props.onSearchBlur(event);
|
|
159
156
|
_this.setState({
|
|
160
157
|
selectedResultId: null
|
|
161
158
|
});
|
|
162
159
|
});
|
|
163
|
-
_defineProperty(
|
|
160
|
+
_defineProperty(_this, "onInput", function (event) {
|
|
164
161
|
var onSearchInput = _this.props.onSearchInput;
|
|
165
162
|
_this.setState({
|
|
166
163
|
value: event.currentTarget.value
|
|
@@ -176,7 +173,7 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
176
173
|
* Enter - Submit selected result
|
|
177
174
|
* Tab / ArrowRight - Accept autocomplete
|
|
178
175
|
*/
|
|
179
|
-
_defineProperty(
|
|
176
|
+
_defineProperty(_this, "handleSearchKeyDown", function (event) {
|
|
180
177
|
var firePrivateAnalyticsEvent = _this.props.firePrivateAnalyticsEvent;
|
|
181
178
|
_this.props.onSearchKeyDown(event);
|
|
182
179
|
_this.lastKeyPressed = event.key;
|
|
@@ -245,7 +242,7 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
245
242
|
}
|
|
246
243
|
}
|
|
247
244
|
});
|
|
248
|
-
_defineProperty(
|
|
245
|
+
_defineProperty(_this, "acceptAutocomplete", function (event, text) {
|
|
249
246
|
var onSearchInput = _this.props.onSearchInput;
|
|
250
247
|
var newValue = "".concat(text, " ");
|
|
251
248
|
if (_this.inputSearchRef) {
|
|
@@ -259,12 +256,12 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
259
256
|
onSearchInput(event, true);
|
|
260
257
|
}
|
|
261
258
|
});
|
|
262
|
-
_defineProperty(
|
|
259
|
+
_defineProperty(_this, "setSearchInputRef", function (refs) {
|
|
263
260
|
if (refs && refs.inputRef) {
|
|
264
261
|
_this.inputSearchRef = refs.inputRef;
|
|
265
262
|
}
|
|
266
263
|
});
|
|
267
|
-
_defineProperty(
|
|
264
|
+
_defineProperty(_this, "focusSearchInput", function () {
|
|
268
265
|
if (_this.inputSearchRef &&
|
|
269
266
|
// @ts-ignore unchecked
|
|
270
267
|
typeof _this.inputSearchRef.focus === 'function') {
|
|
@@ -290,7 +287,8 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
290
287
|
};
|
|
291
288
|
return _this;
|
|
292
289
|
}
|
|
293
|
-
|
|
290
|
+
_inherits(QuickSearch, _React$Component);
|
|
291
|
+
return _createClass(QuickSearch, [{
|
|
294
292
|
key: "componentDidMount",
|
|
295
293
|
value: function componentDidMount() {
|
|
296
294
|
var firePrivateAnalyticsEvent = this.props.firePrivateAnalyticsEvent;
|
|
@@ -380,7 +378,6 @@ export var QuickSearch = /*#__PURE__*/function (_React$Component) {
|
|
|
380
378
|
}, this.props.children)));
|
|
381
379
|
}
|
|
382
380
|
}]);
|
|
383
|
-
return QuickSearch;
|
|
384
381
|
}(React.Component);
|
|
385
382
|
|
|
386
383
|
/**
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import baseItem, { withItemClick, withItemFocus } from '@atlaskit/item';
|
|
12
12
|
import { ResultItemAfter, ResultItemAfterWrapper, ResultItemCaption, ResultItemIcon, ResultItemTextAfter, ResultItemSubText } from './styled';
|
|
13
13
|
var Item = withItemClick(withItemFocus(baseItem));
|
|
14
14
|
var ResultItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
15
|
-
_inherits(ResultItem, _React$PureComponent);
|
|
16
|
-
var _super = _createSuper(ResultItem);
|
|
17
15
|
function ResultItem() {
|
|
18
16
|
_classCallCheck(this, ResultItem);
|
|
19
|
-
return
|
|
17
|
+
return _callSuper(this, ResultItem, arguments);
|
|
20
18
|
}
|
|
21
|
-
|
|
19
|
+
_inherits(ResultItem, _React$PureComponent);
|
|
20
|
+
return _createClass(ResultItem, [{
|
|
22
21
|
key: "render",
|
|
23
22
|
value: function render() {
|
|
24
23
|
var icon = this.props.icon ? /*#__PURE__*/React.createElement(ResultItemIcon, null, this.props.icon) : null;
|
|
@@ -45,7 +44,6 @@ var ResultItem = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
45
44
|
}, interactiveWrapperProps), this.props.text, wrappedCaption);
|
|
46
45
|
}
|
|
47
46
|
}]);
|
|
48
|
-
return ResultItem;
|
|
49
47
|
}(React.PureComponent);
|
|
50
48
|
_defineProperty(ResultItem, "defaultProps", {
|
|
51
49
|
isSelected: false,
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { ItemGroup } from '@atlaskit/item';
|
|
10
10
|
import { ResultItemGroupTitle, ResultItemGroupHeader } from './styled';
|
|
11
11
|
var ResultItemGroup = /*#__PURE__*/function (_React$Component) {
|
|
12
|
-
_inherits(ResultItemGroup, _React$Component);
|
|
13
|
-
var _super = _createSuper(ResultItemGroup);
|
|
14
12
|
function ResultItemGroup() {
|
|
15
13
|
_classCallCheck(this, ResultItemGroup);
|
|
16
|
-
return
|
|
14
|
+
return _callSuper(this, ResultItemGroup, arguments);
|
|
17
15
|
}
|
|
18
|
-
|
|
16
|
+
_inherits(ResultItemGroup, _React$Component);
|
|
17
|
+
return _createClass(ResultItemGroup, [{
|
|
19
18
|
key: "render",
|
|
20
19
|
value: function render() {
|
|
21
20
|
var _this$props = this.props,
|
|
@@ -27,6 +26,5 @@ var ResultItemGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
27
26
|
}, children);
|
|
28
27
|
}
|
|
29
28
|
}]);
|
|
30
|
-
return ResultItemGroup;
|
|
31
29
|
}(React.Component);
|
|
32
30
|
export { ResultItemGroup as default };
|
|
@@ -10,9 +10,10 @@ export var ResultItemGroupHeader = styled.div({
|
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
12
12
|
export var ResultItemGroupTitle = styled.div({
|
|
13
|
-
|
|
13
|
+
font: "var(--ds-font-body-small, normal 400 11px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
14
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
14
15
|
lineHeight: '16px',
|
|
15
|
-
fontWeight: 600
|
|
16
|
+
fontWeight: "var(--ds-font-weight-semibold, 600)"
|
|
16
17
|
});
|
|
17
18
|
|
|
18
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
@@ -31,13 +32,13 @@ export var ResultItemAfterWrapper = styled.div({
|
|
|
31
32
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
32
33
|
export var ResultItemCaption = styled.span({
|
|
33
34
|
color: N200,
|
|
34
|
-
|
|
35
|
+
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
35
36
|
marginLeft: "var(--ds-space-100, 8px)"
|
|
36
37
|
});
|
|
37
38
|
|
|
38
39
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
39
40
|
export var ResultItemSubText = styled.span({
|
|
40
|
-
|
|
41
|
+
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
41
42
|
color: N200
|
|
42
43
|
});
|
|
43
44
|
|
|
@@ -2,13 +2,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
9
|
var _excluded = ["name", "isPrivate", "type", "subText"];
|
|
11
|
-
function
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
12
|
import React from 'react';
|
|
14
13
|
import Avatar from '@atlaskit/avatar';
|
|
@@ -17,16 +16,14 @@ import ResultBase from './ResultBase';
|
|
|
17
16
|
* Generic result type for Atlassian containers.
|
|
18
17
|
*/
|
|
19
18
|
var ContainerResult = /*#__PURE__*/function (_React$PureComponent) {
|
|
20
|
-
_inherits(ContainerResult, _React$PureComponent);
|
|
21
|
-
var _super = _createSuper(ContainerResult);
|
|
22
19
|
function ContainerResult() {
|
|
23
20
|
var _this;
|
|
24
21
|
_classCallCheck(this, ContainerResult);
|
|
25
22
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
23
|
args[_key] = arguments[_key];
|
|
27
24
|
}
|
|
28
|
-
_this =
|
|
29
|
-
_defineProperty(
|
|
25
|
+
_this = _callSuper(this, ContainerResult, [].concat(args));
|
|
26
|
+
_defineProperty(_this, "getAvatar", function () {
|
|
30
27
|
if (_this.props.avatar) {
|
|
31
28
|
return _this.props.avatar;
|
|
32
29
|
}
|
|
@@ -40,7 +37,8 @@ var ContainerResult = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
40
37
|
});
|
|
41
38
|
return _this;
|
|
42
39
|
}
|
|
43
|
-
|
|
40
|
+
_inherits(ContainerResult, _React$PureComponent);
|
|
41
|
+
return _createClass(ContainerResult, [{
|
|
44
42
|
key: "render",
|
|
45
43
|
value: function render() {
|
|
46
44
|
var _this$props = this.props,
|
|
@@ -58,6 +56,5 @@ var ContainerResult = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
58
56
|
}));
|
|
59
57
|
}
|
|
60
58
|
}]);
|
|
61
|
-
return ContainerResult;
|
|
62
59
|
}(React.PureComponent);
|
|
63
60
|
export { ContainerResult as default };
|
|
@@ -2,13 +2,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
9
|
var _excluded = ["name", "containerName", "isPrivate", "objectKey", "type"];
|
|
11
|
-
function
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
12
|
import React from 'react';
|
|
14
13
|
import Avatar from '@atlaskit/avatar';
|
|
@@ -17,16 +16,14 @@ import ResultBase from './ResultBase';
|
|
|
17
16
|
* Generic result type for Atlassian objects.
|
|
18
17
|
*/
|
|
19
18
|
var ObjectResult = /*#__PURE__*/function (_React$PureComponent) {
|
|
20
|
-
_inherits(ObjectResult, _React$PureComponent);
|
|
21
|
-
var _super = _createSuper(ObjectResult);
|
|
22
19
|
function ObjectResult() {
|
|
23
20
|
var _this;
|
|
24
21
|
_classCallCheck(this, ObjectResult);
|
|
25
22
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
23
|
args[_key] = arguments[_key];
|
|
27
24
|
}
|
|
28
|
-
_this =
|
|
29
|
-
_defineProperty(
|
|
25
|
+
_this = _callSuper(this, ObjectResult, [].concat(args));
|
|
26
|
+
_defineProperty(_this, "getAvatar", function () {
|
|
30
27
|
if (_this.props.avatar) {
|
|
31
28
|
return _this.props.avatar;
|
|
32
29
|
}
|
|
@@ -41,7 +38,8 @@ var ObjectResult = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
41
38
|
});
|
|
42
39
|
return _this;
|
|
43
40
|
}
|
|
44
|
-
|
|
41
|
+
_inherits(ObjectResult, _React$PureComponent);
|
|
42
|
+
return _createClass(ObjectResult, [{
|
|
45
43
|
key: "getSubtext",
|
|
46
44
|
value: function getSubtext() {
|
|
47
45
|
var _this$props = this.props,
|
|
@@ -71,6 +69,5 @@ var ObjectResult = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
71
69
|
}));
|
|
72
70
|
}
|
|
73
71
|
}]);
|
|
74
|
-
return ObjectResult;
|
|
75
72
|
}(React.PureComponent);
|
|
76
73
|
export { ObjectResult as default };
|
|
@@ -2,31 +2,28 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
9
|
var _excluded = ["name", "mentionName", "mentionPrefix", "presenceMessage", "presenceState", "type"];
|
|
11
|
-
function
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
12
|
import React from 'react';
|
|
14
13
|
import Avatar from '@atlaskit/avatar';
|
|
15
14
|
import ResultBase from './ResultBase';
|
|
16
15
|
var PersonResult = /*#__PURE__*/function (_React$PureComponent) {
|
|
17
|
-
_inherits(PersonResult, _React$PureComponent);
|
|
18
|
-
var _super = _createSuper(PersonResult);
|
|
19
16
|
function PersonResult() {
|
|
20
17
|
var _this;
|
|
21
18
|
_classCallCheck(this, PersonResult);
|
|
22
19
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
20
|
args[_key] = arguments[_key];
|
|
24
21
|
}
|
|
25
|
-
_this =
|
|
26
|
-
_defineProperty(
|
|
22
|
+
_this = _callSuper(this, PersonResult, [].concat(args));
|
|
23
|
+
_defineProperty(_this, "getMention", function () {
|
|
27
24
|
return _this.props.mentionName ? "".concat(_this.props.mentionPrefix).concat(_this.props.mentionName) : undefined;
|
|
28
25
|
});
|
|
29
|
-
_defineProperty(
|
|
26
|
+
_defineProperty(_this, "getAvatar", function () {
|
|
30
27
|
if (_this.props.avatar) {
|
|
31
28
|
return _this.props.avatar;
|
|
32
29
|
}
|
|
@@ -38,7 +35,8 @@ var PersonResult = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
38
35
|
});
|
|
39
36
|
return _this;
|
|
40
37
|
}
|
|
41
|
-
|
|
38
|
+
_inherits(PersonResult, _React$PureComponent);
|
|
39
|
+
return _createClass(PersonResult, [{
|
|
42
40
|
key: "render",
|
|
43
41
|
value: function render() {
|
|
44
42
|
var _this$props = this.props,
|
|
@@ -59,7 +57,6 @@ var PersonResult = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
59
57
|
}));
|
|
60
58
|
}
|
|
61
59
|
}]);
|
|
62
|
-
return PersonResult;
|
|
63
60
|
}(React.PureComponent);
|
|
64
61
|
_defineProperty(PersonResult, "defaultProps", {
|
|
65
62
|
mentionPrefix: '@',
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
-
function
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
12
|
import React from 'react';
|
|
14
13
|
import { QS_ANALYTICS_EV_SUBMIT } from '../constants';
|
|
@@ -19,19 +18,17 @@ import { ResultContext, SelectedResultIdContext } from '../context';
|
|
|
19
18
|
// when you don't pass it. There doesn't seem to be a better way of declaring optional default props.
|
|
20
19
|
|
|
21
20
|
export var ResultBase = /*#__PURE__*/function (_React$PureComponent) {
|
|
22
|
-
_inherits(ResultBase, _React$PureComponent);
|
|
23
|
-
var _super = _createSuper(ResultBase);
|
|
24
21
|
function ResultBase() {
|
|
25
22
|
var _this;
|
|
26
23
|
_classCallCheck(this, ResultBase);
|
|
27
24
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
25
|
args[_key] = arguments[_key];
|
|
29
26
|
}
|
|
30
|
-
_this =
|
|
31
|
-
_defineProperty(
|
|
27
|
+
_this = _callSuper(this, ResultBase, [].concat(args));
|
|
28
|
+
_defineProperty(_this, "state", {
|
|
32
29
|
isMouseSelected: false
|
|
33
30
|
});
|
|
34
|
-
_defineProperty(
|
|
31
|
+
_defineProperty(_this, "handleClick", function (e) {
|
|
35
32
|
var _this$props = _this.props,
|
|
36
33
|
onClick = _this$props.onClick,
|
|
37
34
|
resultId = _this$props.resultId,
|
|
@@ -51,7 +48,7 @@ export var ResultBase = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
51
48
|
});
|
|
52
49
|
}
|
|
53
50
|
});
|
|
54
|
-
_defineProperty(
|
|
51
|
+
_defineProperty(_this, "handleMouseEnter", function (event) {
|
|
55
52
|
_this.props.context.onMouseEnter({
|
|
56
53
|
resultId: _this.props.resultId,
|
|
57
54
|
type: _this.props.type,
|
|
@@ -61,7 +58,7 @@ export var ResultBase = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
61
58
|
isMouseSelected: true
|
|
62
59
|
});
|
|
63
60
|
});
|
|
64
|
-
_defineProperty(
|
|
61
|
+
_defineProperty(_this, "handleMouseLeave", function () {
|
|
65
62
|
_this.props.context.onMouseLeave();
|
|
66
63
|
_this.setState({
|
|
67
64
|
isMouseSelected: false
|
|
@@ -69,7 +66,8 @@ export var ResultBase = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
69
66
|
});
|
|
70
67
|
return _this;
|
|
71
68
|
}
|
|
72
|
-
|
|
69
|
+
_inherits(ResultBase, _React$PureComponent);
|
|
70
|
+
return _createClass(ResultBase, [{
|
|
73
71
|
key: "registerResult",
|
|
74
72
|
value: function registerResult() {
|
|
75
73
|
var context = this.props.context;
|
|
@@ -144,7 +142,6 @@ export var ResultBase = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
144
142
|
});
|
|
145
143
|
}
|
|
146
144
|
}]);
|
|
147
|
-
return ResultBase;
|
|
148
145
|
}(React.PureComponent);
|
|
149
146
|
_defineProperty(ResultBase, "defaultProps", {
|
|
150
147
|
type: 'base',
|