@jetbrains/ring-ui-built 7.0.27 → 7.0.29
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/components/_helpers/_rollupPluginBabelHelpers.js +1 -1
- package/components/_helpers/card.js +5 -5
- package/components/_helpers/input.js +7 -7
- package/components/_helpers/select__filter.js +2 -2
- package/components/_helpers/sidebar.js +2 -2
- package/components/alert/alert.js +2 -2
- package/components/alert-service/alert-service.js +2 -2
- package/components/analytics/analytics.js +1 -1
- package/components/analytics/analytics__custom-plugin.js +8 -8
- package/components/auth/auth__core.js +54 -54
- package/components/auth/background-flow.js +4 -4
- package/components/auth/iframe-flow.js +7 -7
- package/components/auth/request-builder.js +3 -3
- package/components/auth/response-parser.js +4 -4
- package/components/auth/storage.js +12 -12
- package/components/auth/token-validator.js +7 -7
- package/components/auth/window-flow.js +7 -7
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/avatar-stack/avatar-stack.js +8 -9
- package/components/button/button.js +2 -2
- package/components/caret/caret.js +7 -7
- package/components/checkbox/checkbox.js +1 -1
- package/components/clipboard/clipboard-fallback.js +3 -3
- package/components/code/code.js +1 -1
- package/components/collapse/collapse-content.js +2 -2
- package/components/collapse/collapse.js +1 -1
- package/components/data-list/data-list.js +3 -3
- package/components/data-list/item.js +1 -1
- package/components/date-picker/consts.js +1 -1
- package/components/date-picker/date-input.js +5 -5
- package/components/date-picker/date-picker.js +9 -9
- package/components/date-picker/date-popup.js +4 -4
- package/components/date-picker/years.js +1 -1
- package/components/dialog/dialog.js +1 -1
- package/components/dropdown/dropdown.js +4 -4
- package/components/dropdown-menu/dropdown-menu.js +6 -7
- package/components/editable-heading/editable-heading.js +4 -4
- package/components/global/focus-sensor-hoc.js +10 -10
- package/components/global/memoize.js +1 -1
- package/components/global/normalize-indent.js +1 -1
- package/components/global/react-dom-renderer.js +1 -1
- package/components/global/schedule-raf.js +1 -1
- package/components/header/header.js +5 -6
- package/components/header/profile.js +11 -12
- package/components/header/smart-profile.js +5 -6
- package/components/header/smart-services.js +4 -4
- package/components/http/http.js +9 -9
- package/components/http/http.mock.js +3 -3
- package/components/hub-source/hub-source.js +6 -6
- package/components/hub-source/hub-source__user.js +2 -2
- package/components/hub-source/hub-source__users-groups.js +4 -4
- package/components/i18n/i18n.js +1 -1
- package/components/island/adaptive-island-hoc.js +1 -1
- package/components/island/content.js +3 -3
- package/components/island/header.js +1 -1
- package/components/list/list.js +8 -12
- package/components/list/list__item.js +83 -59
- package/components/list/list__users-groups-source.js +8 -9
- package/components/loader/loader.js +2 -2
- package/components/loader/loader__core.js +27 -27
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/message/message.js +8 -8
- package/components/old-browsers-message/white-list.js +1 -1
- package/components/pager/pager.js +13 -14
- package/components/permissions/permissions.js +7 -7
- package/components/permissions/permissions__cache.js +4 -4
- package/components/popup/popup.js +8 -8
- package/components/popup/position.js +1 -1
- package/components/popup-menu/popup-menu.js +7 -8
- package/components/progress-bar/progress-bar.js +2 -2
- package/components/query-assist/query-assist.js +55 -54
- package/components/query-assist/query-assist__suggestions.js +6 -7
- package/components/radio/radio__item.js +2 -2
- package/components/select/select.js +32 -33
- package/components/select/select__filter.js +5 -6
- package/components/select/select__popup.js +15 -16
- package/components/shortcuts/core.js +1 -1
- package/components/slider/slider.js +8 -8
- package/components/slider/slider.utils.js +1 -1
- package/components/storage/storage__local.js +1 -1
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +4 -4
- package/components/table/header-cell.js +2 -2
- package/components/table/multitable.js +7 -7
- package/components/table/row-with-focus-sensor.js +4 -4
- package/components/table/row.js +1 -1
- package/components/table/selection-shortcuts-hoc.js +12 -12
- package/components/table/selection.js +7 -7
- package/components/table/table.js +1 -1
- package/components/tabs/collapsible-more.js +6 -7
- package/components/tabs/collapsible-tab.js +3 -3
- package/components/tabs/collapsible-tabs.js +10 -11
- package/components/tabs/dumb-tabs.js +4 -5
- package/components/tabs/smart-tabs.js +4 -5
- package/components/tabs/tabs.js +3 -4
- package/components/tag/tag.js +2 -2
- package/components/tags-input/tags-input.js +22 -23
- package/components/tooltip/tooltip.js +8 -8
- package/components/upload/upload.js +3 -3
- package/components/user-agreement/service.js +3 -3
- package/components/user-agreement/user-agreement.js +8 -8
- package/package.json +2 -2
- package/components/list/list__link.d.ts +0 -9
- package/components/list/list__link.js +0 -52
@@ -49,14 +49,14 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(_ref, ref) {
|
|
49
49
|
focusFirst();
|
50
50
|
} else if (!trapDisabled) {
|
51
51
|
var _nodeRef$current, _nodeRef$current2;
|
52
|
-
const previousFocusedElementIsInContainer = previousFocusedNodeRef.current && ((_nodeRef$current = nodeRef.current) === null || _nodeRef$current ===
|
52
|
+
const previousFocusedElementIsInContainer = previousFocusedNodeRef.current && ((_nodeRef$current = nodeRef.current) === null || _nodeRef$current === void 0 ? void 0 : _nodeRef$current.contains(previousFocusedNodeRef.current));
|
53
53
|
// The component wrapped in TabTrap can already have a focused element (e.g. Date Picker),
|
54
54
|
// so we need to check if it does. If so, we don't need to focus anything.
|
55
|
-
const currentlyFocusedElementIsInContainer = (_nodeRef$current2 = nodeRef.current) === null || _nodeRef$current2 ===
|
55
|
+
const currentlyFocusedElementIsInContainer = (_nodeRef$current2 = nodeRef.current) === null || _nodeRef$current2 === void 0 ? void 0 : _nodeRef$current2.contains(document.activeElement);
|
56
56
|
if (!nodeRef.current || !previousFocusedElementIsInContainer && !currentlyFocusedElementIsInContainer) {
|
57
57
|
var _trapButtonNodeRef$cu;
|
58
58
|
trapWithoutFocusRef.current = true;
|
59
|
-
(_trapButtonNodeRef$cu = trapButtonNodeRef.current) === null || _trapButtonNodeRef$cu ===
|
59
|
+
(_trapButtonNodeRef$cu = trapButtonNodeRef.current) === null || _trapButtonNodeRef$cu === void 0 || _trapButtonNodeRef$cu.focus();
|
60
60
|
}
|
61
61
|
}
|
62
62
|
return () => {
|
@@ -112,7 +112,7 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(_ref, ref) {
|
|
112
112
|
if (!newFocused) {
|
113
113
|
return;
|
114
114
|
}
|
115
|
-
if (newFocused instanceof Element && (_nodeRef$current3 = nodeRef.current) !== null && _nodeRef$current3 !==
|
115
|
+
if (newFocused instanceof Element && (_nodeRef$current3 = nodeRef.current) !== null && _nodeRef$current3 !== void 0 && _nodeRef$current3.contains(newFocused)) {
|
116
116
|
return;
|
117
117
|
}
|
118
118
|
focusLast();
|
@@ -21,8 +21,8 @@ const _excluded = ["className", "column", "onSort", "sortKey", "sortOrder", "dat
|
|
21
21
|
class HeaderCell extends PureComponent {
|
22
22
|
constructor() {
|
23
23
|
super(...arguments);
|
24
|
-
_defineProperty(this, "sortable",
|
25
|
-
_defineProperty(this, "sorted",
|
24
|
+
_defineProperty(this, "sortable", void 0);
|
25
|
+
_defineProperty(this, "sorted", void 0);
|
26
26
|
_defineProperty(this, "onClick", () => {
|
27
27
|
if (this.sortable) {
|
28
28
|
const {
|
@@ -24,14 +24,14 @@ class MultiTable extends PureComponent {
|
|
24
24
|
let newSelection = currentTable.selection.moveUp();
|
25
25
|
if (newSelection) {
|
26
26
|
var _currentTable$onSelec;
|
27
|
-
(_currentTable$onSelec = currentTable.onSelect) === null || _currentTable$onSelec ===
|
27
|
+
(_currentTable$onSelec = currentTable.onSelect) === null || _currentTable$onSelec === void 0 || _currentTable$onSelec.call(currentTable, newSelection);
|
28
28
|
} else if (prevTable) {
|
29
29
|
var _currentTable$onSelec2;
|
30
|
-
(_currentTable$onSelec2 = currentTable.onSelect) === null || _currentTable$onSelec2 ===
|
30
|
+
(_currentTable$onSelec2 = currentTable.onSelect) === null || _currentTable$onSelec2 === void 0 || _currentTable$onSelec2.call(currentTable, currentTable.selection.resetFocus());
|
31
31
|
newSelection = prevTable.selection.moveUp();
|
32
32
|
if (newSelection) {
|
33
33
|
var _prevTable$onSelect;
|
34
|
-
(_prevTable$onSelect = prevTable.onSelect) === null || _prevTable$onSelect ===
|
34
|
+
(_prevTable$onSelect = prevTable.onSelect) === null || _prevTable$onSelect === void 0 || _prevTable$onSelect.call(prevTable, newSelection);
|
35
35
|
}
|
36
36
|
}
|
37
37
|
return false;
|
@@ -53,14 +53,14 @@ class MultiTable extends PureComponent {
|
|
53
53
|
let newSelection = currentTable.selection.moveDown();
|
54
54
|
if (newSelection) {
|
55
55
|
var _currentTable$onSelec3;
|
56
|
-
(_currentTable$onSelec3 = currentTable.onSelect) === null || _currentTable$onSelec3 ===
|
56
|
+
(_currentTable$onSelec3 = currentTable.onSelect) === null || _currentTable$onSelec3 === void 0 || _currentTable$onSelec3.call(currentTable, newSelection);
|
57
57
|
} else if (nextTable) {
|
58
58
|
var _currentTable$onSelec4;
|
59
|
-
(_currentTable$onSelec4 = currentTable.onSelect) === null || _currentTable$onSelec4 ===
|
59
|
+
(_currentTable$onSelec4 = currentTable.onSelect) === null || _currentTable$onSelec4 === void 0 || _currentTable$onSelec4.call(currentTable, currentTable.selection.resetFocus());
|
60
60
|
newSelection = nextTable.selection.moveDown();
|
61
61
|
if (newSelection) {
|
62
62
|
var _nextTable$onSelect;
|
63
|
-
(_nextTable$onSelect = nextTable.onSelect) === null || _nextTable$onSelect ===
|
63
|
+
(_nextTable$onSelect = nextTable.onSelect) === null || _nextTable$onSelect === void 0 || _nextTable$onSelect.call(nextTable, newSelection);
|
64
64
|
}
|
65
65
|
}
|
66
66
|
return false;
|
@@ -111,7 +111,7 @@ class MultiTable extends PureComponent {
|
|
111
111
|
const currentFocused = currentSelections.filter(selection => selection.getFocused());
|
112
112
|
if (currentFocused.includes(prevFocused)) {
|
113
113
|
var _prevProps$children$p, _prevProps$children$p2;
|
114
|
-
(_prevProps$children$p = (_prevProps$children$p2 = prevProps.children[prevFocusedIndex].props).onSelect) === null || _prevProps$children$p ===
|
114
|
+
(_prevProps$children$p = (_prevProps$children$p2 = prevProps.children[prevFocusedIndex].props).onSelect) === null || _prevProps$children$p === void 0 || _prevProps$children$p.call(_prevProps$children$p2, prevFocused.resetFocus());
|
115
115
|
}
|
116
116
|
}
|
117
117
|
}
|
@@ -62,19 +62,19 @@ class RowWithFocusSensorCallbacks extends PureComponent {
|
|
62
62
|
_defineProperty(this, "RowWithFocusSensor", getContainer());
|
63
63
|
_defineProperty(this, "onFocus", () => {
|
64
64
|
var _this$props$onFocus, _this$props;
|
65
|
-
(_this$props$onFocus = (_this$props = this.props).onFocus) === null || _this$props$onFocus ===
|
65
|
+
(_this$props$onFocus = (_this$props = this.props).onFocus) === null || _this$props$onFocus === void 0 || _this$props$onFocus.call(_this$props, this.props.item);
|
66
66
|
});
|
67
67
|
_defineProperty(this, "onSelect", (item, selected) => {
|
68
68
|
var _this$props$onSelect, _this$props2;
|
69
|
-
(_this$props$onSelect = (_this$props2 = this.props).onSelect) === null || _this$props$onSelect ===
|
69
|
+
(_this$props$onSelect = (_this$props2 = this.props).onSelect) === null || _this$props$onSelect === void 0 || _this$props$onSelect.call(_this$props2, item, selected);
|
70
70
|
});
|
71
71
|
_defineProperty(this, "onCollapse", () => {
|
72
72
|
var _this$props$onCollaps, _this$props3;
|
73
|
-
(_this$props$onCollaps = (_this$props3 = this.props).onCollapse) === null || _this$props$onCollaps ===
|
73
|
+
(_this$props$onCollaps = (_this$props3 = this.props).onCollapse) === null || _this$props$onCollaps === void 0 || _this$props$onCollaps.call(_this$props3, this.props.item);
|
74
74
|
});
|
75
75
|
_defineProperty(this, "onExpand", () => {
|
76
76
|
var _this$props$onExpand, _this$props4;
|
77
|
-
(_this$props$onExpand = (_this$props4 = this.props).onExpand) === null || _this$props$onExpand ===
|
77
|
+
(_this$props$onExpand = (_this$props4 = this.props).onExpand) === null || _this$props$onExpand === void 0 || _this$props$onExpand.call(_this$props4, this.props.item);
|
78
78
|
});
|
79
79
|
}
|
80
80
|
render() {
|
package/components/table/row.js
CHANGED
@@ -100,7 +100,7 @@ class Row extends PureComponent {
|
|
100
100
|
} = this.props;
|
101
101
|
this.props.onDoubleClick(item);
|
102
102
|
});
|
103
|
-
_defineProperty(this, "row",
|
103
|
+
_defineProperty(this, "row", void 0);
|
104
104
|
_defineProperty(this, "rowRef", el => {
|
105
105
|
this.row = el;
|
106
106
|
});
|
@@ -15,7 +15,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
15
15
|
} = this.props;
|
16
16
|
const newSelection = selection.moveUp();
|
17
17
|
if (newSelection) {
|
18
|
-
onSelect === null || onSelect ===
|
18
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
19
19
|
}
|
20
20
|
return false;
|
21
21
|
});
|
@@ -26,11 +26,11 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
26
26
|
} = this.props;
|
27
27
|
const newSelection = selection.moveDown();
|
28
28
|
if (newSelection) {
|
29
|
-
onSelect === null || onSelect ===
|
29
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
30
30
|
}
|
31
31
|
return false;
|
32
32
|
});
|
33
|
-
_defineProperty(this, "shiftSelectionMode",
|
33
|
+
_defineProperty(this, "shiftSelectionMode", void 0);
|
34
34
|
_defineProperty(this, "onShiftKeyDown", () => {
|
35
35
|
const {
|
36
36
|
selection
|
@@ -61,9 +61,9 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
61
61
|
const newSelection = this.shiftSelect(selection);
|
62
62
|
const newMovedSelection = newSelection.moveUp();
|
63
63
|
if (newMovedSelection) {
|
64
|
-
onSelect === null || onSelect ===
|
64
|
+
onSelect === null || onSelect === void 0 || onSelect(newMovedSelection);
|
65
65
|
} else {
|
66
|
-
onSelect === null || onSelect ===
|
66
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
67
67
|
}
|
68
68
|
});
|
69
69
|
_defineProperty(this, "onShiftDownPress", e => {
|
@@ -79,9 +79,9 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
79
79
|
const newSelection = this.shiftSelect(selection);
|
80
80
|
const newMovedSelection = newSelection.moveDown();
|
81
81
|
if (newMovedSelection) {
|
82
|
-
onSelect === null || onSelect ===
|
82
|
+
onSelect === null || onSelect === void 0 || onSelect(newMovedSelection);
|
83
83
|
} else {
|
84
|
-
onSelect === null || onSelect ===
|
84
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
85
85
|
}
|
86
86
|
});
|
87
87
|
_defineProperty(this, "onHomePress", () => {
|
@@ -91,7 +91,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
91
91
|
} = this.props;
|
92
92
|
const newSelection = selection.moveStart();
|
93
93
|
if (newSelection) {
|
94
|
-
onSelect === null || onSelect ===
|
94
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
95
95
|
}
|
96
96
|
return false;
|
97
97
|
});
|
@@ -102,7 +102,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
102
102
|
} = this.props;
|
103
103
|
const newSelection = selection.moveEnd();
|
104
104
|
if (newSelection) {
|
105
|
-
onSelect === null || onSelect ===
|
105
|
+
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
106
106
|
}
|
107
107
|
return false;
|
108
108
|
});
|
@@ -115,7 +115,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
115
115
|
if (!selectable) {
|
116
116
|
return true;
|
117
117
|
}
|
118
|
-
onSelect === null || onSelect ===
|
118
|
+
onSelect === null || onSelect === void 0 || onSelect(selection.toggleSelection());
|
119
119
|
return false;
|
120
120
|
});
|
121
121
|
_defineProperty(this, "onEscPress", () => {
|
@@ -123,7 +123,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
123
123
|
selection,
|
124
124
|
onSelect
|
125
125
|
} = this.props;
|
126
|
-
onSelect === null || onSelect ===
|
126
|
+
onSelect === null || onSelect === void 0 || onSelect(selection.reset());
|
127
127
|
//this.restoreFocusWithoutScroll();
|
128
128
|
});
|
129
129
|
_defineProperty(this, "onCmdAPress", () => {
|
@@ -135,7 +135,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
135
135
|
if (!selectable) {
|
136
136
|
return true;
|
137
137
|
}
|
138
|
-
onSelect === null || onSelect ===
|
138
|
+
onSelect === null || onSelect === void 0 || onSelect(selection.selectAll());
|
139
139
|
return false;
|
140
140
|
});
|
141
141
|
_defineProperty(this, "shortcutsMap", {
|
@@ -11,13 +11,13 @@ let Selection$1 = class Selection {
|
|
11
11
|
getChildren = () => [],
|
12
12
|
isItemSelectable = () => true
|
13
13
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
14
|
-
_defineProperty(this, "_rawData",
|
15
|
-
_defineProperty(this, "_getChildren",
|
16
|
-
_defineProperty(this, "_data",
|
17
|
-
_defineProperty(this, "_selected",
|
18
|
-
_defineProperty(this, "_focused",
|
19
|
-
_defineProperty(this, "_getKey",
|
20
|
-
_defineProperty(this, "_isItemSelectable",
|
14
|
+
_defineProperty(this, "_rawData", void 0);
|
15
|
+
_defineProperty(this, "_getChildren", void 0);
|
16
|
+
_defineProperty(this, "_data", void 0);
|
17
|
+
_defineProperty(this, "_selected", void 0);
|
18
|
+
_defineProperty(this, "_focused", void 0);
|
19
|
+
_defineProperty(this, "_getKey", void 0);
|
20
|
+
_defineProperty(this, "_isItemSelectable", void 0);
|
21
21
|
this._rawData = data;
|
22
22
|
this._getChildren = getChildren;
|
23
23
|
this._data = this._buildData(data);
|
@@ -296,7 +296,7 @@ class Table extends PureComponent {
|
|
296
296
|
columns: columns,
|
297
297
|
"data-test": getItemDataTest(value)
|
298
298
|
}, restProps), {}, {
|
299
|
-
key: (_restProps$key = restProps.key) !== null && _restProps$key !==
|
299
|
+
key: (_restProps$key = restProps.key) !== null && _restProps$key !== void 0 ? _restProps$key : getItemKey(value)
|
300
300
|
}));
|
301
301
|
return isDragged ? jsx("table", {
|
302
302
|
style: _objectSpread2({}, props.style),
|
@@ -44,13 +44,6 @@ import 'memoize-one';
|
|
44
44
|
import '../global/memoize.js';
|
45
45
|
import 'core-js/modules/es.weak-map.js';
|
46
46
|
import '../global/create-stateful-context.js';
|
47
|
-
import '../list/list__link.js';
|
48
|
-
import '../link/link.js';
|
49
|
-
import '../link/clickableLink.js';
|
50
|
-
import '../_helpers/link.js';
|
51
|
-
import '../list/list__classes.js';
|
52
|
-
import '../list/consts.js';
|
53
|
-
import '../_helpers/list.js';
|
54
47
|
import '../list/list__item.js';
|
55
48
|
import '../avatar/avatar.js';
|
56
49
|
import '../global/url.js';
|
@@ -66,6 +59,12 @@ import '../_helpers/icon__svg.js';
|
|
66
59
|
import 'core-js/modules/es.string.starts-with.js';
|
67
60
|
import '../global/composeRefs.js';
|
68
61
|
import '../control-help/control-help.js';
|
62
|
+
import '../link/link.js';
|
63
|
+
import '../link/clickableLink.js';
|
64
|
+
import '../_helpers/link.js';
|
65
|
+
import '../_helpers/list.js';
|
66
|
+
import '../list/consts.js';
|
67
|
+
import '../list/list__classes.js';
|
69
68
|
import '../list/list__custom.js';
|
70
69
|
import '../global/get-event-key.js';
|
71
70
|
import '../list/list__title.js';
|
@@ -35,9 +35,9 @@ const TabTitle = /*#__PURE__*/React.memo(function TabTitle(_ref) {
|
|
35
35
|
const titleClasses = classNames(styles.title, className, {
|
36
36
|
[styles.selected]: selected,
|
37
37
|
[styles.collapsed]: collapsed,
|
38
|
-
[activeClassName !== null && activeClassName !==
|
39
|
-
[collapsedClassName !== null && collapsedClassName !==
|
40
|
-
[collapsedActiveClassName !== null && collapsedActiveClassName !==
|
38
|
+
[activeClassName !== null && activeClassName !== void 0 ? activeClassName : '']: selected,
|
39
|
+
[collapsedClassName !== null && collapsedClassName !== void 0 ? collapsedClassName : '']: collapsed,
|
40
|
+
[collapsedActiveClassName !== null && collapsedActiveClassName !== void 0 ? collapsedActiveClassName : '']: collapsed && selected
|
41
41
|
});
|
42
42
|
return jsx(TabLink, _objectSpread2({
|
43
43
|
title: title,
|
@@ -46,10 +46,6 @@ import 'memoize-one';
|
|
46
46
|
import '../global/memoize.js';
|
47
47
|
import 'core-js/modules/es.weak-map.js';
|
48
48
|
import '../global/create-stateful-context.js';
|
49
|
-
import '../list/list__link.js';
|
50
|
-
import '../list/list__classes.js';
|
51
|
-
import '../list/consts.js';
|
52
|
-
import '../_helpers/list.js';
|
53
49
|
import '../list/list__item.js';
|
54
50
|
import '../avatar/avatar.js';
|
55
51
|
import '../global/url.js';
|
@@ -65,6 +61,9 @@ import '../_helpers/icon__svg.js';
|
|
65
61
|
import 'core-js/modules/es.string.starts-with.js';
|
66
62
|
import '../global/composeRefs.js';
|
67
63
|
import '../control-help/control-help.js';
|
64
|
+
import '../_helpers/list.js';
|
65
|
+
import '../list/consts.js';
|
66
|
+
import '../list/list__classes.js';
|
68
67
|
import '../list/list__custom.js';
|
69
68
|
import '../global/get-event-key.js';
|
70
69
|
import '../list/list__title.js';
|
@@ -111,7 +110,7 @@ const CollapsibleTabs = _ref => {
|
|
111
110
|
const measureRef = useRef(null);
|
112
111
|
const selectedIndex = useMemo(() => {
|
113
112
|
var _children$filter$find;
|
114
|
-
return (_children$filter$find = children.filter(tab => tab.props.alwaysHidden !== true).findIndex(tab => tab.props.id === selected)) !== null && _children$filter$find !==
|
113
|
+
return (_children$filter$find = children.filter(tab => tab.props.alwaysHidden !== true).findIndex(tab => tab.props.id === selected)) !== null && _children$filter$find !== void 0 ? _children$filter$find : null;
|
115
114
|
}, [children, selected]);
|
116
115
|
const visibleElements = useMemo(() => {
|
117
116
|
let items;
|
@@ -143,7 +142,7 @@ const CollapsibleTabs = _ref => {
|
|
143
142
|
} = elements.sizes;
|
144
143
|
let renderMore = children.some(tab => tab.props.alwaysHidden);
|
145
144
|
const tabsToRender = [];
|
146
|
-
let filledWidth = renderMore ? more !== null && more !==
|
145
|
+
let filledWidth = renderMore ? more !== null && more !== void 0 ? more : 0 : 0;
|
147
146
|
for (let i = 0; i < tabsSizes.length; i++) {
|
148
147
|
if (filledWidth + tabsSizes[i] < containerWidth + MEASURE_TOLERANCE) {
|
149
148
|
filledWidth += tabsSizes[i];
|
@@ -179,7 +178,7 @@ const CollapsibleTabs = _ref => {
|
|
179
178
|
const newLastVisibleIndex = tabsToRender.length - 1;
|
180
179
|
if (elements.lastVisibleIndex !== newLastVisibleIndex) {
|
181
180
|
setLastVisibleIndex(newLastVisibleIndex);
|
182
|
-
onLastVisibleIndexChange === null || onLastVisibleIndexChange ===
|
181
|
+
onLastVisibleIndexChange === null || onLastVisibleIndexChange === void 0 || onLastVisibleIndexChange(newLastVisibleIndex);
|
183
182
|
}
|
184
183
|
}, [children, elements.lastVisibleIndex, elements.sizes, onLastVisibleIndexChange, selectedIndex]);
|
185
184
|
// Prepare list of visible and hidden elements
|
@@ -188,7 +187,7 @@ const CollapsibleTabs = _ref => {
|
|
188
187
|
var _elements$lastVisible2;
|
189
188
|
const res = children.reduce((accumulator, tab) => {
|
190
189
|
var _elements$lastVisible;
|
191
|
-
if (tab.props.alwaysHidden !== true && accumulator.visible.length - 1 < ((_elements$lastVisible = elements.lastVisibleIndex) !== null && _elements$lastVisible !==
|
190
|
+
if (tab.props.alwaysHidden !== true && accumulator.visible.length - 1 < ((_elements$lastVisible = elements.lastVisibleIndex) !== null && _elements$lastVisible !== void 0 ? _elements$lastVisible : 0)) {
|
192
191
|
accumulator.visible.push(tab);
|
193
192
|
} else {
|
194
193
|
accumulator.hidden.push(tab);
|
@@ -199,7 +198,7 @@ const CollapsibleTabs = _ref => {
|
|
199
198
|
hidden: [],
|
200
199
|
ready: elements.lastVisibleIndex !== null
|
201
200
|
});
|
202
|
-
if (selectedIndex > ((_elements$lastVisible2 = elements.lastVisibleIndex) !== null && _elements$lastVisible2 !==
|
201
|
+
if (selectedIndex > ((_elements$lastVisible2 = elements.lastVisibleIndex) !== null && _elements$lastVisible2 !== void 0 ? _elements$lastVisible2 : 0)) {
|
203
202
|
const selectedItem = children.find(tab => !tab.props.alwaysHidden && tab.props.id === selected);
|
204
203
|
if (selectedItem != null) {
|
205
204
|
res.visible.push(selectedItem);
|
@@ -231,9 +230,9 @@ const CollapsibleTabs = _ref => {
|
|
231
230
|
const measureTask = fastdom.measure(() => {
|
232
231
|
var _container$children, _moreButton$offsetWid;
|
233
232
|
const container = measureRef.current;
|
234
|
-
const descendants = [...((_container$children = container === null || container ===
|
233
|
+
const descendants = [...((_container$children = container === null || container === void 0 ? void 0 : container.children) !== null && _container$children !== void 0 ? _container$children : [])];
|
235
234
|
const moreButton = descendants.pop();
|
236
|
-
let moreButtonWidth = (_moreButton$offsetWid = moreButton === null || moreButton ===
|
235
|
+
let moreButtonWidth = (_moreButton$offsetWid = moreButton === null || moreButton === void 0 ? void 0 : moreButton.offsetWidth) !== null && _moreButton$offsetWid !== void 0 ? _moreButton$offsetWid : 0;
|
237
236
|
const {
|
238
237
|
marginLeft: moreButtonMarginLeft = '0',
|
239
238
|
marginRight: moreButtonMarginRight = '0'
|
@@ -49,10 +49,6 @@ import 'react-virtualized/dist/es/CellMeasurer';
|
|
49
49
|
import 'util-deprecate';
|
50
50
|
import 'memoize-one';
|
51
51
|
import '../global/create-stateful-context.js';
|
52
|
-
import '../list/list__link.js';
|
53
|
-
import '../list/list__classes.js';
|
54
|
-
import '../list/consts.js';
|
55
|
-
import '../_helpers/list.js';
|
56
52
|
import '../list/list__item.js';
|
57
53
|
import '../avatar/avatar.js';
|
58
54
|
import '../global/url.js';
|
@@ -68,6 +64,9 @@ import '../_helpers/icon__svg.js';
|
|
68
64
|
import 'core-js/modules/es.string.starts-with.js';
|
69
65
|
import '../global/composeRefs.js';
|
70
66
|
import '../control-help/control-help.js';
|
67
|
+
import '../_helpers/list.js';
|
68
|
+
import '../list/consts.js';
|
69
|
+
import '../list/list__classes.js';
|
71
70
|
import '../list/list__custom.js';
|
72
71
|
import '../global/get-event-key.js';
|
73
72
|
import '../list/list__title.js';
|
@@ -89,7 +88,7 @@ class Tabs extends PureComponent {
|
|
89
88
|
super(...arguments);
|
90
89
|
_defineProperty(this, "handleSelect", memoize(key => () => {
|
91
90
|
var _this$props$onSelect, _this$props;
|
92
|
-
return (_this$props$onSelect = (_this$props = this.props).onSelect) === null || _this$props$onSelect ===
|
91
|
+
return (_this$props$onSelect = (_this$props = this.props).onSelect) === null || _this$props$onSelect === void 0 ? void 0 : _this$props$onSelect.call(_this$props, key);
|
93
92
|
}));
|
94
93
|
_defineProperty(this, "getTabTitle", (child, i) => {
|
95
94
|
if (child == null || typeof child !== 'object' || child.type === CustomItem) {
|
@@ -48,10 +48,6 @@ import 'react-virtualized/dist/es/CellMeasurer';
|
|
48
48
|
import 'util-deprecate';
|
49
49
|
import 'memoize-one';
|
50
50
|
import '../global/create-stateful-context.js';
|
51
|
-
import '../list/list__link.js';
|
52
|
-
import '../list/list__classes.js';
|
53
|
-
import '../list/consts.js';
|
54
|
-
import '../_helpers/list.js';
|
55
51
|
import '../list/list__item.js';
|
56
52
|
import '../avatar/avatar.js';
|
57
53
|
import '../global/url.js';
|
@@ -67,6 +63,9 @@ import '../_helpers/icon__svg.js';
|
|
67
63
|
import 'core-js/modules/es.string.starts-with.js';
|
68
64
|
import '../global/composeRefs.js';
|
69
65
|
import '../control-help/control-help.js';
|
66
|
+
import '../_helpers/list.js';
|
67
|
+
import '../list/consts.js';
|
68
|
+
import '../list/list__classes.js';
|
70
69
|
import '../list/list__custom.js';
|
71
70
|
import '../global/get-event-key.js';
|
72
71
|
import '../list/list__title.js';
|
@@ -87,7 +86,7 @@ const _excluded = ["children", "initSelected", "data-test"];
|
|
87
86
|
class SmartTabs extends PureComponent {
|
88
87
|
constructor(props) {
|
89
88
|
super(props);
|
90
|
-
_defineProperty(this, "state",
|
89
|
+
_defineProperty(this, "state", void 0);
|
91
90
|
_defineProperty(this, "handleSelect", selected => this.setState({
|
92
91
|
selected
|
93
92
|
}));
|
package/components/tabs/tabs.js
CHANGED
@@ -51,10 +51,6 @@ import 'react-virtualized/dist/es/CellMeasurer';
|
|
51
51
|
import 'util-deprecate';
|
52
52
|
import 'memoize-one';
|
53
53
|
import '../global/create-stateful-context.js';
|
54
|
-
import '../list/list__link.js';
|
55
|
-
import '../list/list__classes.js';
|
56
|
-
import '../list/consts.js';
|
57
|
-
import '../_helpers/list.js';
|
58
54
|
import '../list/list__item.js';
|
59
55
|
import '../avatar/avatar.js';
|
60
56
|
import '../global/url.js';
|
@@ -70,6 +66,9 @@ import '../_helpers/icon__svg.js';
|
|
70
66
|
import 'core-js/modules/es.string.starts-with.js';
|
71
67
|
import '../global/composeRefs.js';
|
72
68
|
import '../control-help/control-help.js';
|
69
|
+
import '../_helpers/list.js';
|
70
|
+
import '../list/consts.js';
|
71
|
+
import '../list/list__classes.js';
|
73
72
|
import '../list/list__custom.js';
|
74
73
|
import '../global/get-event-key.js';
|
75
74
|
import '../list/list__title.js';
|
package/components/tag/tag.js
CHANGED
@@ -38,7 +38,7 @@ class Tag extends PureComponent {
|
|
38
38
|
});
|
39
39
|
}
|
40
40
|
});
|
41
|
-
_defineProperty(this, "tagNode",
|
41
|
+
_defineProperty(this, "tagNode", void 0);
|
42
42
|
_defineProperty(this, "tagRef", el => {
|
43
43
|
this.tagNode = el;
|
44
44
|
});
|
@@ -51,7 +51,7 @@ class Tag extends PureComponent {
|
|
51
51
|
}
|
52
52
|
if (this.state.focused) {
|
53
53
|
var _this$tagNode;
|
54
|
-
(_this$tagNode = this.tagNode) === null || _this$tagNode ===
|
54
|
+
(_this$tagNode = this.tagNode) === null || _this$tagNode === void 0 || _this$tagNode.focus();
|
55
55
|
}
|
56
56
|
this.setDocumentClickListener(this.state.focused);
|
57
57
|
}
|
@@ -65,18 +65,17 @@ import 'react-virtualized/dist/es/WindowScroller';
|
|
65
65
|
import 'react-virtualized/dist/es/CellMeasurer';
|
66
66
|
import 'memoize-one';
|
67
67
|
import '../global/create-stateful-context.js';
|
68
|
-
import '../list/list__link.js';
|
69
|
-
import '../link/link.js';
|
70
|
-
import '../_helpers/link.js';
|
71
|
-
import '../list/list__classes.js';
|
72
|
-
import '../list/consts.js';
|
73
|
-
import '../_helpers/list.js';
|
74
68
|
import '../list/list__item.js';
|
75
69
|
import '../checkbox/checkbox.js';
|
76
70
|
import '@jetbrains/icons/checkmark-12px';
|
77
71
|
import '@jetbrains/icons/remove-12px';
|
78
72
|
import '../global/composeRefs.js';
|
79
73
|
import '../control-help/control-help.js';
|
74
|
+
import '../link/link.js';
|
75
|
+
import '../_helpers/link.js';
|
76
|
+
import '../_helpers/list.js';
|
77
|
+
import '../list/consts.js';
|
78
|
+
import '../list/list__classes.js';
|
80
79
|
import '../list/list__custom.js';
|
81
80
|
import '../list/list__title.js';
|
82
81
|
import '../list/list__separator.js';
|
@@ -113,17 +112,17 @@ class TagsInput extends PureComponent {
|
|
113
112
|
query: '',
|
114
113
|
activeIndex: 0
|
115
114
|
});
|
116
|
-
_defineProperty(this, "ngModelStateField",
|
115
|
+
_defineProperty(this, "ngModelStateField", void 0);
|
117
116
|
_defineProperty(this, "id", this.props.id || getUID('ring-tags-list-'));
|
118
|
-
_defineProperty(this, "node",
|
117
|
+
_defineProperty(this, "node", void 0);
|
119
118
|
_defineProperty(this, "nodeRef", node => {
|
120
119
|
this.node = node;
|
121
120
|
});
|
122
|
-
_defineProperty(this, "input",
|
123
|
-
_defineProperty(this, "caret",
|
121
|
+
_defineProperty(this, "input", void 0);
|
122
|
+
_defineProperty(this, "caret", void 0);
|
124
123
|
_defineProperty(this, "focusInput", () => {
|
125
124
|
var _this$getInputNode;
|
126
|
-
(_this$getInputNode = this.getInputNode()) === null || _this$getInputNode ===
|
125
|
+
(_this$getInputNode = this.getInputNode()) === null || _this$getInputNode === void 0 || _this$getInputNode.focus();
|
127
126
|
});
|
128
127
|
_defineProperty(this, "focus", () => {
|
129
128
|
this.focusInput();
|
@@ -134,8 +133,8 @@ class TagsInput extends PureComponent {
|
|
134
133
|
return;
|
135
134
|
}
|
136
135
|
const isUniqueTag = this.state.tags.filter(item => tag.key === item.key).length === 0;
|
137
|
-
(_this$select = this.select) === null || _this$select ===
|
138
|
-
(_this$select2 = this.select) === null || _this$select2 ===
|
136
|
+
(_this$select = this.select) === null || _this$select === void 0 || _this$select.clear();
|
137
|
+
(_this$select2 = this.select) === null || _this$select2 === void 0 || _this$select2.filterValue('');
|
139
138
|
if (isUniqueTag) {
|
140
139
|
this.setState(prevState => ({
|
141
140
|
tags: prevState.tags.concat([tag])
|
@@ -151,7 +150,7 @@ class TagsInput extends PureComponent {
|
|
151
150
|
if (event.target !== this.node && event.target.parentElement !== this.node) {
|
152
151
|
return;
|
153
152
|
}
|
154
|
-
(_this$select3 = this.select) === null || _this$select3 ===
|
153
|
+
(_this$select3 = this.select) === null || _this$select3 === void 0 || _this$select3._clickHandler();
|
155
154
|
});
|
156
155
|
_defineProperty(this, "filterExistingTags", suggestions => {
|
157
156
|
const tagsMap = new Map(this.state.tags.map(tag => [tag.key, tag]));
|
@@ -210,18 +209,18 @@ class TagsInput extends PureComponent {
|
|
210
209
|
const key = getEventKey(event);
|
211
210
|
const isInputFocused = () => {
|
212
211
|
var _this$getInputNode$ta, _this$getInputNode2;
|
213
|
-
return event.target instanceof Element && event.target.matches((_this$getInputNode$ta = (_this$getInputNode2 = this.getInputNode()) === null || _this$getInputNode2 ===
|
212
|
+
return event.target instanceof Element && event.target.matches((_this$getInputNode$ta = (_this$getInputNode2 = this.getInputNode()) === null || _this$getInputNode2 === void 0 ? void 0 : _this$getInputNode2.tagName) !== null && _this$getInputNode$ta !== void 0 ? _this$getInputNode$ta : '');
|
214
213
|
};
|
215
214
|
if (key === ' ' && this.props.allowAddNewTags) {
|
216
215
|
var _this$getInputNode3;
|
217
216
|
event.stopPropagation();
|
218
|
-
const value = (_this$getInputNode3 = this.getInputNode()) === null || _this$getInputNode3 ===
|
217
|
+
const value = (_this$getInputNode3 = this.getInputNode()) === null || _this$getInputNode3 === void 0 ? void 0 : _this$getInputNode3.value;
|
219
218
|
if (value != null && value !== '') {
|
220
219
|
this.handleTagCreation(value);
|
221
220
|
}
|
222
221
|
return true;
|
223
222
|
}
|
224
|
-
if ((_this$select4 = this.select) !== null && _this$select4 !==
|
223
|
+
if ((_this$select4 = this.select) !== null && _this$select4 !== void 0 && (_this$select4 = _this$select4._popup) !== null && _this$select4 !== void 0 && _this$select4.isVisible()) {
|
225
224
|
return true;
|
226
225
|
}
|
227
226
|
if (key === 'ArrowLeft') {
|
@@ -235,7 +234,7 @@ class TagsInput extends PureComponent {
|
|
235
234
|
if (this.state.activeIndex === this.state.tags.length - 1) {
|
236
235
|
if (!this.props.disabled) {
|
237
236
|
var _this$getInputNode4;
|
238
|
-
(_this$getInputNode4 = this.getInputNode()) === null || _this$getInputNode4 ===
|
237
|
+
(_this$getInputNode4 = this.getInputNode()) === null || _this$getInputNode4 === void 0 || _this$getInputNode4.focus();
|
239
238
|
this.setActiveIndex();
|
240
239
|
}
|
241
240
|
} else {
|
@@ -245,11 +244,11 @@ class TagsInput extends PureComponent {
|
|
245
244
|
}
|
246
245
|
if (!this.props.disabled) {
|
247
246
|
var _this$getInputNode5;
|
248
|
-
if (key === 'Backspace' && !((_this$getInputNode5 = this.getInputNode()) !== null && _this$getInputNode5 !==
|
247
|
+
if (key === 'Backspace' && !((_this$getInputNode5 = this.getInputNode()) !== null && _this$getInputNode5 !== void 0 && _this$getInputNode5.value)) {
|
249
248
|
var _this$select5;
|
250
249
|
event.preventDefault();
|
251
250
|
const tagsLength = this.state.tags.length;
|
252
|
-
(_this$select5 = this.select) === null || _this$select5 ===
|
251
|
+
(_this$select5 = this.select) === null || _this$select5 === void 0 || _this$select5._hidePopup(true); // otherwise confirmation may be overlapped by popup
|
253
252
|
this.onRemoveTag(this.state.tags[tagsLength - 1]);
|
254
253
|
return false;
|
255
254
|
}
|
@@ -270,7 +269,7 @@ class TagsInput extends PureComponent {
|
|
270
269
|
label
|
271
270
|
});
|
272
271
|
});
|
273
|
-
_defineProperty(this, "select",
|
272
|
+
_defineProperty(this, "select", void 0);
|
274
273
|
_defineProperty(this, "selectRef", el => {
|
275
274
|
this.select = el;
|
276
275
|
});
|
@@ -299,13 +298,13 @@ class TagsInput extends PureComponent {
|
|
299
298
|
var _this$select6;
|
300
299
|
this.focusInput();
|
301
300
|
this.loadSuggestions();
|
302
|
-
(_this$select6 = this.select) === null || _this$select6 ===
|
301
|
+
(_this$select6 = this.select) === null || _this$select6 === void 0 || _this$select6._showPopup();
|
303
302
|
}
|
304
303
|
}
|
305
304
|
getInputNode() {
|
306
305
|
if (!this.input) {
|
307
306
|
var _this$select7;
|
308
|
-
this.input = (_this$select7 = this.select) === null || _this$select7 ===
|
307
|
+
this.input = (_this$select7 = this.select) === null || _this$select7 === void 0 ? void 0 : _this$select7.filter;
|
309
308
|
if (this.input) {
|
310
309
|
this.caret = new Caret(this.input);
|
311
310
|
}
|