@jetbrains/ring-ui-built 7.0.28 → 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 +2 -2
- 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/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/profile.js +6 -6
- package/components/header/smart-profile.js +2 -2
- 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 +4 -4
- package/components/list/list__item.js +20 -9
- package/components/list/list__users-groups-source.js +2 -2
- 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 +9 -9
- 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 +1 -1
- package/components/progress-bar/progress-bar.js +2 -2
- package/components/query-assist/query-assist.js +49 -47
- package/components/radio/radio__item.js +2 -2
- package/components/select/select.js +27 -27
- package/components/select/select__popup.js +9 -9
- 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-tab.js +3 -3
- package/components/tabs/collapsible-tabs.js +7 -7
- package/components/tabs/dumb-tabs.js +1 -1
- package/components/tabs/smart-tabs.js +1 -1
- package/components/tag/tag.js +2 -2
- package/components/tags-input/tags-input.js +17 -17
- 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
@@ -159,13 +159,13 @@ function getListItems(props, state, rawFilterString) {
|
|
159
159
|
exactMatch = item.label === filterString;
|
160
160
|
if (props.multiple && !(typeof props.multiple === 'object' && props.multiple.removeSelectedItems)) {
|
161
161
|
var _state$multipleMap;
|
162
|
-
item.checkbox = !!((_state$multipleMap = state.multipleMap) !== null && _state$multipleMap !==
|
162
|
+
item.checkbox = !!((_state$multipleMap = state.multipleMap) !== null && _state$multipleMap !== void 0 && _state$multipleMap[item.key]);
|
163
163
|
}
|
164
164
|
if (props.multiple && typeof props.multiple === 'object' && props.multiple.limit && Array.isArray(state.selected)) {
|
165
165
|
item.disabled = props.multiple.limit === state.selected.length && !state.selected.find(selectedItem => selectedItem.key === item.key);
|
166
166
|
}
|
167
167
|
// Ignore item if it's multiple and is already selected
|
168
|
-
if (!(props.multiple && typeof props.multiple === 'object' && props.multiple.removeSelectedItems && (_state$multipleMap2 = state.multipleMap) !== null && _state$multipleMap2 !==
|
168
|
+
if (!(props.multiple && typeof props.multiple === 'object' && props.multiple.removeSelectedItems && (_state$multipleMap2 = state.multipleMap) !== null && _state$multipleMap2 !== void 0 && _state$multipleMap2[item.key])) {
|
169
169
|
filteredData.push(item);
|
170
170
|
}
|
171
171
|
}
|
@@ -186,7 +186,7 @@ function getListItems(props, state, rawFilterString) {
|
|
186
186
|
addButton = {
|
187
187
|
prefix: add.prefix,
|
188
188
|
label,
|
189
|
-
delayed: (_add$delayed = add.delayed) !== null && _add$delayed !==
|
189
|
+
delayed: (_add$delayed = add.delayed) !== null && _add$delayed !== void 0 ? _add$delayed : true
|
190
190
|
};
|
191
191
|
}
|
192
192
|
}
|
@@ -287,14 +287,14 @@ class Select extends Component {
|
|
287
287
|
});
|
288
288
|
});
|
289
289
|
}
|
290
|
-
if (!((_this$_popup = this._popup) !== null && _this$_popup !==
|
290
|
+
if (!((_this$_popup = this._popup) !== null && _this$_popup !== void 0 && _this$_popup.isClickingPopup)) {
|
291
291
|
this.setState({
|
292
292
|
shortcutsEnabled: false,
|
293
293
|
focused: false
|
294
294
|
});
|
295
295
|
}
|
296
296
|
});
|
297
|
-
_defineProperty(this, "node",
|
297
|
+
_defineProperty(this, "node", void 0);
|
298
298
|
_defineProperty(this, "nodeRef", el => {
|
299
299
|
this.node = el;
|
300
300
|
});
|
@@ -306,9 +306,9 @@ class Select extends Component {
|
|
306
306
|
});
|
307
307
|
_defineProperty(this, "focus", () => {
|
308
308
|
var _this$node;
|
309
|
-
const focusableSelectExists = (_this$node = this.node) === null || _this$node ===
|
309
|
+
const focusableSelectExists = (_this$node = this.node) === null || _this$node === void 0 ? void 0 : _this$node.querySelector('[data-test~=ring-select__focus]');
|
310
310
|
const restoreFocusNode = this.props.targetElement || focusableSelectExists;
|
311
|
-
restoreFocusNode === null || restoreFocusNode ===
|
311
|
+
restoreFocusNode === null || restoreFocusNode === void 0 || restoreFocusNode.focus();
|
312
312
|
});
|
313
313
|
_defineProperty(this, "_onEnter", () => {
|
314
314
|
var _this$_popup2;
|
@@ -316,14 +316,14 @@ class Select extends Component {
|
|
316
316
|
this.addHandler();
|
317
317
|
}
|
318
318
|
this.props.onDone();
|
319
|
-
if (!((_this$_popup2 = this._popup) !== null && _this$_popup2 !==
|
319
|
+
if (!((_this$_popup2 = this._popup) !== null && _this$_popup2 !== void 0 && _this$_popup2.isVisible()) && this.props.allowAny) {
|
320
320
|
return true;
|
321
321
|
}
|
322
322
|
return undefined;
|
323
323
|
});
|
324
324
|
_defineProperty(this, "_onEsc", event => {
|
325
325
|
var _this$_popup3;
|
326
|
-
if (!((_this$_popup3 = this._popup) !== null && _this$_popup3 !==
|
326
|
+
if (!((_this$_popup3 = this._popup) !== null && _this$_popup3 !== void 0 && _this$_popup3.isVisible())) {
|
327
327
|
return true;
|
328
328
|
} else if (this.props.multiple || !this.props.getInitial) {
|
329
329
|
return false;
|
@@ -420,7 +420,7 @@ class Select extends Component {
|
|
420
420
|
this.props.onChange(fakeSelected, event);
|
421
421
|
});
|
422
422
|
}
|
423
|
-
if (!((_this$_popup4 = this._popup) !== null && _this$_popup4 !==
|
423
|
+
if (!((_this$_popup4 = this._popup) !== null && _this$_popup4 !== void 0 && _this$_popup4.isVisible())) {
|
424
424
|
this.props.onBeforeOpen();
|
425
425
|
}
|
426
426
|
this.setState({
|
@@ -452,7 +452,7 @@ class Select extends Component {
|
|
452
452
|
if (!isItem(selected) && !isCustomItem(selected) || selected.disabled || selected.isResetItem) {
|
453
453
|
return;
|
454
454
|
}
|
455
|
-
const tryKeepOpen = (_this$props$tryKeepOp = _this.props.tryKeepOpen) !== null && _this$props$tryKeepOp !==
|
455
|
+
const tryKeepOpen = (_this$props$tryKeepOp = _this.props.tryKeepOpen) !== null && _this$props$tryKeepOp !== void 0 ? _this$props$tryKeepOp : opts.tryKeepOpen;
|
456
456
|
if (!_this.props.multiple) {
|
457
457
|
if (!tryKeepOpen) {
|
458
458
|
_this._hidePopup(isSelectItemEvent);
|
@@ -509,10 +509,10 @@ class Select extends Component {
|
|
509
509
|
}, () => {
|
510
510
|
if (_this.state.multipleMap[selected.key]) {
|
511
511
|
var _this$props$onSelect, _this$props;
|
512
|
-
(_this$props$onSelect = (_this$props = _this.props).onSelect) === null || _this$props$onSelect ===
|
512
|
+
(_this$props$onSelect = (_this$props = _this.props).onSelect) === null || _this$props$onSelect === void 0 || _this$props$onSelect.call(_this$props, selected, event);
|
513
513
|
} else {
|
514
514
|
var _this$props$onDeselec, _this$props2;
|
515
|
-
(_this$props$onDeselec = (_this$props2 = _this.props).onDeselect) === null || _this$props$onDeselec ===
|
515
|
+
(_this$props$onDeselec = (_this$props2 = _this.props).onDeselect) === null || _this$props$onDeselec === void 0 || _this$props$onDeselec.call(_this$props2, selected);
|
516
516
|
}
|
517
517
|
_this.props.onChange(_this.state.selected, event);
|
518
518
|
if (tryKeepOpen) {
|
@@ -532,13 +532,13 @@ class Select extends Component {
|
|
532
532
|
nextSelection = _this.props.data.filter(item => (isItem(item) || isCustomItem(item)) && !item.disabled);
|
533
533
|
nextSelection.filter(item => !_this.props.selected.find(selectedItem => item.key === selectedItem.key)).forEach(item => {
|
534
534
|
var _this$props$onSelect2, _this$props3;
|
535
|
-
(_this$props$onSelect2 = (_this$props3 = _this.props).onSelect) === null || _this$props$onSelect2 ===
|
535
|
+
(_this$props$onSelect2 = (_this$props3 = _this.props).onSelect) === null || _this$props$onSelect2 === void 0 || _this$props$onSelect2.call(_this$props3, item);
|
536
536
|
});
|
537
537
|
} else {
|
538
538
|
nextSelection = [];
|
539
539
|
currentSelection.forEach(item => {
|
540
540
|
var _this$props$onDeselec2, _this$props4;
|
541
|
-
(_this$props$onDeselec2 = (_this$props4 = _this.props).onDeselect) === null || _this$props$onDeselec2 ===
|
541
|
+
(_this$props$onDeselec2 = (_this$props4 = _this.props).onDeselect) === null || _this$props$onDeselec2 === void 0 || _this$props$onDeselec2.call(_this$props4, item);
|
542
542
|
});
|
543
543
|
}
|
544
544
|
_this.props.onChange(nextSelection, event);
|
@@ -587,7 +587,7 @@ class Select extends Component {
|
|
587
587
|
});
|
588
588
|
return false;
|
589
589
|
});
|
590
|
-
_defineProperty(this, "filter",
|
590
|
+
_defineProperty(this, "filter", void 0);
|
591
591
|
_defineProperty(this, "filterRef", el => {
|
592
592
|
this.filter = el;
|
593
593
|
});
|
@@ -747,10 +747,10 @@ class Select extends Component {
|
|
747
747
|
let message;
|
748
748
|
if (this.props.loading) {
|
749
749
|
var _this$props$loadingMe;
|
750
|
-
message = (_this$props$loadingMe = this.props.loadingMessage) !== null && _this$props$loadingMe !==
|
750
|
+
message = (_this$props$loadingMe = this.props.loadingMessage) !== null && _this$props$loadingMe !== void 0 ? _this$props$loadingMe : translate('loading');
|
751
751
|
} else if (!shownData.length) {
|
752
752
|
var _this$props$notFoundM;
|
753
|
-
message = (_this$props$notFoundM = this.props.notFoundMessage) !== null && _this$props$notFoundM !==
|
753
|
+
message = (_this$props$notFoundM = this.props.notFoundMessage) !== null && _this$props$notFoundM !== void 0 ? _this$props$notFoundM : translate('noOptionsFound');
|
754
754
|
}
|
755
755
|
return jsx(SelectPopup, {
|
756
756
|
data: _shownData,
|
@@ -832,7 +832,7 @@ class Select extends Component {
|
|
832
832
|
}
|
833
833
|
getTopbar() {
|
834
834
|
var _this$props$renderTop, _this$props5;
|
835
|
-
return (_this$props$renderTop = (_this$props5 = this.props).renderTopToolbar) === null || _this$props$renderTop ===
|
835
|
+
return (_this$props$renderTop = (_this$props5 = this.props).renderTopToolbar) === null || _this$props$renderTop === void 0 ? void 0 : _this$props$renderTop.call(_this$props5);
|
836
836
|
}
|
837
837
|
getFilterFn() {
|
838
838
|
return getFilterFn(this.props.filter);
|
@@ -872,12 +872,12 @@ class Select extends Component {
|
|
872
872
|
}
|
873
873
|
_getLabel() {
|
874
874
|
var _ref3, _this$props$label;
|
875
|
-
return (_ref3 = (_this$props$label = this.props.label) !== null && _this$props$label !==
|
875
|
+
return (_ref3 = (_this$props$label = this.props.label) !== null && _this$props$label !== void 0 ? _this$props$label : this.props.selectedLabel) !== null && _ref3 !== void 0 ? _ref3 : 'Select an option';
|
876
876
|
}
|
877
877
|
_getPlaceholder() {
|
878
878
|
if (this._selectionIsEmpty()) {
|
879
879
|
var _this$props$label2;
|
880
|
-
return (_this$props$label2 = this.props.label) !== null && _this$props$label2 !==
|
880
|
+
return (_this$props$label2 = this.props.label) !== null && _this$props$label2 !== void 0 ? _this$props$label2 : 'Select an option';
|
881
881
|
}
|
882
882
|
return this._getSelectedString();
|
883
883
|
}
|
@@ -903,7 +903,7 @@ class Select extends Component {
|
|
903
903
|
} = this.props;
|
904
904
|
const icons = [];
|
905
905
|
const height = this.props.height || this.context;
|
906
|
-
if (!Array.isArray(selected) && selected !== null && selected !==
|
906
|
+
if (!Array.isArray(selected) && selected !== null && selected !== void 0 && selected.icon) {
|
907
907
|
icons.push(jsx("button", {
|
908
908
|
title: "Toggle options popup",
|
909
909
|
type: "button",
|
@@ -941,7 +941,7 @@ class Select extends Component {
|
|
941
941
|
}
|
942
942
|
_getAvatar() {
|
943
943
|
var _this$state$selected, _this$state$selected2;
|
944
|
-
return !Array.isArray(this.state.selected) && (((_this$state$selected = this.state.selected) === null || _this$state$selected ===
|
944
|
+
return !Array.isArray(this.state.selected) && (((_this$state$selected = this.state.selected) === null || _this$state$selected === void 0 ? void 0 : _this$state$selected.avatar) || ((_this$state$selected2 = this.state.selected) === null || _this$state$selected2 === void 0 ? void 0 : _this$state$selected2.showGeneratedAvatar)) && jsx(Avatar, {
|
945
945
|
className: styles.avatar,
|
946
946
|
url: this.state.selected.avatar,
|
947
947
|
username: this.state.selected.username,
|
@@ -987,9 +987,9 @@ class Select extends Component {
|
|
987
987
|
const ariaProps = this.state.showPopup ? {
|
988
988
|
'aria-owns': this.listId,
|
989
989
|
'aria-activedescendant': activeItemId,
|
990
|
-
'aria-label': (_this$props$label3 = this.props.label) !== null && _this$props$label3 !==
|
990
|
+
'aria-label': (_this$props$label3 = this.props.label) !== null && _this$props$label3 !== void 0 ? _this$props$label3 : undefined
|
991
991
|
} : {
|
992
|
-
'aria-label': (_this$props$label4 = this.props.label) !== null && _this$props$label4 !==
|
992
|
+
'aria-label': (_this$props$label4 = this.props.label) !== null && _this$props$label4 !== void 0 ? _this$props$label4 : undefined
|
993
993
|
};
|
994
994
|
switch (this.props.type) {
|
995
995
|
case Type.INPUT_WITHOUT_CONTROLS:
|
@@ -1026,7 +1026,7 @@ class Select extends Component {
|
|
1026
1026
|
placeholder: this.props.inputPlaceholder,
|
1027
1027
|
onKeyDown: this.props.onKeyDown,
|
1028
1028
|
"data-test": "ring-select__focus",
|
1029
|
-
enableShortcuts: shortcutsEnabled ? Object.keys(_objectSpread2(_objectSpread2({}, this.getShortcutsMap()), (_this$_popup5 = this._popup) === null || _this$_popup5 ===
|
1029
|
+
enableShortcuts: shortcutsEnabled ? Object.keys(_objectSpread2(_objectSpread2({}, this.getShortcutsMap()), (_this$_popup5 = this._popup) === null || _this$_popup5 === void 0 || (_this$_popup5 = _this$_popup5.list) === null || _this$_popup5 === void 0 ? void 0 : _this$_popup5.shortcutsMap)) : undefined,
|
1030
1030
|
icon: this.props.filterIcon,
|
1031
1031
|
afterInput: iconsNode
|
1032
1032
|
})), this._renderPopup()]
|
@@ -1074,7 +1074,7 @@ class Select extends Component {
|
|
1074
1074
|
map: this.getShortcutsMap(),
|
1075
1075
|
scope: this.shortcutsScope
|
1076
1076
|
}), jsx(Anchor, _objectSpread2(_objectSpread2({}, ariaProps), {}, {
|
1077
|
-
className: (_this$props$buttonCla = this.props.buttonClassName) !== null && _this$props$buttonCla !==
|
1077
|
+
className: (_this$props$buttonCla = this.props.buttonClassName) !== null && _this$props$buttonCla !== void 0 ? _this$props$buttonCla : undefined,
|
1078
1078
|
id: this.props.id,
|
1079
1079
|
onClick: this._clickHandler,
|
1080
1080
|
"data-test": "ring-select__focus",
|
@@ -98,8 +98,8 @@ class SelectPopup extends PureComponent {
|
|
98
98
|
});
|
99
99
|
_defineProperty(this, "isClickingPopup", false);
|
100
100
|
// This flag is set to true while an item in the popup is being clicked
|
101
|
-
_defineProperty(this, "filter",
|
102
|
-
_defineProperty(this, "caret",
|
101
|
+
_defineProperty(this, "filter", void 0);
|
102
|
+
_defineProperty(this, "caret", void 0);
|
103
103
|
_defineProperty(this, "onFilterFocus", () => {
|
104
104
|
this._togglePopupFilterShortcuts(false);
|
105
105
|
this.setState({
|
@@ -117,7 +117,7 @@ class SelectPopup extends PureComponent {
|
|
117
117
|
_defineProperty(this, "mouseUpHandler", () => {
|
118
118
|
this.isClickingPopup = false;
|
119
119
|
});
|
120
|
-
_defineProperty(this, "popup",
|
120
|
+
_defineProperty(this, "popup", void 0);
|
121
121
|
_defineProperty(this, "onListSelect", (selected, event, opts) => {
|
122
122
|
const getSelectItemEvent = () => {
|
123
123
|
const customEvent = document.createEvent('Event');
|
@@ -135,7 +135,7 @@ class SelectPopup extends PureComponent {
|
|
135
135
|
});
|
136
136
|
_defineProperty(this, "onClickHandler", () => {
|
137
137
|
var _this$filter;
|
138
|
-
return (_this$filter = this.filter) === null || _this$filter ===
|
138
|
+
return (_this$filter = this.filter) === null || _this$filter === void 0 ? void 0 : _this$filter.focus();
|
139
139
|
});
|
140
140
|
_defineProperty(this, "handleRemoveTag", memoize(tag => event => this.removeTag(tag, event)));
|
141
141
|
_defineProperty(this, "handleTagClick", memoize(tag => () => {
|
@@ -163,7 +163,7 @@ class SelectPopup extends PureComponent {
|
|
163
163
|
inline: true,
|
164
164
|
onClick: this.handleSelectAll,
|
165
165
|
children: activeFilters.length !== this.props.selected.length ? multiple.selectAllLabel || 'Select all' : multiple.deselectAllLabel || 'Deselect all'
|
166
|
-
}), ((_multiple$renderSelec = multiple.renderSelectedItemsDescription) === null || _multiple$renderSelec ===
|
166
|
+
}), ((_multiple$renderSelec = multiple.renderSelectedItemsDescription) === null || _multiple$renderSelec === void 0 ? void 0 : _multiple$renderSelec.call(multiple, this.props.selected, activeFilters.length)) || jsx(Text, {
|
167
167
|
info: true,
|
168
168
|
children: "".concat(this.props.selected.length, " selected")
|
169
169
|
})]
|
@@ -189,13 +189,13 @@ class SelectPopup extends PureComponent {
|
|
189
189
|
const containerNode = getPopupContainer(ringPopupTarget) || document.documentElement;
|
190
190
|
return anchorNode != null ? Math.min(directions.reduce((maxHeight, direction) => {
|
191
191
|
var _maxHeightForDirectio;
|
192
|
-
return Math.max(maxHeight, (_maxHeightForDirectio = maxHeightForDirection(direction, anchorNode, getStyles(containerNode).position !== 'static' ? containerNode : null)) !== null && _maxHeightForDirectio !==
|
192
|
+
return Math.max(maxHeight, (_maxHeightForDirectio = maxHeightForDirection(direction, anchorNode, getStyles(containerNode).position !== 'static' ? containerNode : null)) !== null && _maxHeightForDirectio !== void 0 ? _maxHeightForDirectio : 0);
|
193
193
|
}, minMaxHeight), userDefinedMaxHeight) : userDefinedMaxHeight;
|
194
194
|
}));
|
195
195
|
_defineProperty(this, "popupRef", el => {
|
196
196
|
this.popup = el;
|
197
197
|
});
|
198
|
-
_defineProperty(this, "list",
|
198
|
+
_defineProperty(this, "list", void 0);
|
199
199
|
_defineProperty(this, "listRef", el => {
|
200
200
|
this.list = el;
|
201
201
|
});
|
@@ -231,7 +231,7 @@ class SelectPopup extends PureComponent {
|
|
231
231
|
focusFilter() {
|
232
232
|
setTimeout(() => {
|
233
233
|
var _this$filter2;
|
234
|
-
return (_this$filter2 = this.filter) === null || _this$filter2 ===
|
234
|
+
return (_this$filter2 = this.filter) === null || _this$filter2 === void 0 ? void 0 : _this$filter2.focus();
|
235
235
|
});
|
236
236
|
}
|
237
237
|
isEventTargetFilter(event) {
|
@@ -309,7 +309,7 @@ class SelectPopup extends PureComponent {
|
|
309
309
|
className: styles.filterWrapper,
|
310
310
|
"data-test": "ring-select-popup-filter",
|
311
311
|
children: [!this.props.tags && jsx(Icon, {
|
312
|
-
glyph: (_this$props$filterIco = this.props.filterIcon) !== null && _this$props$filterIco !==
|
312
|
+
glyph: (_this$props$filterIco = this.props.filterIcon) !== null && _this$props$filterIco !== void 0 ? _this$props$filterIco : searchIcon,
|
313
313
|
className: styles.filterIcon,
|
314
314
|
"data-test-custom": "ring-select-popup-filter-icon"
|
315
315
|
}), jsx(FilterWithShortcuts, {
|
@@ -174,7 +174,7 @@ class Shortcuts {
|
|
174
174
|
}
|
175
175
|
hasKey(key, scope) {
|
176
176
|
var _this$_scopes$scope;
|
177
|
-
return !!((_this$_scopes$scope = this._scopes[scope]) !== null && _this$_scopes$scope !==
|
177
|
+
return !!((_this$_scopes$scope = this._scopes[scope]) !== null && _this$_scopes$scope !== void 0 && _this$_scopes$scope[key]);
|
178
178
|
}
|
179
179
|
_getKeyboardEventType(params) {
|
180
180
|
if (!params.type && sniffr.os.name === 'windows') {
|
@@ -37,10 +37,10 @@ const Slider = _ref => {
|
|
37
37
|
} = _ref;
|
38
38
|
const ref = useRef(null);
|
39
39
|
const previouslyDragged = useRef(false);
|
40
|
-
const [values, setValues] = useState(defaultValue !== null && defaultValue !==
|
41
|
-
const validValues = useMemo(() => toRange(value !== null && value !==
|
40
|
+
const [values, setValues] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : min);
|
41
|
+
const validValues = useMemo(() => toRange(value !== null && value !== void 0 ? value : values, min, max), [max, min, value, values]);
|
42
42
|
const validStep = step < 0 ? 0 : step;
|
43
|
-
const isRange = isArray(defaultValue !== null && defaultValue !==
|
43
|
+
const isRange = isArray(defaultValue !== null && defaultValue !== void 0 ? defaultValue : value);
|
44
44
|
const [isDragging, setIsDragging] = useState(false);
|
45
45
|
const [draggedIndex, setDraggedIndex] = useState(-1);
|
46
46
|
const [shortcutsScope] = useState(getUID('ring-slider-'));
|
@@ -64,7 +64,7 @@ const Slider = _ref => {
|
|
64
64
|
const trackLength = useMemo(() => toPercent(Math.max(...validValues), min, max) - trackStart, [max, min, trackStart, validValues]);
|
65
65
|
const handleValueChange = useCallback(nextValues => {
|
66
66
|
setValues(nextValues);
|
67
|
-
onChange === null || onChange ===
|
67
|
+
onChange === null || onChange === void 0 || onChange(isRange ? nextValues : nextValues[0]);
|
68
68
|
}, [isRange, onChange]);
|
69
69
|
const shortcutsMap = useMemo(() => {
|
70
70
|
const setValueAndSwap = (nextValue, index) => {
|
@@ -74,12 +74,12 @@ const Slider = _ref => {
|
|
74
74
|
var _ref$current;
|
75
75
|
const previousValue = nextValues[index];
|
76
76
|
nextValues.reverse();
|
77
|
-
const thumb = (_ref$current = ref.current) === null || _ref$current ===
|
78
|
-
thumb === null || thumb ===
|
77
|
+
const thumb = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector("[role=\"slider\"][data-index=\"".concat(nextValues.indexOf(previousValue), "\"]"));
|
78
|
+
thumb === null || thumb === void 0 || thumb.focus();
|
79
79
|
}
|
80
80
|
handleValueChange(nextValues);
|
81
81
|
};
|
82
|
-
const getIndex = target => Number(target === null || target ===
|
82
|
+
const getIndex = target => Number(target === null || target === void 0 ? void 0 : target.getAttribute('data-index'));
|
83
83
|
const map = {};
|
84
84
|
if (!disabled) {
|
85
85
|
map.left = map.down = _ref2 => {
|
@@ -242,7 +242,7 @@ const Slider = _ref => {
|
|
242
242
|
className: classNames(styles.markValue, {
|
243
243
|
[styles.disabled]: disabled
|
244
244
|
}),
|
245
|
-
children: label !== null && label !==
|
245
|
+
children: label !== null && label !== void 0 ? label : markValue
|
246
246
|
}, index);
|
247
247
|
}), tickMarks.map((_ref9, index) => {
|
248
248
|
let {
|
@@ -23,7 +23,7 @@ function calculateValue(ref, x, min, max, step) {
|
|
23
23
|
left
|
24
24
|
} = ref.current.getBoundingClientRect();
|
25
25
|
const value = toValue((x - left) / width, min, max);
|
26
|
-
const precision = (_step$toString$split = step.toString().split('.')) === null || _step$toString$split ===
|
26
|
+
const precision = (_step$toString$split = step.toString().split('.')) === null || _step$toString$split === void 0 || (_step$toString$split = _step$toString$split[1]) === null || _step$toString$split === void 0 ? void 0 : _step$toString$split.length;
|
27
27
|
return Number(roundToStep(value, step, min).toFixed(precision));
|
28
28
|
}
|
29
29
|
function validateValue(value, min, max) {
|
@@ -69,7 +69,7 @@ class LocalStorage {
|
|
69
69
|
}
|
70
70
|
constructor() {
|
71
71
|
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
72
|
-
_defineProperty(this, "storageType",
|
72
|
+
_defineProperty(this, "storageType", void 0);
|
73
73
|
this.storageType = config.type === 'session' ? 'sessionStorage' : 'localStorage';
|
74
74
|
}
|
75
75
|
/**
|