@jetbrains/ring-ui-built 6.0.39 → 6.0.41
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/heading.js +1 -1
- package/components/alert/alert.js +1 -1
- package/components/alert-service/alert-service.js +1 -1
- package/components/auth/auth.js +1 -1
- package/components/auth/auth__core.js +1 -1
- package/components/auth/down-notification.js +1 -1
- package/components/auth/iframe-flow.js +1 -1
- package/components/auth/storage.js +1 -1
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/auth-dialog-service/auth-dialog-service.js +1 -1
- package/components/badge/badge.js +7 -0
- package/components/button/button.js +2 -2
- package/components/checkbox/checkbox.d.ts +1 -0
- package/components/checkbox/checkbox.js +3 -2
- package/components/clipboard/clipboard.js +1 -1
- package/components/confirm/confirm.js +1 -1
- package/components/confirm-service/confirm-service.js +1 -1
- package/components/data-list/data-list.js +1 -2
- package/components/data-list/data-list.mock.js +1 -0
- package/components/data-list/item.js +0 -1
- package/components/data-list/title.js +1 -1
- package/components/date-picker/date-input.js +1 -1
- package/components/date-picker/date-popup.js +1 -1
- package/components/dialog/dialog.js +1 -1
- package/components/dropdown/anchor.js +1 -0
- package/components/dropdown/dropdown.js +1 -0
- package/components/dropdown-menu/dropdown-menu.js +1 -0
- package/components/editable-heading/editable-heading.js +1 -1
- package/components/form/form.js +1 -1
- package/components/global/composeRefs.d.ts +3 -1
- package/components/global/composeRefs.js +4 -1
- package/components/global/focus-sensor-hoc.js +4 -2
- package/components/global/rerender-hoc.js +4 -2
- package/components/header/header.js +2 -1
- package/components/header/profile.js +2 -1
- package/components/header/services.js +1 -0
- package/components/header/smart-profile.js +2 -1
- package/components/header/smart-services.js +2 -1
- package/components/header/tray-icon.js +1 -1
- package/components/heading/heading.d.ts +7 -4
- package/components/heading/heading.js +39 -26
- package/components/input/input-legacy.js +1 -1
- package/components/input/input.js +1 -1
- package/components/input-size/input-size.js +1 -1
- package/components/list/list__item.js +1 -1
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/login-dialog/service.js +1 -1
- package/components/message/message.js +1 -1
- package/components/pager/pager.js +2 -2
- package/components/query-assist/query-assist.js +1 -1
- package/components/select/select.d.ts +1 -0
- package/components/select/select.js +3 -2
- package/components/select/select__filter.js +1 -1
- package/components/select/select__popup.d.ts +1 -0
- package/components/select/select__popup.js +4 -3
- package/components/storage/storage.js +1 -1
- package/components/storage/storage__local.js +1 -1
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.d.ts +9 -36
- package/components/tab-trap/tab-trap.js +144 -156
- package/components/table/row-with-focus-sensor.js +1 -2
- package/components/table/row.d.ts +1 -0
- package/components/table/row.js +3 -3
- package/components/table/smart-table.js +1 -1
- package/components/table/table.js +1 -1
- package/components/tabs/collapsible-more.js +1 -0
- package/components/tabs/collapsible-tabs.js +1 -0
- package/components/tabs/dumb-tabs.js +1 -0
- package/components/tabs/smart-tabs.js +1 -0
- package/components/tabs/tabs.js +1 -0
- package/components/tag/tag.js +9 -2
- package/components/tags-list/tags-list.js +2 -2
- package/components/text/text.d.ts +1 -0
- package/components/text/text.js +4 -2
- package/components/toggle/toggle.d.ts +1 -2
- package/components/toggle/toggle.js +15 -9
- package/components/user-agreement/service.js +1 -1
- package/components/user-agreement/user-agreement.js +1 -1
- package/components/user-card/card.js +1 -1
- package/components/user-card/smart-user-card-tooltip.js +1 -0
- package/components/user-card/tooltip.js +1 -0
- package/components/user-card/user-card.js +2 -1
- package/package.json +2 -2
@@ -1,45 +1,18 @@
|
|
1
|
-
import {
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
2
2
|
import * as React from 'react';
|
3
|
-
import PropTypes from 'prop-types';
|
4
3
|
export declare const FOCUSABLE_ELEMENTS = "input, button, select, textarea, a[href], *[tabindex]:not([data-trap-button]):not([data-scrollable-container])";
|
5
4
|
export interface TabTrapProps extends HTMLAttributes<HTMLElement> {
|
6
5
|
children: ReactNode;
|
7
|
-
trapDisabled
|
8
|
-
autoFocusFirst
|
9
|
-
focusBackOnClose
|
10
|
-
focusBackOnExit
|
6
|
+
trapDisabled?: boolean;
|
7
|
+
autoFocusFirst?: boolean;
|
8
|
+
focusBackOnClose?: boolean;
|
9
|
+
focusBackOnExit?: boolean;
|
11
10
|
}
|
12
11
|
/**
|
13
12
|
* @name TabTrap
|
14
13
|
*/
|
15
|
-
|
16
|
-
|
17
|
-
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
18
|
-
trapDisabled: PropTypes.Requireable<boolean>;
|
19
|
-
autoFocusFirst: PropTypes.Requireable<boolean>;
|
20
|
-
focusBackOnClose: PropTypes.Requireable<boolean>;
|
21
|
-
focusBackOnExit: PropTypes.Requireable<boolean>;
|
22
|
-
};
|
23
|
-
static defaultProps: {
|
24
|
-
trapDisabled: boolean;
|
25
|
-
autoFocusFirst: boolean;
|
26
|
-
focusBackOnClose: boolean;
|
27
|
-
focusBackOnExit: boolean;
|
28
|
-
};
|
29
|
-
constructor(props: TabTrapProps);
|
30
|
-
componentDidMount(): void;
|
31
|
-
componentWillUnmount(): void;
|
32
|
-
previousFocusedNode?: Element | null;
|
33
|
-
trapWithoutFocus?: boolean;
|
34
|
-
restoreFocus: () => void;
|
35
|
-
node?: HTMLElement | null;
|
36
|
-
containerRef: (node: HTMLElement | null) => void;
|
37
|
-
focusElement: (first?: boolean) => void;
|
38
|
-
focusFirst: () => void;
|
39
|
-
focusLast: () => void;
|
40
|
-
focusLastIfEnabled: (event: React.FocusEvent) => void;
|
41
|
-
handleBlurIfWithoutFocus: (event: React.FocusEvent) => void;
|
42
|
-
trapButtonNode?: HTMLElement | null;
|
43
|
-
trapButtonRef: (node: HTMLElement | null) => void;
|
44
|
-
render(): React.JSX.Element;
|
14
|
+
interface TabTrap {
|
15
|
+
node: HTMLElement | null;
|
45
16
|
}
|
17
|
+
declare const TabTrap: React.ForwardRefExoticComponent<TabTrapProps & React.RefAttributes<TabTrap>>;
|
18
|
+
export default TabTrap;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { c as _objectWithoutProperties, j as _toConsumableArray, d as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.array.filter.js';
|
3
3
|
import 'core-js/modules/es.object.to-string.js';
|
4
|
-
import {
|
4
|
+
import { forwardRef, useRef, useImperativeHandle, useCallback, useEffect } from 'react';
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import { isNodeInVisiblePartOfPage } from '../global/dom.js';
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
@@ -18,173 +18,161 @@ var modules_6dce58ae = {"light":"light_rui_2ac4","trapButton":"trapButton_rui_11
|
|
18
18
|
|
19
19
|
var _excluded = ["children", "trapDisabled", "autoFocusFirst", "focusBackOnClose", "focusBackOnExit"];
|
20
20
|
var FOCUSABLE_ELEMENTS = 'input, button, select, textarea, a[href], *[tabindex]:not([data-trap-button]):not([data-scrollable-container])';
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
22
|
+
var TabTrap = /*#__PURE__*/forwardRef(function TabTrap(_ref, ref) {
|
23
|
+
var children = _ref.children,
|
24
|
+
_ref$trapDisabled = _ref.trapDisabled,
|
25
|
+
trapDisabled = _ref$trapDisabled === void 0 ? false : _ref$trapDisabled,
|
26
|
+
_ref$autoFocusFirst = _ref.autoFocusFirst,
|
27
|
+
autoFocusFirst = _ref$autoFocusFirst === void 0 ? true : _ref$autoFocusFirst,
|
28
|
+
_ref$focusBackOnClose = _ref.focusBackOnClose,
|
29
|
+
focusBackOnClose = _ref$focusBackOnClose === void 0 ? true : _ref$focusBackOnClose,
|
30
|
+
_ref$focusBackOnExit = _ref.focusBackOnExit,
|
31
|
+
focusBackOnExit = _ref$focusBackOnExit === void 0 ? false : _ref$focusBackOnExit,
|
32
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
33
|
+
var nodeRef = useRef(null);
|
34
|
+
var trapButtonNodeRef = useRef(null);
|
35
|
+
var previousFocusedNodeRef = useRef(null);
|
36
|
+
var trapWithoutFocusRef = useRef(false);
|
37
|
+
var mountedRef = useRef(false);
|
38
|
+
// It's the same approach as in focus-trap-react:
|
39
|
+
// https://github.com/focus-trap/focus-trap-react/commit/3b22fca9eebeb883edc89548850fe5a5b9d6d50e
|
40
|
+
// We can't do it in useEffect because it's too late, some children might have already
|
41
|
+
// focused itself.
|
42
|
+
if (previousFocusedNodeRef.current === null) {
|
43
|
+
previousFocusedNodeRef.current = document.activeElement;
|
44
|
+
}
|
45
|
+
useImperativeHandle(ref, function () {
|
46
|
+
return {
|
47
|
+
node: nodeRef.current
|
48
|
+
};
|
49
|
+
}, []);
|
50
|
+
var focusFirst = useCallback(function () {
|
51
|
+
return focusElement(true);
|
52
|
+
}, []);
|
53
|
+
var focusLast = function focusLast() {
|
54
|
+
return focusElement(false);
|
55
|
+
};
|
56
|
+
useEffect(function () {
|
57
|
+
mountedRef.current = true;
|
58
|
+
return function () {
|
59
|
+
mountedRef.current = false;
|
60
|
+
};
|
61
|
+
}, []);
|
62
|
+
useEffect(function () {
|
63
|
+
if (autoFocusFirst) {
|
64
|
+
focusFirst();
|
65
|
+
} else if (!trapDisabled) {
|
66
|
+
var _nodeRef$current, _nodeRef$current2;
|
67
|
+
var previousFocusedElementIsInContainer = previousFocusedNodeRef.current && ((_nodeRef$current = nodeRef.current) === null || _nodeRef$current === void 0 ? void 0 : _nodeRef$current.contains(previousFocusedNodeRef.current));
|
68
|
+
// The component wrapped in TabTrap can already have a focused element (e.g. Date Picker),
|
69
|
+
// so we need to check if it does. If so, we don't need to focus anything.
|
70
|
+
var currentlyFocusedElementIsInContainer = (_nodeRef$current2 = nodeRef.current) === null || _nodeRef$current2 === void 0 ? void 0 : _nodeRef$current2.contains(document.activeElement);
|
71
|
+
if (!nodeRef.current || !previousFocusedElementIsInContainer && !currentlyFocusedElementIsInContainer) {
|
72
|
+
var _trapButtonNodeRef$cu;
|
73
|
+
trapWithoutFocusRef.current = true;
|
74
|
+
(_trapButtonNodeRef$cu = trapButtonNodeRef.current) === null || _trapButtonNodeRef$cu === void 0 || _trapButtonNodeRef$cu.focus();
|
64
75
|
}
|
65
|
-
}
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
_defineProperty(_this, "focusLast", function () {
|
70
|
-
return _this.focusElement(false);
|
71
|
-
});
|
72
|
-
_defineProperty(_this, "focusLastIfEnabled", function (event) {
|
73
|
-
if (_this.trapWithoutFocus) {
|
74
|
-
return;
|
76
|
+
}
|
77
|
+
return function () {
|
78
|
+
if (focusBackOnClose) {
|
79
|
+
restoreFocus();
|
75
80
|
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
81
|
+
};
|
82
|
+
}, [autoFocusFirst, trapDisabled, focusBackOnClose, focusFirst]);
|
83
|
+
function restoreFocus() {
|
84
|
+
var previousFocusedNode = previousFocusedNodeRef.current;
|
85
|
+
if (previousFocusedNode instanceof HTMLElement && previousFocusedNode.focus && isNodeInVisiblePartOfPage(previousFocusedNode)) {
|
86
|
+
// If no delay is added, restoring focus caused by pressing Enter will trigger
|
87
|
+
// the onClick event on the previousFocusedNode, e.g.
|
88
|
+
// https://youtrack.jetbrains.com/issue/RG-2450/Anchor-should-be-focused-after-closing-datepicker#focus=Comments-27-10044234.0-0.
|
89
|
+
setTimeout(function () {
|
90
|
+
// This is to prevent the focus from being restored the first time
|
91
|
+
// componentWillUnmount is called in StrictMode.
|
92
|
+
if (!mountedRef.current) {
|
93
|
+
previousFocusedNode.focus({
|
94
|
+
preventScroll: true
|
95
|
+
});
|
80
96
|
}
|
81
|
-
}
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
if (!newFocused) {
|
93
|
-
return;
|
94
|
-
}
|
95
|
-
if (newFocused instanceof Element && (_this$node = _this.node) !== null && _this$node !== void 0 && _this$node.contains(newFocused)) {
|
96
|
-
return;
|
97
|
-
}
|
98
|
-
_this.focusLast();
|
99
|
-
});
|
100
|
-
_defineProperty(_this, "trapButtonNode", void 0);
|
101
|
-
_defineProperty(_this, "trapButtonRef", function (node) {
|
102
|
-
if (!node) {
|
103
|
-
return;
|
104
|
-
}
|
105
|
-
_this.trapButtonNode = node;
|
97
|
+
});
|
98
|
+
}
|
99
|
+
}
|
100
|
+
function focusElement() {
|
101
|
+
var first = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
102
|
+
var node = nodeRef.current;
|
103
|
+
if (!node) {
|
104
|
+
return;
|
105
|
+
}
|
106
|
+
var tabables = _toConsumableArray(node.querySelectorAll(FOCUSABLE_ELEMENTS)).filter(function (item) {
|
107
|
+
return item.tabIndex >= 0;
|
106
108
|
});
|
107
|
-
|
108
|
-
|
109
|
+
var toBeFocused = first ? tabables[0] : tabables[tabables.length - 1];
|
110
|
+
if (toBeFocused) {
|
111
|
+
toBeFocused.focus();
|
112
|
+
}
|
109
113
|
}
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
value: function componentDidMount() {
|
114
|
-
if (this.props.autoFocusFirst) {
|
115
|
-
this.focusFirst();
|
116
|
-
} else if (!this.props.trapDisabled) {
|
117
|
-
var _this$node2, _this$node3;
|
118
|
-
var previousFocusedElementIsInContainer = this.previousFocusedNode && ((_this$node2 = this.node) === null || _this$node2 === void 0 ? void 0 : _this$node2.contains(this.previousFocusedNode));
|
119
|
-
// The component wrapped in TabTrap can already have a focused element (e.g. Date Picker),
|
120
|
-
// so we need to check if it does. If so, we don't need to focus anything.
|
121
|
-
var currentlyFocusedElementIsInContainer = (_this$node3 = this.node) === null || _this$node3 === void 0 ? void 0 : _this$node3.contains(document.activeElement);
|
122
|
-
if (!this.node || !previousFocusedElementIsInContainer && !currentlyFocusedElementIsInContainer) {
|
123
|
-
var _this$trapButtonNode;
|
124
|
-
this.trapWithoutFocus = true;
|
125
|
-
(_this$trapButtonNode = this.trapButtonNode) === null || _this$trapButtonNode === void 0 || _this$trapButtonNode.focus();
|
126
|
-
}
|
127
|
-
}
|
114
|
+
function focusLastIfEnabled(event) {
|
115
|
+
if (trapWithoutFocusRef.current) {
|
116
|
+
return;
|
128
117
|
}
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
this.restoreFocus();
|
118
|
+
if (focusBackOnExit) {
|
119
|
+
var prevFocused = event.nativeEvent.relatedTarget;
|
120
|
+
if (prevFocused != null && nodeRef.current != null && prevFocused instanceof Element && nodeRef.current.contains(prevFocused)) {
|
121
|
+
restoreFocus();
|
134
122
|
}
|
123
|
+
} else {
|
124
|
+
focusLast();
|
135
125
|
}
|
136
|
-
}
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
if (trapDisabled) {
|
147
|
-
return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({
|
148
|
-
ref: this.containerRef
|
149
|
-
}, restProps), {}, {
|
150
|
-
children: children
|
151
|
-
}));
|
152
|
-
}
|
153
|
-
return /*#__PURE__*/jsxs("div", _objectSpread2(_objectSpread2({
|
154
|
-
ref: this.containerRef
|
155
|
-
}, restProps), {}, {
|
156
|
-
children: [/*#__PURE__*/jsx("div", {
|
157
|
-
// It never actually stays focused
|
158
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
159
|
-
tabIndex: 0,
|
160
|
-
ref: this.trapButtonRef,
|
161
|
-
className: modules_6dce58ae.trapButton,
|
162
|
-
onFocus: this.focusLastIfEnabled,
|
163
|
-
onBlur: this.handleBlurIfWithoutFocus,
|
164
|
-
"data-trap-button": true
|
165
|
-
}), children, /*#__PURE__*/jsx("div", {
|
166
|
-
// It never actually stays focused
|
167
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
168
|
-
tabIndex: 0,
|
169
|
-
onFocus: focusBackOnExit ? this.restoreFocus : this.focusFirst,
|
170
|
-
"data-trap-button": true
|
171
|
-
})]
|
172
|
-
}));
|
126
|
+
}
|
127
|
+
function handleBlurIfWithoutFocus(event) {
|
128
|
+
var _nodeRef$current3;
|
129
|
+
if (!trapWithoutFocusRef.current) {
|
130
|
+
return;
|
131
|
+
}
|
132
|
+
trapWithoutFocusRef.current = false;
|
133
|
+
var newFocused = event.nativeEvent.relatedTarget;
|
134
|
+
if (!newFocused) {
|
135
|
+
return;
|
173
136
|
}
|
174
|
-
|
175
|
-
|
176
|
-
|
137
|
+
if (newFocused instanceof Element && (_nodeRef$current3 = nodeRef.current) !== null && _nodeRef$current3 !== void 0 && _nodeRef$current3.contains(newFocused)) {
|
138
|
+
return;
|
139
|
+
}
|
140
|
+
focusLast();
|
141
|
+
}
|
142
|
+
if (trapDisabled) {
|
143
|
+
return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({
|
144
|
+
ref: nodeRef
|
145
|
+
}, restProps), {}, {
|
146
|
+
children: children
|
147
|
+
}));
|
148
|
+
}
|
149
|
+
return /*#__PURE__*/jsxs("div", _objectSpread2(_objectSpread2({
|
150
|
+
ref: nodeRef
|
151
|
+
}, restProps), {}, {
|
152
|
+
children: [/*#__PURE__*/jsx("div", {
|
153
|
+
// It never actually stays focused
|
154
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
155
|
+
tabIndex: 0,
|
156
|
+
ref: trapButtonNodeRef,
|
157
|
+
className: modules_6dce58ae.trapButton,
|
158
|
+
onFocus: focusLastIfEnabled,
|
159
|
+
onBlur: handleBlurIfWithoutFocus,
|
160
|
+
"data-trap-button": true
|
161
|
+
}), children, /*#__PURE__*/jsx("div", {
|
162
|
+
// It never actually stays focused
|
163
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
164
|
+
tabIndex: 0,
|
165
|
+
onFocus: focusBackOnExit ? restoreFocus : focusFirst,
|
166
|
+
"data-trap-button": true
|
167
|
+
})]
|
168
|
+
}));
|
169
|
+
});
|
170
|
+
TabTrap.propTypes = {
|
177
171
|
children: PropTypes.node.isRequired,
|
178
172
|
trapDisabled: PropTypes.bool,
|
179
173
|
autoFocusFirst: PropTypes.bool,
|
180
174
|
focusBackOnClose: PropTypes.bool,
|
181
175
|
focusBackOnExit: PropTypes.bool
|
182
|
-
}
|
183
|
-
_defineProperty(TabTrap, "defaultProps", {
|
184
|
-
trapDisabled: false,
|
185
|
-
autoFocusFirst: true,
|
186
|
-
focusBackOnClose: true,
|
187
|
-
focusBackOnExit: false
|
188
|
-
});
|
176
|
+
};
|
189
177
|
|
190
178
|
export { FOCUSABLE_ELEMENTS, TabTrap as default };
|
@@ -10,6 +10,7 @@ import '../global/composeRefs.js';
|
|
10
10
|
import 'core-js/modules/es.object.to-string.js';
|
11
11
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
12
12
|
import 'memoize-one';
|
13
|
+
import 'util-deprecate';
|
13
14
|
import 'core-js/modules/es.array.map.js';
|
14
15
|
import 'classnames';
|
15
16
|
import '@jetbrains/icons/chevron-right';
|
@@ -19,7 +20,6 @@ import '../checkbox/checkbox.js';
|
|
19
20
|
import '@jetbrains/icons/checkmark-12px';
|
20
21
|
import '@jetbrains/icons/remove-12px';
|
21
22
|
import '../icon/icon.js';
|
22
|
-
import 'util-deprecate';
|
23
23
|
import '../icon/icon__constants.js';
|
24
24
|
import '../_helpers/icon__svg.js';
|
25
25
|
import 'core-js/modules/es.regexp.exec.js';
|
@@ -32,7 +32,6 @@ import 'core-js/modules/es.weak-map.js';
|
|
32
32
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
33
33
|
import '../control-help/control-help.js';
|
34
34
|
import '../button/button.js';
|
35
|
-
import '@jetbrains/icons/chevron-10px';
|
36
35
|
import '../link/clickableLink.js';
|
37
36
|
import '../global/controls-height.js';
|
38
37
|
import '../_helpers/button__classes.js';
|
@@ -56,6 +56,7 @@ export default class Row<T extends SelectionItem> extends PureComponent<RowProps
|
|
56
56
|
onDoubleClick: () => void;
|
57
57
|
row?: HTMLElement | null;
|
58
58
|
rowRef: (el: HTMLElement | null) => void;
|
59
|
+
composedRowRef: import("memoize-one").MemoizedFn<(...refs: (React.Ref<HTMLElement> | undefined)[]) => (value: HTMLElement | null) => void>;
|
59
60
|
render(): React.JSX.Element;
|
60
61
|
}
|
61
62
|
export type RowAttrs<T extends SelectionItem> = JSX.LibraryManagedAttributes<typeof Row, RowProps<T>>;
|
package/components/table/row.js
CHANGED
@@ -12,7 +12,7 @@ import { Button } from '../button/button.js';
|
|
12
12
|
import Tooltip from '../tooltip/tooltip.js';
|
13
13
|
import joinDataTestAttributes from '../global/data-tests.js';
|
14
14
|
import getUID from '../global/get-uid.js';
|
15
|
-
import
|
15
|
+
import { createComposedRef } from '../global/composeRefs.js';
|
16
16
|
import Cell from './cell.js';
|
17
17
|
import { m as modules_1db4bbca } from '../_helpers/table.js';
|
18
18
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
@@ -33,7 +33,6 @@ import 'core-js/modules/es.weak-map.js';
|
|
33
33
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
34
34
|
import '../global/prop-types.js';
|
35
35
|
import '../control-help/control-help.js';
|
36
|
-
import '@jetbrains/icons/chevron-10px';
|
37
36
|
import '../link/clickableLink.js';
|
38
37
|
import '../global/controls-height.js';
|
39
38
|
import '../_helpers/button__classes.js';
|
@@ -122,6 +121,7 @@ var Row = /*#__PURE__*/function (_PureComponent) {
|
|
122
121
|
_defineProperty(_this, "rowRef", function (el) {
|
123
122
|
_this.row = el;
|
124
123
|
});
|
124
|
+
_defineProperty(_this, "composedRowRef", createComposedRef());
|
125
125
|
return _this;
|
126
126
|
}
|
127
127
|
_inherits(Row, _PureComponent);
|
@@ -249,7 +249,7 @@ var Row = /*#__PURE__*/function (_PureComponent) {
|
|
249
249
|
});
|
250
250
|
return /*#__PURE__*/jsx("tr", _objectSpread2(_objectSpread2(_objectSpread2({
|
251
251
|
id: this.id,
|
252
|
-
ref:
|
252
|
+
ref: this.composedRowRef(this.rowRef, innerRef),
|
253
253
|
className: classes,
|
254
254
|
tabIndex: 0,
|
255
255
|
"data-test": joinDataTestAttributes('ring-table-row', dataTest)
|
@@ -14,6 +14,7 @@ import '../global/composeRefs.js';
|
|
14
14
|
import 'core-js/modules/es.object.to-string.js';
|
15
15
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
16
16
|
import 'memoize-one';
|
17
|
+
import 'util-deprecate';
|
17
18
|
import '../global/get-uid.js';
|
18
19
|
import 'core-js/modules/es.regexp.to-string.js';
|
19
20
|
import '../shortcuts/shortcuts.js';
|
@@ -46,7 +47,6 @@ import '../checkbox/checkbox.js';
|
|
46
47
|
import '@jetbrains/icons/checkmark-12px';
|
47
48
|
import '@jetbrains/icons/remove-12px';
|
48
49
|
import '../icon/icon.js';
|
49
|
-
import 'util-deprecate';
|
50
50
|
import '../icon/icon__constants.js';
|
51
51
|
import '../_helpers/icon__svg.js';
|
52
52
|
import 'core-js/modules/es.string.replace.js';
|
@@ -21,6 +21,7 @@ import '../global/composeRefs.js';
|
|
21
21
|
import 'core-js/modules/es.object.to-string.js';
|
22
22
|
import 'core-js/modules/web.dom-collections.for-each.js';
|
23
23
|
import 'memoize-one';
|
24
|
+
import 'util-deprecate';
|
24
25
|
import 'core-js/modules/es.regexp.to-string.js';
|
25
26
|
import '../shortcuts/core.js';
|
26
27
|
import 'core-js/modules/es.array.find-index.js';
|
@@ -50,7 +51,6 @@ import '../checkbox/checkbox.js';
|
|
50
51
|
import '@jetbrains/icons/checkmark-12px';
|
51
52
|
import '@jetbrains/icons/remove-12px';
|
52
53
|
import '../icon/icon.js';
|
53
|
-
import 'util-deprecate';
|
54
54
|
import '../icon/icon__constants.js';
|
55
55
|
import '../_helpers/icon__svg.js';
|
56
56
|
import 'core-js/modules/es.string.replace.js';
|
@@ -85,6 +85,7 @@ import '../list/consts.js';
|
|
85
85
|
import '../global/typescript-utils.js';
|
86
86
|
import '../_helpers/anchor.js';
|
87
87
|
import '../button/button.js';
|
88
|
+
import '@jetbrains/icons/chevron-down';
|
88
89
|
import '../link/clickableLink.js';
|
89
90
|
import '../global/controls-height.js';
|
90
91
|
import '../_helpers/button__classes.js';
|
@@ -91,6 +91,7 @@ import '../dropdown/dropdown.js';
|
|
91
91
|
import '../global/typescript-utils.js';
|
92
92
|
import '../_helpers/anchor.js';
|
93
93
|
import '../button/button.js';
|
94
|
+
import '@jetbrains/icons/chevron-down';
|
94
95
|
import '../global/controls-height.js';
|
95
96
|
import '../_helpers/button__classes.js';
|
96
97
|
import './custom-item.js';
|
@@ -94,6 +94,7 @@ import '../dropdown/dropdown.js';
|
|
94
94
|
import '../global/typescript-utils.js';
|
95
95
|
import '../_helpers/anchor.js';
|
96
96
|
import '../button/button.js';
|
97
|
+
import '@jetbrains/icons/chevron-down';
|
97
98
|
import '../global/controls-height.js';
|
98
99
|
import '../_helpers/button__classes.js';
|
99
100
|
import './collapsible-tab.js';
|
@@ -93,6 +93,7 @@ import '../dropdown/dropdown.js';
|
|
93
93
|
import '../global/typescript-utils.js';
|
94
94
|
import '../_helpers/anchor.js';
|
95
95
|
import '../button/button.js';
|
96
|
+
import '@jetbrains/icons/chevron-down';
|
96
97
|
import '../global/controls-height.js';
|
97
98
|
import '../_helpers/button__classes.js';
|
98
99
|
import './collapsible-tab.js';
|
package/components/tabs/tabs.js
CHANGED
@@ -96,6 +96,7 @@ import '../dropdown/dropdown.js';
|
|
96
96
|
import '../global/typescript-utils.js';
|
97
97
|
import '../_helpers/anchor.js';
|
98
98
|
import '../button/button.js';
|
99
|
+
import '@jetbrains/icons/chevron-down';
|
99
100
|
import '../global/controls-height.js';
|
100
101
|
import '../_helpers/button__classes.js';
|
101
102
|
import './collapsible-tab.js';
|
package/components/tag/tag.js
CHANGED
@@ -4,11 +4,11 @@ import { PureComponent } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import classNames from 'classnames';
|
6
6
|
import closeIcon from '@jetbrains/icons/close-12px';
|
7
|
+
import deprecate from 'util-deprecate';
|
7
8
|
import Icon from '../icon/icon.js';
|
8
9
|
import { Button } from '../button/button.js';
|
9
10
|
import { ControlsHeight } from '../global/controls-height.js';
|
10
11
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
11
|
-
import 'util-deprecate';
|
12
12
|
import '../icon/icon__constants.js';
|
13
13
|
import '../_helpers/icon__svg.js';
|
14
14
|
import 'core-js/modules/es.regexp.exec.js';
|
@@ -20,12 +20,16 @@ import 'core-js/modules/es.map.js';
|
|
20
20
|
import 'core-js/modules/es.object.to-string.js';
|
21
21
|
import 'core-js/modules/es.weak-map.js';
|
22
22
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
23
|
-
import '@jetbrains/icons/chevron-
|
23
|
+
import '@jetbrains/icons/chevron-down';
|
24
24
|
import '../link/clickableLink.js';
|
25
25
|
import '../_helpers/button__classes.js';
|
26
26
|
|
27
27
|
var modules_2f9be069 = {"max-height":"20px","tag":"tag_rui_5765 resetButton_rui_f295","tagAngled":"tagAngled_rui_5765","light":"light_rui_2ac4","withRemove":"withRemove_rui_5765","container":"container_rui_5765","focused":"focused_rui_5765","content":"content_rui_5765 ellipsis_rui_f295","disabled":"disabled_rui_5765","remove":"remove_rui_5765","removeIcon":"removeIcon_rui_5765","icon":"icon_rui_5765","avatarContainer":"avatarContainer_rui_5765","customIcon":"customIcon_rui_5765","avatarIcon":"avatarIcon_rui_5765"};
|
28
28
|
|
29
|
+
var warnAngled = deprecate(function () {}, 'Tag angled prop is deprecated and will be removed in Ring UI 7.0');
|
30
|
+
/**
|
31
|
+
* @name Tag
|
32
|
+
*/
|
29
33
|
var Tag = /*#__PURE__*/function (_PureComponent) {
|
30
34
|
function Tag() {
|
31
35
|
var _this;
|
@@ -148,6 +152,9 @@ var Tag = /*#__PURE__*/function (_PureComponent) {
|
|
148
152
|
}, {
|
149
153
|
key: "render",
|
150
154
|
value: function render() {
|
155
|
+
if (this.props.angled) {
|
156
|
+
warnAngled();
|
157
|
+
}
|
151
158
|
var classes = classNames('ring-js-shortcuts', modules_2f9be069.tag, {
|
152
159
|
[modules_2f9be069.focused]: this.state.focused,
|
153
160
|
[modules_2f9be069.disabled]: this.props.disabled,
|
@@ -7,8 +7,8 @@ import Tag from '../tag/tag.js';
|
|
7
7
|
import { jsxs } from 'react/jsx-runtime';
|
8
8
|
import 'core-js/modules/es.array.concat.js';
|
9
9
|
import '@jetbrains/icons/close-12px';
|
10
|
-
import '../icon/icon.js';
|
11
10
|
import 'util-deprecate';
|
11
|
+
import '../icon/icon.js';
|
12
12
|
import '../icon/icon__constants.js';
|
13
13
|
import '../_helpers/icon__svg.js';
|
14
14
|
import 'core-js/modules/es.regexp.exec.js';
|
@@ -21,7 +21,7 @@ import 'core-js/modules/es.object.to-string.js';
|
|
21
21
|
import 'core-js/modules/es.weak-map.js';
|
22
22
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
23
23
|
import '../button/button.js';
|
24
|
-
import '@jetbrains/icons/chevron-
|
24
|
+
import '@jetbrains/icons/chevron-down';
|
25
25
|
import '../link/clickableLink.js';
|
26
26
|
import '../global/controls-height.js';
|
27
27
|
import '../_helpers/button__classes.js';
|
package/components/text/text.js
CHANGED
@@ -5,9 +5,9 @@ import PropTypes from 'prop-types';
|
|
5
5
|
import classNames from 'classnames';
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
7
7
|
|
8
|
-
var modules_78d1bce6 = {"light":"light_rui_2ac4","text":"text_rui_2f31","sizeS":"sizeS_rui_2f31","sizeM":"sizeM_rui_2f31","sizeL":"sizeL_rui_2f31","info":"info_rui_2f31"};
|
8
|
+
var modules_78d1bce6 = {"light":"light_rui_2ac4","text":"text_rui_2f31","sizeS":"sizeS_rui_2f31","sizeM":"sizeM_rui_2f31","sizeL":"sizeL_rui_2f31","info":"info_rui_2f31","bold":"bold_rui_2f31"};
|
9
9
|
|
10
|
-
var _excluded = ["children", "className", "info", "size"];
|
10
|
+
var _excluded = ["children", "className", "info", "size", "bold"];
|
11
11
|
var TextSize = {
|
12
12
|
S: 's',
|
13
13
|
M: 'm',
|
@@ -30,9 +30,11 @@ var Text = /*#__PURE__*/function (_Component) {
|
|
30
30
|
className = _this$props.className,
|
31
31
|
info = _this$props.info,
|
32
32
|
size = _this$props.size,
|
33
|
+
bold = _this$props.bold,
|
33
34
|
restProps = _objectWithoutProperties(_this$props, _excluded);
|
34
35
|
var classes = classNames(modules_78d1bce6.text, className, {
|
35
36
|
[modules_78d1bce6.info]: info,
|
37
|
+
[modules_78d1bce6.bold]: bold,
|
36
38
|
[modules_78d1bce6.sizeS]: size === Text.Size.S,
|
37
39
|
[modules_78d1bce6.sizeM]: size === Text.Size.M,
|
38
40
|
[modules_78d1bce6.sizeL]: size === Text.Size.L
|
@@ -10,9 +10,9 @@ export declare const Size: {
|
|
10
10
|
*/
|
11
11
|
export interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
12
12
|
size: string;
|
13
|
-
pale?: boolean | null | undefined;
|
14
13
|
leftLabel?: ReactNode;
|
15
14
|
'data-test'?: string | null | undefined;
|
15
|
+
help?: ReactNode;
|
16
16
|
}
|
17
17
|
declare class Toggle extends PureComponent<ToggleProps> {
|
18
18
|
static propTypes: {
|
@@ -24,7 +24,6 @@ declare class Toggle extends PureComponent<ToggleProps> {
|
|
24
24
|
defaultChecked: PropTypes.Requireable<boolean>;
|
25
25
|
checked: PropTypes.Requireable<boolean>;
|
26
26
|
disabled: PropTypes.Requireable<boolean>;
|
27
|
-
pale: PropTypes.Requireable<boolean>;
|
28
27
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
29
28
|
onTransitionEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
30
29
|
size: PropTypes.Requireable<string>;
|