@jetbrains/ring-ui 4.1.0-beta.3 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +17 -15
- package/babel.config.js +3 -2
- package/components/alert/alert.js +9 -3
- package/components/alert/alert.test.js +21 -48
- package/components/alert/container.css +1 -1
- package/components/alert/container.test.js +3 -13
- package/components/alert-service/alert-service.examples.css +18 -0
- package/components/alert-service/alert-service.examples.js +21 -0
- package/components/alert-service/alert-service.js +10 -3
- package/components/analytics/analytics__fus-plugin.js +3 -3
- package/components/analytics/analytics__ga-plugin.js +2 -2
- package/components/auth/auth.test.js +14 -7
- package/components/auth/auth__core.js +64 -33
- package/components/auth-dialog/auth-dialog.css +2 -3
- package/components/auth-dialog/auth-dialog.js +4 -1
- package/components/auth-dialog/auth-dialog.test.js +3 -19
- package/components/avatar/avatar.css +4 -1
- package/components/avatar/avatar.examples.js +3 -2
- package/components/avatar/avatar.js +34 -6
- package/components/avatar/avatar.test.js +20 -17
- package/components/avatar/fallback-avatar.js +136 -0
- package/components/avatar-editor-ng/avatar-editor-ng.css +2 -2
- package/components/avatar-editor-ng/avatar-editor-ng.js +2 -1
- package/components/avatar-editor-ng/{avatar-editor-ng.html → avatar-editor-ng__template.js} +2 -2
- package/components/badge/badge.test.js +13 -20
- package/components/button/button.css +2 -2
- package/components/button/button.js +4 -1
- package/components/button/button.test.js +32 -33
- package/components/button-group/button-group.js +1 -1
- package/components/button-group/caption.js +1 -1
- package/components/button-ng/button-ng.js +1 -1
- package/components/button-set-ng/button-set-ng.js +3 -1
- package/components/checkbox/checkbox.css +1 -1
- package/components/code/code.js +2 -5
- package/components/confirm/confirm.js +1 -0
- package/components/confirm-service/confirm-service.js +5 -5
- package/components/content-layout/content-layout.css +1 -1
- package/components/data-list/data-list.css +1 -1
- package/components/date-picker/date-input.js +5 -4
- package/components/date-picker/date-picker.css +34 -22
- package/components/date-picker/date-picker.js +16 -14
- package/components/date-picker/date-popup.js +22 -7
- package/components/date-picker/month-names.js +8 -5
- package/components/date-picker/month.js +6 -2
- package/components/date-picker/weekdays.js +10 -2
- package/components/dialog/dialog.examples.js +3 -1
- package/components/dialog/dialog.js +10 -5
- package/components/dialog/dialog.test.js +1 -1
- package/components/dialog/dialog__body-scroll-preventer.js +51 -31
- package/components/dialog-ng/dialog-ng.js +10 -10
- package/components/dialog-ng/{dialog-ng.html → dialog-ng__template.js} +2 -2
- package/components/dropdown/dropdown.examples.js +36 -1
- package/components/dropdown/dropdown.test.js +2 -2
- package/components/dropdown-menu/dropdown-menu.examples.js +47 -0
- package/components/dropdown-menu/dropdown-menu.js +117 -0
- package/components/dropdown-menu/dropdown-menu.test.js +76 -0
- package/components/error-bubble/error-bubble-legacy.css +1 -1
- package/components/error-bubble/error-bubble.css +1 -1
- package/components/error-bubble/error-bubble.examples.js +1 -1
- package/components/error-page/error-page.css +2 -2
- package/components/footer-ng/footer-ng.js +13 -3
- package/components/form/form.css +2 -2
- package/components/form-ng/form-ng.js +3 -1
- package/components/global/global.css +1 -1
- package/components/global/theme.js +1 -1
- package/components/global/variables.css +8 -1
- package/components/grid/grid.css +10 -9
- package/components/header/header.css +1 -1
- package/components/header/header.examples.js +7 -8
- package/components/header/profile.js +10 -11
- package/components/http/http.js +1 -1
- package/components/icon/icon.css +5 -4
- package/components/input/input-legacy.css +7 -7
- package/components/island/header.js +2 -2
- package/components/island/island.css +8 -3
- package/components/island-legacy/island-legacy.css +3 -1
- package/components/list/list.js +6 -1
- package/components/list/list__custom.js +9 -3
- package/components/list/list__item.js +8 -2
- package/components/list/list__link.js +2 -1
- package/components/loader-inline/loader-inline.css +1 -1
- package/components/loader-screen/loader-screen.css +1 -1
- package/components/message/message.css +1 -1
- package/components/message/message.examples.js +8 -7
- package/components/pager/pager.js +5 -3
- package/components/permissions/permissions.js +1 -1
- package/components/popup/popup.js +1 -1
- package/components/popup/popup.test.js +15 -13
- package/components/progress-bar/progress-bar.css +1 -1
- package/components/progress-bar/progress-bar.examples.js +3 -3
- package/components/progress-bar/progress-bar.js +5 -2
- package/components/progress-bar/progress-bar.test.js +12 -13
- package/components/progress-bar-ng/progress-bar-ng.examples.js +3 -3
- package/components/query-assist/query-assist.css +13 -3
- package/components/query-assist/query-assist.examples.js +3 -4
- package/components/query-assist/query-assist.js +56 -12
- package/components/query-assist/query-assist.test.js +37 -5
- package/components/save-field-ng/save-field-ng.css +0 -3
- package/components/save-field-ng/save-field-ng.js +3 -1
- package/components/save-field-ng/{save-field-ng.html → save-field-ng__template.js} +2 -2
- package/components/select/select.css +12 -7
- package/components/select/select.examples.js +13 -0
- package/components/select/select.js +30 -43
- package/components/select/select.test.js +4 -5
- package/components/select/select__popup.js +1 -0
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.css +1 -1
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.js +1 -1
- package/components/shortcuts-hint-ng/{shortcuts-hint-ng.html → shortcuts-hint-ng__template.js} +2 -2
- package/components/sidebar/sidebar.css +1 -0
- package/components/sidebar-ng/sidebar-ng.js +6 -2
- package/components/sidebar-ng/{sidebar-ng__button.html → sidebar-ng__button-template.js} +2 -2
- package/components/sidebar-ng/{sidebar-ng.html → sidebar-ng__template.js} +2 -2
- package/components/table/header.js +9 -1
- package/components/table/row.js +2 -1
- package/components/table/table.css +2 -1
- package/components/table-legacy/table-legacy.css +2 -2
- package/components/table-legacy/table-legacy__toolbar.css +2 -2
- package/components/table-legacy-ng/table-legacy-ng.js +38 -5
- package/components/table-legacy-ng/table-legacy-ng__pager.js +7 -1
- package/components/tabs/collapsible-tab.js +2 -2
- package/components/tabs/collapsible-tabs.js +5 -9
- package/components/tabs/tab-link.js +4 -2
- package/components/tabs/tabs.css +32 -5
- package/components/tabs-ng/tabs-ng.js +4 -2
- package/components/tabs-ng/{tabs-ng.html → tabs-ng__template.js} +6 -2
- package/components/tag/tag.css +5 -2
- package/components/tag/tag.examples.js +3 -0
- package/components/tag/tag.js +19 -16
- package/components/tags-input/tag-input.examples.js +1 -1
- package/components/tags-input/tags-input.js +5 -2
- package/components/template-ng/template-ng.js +1 -1
- package/components/tooltip/tooltip.js +7 -2
- package/components/user-agreement/user-agreement.css +1 -5
- package/components/user-agreement/user-agreement.examples.js +7 -6
- package/components/user-agreement/user-agreement.js +11 -3
- package/package.json +85 -83
- package/webpack.config.js +14 -10
- package/components/button-set-ng/button-set-ng.html +0 -1
- package/components/footer-ng/footer-ng.html +0 -13
- package/components/form-ng/form-ng__error-bubble.html +0 -3
- package/components/table-legacy-ng/table-legacy-ng.html +0 -4
- package/components/table-legacy-ng/table-legacy-ng__column.html +0 -12
- package/components/table-legacy-ng/table-legacy-ng__header.html +0 -4
- package/components/table-legacy-ng/table-legacy-ng__pager.html +0 -7
- package/components/table-legacy-ng/table-legacy-ng__row.html +0 -12
- package/components/table-legacy-ng/table-legacy-ng__title.html +0 -9
- package/dist/_helpers/_rollupPluginBabelHelpers.js +0 -123
- package/dist/_helpers/background-flow.js +0 -232
- package/dist/_helpers/badge.js +0 -3
- package/dist/_helpers/button.js +0 -145
- package/dist/_helpers/clickableLink.js +0 -65
- package/dist/_helpers/data-tests.js +0 -15
- package/dist/_helpers/disable-hover-hoc.js +0 -407
- package/dist/_helpers/dom.js +0 -101
- package/dist/_helpers/get-uid.js +0 -15
- package/dist/_helpers/linear-function.js +0 -17
- package/dist/_helpers/list.js +0 -1327
- package/dist/_helpers/logo.js +0 -36
- package/dist/_helpers/memoize.js +0 -17
- package/dist/_helpers/popup.js +0 -691
- package/dist/_helpers/popup.target.js +0 -27
- package/dist/_helpers/rerender-hoc.js +0 -49
- package/dist/_helpers/schedule-raf.js +0 -31
- package/dist/_helpers/sniffer.js +0 -6
- package/dist/_helpers/theme.js +0 -40
- package/dist/_helpers/url.js +0 -125
- package/dist/alert-service.js +0 -149
- package/dist/alert.js +0 -284
- package/dist/analytics.js +0 -116
- package/dist/auth-dialog-service.js +0 -56
- package/dist/auth-dialog.js +0 -122
- package/dist/auth.js +0 -1744
- package/dist/avatar.js +0 -152
- package/dist/badge.js +0 -52
- package/dist/button-group.js +0 -48
- package/dist/button-set.js +0 -27
- package/dist/button-toolbar.js +0 -30
- package/dist/button.js +0 -12
- package/dist/caret.js +0 -262
- package/dist/checkbox.js +0 -108
- package/dist/confirm-service.js +0 -102
- package/dist/confirm.js +0 -113
- package/dist/content-layout.js +0 -184
- package/dist/contenteditable.js +0 -81
- package/dist/data-list.js +0 -466
- package/dist/date-picker.js +0 -1398
- package/dist/dialog.js +0 -223
- package/dist/dropdown.js +0 -250
- package/dist/error-bubble.js +0 -56
- package/dist/error-message.js +0 -53
- package/dist/footer.js +0 -124
- package/dist/grid.js +0 -148
- package/dist/group.js +0 -34
- package/dist/header.js +0 -658
- package/dist/heading.js +0 -76
- package/dist/http.js +0 -207
- package/dist/hub-source.js +0 -130
- package/dist/icon.js +0 -211
- package/dist/input.js +0 -228
- package/dist/island.js +0 -314
- package/dist/link.js +0 -117
- package/dist/list.js +0 -29
- package/dist/loader-inline.js +0 -165
- package/dist/loader-screen.js +0 -45
- package/dist/loader.js +0 -338
- package/dist/login-dialog.js +0 -173
- package/dist/logo.js +0 -8
- package/dist/message.js +0 -226
- package/dist/old-browsers-message.js +0 -129
- package/dist/pager.js +0 -325
- package/dist/panel.js +0 -34
- package/dist/permissions.js +0 -466
- package/dist/popup-menu.js +0 -93
- package/dist/popup.js +0 -16
- package/dist/progress-bar.js +0 -111
- package/dist/proxy-attrs.js +0 -19
- package/dist/query-assist.js +0 -1081
- package/dist/radio.js +0 -112
- package/dist/select.js +0 -1920
- package/dist/selection.js +0 -213
- package/dist/shortcuts.js +0 -307
- package/dist/storage.js +0 -373
- package/dist/style.css +0 -1
- package/dist/tab-trap.js +0 -174
- package/dist/table.js +0 -903
- package/dist/tabs.js +0 -721
- package/dist/tag.js +0 -187
- package/dist/tags-input.js +0 -440
- package/dist/tags-list.js +0 -91
- package/dist/text.js +0 -38
- package/dist/toggle.js +0 -80
- package/dist/tooltip.js +0 -202
- package/dist/user-card.js +0 -218
package/dist/tab-trap.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { b as _defineProperty, _ as _objectWithoutProperties, a as _extends } from './_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { i as isNodeInVisiblePartOfPage } from './_helpers/dom.js';
|
|
5
|
-
|
|
6
|
-
var modules_6dce58ae = {"trapButton":"tabTrap_trapButton__12cecc9f"};
|
|
7
|
-
|
|
8
|
-
const FOCUSABLE_ELEMENTS = 'input, button, select, textarea, a[href], *[tabindex]:not([data-trap-button]):not([data-scrollable-container])';
|
|
9
|
-
/**
|
|
10
|
-
* @name TabTrap
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
class TabTrap extends Component {
|
|
14
|
-
constructor(...args) {
|
|
15
|
-
super(...args);
|
|
16
|
-
|
|
17
|
-
_defineProperty(this, "restoreFocus", () => {
|
|
18
|
-
const {
|
|
19
|
-
previousFocusedNode
|
|
20
|
-
} = this;
|
|
21
|
-
|
|
22
|
-
if (previousFocusedNode && previousFocusedNode.focus && isNodeInVisiblePartOfPage(previousFocusedNode)) {
|
|
23
|
-
previousFocusedNode.focus({
|
|
24
|
-
preventScroll: true
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
_defineProperty(this, "containerRef", node => {
|
|
30
|
-
if (!node) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
this.node = node;
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
_defineProperty(this, "focusElement", (first = true) => {
|
|
38
|
-
const {
|
|
39
|
-
node
|
|
40
|
-
} = this;
|
|
41
|
-
|
|
42
|
-
if (!node) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const tabables = [...node.querySelectorAll(FOCUSABLE_ELEMENTS)].filter(item => item.tabIndex >= 0);
|
|
47
|
-
const toBeFocused = first ? tabables[0] : tabables[tabables.length - 1];
|
|
48
|
-
|
|
49
|
-
if (toBeFocused) {
|
|
50
|
-
toBeFocused.focus();
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
_defineProperty(this, "focusFirst", () => this.focusElement(true));
|
|
55
|
-
|
|
56
|
-
_defineProperty(this, "focusLast", () => this.focusElement(false));
|
|
57
|
-
|
|
58
|
-
_defineProperty(this, "focusLastIfEnabled", event => {
|
|
59
|
-
if (this.trapWithoutFocus) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (this.props.focusBackOnExit) {
|
|
64
|
-
const prevFocused = event.nativeEvent.relatedTarget;
|
|
65
|
-
|
|
66
|
-
if (prevFocused != null && this.node != null && this.node.contains(prevFocused)) {
|
|
67
|
-
this.restoreFocus();
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
this.focusLast();
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
_defineProperty(this, "handleBlurIfWithoutFocus", event => {
|
|
75
|
-
if (!this.trapWithoutFocus) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
this.trapWithoutFocus = false;
|
|
80
|
-
const newFocused = event.nativeEvent.relatedTarget;
|
|
81
|
-
|
|
82
|
-
if (!newFocused) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (this.node.contains(newFocused)) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
this.focusLast();
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
_defineProperty(this, "trapButtonRef", node => {
|
|
94
|
-
if (!node) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
this.trapButtonNode = node;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
componentDidMount() {
|
|
103
|
-
this.previousFocusedNode = document.activeElement;
|
|
104
|
-
|
|
105
|
-
if (this.props.autoFocusFirst) {
|
|
106
|
-
this.focusFirst();
|
|
107
|
-
} else if (!this.props.trapDisabled && (!this.node || !this.node.contains(this.previousFocusedNode))) {
|
|
108
|
-
this.trapWithoutFocus = true;
|
|
109
|
-
this.trapButtonNode.focus();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
componentWillUnmount() {
|
|
114
|
-
if (this.props.focusBackOnClose) {
|
|
115
|
-
this.restoreFocus();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
render() {
|
|
120
|
-
const _this$props = this.props,
|
|
121
|
-
{
|
|
122
|
-
children,
|
|
123
|
-
trapDisabled,
|
|
124
|
-
autoFocusFirst,
|
|
125
|
-
focusBackOnClose,
|
|
126
|
-
focusBackOnExit
|
|
127
|
-
} = _this$props,
|
|
128
|
-
restProps = _objectWithoutProperties(_this$props, ["children", "trapDisabled", "autoFocusFirst", "focusBackOnClose", "focusBackOnExit"]);
|
|
129
|
-
|
|
130
|
-
if (trapDisabled) {
|
|
131
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
132
|
-
ref: this.containerRef
|
|
133
|
-
}, restProps), children);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
137
|
-
ref: this.containerRef
|
|
138
|
-
}, restProps), /*#__PURE__*/React.createElement("div", {
|
|
139
|
-
// It never actually stays focused
|
|
140
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
141
|
-
tabIndex: 0,
|
|
142
|
-
ref: this.trapButtonRef,
|
|
143
|
-
className: modules_6dce58ae.trapButton,
|
|
144
|
-
onFocus: this.focusLastIfEnabled,
|
|
145
|
-
onBlur: this.handleBlurIfWithoutFocus,
|
|
146
|
-
"data-trap-button": true
|
|
147
|
-
}), children, /*#__PURE__*/React.createElement("div", {
|
|
148
|
-
// It never actually stays focused
|
|
149
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
150
|
-
tabIndex: 0,
|
|
151
|
-
onFocus: focusBackOnExit ? this.restoreFocus : this.focusFirst,
|
|
152
|
-
"data-trap-button": true
|
|
153
|
-
}));
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
_defineProperty(TabTrap, "propTypes", {
|
|
159
|
-
children: PropTypes.node.isRequired,
|
|
160
|
-
trapDisabled: PropTypes.bool,
|
|
161
|
-
autoFocusFirst: PropTypes.bool,
|
|
162
|
-
focusBackOnClose: PropTypes.bool,
|
|
163
|
-
focusBackOnExit: PropTypes.bool
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
_defineProperty(TabTrap, "defaultProps", {
|
|
167
|
-
trapDisabled: false,
|
|
168
|
-
autoFocusFirst: true,
|
|
169
|
-
focusBackOnClose: true,
|
|
170
|
-
focusBackOnExit: false
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
export default TabTrap;
|
|
174
|
-
export { FOCUSABLE_ELEMENTS };
|