@jetbrains/ring-ui-built 7.0.66 → 7.0.71
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/anchor.js +12 -17
- package/components/_helpers/avatar-info.js +4 -5
- package/components/_helpers/button.classes.js +20 -21
- package/components/_helpers/caption.js +3 -3
- package/components/_helpers/card.js +26 -32
- package/components/_helpers/dialog-body-scroll-preventer.js +1 -2
- package/components/_helpers/icon-svg.js +9 -12
- package/components/_helpers/input.js +78 -86
- package/components/_helpers/loader-core.js +260 -0
- package/components/_helpers/query-assist-suggestions.js +0 -1
- package/components/_helpers/select-filter.js +19 -26
- package/components/_helpers/services-link.js +9 -12
- package/components/_helpers/sidebar.js +36 -44
- package/components/_helpers/tab-link.js +9 -11
- package/components/_helpers/theme.js +20 -24
- package/components/_helpers/title.js +12 -17
- package/components/alert/alert.js +41 -49
- package/components/alert/container.js +9 -12
- package/components/alert-service/alert-service.js +23 -32
- package/components/analytics/analytics-custom-plugin.js +12 -17
- package/components/analytics/analytics.js +1 -3
- package/components/auth/auth-core.js +128 -170
- package/components/auth/auth.js +3 -10
- package/components/auth/background-flow.js +5 -8
- package/components/auth/down-notification.js +9 -17
- package/components/auth/iframe-flow.js +13 -19
- package/components/auth/request-builder.js +4 -9
- package/components/auth/response-parser.js +9 -12
- package/components/auth/storage.js +12 -18
- package/components/auth/token-validator.js +19 -30
- package/components/auth/window-flow.js +22 -27
- package/components/auth-dialog/auth-dialog.js +40 -48
- package/components/auth-dialog-service/auth-dialog-service.js +10 -13
- package/components/avatar/avatar.figma.js +6 -6
- package/components/avatar/avatar.js +58 -59
- package/components/avatar/fallback-avatar.js +8 -11
- package/components/avatar-stack/avatar-stack.figma.js +10 -11
- package/components/avatar-stack/avatar-stack.js +25 -31
- package/components/banner/banner.js +0 -6
- package/components/breadcrumbs/breadcrumbs.figma.js +8 -6
- package/components/breadcrumbs/breadcrumbs.js +4 -5
- package/components/button/button.figma.js +15 -10
- package/components/button/button.js +59 -64
- package/components/button-group/button-group.js +11 -15
- package/components/button-group/caption.js +0 -1
- package/components/button-set/button-set.js +9 -12
- package/components/button-toolbar/button-toolbar.js +8 -11
- package/components/caret/caret.js +20 -28
- package/components/checkbox/checkbox-group.figma.js +8 -10
- package/components/checkbox/checkbox.figma.js +5 -5
- package/components/checkbox/checkbox.js +27 -35
- package/components/clipboard/clipboard-fallback.js +3 -3
- package/components/clipboard/clipboard.js +3 -16
- package/components/code/code.js +8 -14
- package/components/collapse/collapse-content.js +10 -15
- package/components/collapse/collapse-control.js +5 -7
- package/components/collapse/collapse.js +9 -11
- package/components/collapse/utils.js +1 -1
- package/components/confirm/confirm.js +17 -26
- package/components/confirm-service/confirm-service.js +30 -31
- package/components/content-layout/content-layout.js +21 -28
- package/components/content-layout/sidebar.js +0 -2
- package/components/contenteditable/contenteditable.js +23 -28
- package/components/control-help/control-help.js +8 -10
- package/components/control-label/control-label.js +12 -17
- package/components/data-list/data-list.js +57 -65
- package/components/data-list/data-list.mock.js +0 -4
- package/components/data-list/item.js +65 -72
- package/components/data-list/selection.js +11 -19
- package/components/data-list/title.js +0 -4
- package/components/date-picker/consts.js +3 -4
- package/components/date-picker/date-input.js +25 -33
- package/components/date-picker/date-picker.js +179 -193
- package/components/date-picker/date-popup.js +135 -127
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/day.js +24 -30
- package/components/date-picker/month-names.js +7 -12
- package/components/date-picker/month-slider.js +16 -22
- package/components/date-picker/month.js +3 -5
- package/components/date-picker/months.js +6 -6
- package/components/date-picker/weekdays.js +0 -1
- package/components/date-picker/years.js +20 -26
- package/components/dialog/dialog-body-scroll-preventer.js +0 -1
- package/components/dialog/dialog.js +73 -83
- package/components/dropdown/anchor.js +0 -4
- package/components/dropdown/dropdown.js +98 -114
- package/components/dropdown-menu/dropdown-menu.js +80 -79
- package/components/editable-heading/editable-heading.js +48 -54
- package/components/error-bubble/error-bubble.figma.js +4 -4
- package/components/error-bubble/error-bubble.js +9 -13
- package/components/error-message/error-message.js +1 -6
- package/components/footer/footer.js +11 -15
- package/components/global/compose-refs.js +1 -4
- package/components/global/compose.js +1 -4
- package/components/global/configuration.js +3 -3
- package/components/global/controls-height.js +0 -1
- package/components/global/create-stateful-context.js +10 -14
- package/components/global/data-tests.js +2 -10
- package/components/global/dom.js +6 -19
- package/components/global/focus-sensor-hoc.js +74 -87
- package/components/global/fuzzy-highlight.js +3 -8
- package/components/global/get-uid.js +1 -1
- package/components/global/inject-styles.js +5 -6
- package/components/global/listeners.js +2 -11
- package/components/global/memoize.js +0 -2
- package/components/global/normalize-indent.js +2 -6
- package/components/global/promise-with-timeout.js +4 -5
- package/components/global/react-dom-renderer.js +4 -9
- package/components/global/rerender-hoc.js +8 -11
- package/components/global/schedule-raf.js +1 -2
- package/components/global/theme.js +0 -5
- package/components/global/trivial-template-tag.js +1 -6
- package/components/global/url.js +2 -6
- package/components/global/use-event-callback.js +2 -3
- package/components/grid/col.js +7 -18
- package/components/grid/grid.js +9 -14
- package/components/grid/row.js +7 -11
- package/components/group/group.js +9 -12
- package/components/header/header-icon.js +8 -13
- package/components/header/header.js +16 -27
- package/components/header/links.js +7 -10
- package/components/header/logo.js +12 -16
- package/components/header/profile.js +73 -83
- package/components/header/services-link.js +0 -2
- package/components/header/services.js +32 -43
- package/components/header/smart-profile.js +44 -59
- package/components/header/smart-services.js +33 -45
- package/components/header/tray.js +8 -10
- package/components/heading/heading.js +27 -27
- package/components/http/http.js +120 -125
- package/components/http/http.mock.js +6 -10
- package/components/hub-source/hub-source-user.js +6 -13
- package/components/hub-source/hub-source-users-groups.js +8 -12
- package/components/hub-source/hub-source.js +8 -10
- package/components/i18n/i18n-context.js +4 -7
- package/components/i18n/i18n.js +5 -5
- package/components/icon/icon-svg.js +0 -4
- package/components/icon/icon.js +28 -32
- package/components/icon/index.js +0 -4
- package/components/input/input.figma.js +8 -8
- package/components/input/input.js +0 -4
- package/components/island/adaptive-island-hoc.js +19 -23
- package/components/island/content.js +70 -75
- package/components/island/header.js +21 -21
- package/components/island/island.js +11 -14
- package/components/link/clickable-link.js +30 -37
- package/components/link/link.js +27 -29
- package/components/list/list-custom.js +6 -11
- package/components/list/list-item.js +49 -56
- package/components/list/list-separator.js +0 -1
- package/components/list/list-title.js +0 -1
- package/components/list/list-users-groups-source.js +14 -22
- package/components/list/list.classes.js +8 -9
- package/components/list/list.js +387 -404
- package/components/loader/loader-core.js +2 -265
- package/components/loader/loader.d.ts +8 -0
- package/components/loader/loader.js +43 -29
- package/components/loader-inline/loader-inline.js +9 -12
- package/components/loader-screen/loader-screen.js +10 -14
- package/components/login-dialog/login-dialog.js +46 -54
- package/components/login-dialog/service.js +13 -15
- package/components/message/message.js +65 -79
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -3
- package/components/old-browsers-message/old-browsers-message.js +1 -4
- package/components/old-browsers-message/white-list.js +5 -7
- package/components/pager/pager.js +73 -88
- package/components/panel/panel.js +9 -12
- package/components/permissions/permissions-cache.js +6 -8
- package/components/permissions/permissions.js +19 -21
- package/components/popup/popup.js +136 -145
- package/components/popup/popup.target.js +8 -10
- package/components/popup/position-css.js +19 -27
- package/components/popup/position.js +22 -28
- package/components/popup-menu/popup-menu.js +27 -37
- package/components/progress-bar/progress-bar.js +26 -32
- package/components/query-assist/query-assist-suggestions.js +0 -6
- package/components/query-assist/query-assist.js +432 -468
- package/components/radio/radio-item.js +30 -40
- package/components/radio/radio.js +6 -10
- package/components/scrollable-section/scrollable-section.js +7 -10
- package/components/select/select-filter.js +0 -6
- package/components/select/select-popup.js +155 -174
- package/components/select/select.js +464 -479
- package/components/shortcuts/core.js +40 -45
- package/components/shortcuts/shortcut-title.js +0 -1
- package/components/shortcuts/shortcuts-hoc.js +9 -15
- package/components/shortcuts/shortcuts.js +3 -5
- package/components/slider/slider.js +53 -66
- package/components/slider/slider.utils.js +1 -4
- package/components/storage/storage-local.js +2 -8
- package/components/storage/storage.js +0 -5
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +21 -30
- package/components/table/cell.js +3 -4
- package/components/table/disable-hover-hoc.js +24 -28
- package/components/table/header-cell.js +30 -38
- package/components/table/header.js +20 -28
- package/components/table/multitable.js +81 -101
- package/components/table/row-with-focus-sensor.js +17 -28
- package/components/table/row.js +89 -99
- package/components/table/selection-adapter.js +0 -2
- package/components/table/selection-shortcuts-hoc.js +159 -161
- package/components/table/selection.js +23 -31
- package/components/table/simple-table.js +16 -22
- package/components/table/smart-table.js +19 -26
- package/components/table/table.js +137 -146
- package/components/tabs/collapsible-more.js +34 -47
- package/components/tabs/collapsible-tab.js +28 -33
- package/components/tabs/collapsible-tabs.js +16 -24
- package/components/tabs/custom-item.js +3 -6
- package/components/tabs/dumb-tabs.js +48 -64
- package/components/tabs/smart-tabs.js +14 -23
- package/components/tabs/tab-link.js +0 -2
- package/components/tabs/tab.js +0 -1
- package/components/tabs/tabs.js +0 -7
- package/components/tag/tag.js +30 -35
- package/components/tags-input/tags-input.js +192 -218
- package/components/tags-list/tags-list.js +26 -31
- package/components/text/text.js +16 -19
- package/components/toggle/toggle.js +19 -23
- package/components/tooltip/tooltip.js +110 -121
- package/components/upload/upload.js +19 -28
- package/components/user-agreement/service.js +247 -252
- package/components/user-agreement/toolbox.eula.js +160 -1
- package/components/user-agreement/user-agreement.js +23 -32
- package/components/user-card/card.js +0 -5
- package/components/user-card/smart-user-card-tooltip.js +41 -50
- package/components/user-card/tooltip.js +32 -38
- package/components/user-card/user-card.js +0 -5
- package/package.json +9 -3
- package/components/_helpers/_rollupPluginBabelHelpers.js +0 -72
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
2
|
import { forwardRef, useRef, useImperativeHandle, useCallback, useEffect } from 'react';
|
|
5
3
|
import { isNodeInVisiblePartOfPage } from '../global/dom.js';
|
|
6
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
7
4
|
|
|
8
5
|
var styles = {"trapButton":"ring-tab-trap-trapButton"};
|
|
9
6
|
|
|
10
|
-
const _excluded = ["children", "trapDisabled", "autoFocusFirst", "focusBackOnClose", "focusBackOnExit"];
|
|
11
7
|
const FOCUSABLE_ELEMENTS = 'input, button, select, textarea, a[href], *[tabindex]:not([data-trap-button]):not([data-scrollable-container])';
|
|
12
8
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
13
|
-
const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
+
const TabTrap = /*#__PURE__*/forwardRef(function TabTrap({
|
|
10
|
+
children,
|
|
11
|
+
trapDisabled = false,
|
|
12
|
+
autoFocusFirst = true,
|
|
13
|
+
focusBackOnClose = true,
|
|
14
|
+
focusBackOnExit = false,
|
|
15
|
+
...restProps
|
|
16
|
+
}, ref) {
|
|
22
17
|
const nodeRef = useRef(null);
|
|
23
18
|
const trapButtonNodeRef = useRef(null);
|
|
24
19
|
const previousFocusedNodeRef = useRef(null);
|
|
@@ -46,15 +41,13 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(_ref, ref) {
|
|
|
46
41
|
if (autoFocusFirst) {
|
|
47
42
|
focusFirst();
|
|
48
43
|
} else if (!trapDisabled) {
|
|
49
|
-
|
|
50
|
-
const previousFocusedElementIsInContainer = previousFocusedNodeRef.current && ((_nodeRef$current = nodeRef.current) === null || _nodeRef$current === void 0 ? void 0 : _nodeRef$current.contains(previousFocusedNodeRef.current));
|
|
44
|
+
const previousFocusedElementIsInContainer = previousFocusedNodeRef.current && nodeRef.current?.contains(previousFocusedNodeRef.current);
|
|
51
45
|
// The component wrapped in TabTrap can already have a focused element (e.g. Date Picker),
|
|
52
46
|
// so we need to check if it does. If so, we don't need to focus anything.
|
|
53
|
-
const currentlyFocusedElementIsInContainer =
|
|
47
|
+
const currentlyFocusedElementIsInContainer = nodeRef.current?.contains(document.activeElement);
|
|
54
48
|
if (!nodeRef.current || !previousFocusedElementIsInContainer && !currentlyFocusedElementIsInContainer) {
|
|
55
|
-
var _trapButtonNodeRef$cu;
|
|
56
49
|
trapWithoutFocusRef.current = true;
|
|
57
|
-
|
|
50
|
+
trapButtonNodeRef.current?.focus();
|
|
58
51
|
}
|
|
59
52
|
}
|
|
60
53
|
return () => {
|
|
@@ -75,8 +68,7 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(_ref, ref) {
|
|
|
75
68
|
}
|
|
76
69
|
}
|
|
77
70
|
}
|
|
78
|
-
function focusElement() {
|
|
79
|
-
let first = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
71
|
+
function focusElement(first = true) {
|
|
80
72
|
const node = nodeRef.current;
|
|
81
73
|
if (!node) {
|
|
82
74
|
return;
|
|
@@ -101,7 +93,6 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(_ref, ref) {
|
|
|
101
93
|
}
|
|
102
94
|
}
|
|
103
95
|
function handleBlurIfWithoutFocus(event) {
|
|
104
|
-
var _nodeRef$current3;
|
|
105
96
|
if (!trapWithoutFocusRef.current) {
|
|
106
97
|
return;
|
|
107
98
|
}
|
|
@@ -110,21 +101,21 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(_ref, ref) {
|
|
|
110
101
|
if (!newFocused) {
|
|
111
102
|
return;
|
|
112
103
|
}
|
|
113
|
-
if (newFocused instanceof Element &&
|
|
104
|
+
if (newFocused instanceof Element && nodeRef.current?.contains(newFocused)) {
|
|
114
105
|
return;
|
|
115
106
|
}
|
|
116
107
|
focusLast();
|
|
117
108
|
}
|
|
118
109
|
if (trapDisabled) {
|
|
119
|
-
return jsx("div",
|
|
120
|
-
ref: nodeRef
|
|
121
|
-
|
|
110
|
+
return jsx("div", {
|
|
111
|
+
ref: nodeRef,
|
|
112
|
+
...restProps,
|
|
122
113
|
children: children
|
|
123
|
-
})
|
|
114
|
+
});
|
|
124
115
|
}
|
|
125
|
-
return jsxs("div",
|
|
126
|
-
ref: nodeRef
|
|
127
|
-
|
|
116
|
+
return jsxs("div", {
|
|
117
|
+
ref: nodeRef,
|
|
118
|
+
...restProps,
|
|
128
119
|
children: [jsx("div", {
|
|
129
120
|
// It never actually stays focused
|
|
130
121
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
@@ -141,7 +132,7 @@ const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(_ref, ref) {
|
|
|
141
132
|
onFocus: focusBackOnExit ? restoreFocus : focusFirst,
|
|
142
133
|
"data-trap-button": true
|
|
143
134
|
})]
|
|
144
|
-
})
|
|
135
|
+
});
|
|
145
136
|
});
|
|
146
137
|
|
|
147
138
|
export { FOCUSABLE_ELEMENTS, TabTrap as default };
|
package/components/table/cell.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { PureComponent } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
6
5
|
import { s as style } from '../_helpers/table.js';
|
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
6
|
|
|
9
7
|
class Cell extends PureComponent {
|
|
10
8
|
render() {
|
|
11
9
|
const classes = classNames(style.cell, this.props.className);
|
|
12
|
-
return jsx("td",
|
|
10
|
+
return jsx("td", {
|
|
11
|
+
...this.props,
|
|
13
12
|
className: classes,
|
|
14
13
|
"data-test": joinDataTestAttributes('ring-table-cell', this.props['data-test']),
|
|
15
14
|
children: this.props.children
|
|
16
|
-
})
|
|
15
|
+
});
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
18
|
|
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent } from 'react';
|
|
5
3
|
|
|
6
4
|
function disableHoverHOC(ComposedComponent) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
disabledHover: false
|
|
13
|
-
});
|
|
14
|
-
_defineProperty(this, "onMouseMove", () => {
|
|
15
|
-
if (this.state.disabledHover) {
|
|
16
|
-
this.setState({
|
|
17
|
-
disabledHover: false
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
_defineProperty(this, "onKeyDown", e => {
|
|
22
|
-
const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line @typescript-eslint/no-magic-numbers
|
|
23
|
-
if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
|
|
24
|
-
this.setState({
|
|
25
|
-
disabledHover: true
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
5
|
+
return class DisableHover extends PureComponent {
|
|
6
|
+
static defaultProps = ComposedComponent.defaultProps;
|
|
7
|
+
state = {
|
|
8
|
+
disabledHover: false
|
|
9
|
+
};
|
|
30
10
|
componentDidMount() {
|
|
31
11
|
document.addEventListener('mousemove', this.onMouseMove);
|
|
32
12
|
document.addEventListener('keydown', this.onKeyDown, true);
|
|
@@ -35,12 +15,28 @@ function disableHoverHOC(ComposedComponent) {
|
|
|
35
15
|
document.removeEventListener('mousemove', this.onMouseMove);
|
|
36
16
|
document.removeEventListener('keydown', this.onKeyDown, true);
|
|
37
17
|
}
|
|
18
|
+
onMouseMove = () => {
|
|
19
|
+
if (this.state.disabledHover) {
|
|
20
|
+
this.setState({
|
|
21
|
+
disabledHover: false
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
onKeyDown = e => {
|
|
26
|
+
const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line @typescript-eslint/no-magic-numbers
|
|
27
|
+
if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
|
|
28
|
+
this.setState({
|
|
29
|
+
disabledHover: true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
38
33
|
render() {
|
|
39
|
-
return jsx(ComposedComponent,
|
|
34
|
+
return jsx(ComposedComponent, {
|
|
35
|
+
...this.props,
|
|
40
36
|
disabledHover: this.state.disabledHover
|
|
41
|
-
})
|
|
37
|
+
});
|
|
42
38
|
}
|
|
43
|
-
}
|
|
39
|
+
};
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
export { disableHoverHOC as default };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent } from 'react';
|
|
5
3
|
import classNames from 'classnames';
|
|
@@ -11,44 +9,40 @@ import { s as style } from '../_helpers/table.js';
|
|
|
11
9
|
import 'util-deprecate';
|
|
12
10
|
import '../icon/icon.constants.js';
|
|
13
11
|
import '../_helpers/icon-svg.js';
|
|
14
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
15
|
-
import 'core-js/modules/es.string.replace.js';
|
|
16
12
|
import '../global/memoize.js';
|
|
17
13
|
|
|
18
|
-
const _excluded = ["className", "column", "onSort", "sortKey", "sortOrder", "data-test"];
|
|
19
14
|
class HeaderCell extends PureComponent {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
15
|
+
static defaultProps = {
|
|
16
|
+
onSort: () => {}
|
|
17
|
+
};
|
|
18
|
+
sortable;
|
|
19
|
+
sorted;
|
|
20
|
+
onClick = () => {
|
|
21
|
+
if (this.sortable) {
|
|
22
|
+
const {
|
|
23
|
+
column,
|
|
24
|
+
onSort,
|
|
25
|
+
sortOrder
|
|
26
|
+
} = this.props;
|
|
27
|
+
onSort({
|
|
28
|
+
column,
|
|
29
|
+
order: !(this.sorted && sortOrder)
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
38
33
|
onChildrenClick(e) {
|
|
39
34
|
e.stopPropagation();
|
|
40
35
|
}
|
|
41
36
|
render() {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
37
|
+
const {
|
|
38
|
+
className,
|
|
39
|
+
column,
|
|
40
|
+
onSort,
|
|
41
|
+
sortKey,
|
|
42
|
+
sortOrder,
|
|
43
|
+
'data-test': dataTest,
|
|
44
|
+
...restProps
|
|
45
|
+
} = this.props;
|
|
52
46
|
this.sortable = column.sortable === true;
|
|
53
47
|
this.sorted = sortKey === column.id;
|
|
54
48
|
const glyph = this.sorted ? chevron12pxDown : sortableIcon;
|
|
@@ -59,7 +53,8 @@ class HeaderCell extends PureComponent {
|
|
|
59
53
|
[style.sortedUp]: sortOrder && this.sorted,
|
|
60
54
|
[style.cellRight]: column.rightAlign
|
|
61
55
|
});
|
|
62
|
-
return jsxs("th",
|
|
56
|
+
return jsxs("th", {
|
|
57
|
+
...restProps,
|
|
63
58
|
className: classes,
|
|
64
59
|
onClick: this.onClick,
|
|
65
60
|
"data-test": joinDataTestAttributes('ring-table-header-cell', dataTest),
|
|
@@ -74,11 +69,8 @@ class HeaderCell extends PureComponent {
|
|
|
74
69
|
className: style.icon
|
|
75
70
|
})
|
|
76
71
|
})]
|
|
77
|
-
})
|
|
72
|
+
});
|
|
78
73
|
}
|
|
79
74
|
}
|
|
80
|
-
_defineProperty(HeaderCell, "defaultProps", {
|
|
81
|
-
onSort: () => {}
|
|
82
|
-
});
|
|
83
75
|
|
|
84
76
|
export { HeaderCell as default };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent } from 'react';
|
|
5
3
|
import classNames from 'classnames';
|
|
@@ -13,8 +11,6 @@ import '../icon/icon.js';
|
|
|
13
11
|
import 'util-deprecate';
|
|
14
12
|
import '../icon/icon.constants.js';
|
|
15
13
|
import '../_helpers/icon-svg.js';
|
|
16
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
17
|
-
import 'core-js/modules/es.string.replace.js';
|
|
18
14
|
import '../global/memoize.js';
|
|
19
15
|
import '../global/compose-refs.js';
|
|
20
16
|
import 'memoize-one';
|
|
@@ -24,15 +20,22 @@ import '@jetbrains/icons/chevron-12px-down';
|
|
|
24
20
|
import '../global/data-tests.js';
|
|
25
21
|
|
|
26
22
|
class Header extends PureComponent {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
static defaultProps = {
|
|
24
|
+
selectable: true,
|
|
25
|
+
draggable: false,
|
|
26
|
+
checked: true,
|
|
27
|
+
sticky: true,
|
|
28
|
+
topStickOffset: '0px',
|
|
29
|
+
onSort: () => {},
|
|
30
|
+
onCheckboxChange: () => {},
|
|
31
|
+
sortKey: 'id',
|
|
32
|
+
sortOrder: true
|
|
33
|
+
};
|
|
34
|
+
id = getUID('table-header-');
|
|
35
|
+
onCheckboxFocus = event => {
|
|
36
|
+
event.currentTarget.blur();
|
|
37
|
+
};
|
|
38
|
+
createCells(widths = []) {
|
|
36
39
|
const {
|
|
37
40
|
selectable,
|
|
38
41
|
draggable,
|
|
@@ -66,11 +69,11 @@ class Header extends PureComponent {
|
|
|
66
69
|
sortOrder,
|
|
67
70
|
style: columnStyle
|
|
68
71
|
};
|
|
69
|
-
return jsx(HeaderCell,
|
|
70
|
-
"data-test": column.id
|
|
71
|
-
|
|
72
|
+
return jsx(HeaderCell, {
|
|
73
|
+
"data-test": column.id,
|
|
74
|
+
...props,
|
|
72
75
|
children: index === 0 && (draggable || selectable) && metaColumn
|
|
73
|
-
}
|
|
76
|
+
}, column.id);
|
|
74
77
|
});
|
|
75
78
|
}
|
|
76
79
|
render() {
|
|
@@ -106,16 +109,5 @@ class Header extends PureComponent {
|
|
|
106
109
|
});
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
|
-
_defineProperty(Header, "defaultProps", {
|
|
110
|
-
selectable: true,
|
|
111
|
-
draggable: false,
|
|
112
|
-
checked: true,
|
|
113
|
-
sticky: true,
|
|
114
|
-
topStickOffset: '0px',
|
|
115
|
-
onSort: () => {},
|
|
116
|
-
onCheckboxChange: () => {},
|
|
117
|
-
sortKey: 'id',
|
|
118
|
-
sortOrder: true
|
|
119
|
-
});
|
|
120
112
|
|
|
121
113
|
export { Header as default };
|
|
@@ -1,106 +1,7 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent, Children, cloneElement } from 'react';
|
|
5
3
|
|
|
6
4
|
class MultiTable extends PureComponent {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
_defineProperty(this, "onUpPress", () => {
|
|
10
|
-
const {
|
|
11
|
-
children: tables
|
|
12
|
-
} = this.props;
|
|
13
|
-
const tableIndex = tables.findIndex(_ref => {
|
|
14
|
-
let {
|
|
15
|
-
props: {
|
|
16
|
-
selection
|
|
17
|
-
}
|
|
18
|
-
} = _ref;
|
|
19
|
-
return selection.getFocused();
|
|
20
|
-
});
|
|
21
|
-
const currentTable = tables[tableIndex].props;
|
|
22
|
-
const prevTable = tables[tableIndex - 1] ? tables[tableIndex - 1].props : null;
|
|
23
|
-
let newSelection = currentTable.selection.moveUp();
|
|
24
|
-
if (newSelection) {
|
|
25
|
-
var _currentTable$onSelec;
|
|
26
|
-
(_currentTable$onSelec = currentTable.onSelect) === null || _currentTable$onSelec === void 0 || _currentTable$onSelec.call(currentTable, newSelection);
|
|
27
|
-
} else if (prevTable) {
|
|
28
|
-
var _currentTable$onSelec2;
|
|
29
|
-
(_currentTable$onSelec2 = currentTable.onSelect) === null || _currentTable$onSelec2 === void 0 || _currentTable$onSelec2.call(currentTable, currentTable.selection.resetFocus());
|
|
30
|
-
newSelection = prevTable.selection.moveUp();
|
|
31
|
-
if (newSelection) {
|
|
32
|
-
var _prevTable$onSelect;
|
|
33
|
-
(_prevTable$onSelect = prevTable.onSelect) === null || _prevTable$onSelect === void 0 || _prevTable$onSelect.call(prevTable, newSelection);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return false;
|
|
37
|
-
});
|
|
38
|
-
_defineProperty(this, "onDownPress", () => {
|
|
39
|
-
const {
|
|
40
|
-
children: tables
|
|
41
|
-
} = this.props;
|
|
42
|
-
const tableIndex = tables.findIndex(_ref2 => {
|
|
43
|
-
let {
|
|
44
|
-
props: {
|
|
45
|
-
selection
|
|
46
|
-
}
|
|
47
|
-
} = _ref2;
|
|
48
|
-
return selection.getFocused();
|
|
49
|
-
});
|
|
50
|
-
const currentTable = tables[tableIndex].props;
|
|
51
|
-
const nextTable = tables[tableIndex + 1] ? tables[tableIndex + 1].props : null;
|
|
52
|
-
let newSelection = currentTable.selection.moveDown();
|
|
53
|
-
if (newSelection) {
|
|
54
|
-
var _currentTable$onSelec3;
|
|
55
|
-
(_currentTable$onSelec3 = currentTable.onSelect) === null || _currentTable$onSelec3 === void 0 || _currentTable$onSelec3.call(currentTable, newSelection);
|
|
56
|
-
} else if (nextTable) {
|
|
57
|
-
var _currentTable$onSelec4;
|
|
58
|
-
(_currentTable$onSelec4 = currentTable.onSelect) === null || _currentTable$onSelec4 === void 0 || _currentTable$onSelec4.call(currentTable, currentTable.selection.resetFocus());
|
|
59
|
-
newSelection = nextTable.selection.moveDown();
|
|
60
|
-
if (newSelection) {
|
|
61
|
-
var _nextTable$onSelect;
|
|
62
|
-
(_nextTable$onSelect = nextTable.onSelect) === null || _nextTable$onSelect === void 0 || _nextTable$onSelect.call(nextTable, newSelection);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
});
|
|
67
|
-
_defineProperty(this, "onEscPress", () => {
|
|
68
|
-
const {
|
|
69
|
-
children
|
|
70
|
-
} = this.props;
|
|
71
|
-
Children.forEach(children, _ref3 => {
|
|
72
|
-
let {
|
|
73
|
-
props: {
|
|
74
|
-
selection,
|
|
75
|
-
onSelect
|
|
76
|
-
}
|
|
77
|
-
} = _ref3;
|
|
78
|
-
onSelect === null || onSelect === void 0 || onSelect(selection.reset());
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
_defineProperty(this, "onCmdAPress", () => {
|
|
82
|
-
const {
|
|
83
|
-
children
|
|
84
|
-
} = this.props;
|
|
85
|
-
Children.forEach(children, _ref4 => {
|
|
86
|
-
let {
|
|
87
|
-
props: {
|
|
88
|
-
selection,
|
|
89
|
-
onSelect
|
|
90
|
-
}
|
|
91
|
-
} = _ref4;
|
|
92
|
-
onSelect === null || onSelect === void 0 || onSelect(selection.selectAll());
|
|
93
|
-
});
|
|
94
|
-
return false;
|
|
95
|
-
});
|
|
96
|
-
_defineProperty(this, "shortcuts", {
|
|
97
|
-
up: this.onUpPress,
|
|
98
|
-
down: this.onDownPress,
|
|
99
|
-
esc: this.onEscPress,
|
|
100
|
-
'command+a': this.onCmdAPress,
|
|
101
|
-
'ctrl+a': this.onCmdAPress
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
5
|
componentDidUpdate(prevProps) {
|
|
105
6
|
if (prevProps.children) {
|
|
106
7
|
const prevSelections = prevProps.children.map(element => element.props.selection);
|
|
@@ -109,11 +10,90 @@ class MultiTable extends PureComponent {
|
|
|
109
10
|
const currentSelections = this.props.children.map(element => element.props.selection);
|
|
110
11
|
const currentFocused = currentSelections.filter(selection => selection.getFocused());
|
|
111
12
|
if (currentFocused.includes(prevFocused)) {
|
|
112
|
-
|
|
113
|
-
(_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());
|
|
13
|
+
prevProps.children[prevFocusedIndex].props.onSelect?.(prevFocused.resetFocus());
|
|
114
14
|
}
|
|
115
15
|
}
|
|
116
16
|
}
|
|
17
|
+
onUpPress = () => {
|
|
18
|
+
const {
|
|
19
|
+
children: tables
|
|
20
|
+
} = this.props;
|
|
21
|
+
const tableIndex = tables.findIndex(({
|
|
22
|
+
props: {
|
|
23
|
+
selection
|
|
24
|
+
}
|
|
25
|
+
}) => selection.getFocused());
|
|
26
|
+
const currentTable = tables[tableIndex].props;
|
|
27
|
+
const prevTable = tables[tableIndex - 1] ? tables[tableIndex - 1].props : null;
|
|
28
|
+
let newSelection = currentTable.selection.moveUp();
|
|
29
|
+
if (newSelection) {
|
|
30
|
+
currentTable.onSelect?.(newSelection);
|
|
31
|
+
} else if (prevTable) {
|
|
32
|
+
currentTable.onSelect?.(currentTable.selection.resetFocus());
|
|
33
|
+
newSelection = prevTable.selection.moveUp();
|
|
34
|
+
if (newSelection) {
|
|
35
|
+
prevTable.onSelect?.(newSelection);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
};
|
|
40
|
+
onDownPress = () => {
|
|
41
|
+
const {
|
|
42
|
+
children: tables
|
|
43
|
+
} = this.props;
|
|
44
|
+
const tableIndex = tables.findIndex(({
|
|
45
|
+
props: {
|
|
46
|
+
selection
|
|
47
|
+
}
|
|
48
|
+
}) => selection.getFocused());
|
|
49
|
+
const currentTable = tables[tableIndex].props;
|
|
50
|
+
const nextTable = tables[tableIndex + 1] ? tables[tableIndex + 1].props : null;
|
|
51
|
+
let newSelection = currentTable.selection.moveDown();
|
|
52
|
+
if (newSelection) {
|
|
53
|
+
currentTable.onSelect?.(newSelection);
|
|
54
|
+
} else if (nextTable) {
|
|
55
|
+
currentTable.onSelect?.(currentTable.selection.resetFocus());
|
|
56
|
+
newSelection = nextTable.selection.moveDown();
|
|
57
|
+
if (newSelection) {
|
|
58
|
+
nextTable.onSelect?.(newSelection);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
};
|
|
63
|
+
onEscPress = () => {
|
|
64
|
+
const {
|
|
65
|
+
children
|
|
66
|
+
} = this.props;
|
|
67
|
+
Children.forEach(children, ({
|
|
68
|
+
props: {
|
|
69
|
+
selection,
|
|
70
|
+
onSelect
|
|
71
|
+
}
|
|
72
|
+
}) => {
|
|
73
|
+
onSelect?.(selection.reset());
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
onCmdAPress = () => {
|
|
77
|
+
const {
|
|
78
|
+
children
|
|
79
|
+
} = this.props;
|
|
80
|
+
Children.forEach(children, ({
|
|
81
|
+
props: {
|
|
82
|
+
selection,
|
|
83
|
+
onSelect
|
|
84
|
+
}
|
|
85
|
+
}) => {
|
|
86
|
+
onSelect?.(selection.selectAll());
|
|
87
|
+
});
|
|
88
|
+
return false;
|
|
89
|
+
};
|
|
90
|
+
shortcuts = {
|
|
91
|
+
up: this.onUpPress,
|
|
92
|
+
down: this.onDownPress,
|
|
93
|
+
esc: this.onEscPress,
|
|
94
|
+
'command+a': this.onCmdAPress,
|
|
95
|
+
'ctrl+a': this.onCmdAPress
|
|
96
|
+
};
|
|
117
97
|
render() {
|
|
118
98
|
return jsx("div", {
|
|
119
99
|
"data-test": 'ring-multitable',
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent } from 'react';
|
|
5
3
|
import focusSensorHOC from '../global/focus-sensor-hoc.js';
|
|
@@ -17,8 +15,6 @@ import '../icon/icon.js';
|
|
|
17
15
|
import 'util-deprecate';
|
|
18
16
|
import '../icon/icon.constants.js';
|
|
19
17
|
import '../_helpers/icon-svg.js';
|
|
20
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
21
|
-
import 'core-js/modules/es.string.replace.js';
|
|
22
18
|
import '../global/memoize.js';
|
|
23
19
|
import '../control-help/control-help.js';
|
|
24
20
|
import '../button/button.js';
|
|
@@ -41,7 +37,6 @@ import 'sniffr';
|
|
|
41
37
|
import '../global/data-tests.js';
|
|
42
38
|
import '../tab-trap/tab-trap.js';
|
|
43
39
|
import '../popup/position.js';
|
|
44
|
-
import 'core-js/modules/es.array.sort.js';
|
|
45
40
|
import '../popup/popup.consts.js';
|
|
46
41
|
import '../popup/popup.target.js';
|
|
47
42
|
import '../popup/position-css.js';
|
|
@@ -51,34 +46,28 @@ import '../_helpers/table.js';
|
|
|
51
46
|
|
|
52
47
|
const getContainer = () => focusSensorHOC(Row);
|
|
53
48
|
class RowWithFocusSensorCallbacks extends PureComponent {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
(_this$props$onCollaps = (_this$props3 = this.props).onCollapse) === null || _this$props$onCollaps === void 0 || _this$props$onCollaps.call(_this$props3, this.props.item);
|
|
69
|
-
});
|
|
70
|
-
_defineProperty(this, "onExpand", () => {
|
|
71
|
-
var _this$props$onExpand, _this$props4;
|
|
72
|
-
(_this$props$onExpand = (_this$props4 = this.props).onExpand) === null || _this$props$onExpand === void 0 || _this$props$onExpand.call(_this$props4, this.props.item);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
49
|
+
// https://stackoverflow.com/a/53882322/6304152
|
|
50
|
+
RowWithFocusSensor = getContainer();
|
|
51
|
+
onFocus = () => {
|
|
52
|
+
this.props.onFocus?.(this.props.item);
|
|
53
|
+
};
|
|
54
|
+
onSelect = (item, selected) => {
|
|
55
|
+
this.props.onSelect?.(item, selected);
|
|
56
|
+
};
|
|
57
|
+
onCollapse = () => {
|
|
58
|
+
this.props.onCollapse?.(this.props.item);
|
|
59
|
+
};
|
|
60
|
+
onExpand = () => {
|
|
61
|
+
this.props.onExpand?.(this.props.item);
|
|
62
|
+
};
|
|
75
63
|
render() {
|
|
76
|
-
return jsx(this.RowWithFocusSensor,
|
|
64
|
+
return jsx(this.RowWithFocusSensor, {
|
|
65
|
+
...this.props,
|
|
77
66
|
onFocus: this.onFocus,
|
|
78
67
|
onSelect: this.onSelect,
|
|
79
68
|
onCollapse: this.onCollapse,
|
|
80
69
|
onExpand: this.onExpand
|
|
81
|
-
})
|
|
70
|
+
});
|
|
82
71
|
}
|
|
83
72
|
}
|
|
84
73
|
|