@jetbrains/ring-ui-built 7.0.72 → 7.0.73
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 +55 -13
- package/components/_helpers/avatar-info.js +44 -11
- package/components/_helpers/caption.js +2 -2
- package/components/_helpers/card.js +21 -21
- package/components/_helpers/icon-svg.js +75 -17
- package/components/_helpers/input.js +13 -13
- package/components/_helpers/query-assist-suggestions.js +5 -5
- package/components/_helpers/select-filter.js +5 -5
- package/components/_helpers/services-link.js +5 -5
- package/components/_helpers/sidebar.js +6 -6
- package/components/_helpers/tab-link.js +69 -17
- package/components/_helpers/theme.js +231 -54
- package/components/_helpers/title.js +5 -5
- package/components/alert/alert.d.ts +1 -1
- package/components/alert/alert.js +12 -10
- package/components/alert/container.js +4 -4
- package/components/alert-service/alert-service.d.ts +1 -1
- package/components/alert-service/alert-service.js +5 -4
- package/components/auth/auth-core.js +8 -8
- package/components/auth/auth.js +3 -2
- package/components/auth/down-notification.js +61 -17
- package/components/auth/iframe-flow.js +7 -6
- package/components/auth/storage.js +3 -2
- package/components/auth/token-validator.js +1 -1
- package/components/auth/window-flow.js +2 -2
- package/components/auth-dialog/auth-dialog.d.ts +1 -1
- package/components/auth-dialog/auth-dialog.js +15 -14
- package/components/auth-dialog-service/auth-dialog-service.js +4 -6
- package/components/avatar/avatar-info.d.ts +1 -1
- package/components/avatar/avatar-info.js +3 -2
- package/components/avatar/avatar.d.ts +1 -1
- package/components/avatar/avatar.js +16 -15
- package/components/avatar/fallback-avatar.d.ts +1 -1
- package/components/avatar/fallback-avatar.js +183 -59
- package/components/avatar-stack/avatar-stack.d.ts +1 -1
- package/components/avatar-stack/avatar-stack.js +115 -29
- package/components/banner/banner.d.ts +1 -1
- package/components/banner/banner.js +11 -10
- package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/components/breadcrumbs/breadcrumbs.js +3 -2
- package/components/button/button.d.ts +1 -1
- package/components/button/button.js +11 -10
- package/components/button-group/button-group.d.ts +1 -1
- package/components/button-group/button-group.js +6 -8
- package/components/button-group/caption.d.ts +1 -1
- package/components/button-group/caption.js +1 -1
- package/components/button-set/button-set.d.ts +1 -1
- package/components/button-set/button-set.js +2 -5
- package/components/button-toolbar/button-toolbar.d.ts +1 -1
- package/components/button-toolbar/button-toolbar.js +2 -5
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/checkbox.js +12 -17
- package/components/clipboard/clipboard.js +2 -1
- package/components/code/code.d.ts +1 -1
- package/components/code/code.js +5 -5
- package/components/collapse/collapse-content.js +161 -77
- package/components/collapse/collapse-control.js +69 -22
- package/components/collapse/collapse.js +83 -31
- package/components/confirm/confirm.d.ts +1 -1
- package/components/confirm/confirm.js +11 -13
- package/components/confirm-service/confirm-service.js +4 -3
- package/components/content-layout/content-layout.d.ts +1 -1
- package/components/content-layout/content-layout.js +4 -7
- package/components/content-layout/sidebar.d.ts +1 -1
- package/components/content-layout/sidebar.js +1 -1
- package/components/contenteditable/contenteditable.d.ts +2 -2
- package/components/contenteditable/contenteditable.js +50 -14
- package/components/control-help/control-help.d.ts +1 -1
- package/components/control-help/control-help.js +45 -9
- package/components/control-label/control-label.js +62 -13
- package/components/data-list/data-list.d.ts +1 -1
- package/components/data-list/data-list.js +10 -9
- package/components/data-list/data-list.mock.d.ts +1 -1
- package/components/data-list/data-list.mock.js +79 -78
- package/components/data-list/item.d.ts +2 -2
- package/components/data-list/item.js +18 -17
- package/components/data-list/title.d.ts +1 -1
- package/components/data-list/title.js +2 -1
- package/components/date-picker/consts.js +1 -1
- package/components/date-picker/date-input.d.ts +1 -1
- package/components/date-picker/date-input.js +4 -3
- package/components/date-picker/date-picker.d.ts +1 -1
- package/components/date-picker/date-picker.js +97 -31
- package/components/date-picker/date-popup.d.ts +1 -1
- package/components/date-picker/date-popup.js +11 -10
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/day.js +4 -3
- package/components/date-picker/month-names.d.ts +1 -1
- package/components/date-picker/month-names.js +98 -22
- package/components/date-picker/month-slider.d.ts +1 -1
- package/components/date-picker/month-slider.js +4 -4
- package/components/date-picker/month.d.ts +1 -1
- package/components/date-picker/month.js +79 -18
- package/components/date-picker/months.d.ts +1 -1
- package/components/date-picker/months.js +163 -53
- package/components/date-picker/weekdays.d.ts +1 -1
- package/components/date-picker/weekdays.js +56 -16
- package/components/date-picker/years.d.ts +1 -1
- package/components/date-picker/years.js +5 -5
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/dialog.js +21 -23
- package/components/dropdown/anchor.d.ts +1 -1
- package/components/dropdown/anchor.js +2 -1
- package/components/dropdown/dropdown.d.ts +1 -1
- package/components/dropdown/dropdown.js +7 -8
- package/components/dropdown-menu/dropdown-menu.js +299 -83
- package/components/editable-heading/editable-heading.d.ts +2 -2
- package/components/editable-heading/editable-heading.js +523 -174
- package/components/error-bubble/error-bubble.d.ts +1 -1
- package/components/error-bubble/error-bubble.js +7 -9
- package/components/error-message/error-message.d.ts +1 -1
- package/components/error-message/error-message.js +8 -10
- package/components/footer/footer.js +205 -61
- package/components/global/create-stateful-context.d.ts +1 -1
- package/components/global/create-stateful-context.js +73 -18
- package/components/global/focus-sensor-hoc.js +2 -2
- package/components/global/get-uid.js +1 -1
- package/components/global/react-dom-renderer.d.ts +1 -1
- package/components/global/react-dom-renderer.js +2 -2
- package/components/global/rerender-hoc.js +23 -6
- package/components/global/theme.js +3 -2
- package/components/global/use-event-callback.js +37 -13
- package/components/grid/col.d.ts +1 -1
- package/components/grid/col.js +3 -3
- package/components/grid/grid.d.ts +1 -1
- package/components/grid/grid.js +3 -6
- package/components/grid/row.d.ts +1 -1
- package/components/grid/row.js +3 -3
- package/components/group/group.d.ts +1 -1
- package/components/group/group.js +3 -6
- package/components/header/header-icon.d.ts +1 -1
- package/components/header/header-icon.js +3 -2
- package/components/header/header.d.ts +1 -1
- package/components/header/header.js +7 -12
- package/components/header/links.d.ts +1 -1
- package/components/header/links.js +45 -10
- package/components/header/logo.d.ts +1 -1
- package/components/header/logo.js +4 -3
- package/components/header/profile.js +17 -16
- package/components/header/services-link.d.ts +1 -1
- package/components/header/services-link.js +1 -1
- package/components/header/services.d.ts +1 -1
- package/components/header/services.js +35 -16
- package/components/header/smart-profile.d.ts +1 -1
- package/components/header/smart-profile.js +6 -5
- package/components/header/smart-services.d.ts +1 -1
- package/components/header/smart-services.js +3 -2
- package/components/header/tray.d.ts +1 -1
- package/components/header/tray.js +3 -3
- package/components/heading/heading.js +188 -44
- package/components/i18n/i18n-context.js +51 -13
- package/components/icon/icon-svg.d.ts +1 -1
- package/components/icon/icon-svg.js +2 -1
- package/components/icon/icon.d.ts +1 -1
- package/components/icon/icon.js +6 -5
- package/components/icon/index.js +2 -1
- package/components/input/input.d.ts +1 -1
- package/components/input/input.js +2 -1
- package/components/island/adaptive-island-hoc.js +4 -4
- package/components/island/content.d.ts +1 -1
- package/components/island/content.js +36 -17
- package/components/island/header.d.ts +1 -1
- package/components/island/header.js +32 -14
- package/components/island/island.d.ts +1 -1
- package/components/island/island.js +3 -5
- package/components/link/clickable-link.d.ts +1 -1
- package/components/link/clickable-link.js +2 -2
- package/components/link/link.js +4 -4
- package/components/list/list-custom.d.ts +1 -1
- package/components/list/list-custom.js +2 -2
- package/components/list/list-hint.d.ts +1 -1
- package/components/list/list-hint.js +3 -7
- package/components/list/list-item.d.ts +1 -1
- package/components/list/list-item.js +23 -26
- package/components/list/list-separator.d.ts +1 -1
- package/components/list/list-separator.js +3 -3
- package/components/list/list-title.d.ts +1 -1
- package/components/list/list-title.js +7 -7
- package/components/list/list-users-groups-source.js +6 -5
- package/components/list/list.d.ts +6 -6
- package/components/list/list.js +33 -31
- package/components/loader/loader.d.ts +1 -1
- package/components/loader/loader.js +8 -14
- package/components/loader-inline/loader-inline.d.ts +1 -1
- package/components/loader-inline/loader-inline.js +4 -7
- package/components/loader-screen/loader-screen.d.ts +1 -1
- package/components/loader-screen/loader-screen.js +3 -6
- package/components/login-dialog/login-dialog.d.ts +1 -1
- package/components/login-dialog/login-dialog.js +10 -9
- package/components/login-dialog/service.js +4 -3
- package/components/markdown/markdown.d.ts +1 -1
- package/components/markdown/markdown.js +3 -6
- package/components/message/message.d.ts +1 -1
- package/components/message/message.js +13 -15
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/pager/pager.d.ts +5 -5
- package/components/pager/pager.js +28 -27
- package/components/panel/panel.d.ts +1 -1
- package/components/panel/panel.js +3 -6
- package/components/popup/popup.d.ts +2 -2
- package/components/popup/popup.js +14 -11
- package/components/popup/popup.target.js +68 -16
- package/components/popup-menu/popup-menu.d.ts +1 -1
- package/components/popup-menu/popup-menu.js +7 -9
- package/components/progress-bar/progress-bar.d.ts +1 -1
- package/components/progress-bar/progress-bar.js +4 -7
- package/components/query-assist/query-assist-suggestions.d.ts +1 -1
- package/components/query-assist/query-assist-suggestions.js +5 -4
- package/components/query-assist/query-assist.d.ts +2 -2
- package/components/query-assist/query-assist.js +37 -34
- package/components/radio/radio-item.d.ts +1 -1
- package/components/radio/radio-item.js +40 -20
- package/components/radio/radio.d.ts +1 -1
- package/components/radio/radio.js +3 -5
- package/components/scrollable-section/scrollable-section.d.ts +1 -1
- package/components/scrollable-section/scrollable-section.js +100 -38
- package/components/select/select-filter.d.ts +1 -1
- package/components/select/select-filter.js +5 -4
- package/components/select/select-popup.d.ts +7 -7
- package/components/select/select-popup.js +26 -25
- package/components/select/select.d.ts +3 -3
- package/components/select/select.js +52 -52
- package/components/shortcuts/shortcuts-hoc.js +3 -3
- package/components/slider/slider.js +591 -196
- package/components/storage/storage-local.js +2 -1
- package/components/storage/storage.js +2 -1
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +247 -102
- package/components/table/cell.d.ts +1 -1
- package/components/table/cell.js +2 -2
- package/components/table/disable-hover-hoc.js +3 -3
- package/components/table/header-cell.d.ts +1 -1
- package/components/table/header-cell.js +7 -6
- package/components/table/header.d.ts +2 -2
- package/components/table/header.js +14 -13
- package/components/table/multitable.d.ts +1 -1
- package/components/table/multitable.js +3 -3
- package/components/table/row-with-focus-sensor.d.ts +1 -1
- package/components/table/row-with-focus-sensor.js +3 -2
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +51 -24
- package/components/table/selection-shortcuts-hoc.js +2 -2
- package/components/table/simple-table.d.ts +1 -1
- package/components/table/simple-table.js +4 -3
- package/components/table/smart-table.d.ts +1 -1
- package/components/table/smart-table.js +4 -3
- package/components/table/table.d.ts +2 -2
- package/components/table/table.js +21 -23
- package/components/tabs/collapsible-more.d.ts +3 -3
- package/components/tabs/collapsible-more.js +253 -83
- package/components/tabs/collapsible-tab.d.ts +1 -1
- package/components/tabs/collapsible-tab.js +4 -3
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +450 -188
- package/components/tabs/dumb-tabs.d.ts +2 -2
- package/components/tabs/dumb-tabs.js +10 -9
- package/components/tabs/smart-tabs.d.ts +1 -1
- package/components/tabs/smart-tabs.js +6 -5
- package/components/tabs/tab-link.d.ts +1 -1
- package/components/tabs/tab-link.js +2 -1
- package/components/tabs/tab.d.ts +1 -1
- package/components/tabs/tab.js +2 -2
- package/components/tabs/tabs.js +5 -4
- package/components/tag/tag.d.ts +5 -5
- package/components/tag/tag.js +14 -13
- package/components/tags-input/tags-input.d.ts +1 -1
- package/components/tags-input/tags-input.js +10 -9
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/tags-list/tags-list.js +4 -3
- package/components/text/text.d.ts +1 -1
- package/components/text/text.js +2 -2
- package/components/toggle/toggle.d.ts +1 -1
- package/components/toggle/toggle.js +12 -11
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/tooltip/tooltip.js +7 -6
- package/components/upload/upload.js +10 -9
- package/components/user-agreement/service.js +11 -10
- package/components/user-agreement/user-agreement.d.ts +1 -1
- package/components/user-agreement/user-agreement.js +19 -18
- package/components/user-card/card.d.ts +1 -1
- package/components/user-card/card.js +3 -2
- package/components/user-card/smart-user-card-tooltip.d.ts +2 -2
- package/components/user-card/smart-user-card-tooltip.js +7 -6
- package/components/user-card/tooltip.d.ts +2 -2
- package/components/user-card/tooltip.js +7 -6
- package/components/user-card/user-card.js +4 -3
- package/package.json +3 -9
|
@@ -1,138 +1,283 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef, useRef, useImperativeHandle,
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
2
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect } from 'react';
|
|
3
3
|
import { isNodeInVisiblePartOfPage } from '../global/dom.js';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
var styles = {"trapButton":"ring-tab-trap-trapButton"};
|
|
6
7
|
|
|
7
8
|
const FOCUSABLE_ELEMENTS = 'input, button, select, textarea, a[href], *[tabindex]:not([data-trap-button]):not([data-scrollable-container])';
|
|
8
|
-
// eslint-disable-next-line
|
|
9
|
-
const TabTrap = /*#__PURE__*/forwardRef(function TabTrap({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
9
|
+
// eslint-disable-next-line no-shadow
|
|
10
|
+
const TabTrap = /*#__PURE__*/forwardRef(function TabTrap(t0, ref) {
|
|
11
|
+
const $ = c(36);
|
|
12
|
+
if ($[0] !== "0332e0ee653a0153e98c2004e643614e720cfc900b162b7629295f63077cddf5") {
|
|
13
|
+
for (let $i = 0; $i < 36; $i += 1) {
|
|
14
|
+
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
15
|
+
}
|
|
16
|
+
$[0] = "0332e0ee653a0153e98c2004e643614e720cfc900b162b7629295f63077cddf5";
|
|
17
|
+
}
|
|
18
|
+
let children;
|
|
19
|
+
let restProps;
|
|
20
|
+
let t1;
|
|
21
|
+
let t2;
|
|
22
|
+
let t3;
|
|
23
|
+
let t4;
|
|
24
|
+
if ($[1] !== t0) {
|
|
25
|
+
({
|
|
26
|
+
children,
|
|
27
|
+
trapDisabled: t1,
|
|
28
|
+
autoFocusFirst: t2,
|
|
29
|
+
focusBackOnClose: t3,
|
|
30
|
+
focusBackOnExit: t4,
|
|
31
|
+
...restProps
|
|
32
|
+
} = t0);
|
|
33
|
+
$[1] = t0;
|
|
34
|
+
$[2] = children;
|
|
35
|
+
$[3] = restProps;
|
|
36
|
+
$[4] = t1;
|
|
37
|
+
$[5] = t2;
|
|
38
|
+
$[6] = t3;
|
|
39
|
+
$[7] = t4;
|
|
40
|
+
} else {
|
|
41
|
+
children = $[2];
|
|
42
|
+
restProps = $[3];
|
|
43
|
+
t1 = $[4];
|
|
44
|
+
t2 = $[5];
|
|
45
|
+
t3 = $[6];
|
|
46
|
+
t4 = $[7];
|
|
47
|
+
}
|
|
48
|
+
const trapDisabled = t1 === undefined ? false : t1;
|
|
49
|
+
const autoFocusFirst = t2 === undefined ? true : t2;
|
|
50
|
+
const focusBackOnClose = t3 === undefined ? true : t3;
|
|
51
|
+
const focusBackOnExit = t4 === undefined ? false : t4;
|
|
17
52
|
const nodeRef = useRef(null);
|
|
18
53
|
const trapButtonNodeRef = useRef(null);
|
|
19
54
|
const previousFocusedNodeRef = useRef(null);
|
|
20
55
|
const trapWithoutFocusRef = useRef(false);
|
|
21
56
|
const mountedRef = useRef(false);
|
|
22
|
-
// It's the same approach as in focus-trap-react:
|
|
23
|
-
// https://github.com/focus-trap/focus-trap-react/commit/3b22fca9eebeb883edc89548850fe5a5b9d6d50e
|
|
24
|
-
// We can't do it in useEffect because it's too late, some children might have already
|
|
25
|
-
// focused itself.
|
|
26
57
|
if (previousFocusedNodeRef.current === null) {
|
|
27
58
|
previousFocusedNodeRef.current = document.activeElement;
|
|
28
59
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
let t5;
|
|
61
|
+
let t6;
|
|
62
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
63
|
+
t5 = () => ({
|
|
64
|
+
node: nodeRef.current
|
|
65
|
+
});
|
|
66
|
+
t6 = [];
|
|
67
|
+
$[8] = t5;
|
|
68
|
+
$[9] = t6;
|
|
69
|
+
} else {
|
|
70
|
+
t5 = $[8];
|
|
71
|
+
t6 = $[9];
|
|
72
|
+
}
|
|
73
|
+
useImperativeHandle(ref, t5, t6);
|
|
74
|
+
let t7;
|
|
75
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
|
+
t7 = function restoreFocus() {
|
|
77
|
+
const previousFocusedNode = previousFocusedNodeRef.current;
|
|
78
|
+
if (previousFocusedNode instanceof HTMLElement && previousFocusedNode.focus && isNodeInVisiblePartOfPage(previousFocusedNode)) {
|
|
79
|
+
if (!mountedRef.current) {
|
|
80
|
+
previousFocusedNode.focus({
|
|
81
|
+
preventScroll: true
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
38
85
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
86
|
+
$[10] = t7;
|
|
87
|
+
} else {
|
|
88
|
+
t7 = $[10];
|
|
89
|
+
}
|
|
90
|
+
const restoreFocus = t7;
|
|
91
|
+
let t8;
|
|
92
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
93
|
+
t8 = function focusElement(t9) {
|
|
94
|
+
const first = t9 === undefined ? true : t9;
|
|
95
|
+
const node = nodeRef.current;
|
|
96
|
+
if (!node) {
|
|
97
|
+
return;
|
|
51
98
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
|
|
99
|
+
const tabables = [...node.querySelectorAll(FOCUSABLE_ELEMENTS)].filter(_temp);
|
|
100
|
+
const toBeFocused = first ? tabables[0] : tabables[tabables.length - 1];
|
|
101
|
+
if (toBeFocused) {
|
|
102
|
+
toBeFocused.focus();
|
|
56
103
|
}
|
|
57
104
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
105
|
+
$[11] = t8;
|
|
106
|
+
} else {
|
|
107
|
+
t8 = $[11];
|
|
108
|
+
}
|
|
109
|
+
const focusElement = t8;
|
|
110
|
+
let t9;
|
|
111
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
112
|
+
t9 = () => focusElement(true);
|
|
113
|
+
$[12] = t9;
|
|
114
|
+
} else {
|
|
115
|
+
t9 = $[12];
|
|
116
|
+
}
|
|
117
|
+
const focusFirst = t9;
|
|
118
|
+
let t10;
|
|
119
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
120
|
+
t10 = () => focusElement(false);
|
|
121
|
+
$[13] = t10;
|
|
122
|
+
} else {
|
|
123
|
+
t10 = $[13];
|
|
124
|
+
}
|
|
125
|
+
const focusLast = t10;
|
|
126
|
+
let t11;
|
|
127
|
+
let t12;
|
|
128
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
129
|
+
t11 = () => {
|
|
130
|
+
mountedRef.current = true;
|
|
131
|
+
return () => {
|
|
132
|
+
mountedRef.current = false;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
t12 = [];
|
|
136
|
+
$[14] = t11;
|
|
137
|
+
$[15] = t12;
|
|
138
|
+
} else {
|
|
139
|
+
t11 = $[14];
|
|
140
|
+
t12 = $[15];
|
|
141
|
+
}
|
|
142
|
+
useEffect(t11, t12);
|
|
143
|
+
let t13;
|
|
144
|
+
let t14;
|
|
145
|
+
if ($[16] !== autoFocusFirst || $[17] !== focusBackOnClose || $[18] !== trapDisabled) {
|
|
146
|
+
t13 = () => {
|
|
147
|
+
if (autoFocusFirst) {
|
|
148
|
+
focusFirst();
|
|
149
|
+
} else {
|
|
150
|
+
if (!trapDisabled) {
|
|
151
|
+
const previousFocusedElementIsInContainer = previousFocusedNodeRef.current && nodeRef.current?.contains(previousFocusedNodeRef.current);
|
|
152
|
+
const currentlyFocusedElementIsInContainer = nodeRef.current?.contains(document.activeElement);
|
|
153
|
+
if (!nodeRef.current || !previousFocusedElementIsInContainer && !currentlyFocusedElementIsInContainer) {
|
|
154
|
+
trapWithoutFocusRef.current = true;
|
|
155
|
+
trapButtonNodeRef.current?.focus();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
68
158
|
}
|
|
69
|
-
|
|
159
|
+
return () => {
|
|
160
|
+
if (focusBackOnClose) {
|
|
161
|
+
restoreFocus();
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
t14 = [autoFocusFirst, trapDisabled, focusBackOnClose, focusFirst];
|
|
166
|
+
$[16] = autoFocusFirst;
|
|
167
|
+
$[17] = focusBackOnClose;
|
|
168
|
+
$[18] = trapDisabled;
|
|
169
|
+
$[19] = t13;
|
|
170
|
+
$[20] = t14;
|
|
171
|
+
} else {
|
|
172
|
+
t13 = $[19];
|
|
173
|
+
t14 = $[20];
|
|
70
174
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
175
|
+
useEffect(t13, t14);
|
|
176
|
+
let t15;
|
|
177
|
+
if ($[21] !== focusBackOnExit) {
|
|
178
|
+
t15 = function focusLastIfEnabled(event) {
|
|
179
|
+
if (trapWithoutFocusRef.current) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (focusBackOnExit) {
|
|
183
|
+
const prevFocused = event.nativeEvent.relatedTarget;
|
|
184
|
+
if (prevFocused && nodeRef.current && prevFocused instanceof Element && nodeRef.current.contains(prevFocused)) {
|
|
185
|
+
restoreFocus();
|
|
186
|
+
}
|
|
187
|
+
} else {
|
|
188
|
+
focusLast();
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
$[21] = focusBackOnExit;
|
|
192
|
+
$[22] = t15;
|
|
193
|
+
} else {
|
|
194
|
+
t15 = $[22];
|
|
81
195
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
196
|
+
const focusLastIfEnabled = t15;
|
|
197
|
+
let t16;
|
|
198
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
199
|
+
t16 = function handleBlurIfWithoutFocus(event_0) {
|
|
200
|
+
if (!trapWithoutFocusRef.current) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
trapWithoutFocusRef.current = false;
|
|
204
|
+
const newFocused = event_0.nativeEvent.relatedTarget;
|
|
205
|
+
if (!newFocused) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (newFocused instanceof Element && nodeRef.current?.contains(newFocused)) {
|
|
209
|
+
return;
|
|
90
210
|
}
|
|
91
|
-
} else {
|
|
92
211
|
focusLast();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
trapWithoutFocusRef.current = false;
|
|
100
|
-
const newFocused = event.nativeEvent.relatedTarget;
|
|
101
|
-
if (!newFocused) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (newFocused instanceof Element && nodeRef.current?.contains(newFocused)) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
focusLast();
|
|
212
|
+
};
|
|
213
|
+
$[23] = t16;
|
|
214
|
+
} else {
|
|
215
|
+
t16 = $[23];
|
|
108
216
|
}
|
|
217
|
+
const handleBlurIfWithoutFocus = t16;
|
|
109
218
|
if (trapDisabled) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
219
|
+
let t17;
|
|
220
|
+
if ($[24] !== children || $[25] !== restProps) {
|
|
221
|
+
t17 = /*#__PURE__*/jsx("div", {
|
|
222
|
+
ref: nodeRef,
|
|
223
|
+
...restProps,
|
|
224
|
+
children: children
|
|
225
|
+
});
|
|
226
|
+
$[24] = children;
|
|
227
|
+
$[25] = restProps;
|
|
228
|
+
$[26] = t17;
|
|
229
|
+
} else {
|
|
230
|
+
t17 = $[26];
|
|
231
|
+
}
|
|
232
|
+
return t17;
|
|
115
233
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
children: [jsx("div", {
|
|
120
|
-
// It never actually stays focused
|
|
121
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
234
|
+
let t17;
|
|
235
|
+
if ($[27] !== focusLastIfEnabled) {
|
|
236
|
+
t17 = /*#__PURE__*/jsx("div", {
|
|
122
237
|
tabIndex: 0,
|
|
123
238
|
ref: trapButtonNodeRef,
|
|
124
239
|
className: styles.trapButton,
|
|
125
240
|
onFocus: focusLastIfEnabled,
|
|
126
241
|
onBlur: handleBlurIfWithoutFocus,
|
|
127
242
|
"data-trap-button": true
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
|
|
243
|
+
});
|
|
244
|
+
$[27] = focusLastIfEnabled;
|
|
245
|
+
$[28] = t17;
|
|
246
|
+
} else {
|
|
247
|
+
t17 = $[28];
|
|
248
|
+
}
|
|
249
|
+
const t18 = focusBackOnExit ? restoreFocus : focusFirst;
|
|
250
|
+
let t19;
|
|
251
|
+
if ($[29] !== t18) {
|
|
252
|
+
t19 = /*#__PURE__*/jsx("div", {
|
|
131
253
|
tabIndex: 0,
|
|
132
|
-
onFocus:
|
|
254
|
+
onFocus: t18,
|
|
133
255
|
"data-trap-button": true
|
|
134
|
-
})
|
|
135
|
-
|
|
256
|
+
});
|
|
257
|
+
$[29] = t18;
|
|
258
|
+
$[30] = t19;
|
|
259
|
+
} else {
|
|
260
|
+
t19 = $[30];
|
|
261
|
+
}
|
|
262
|
+
let t20;
|
|
263
|
+
if ($[31] !== children || $[32] !== restProps || $[33] !== t17 || $[34] !== t19) {
|
|
264
|
+
t20 = /*#__PURE__*/jsxs("div", {
|
|
265
|
+
ref: nodeRef,
|
|
266
|
+
...restProps,
|
|
267
|
+
children: [t17, children, t19]
|
|
268
|
+
});
|
|
269
|
+
$[31] = children;
|
|
270
|
+
$[32] = restProps;
|
|
271
|
+
$[33] = t17;
|
|
272
|
+
$[34] = t19;
|
|
273
|
+
$[35] = t20;
|
|
274
|
+
} else {
|
|
275
|
+
t20 = $[35];
|
|
276
|
+
}
|
|
277
|
+
return t20;
|
|
136
278
|
});
|
|
279
|
+
function _temp(item) {
|
|
280
|
+
return item.tabIndex >= 0;
|
|
281
|
+
}
|
|
137
282
|
|
|
138
283
|
export { FOCUSABLE_ELEMENTS, TabTrap as default };
|
|
@@ -3,5 +3,5 @@ export interface CellProps extends TdHTMLAttributes<HTMLTableDataCellElement> {
|
|
|
3
3
|
'data-test'?: string | null | undefined;
|
|
4
4
|
}
|
|
5
5
|
export default class Cell extends PureComponent<CellProps> {
|
|
6
|
-
render(): import("react
|
|
6
|
+
render(): import("react").JSX.Element;
|
|
7
7
|
}
|
package/components/table/cell.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
1
|
import { PureComponent } from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
5
4
|
import { s as style } from '../_helpers/table.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
class Cell extends PureComponent {
|
|
8
8
|
render() {
|
|
9
9
|
const classes = classNames(style.cell, this.props.className);
|
|
10
|
-
return jsx("td", {
|
|
10
|
+
return /*#__PURE__*/jsx("td", {
|
|
11
11
|
...this.props,
|
|
12
12
|
className: classes,
|
|
13
13
|
"data-test": joinDataTestAttributes('ring-table-cell', this.props['data-test']),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
1
|
import { PureComponent } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
function disableHoverHOC(ComposedComponent) {
|
|
5
5
|
return class DisableHover extends PureComponent {
|
|
@@ -23,7 +23,7 @@ function disableHoverHOC(ComposedComponent) {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
onKeyDown = e => {
|
|
26
|
-
const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line
|
|
26
|
+
const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line no-magic-numbers
|
|
27
27
|
if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
|
|
28
28
|
this.setState({
|
|
29
29
|
disabledHover: true
|
|
@@ -31,7 +31,7 @@ function disableHoverHOC(ComposedComponent) {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
render() {
|
|
34
|
-
return jsx(ComposedComponent, {
|
|
34
|
+
return /*#__PURE__*/jsx(ComposedComponent, {
|
|
35
35
|
...this.props,
|
|
36
36
|
disabledHover: this.state.disabledHover
|
|
37
37
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
1
|
import { PureComponent } from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import sortableIcon from '@jetbrains/icons/unsorted-12px';
|
|
@@ -6,9 +5,11 @@ import chevron12pxDown from '@jetbrains/icons/chevron-12px-down';
|
|
|
6
5
|
import Icon from '../icon/icon.js';
|
|
7
6
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
8
7
|
import { s as style } from '../_helpers/table.js';
|
|
8
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
9
|
import 'util-deprecate';
|
|
10
10
|
import '../icon/icon.constants.js';
|
|
11
11
|
import '../_helpers/icon-svg.js';
|
|
12
|
+
import 'react-compiler-runtime';
|
|
12
13
|
import '../global/memoize.js';
|
|
13
14
|
|
|
14
15
|
class HeaderCell extends PureComponent {
|
|
@@ -53,18 +54,18 @@ class HeaderCell extends PureComponent {
|
|
|
53
54
|
[style.sortedUp]: sortOrder && this.sorted,
|
|
54
55
|
[style.cellRight]: column.rightAlign
|
|
55
56
|
});
|
|
56
|
-
return jsxs("th", {
|
|
57
|
+
return /*#__PURE__*/jsxs("th", {
|
|
57
58
|
...restProps,
|
|
58
59
|
className: classes,
|
|
59
60
|
onClick: this.onClick,
|
|
60
61
|
"data-test": joinDataTestAttributes('ring-table-header-cell', dataTest),
|
|
61
|
-
children: [jsx("span", {
|
|
62
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
62
63
|
onClick: this.onChildrenClick,
|
|
63
|
-
role:
|
|
64
|
+
role: "presentation",
|
|
64
65
|
children: this.props.children
|
|
65
|
-
}), column.getHeaderValue ? column.getHeaderValue() : column.title, this.sortable && jsx("span", {
|
|
66
|
+
}), column.getHeaderValue ? column.getHeaderValue() : column.title, this.sortable && /*#__PURE__*/jsx("span", {
|
|
66
67
|
className: style.sorter,
|
|
67
|
-
children: jsx(Icon, {
|
|
68
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
68
69
|
glyph: glyph,
|
|
69
70
|
className: style.icon
|
|
70
71
|
})
|
|
@@ -28,7 +28,7 @@ export default class Header extends PureComponent<HeaderProps> {
|
|
|
28
28
|
};
|
|
29
29
|
id: string;
|
|
30
30
|
onCheckboxFocus: (event: SyntheticEvent<HTMLElement>) => void;
|
|
31
|
-
createCells(widths?: never[]): import("react
|
|
32
|
-
render(): import("react
|
|
31
|
+
createCells(widths?: never[]): import("react").JSX.Element[];
|
|
32
|
+
render(): import("react").JSX.Element;
|
|
33
33
|
}
|
|
34
34
|
export type HeaderAttrs = React.JSX.LibraryManagedAttributes<typeof Header, HeaderProps>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
1
|
import { PureComponent } from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import Checkbox from '../checkbox/checkbox.js';
|
|
5
4
|
import getUID from '../global/get-uid.js';
|
|
6
|
-
import { s as style } from '../_helpers/table.js';
|
|
7
5
|
import HeaderCell from './header-cell.js';
|
|
6
|
+
import { s as style } from '../_helpers/table.js';
|
|
7
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
import '@jetbrains/icons/checkmark-12px';
|
|
9
9
|
import '@jetbrains/icons/remove-12px';
|
|
10
10
|
import '../icon/icon.js';
|
|
11
11
|
import 'util-deprecate';
|
|
12
12
|
import '../icon/icon.constants.js';
|
|
13
13
|
import '../_helpers/icon-svg.js';
|
|
14
|
+
import 'react-compiler-runtime';
|
|
14
15
|
import '../global/memoize.js';
|
|
15
16
|
import '../global/compose-refs.js';
|
|
16
17
|
import 'memoize-one';
|
|
@@ -48,9 +49,9 @@ class Header extends PureComponent {
|
|
|
48
49
|
sortOrder
|
|
49
50
|
} = this.props;
|
|
50
51
|
const metaColumnClasses = classNames(style.metaColumn, style.headerMetaColumn);
|
|
51
|
-
const metaColumn = jsx("div", {
|
|
52
|
+
const metaColumn = /*#__PURE__*/jsx("div", {
|
|
52
53
|
className: metaColumnClasses,
|
|
53
|
-
children: selectable && jsx(Checkbox, {
|
|
54
|
+
children: selectable && /*#__PURE__*/jsx(Checkbox, {
|
|
54
55
|
"aria-labelledby": this.id,
|
|
55
56
|
disabled: checkboxDisabled,
|
|
56
57
|
checked: checked,
|
|
@@ -69,7 +70,7 @@ class Header extends PureComponent {
|
|
|
69
70
|
sortOrder,
|
|
70
71
|
style: columnStyle
|
|
71
72
|
};
|
|
72
|
-
return jsx(HeaderCell, {
|
|
73
|
+
return /*#__PURE__*/jsx(HeaderCell, {
|
|
73
74
|
"data-test": column.id,
|
|
74
75
|
...props,
|
|
75
76
|
children: index === 0 && (draggable || selectable) && metaColumn
|
|
@@ -83,9 +84,9 @@ class Header extends PureComponent {
|
|
|
83
84
|
topStickOffset
|
|
84
85
|
} = this.props;
|
|
85
86
|
const regularCells = this.createCells();
|
|
86
|
-
return jsxs("thead", {
|
|
87
|
+
return /*#__PURE__*/jsxs("thead", {
|
|
87
88
|
id: this.id,
|
|
88
|
-
"data-test":
|
|
89
|
+
"data-test": "ring-table-header",
|
|
89
90
|
style: {
|
|
90
91
|
top: topStickOffset
|
|
91
92
|
},
|
|
@@ -93,17 +94,17 @@ class Header extends PureComponent {
|
|
|
93
94
|
[style.tableHead]: true,
|
|
94
95
|
[style.subHeaderSticky]: sticky
|
|
95
96
|
}),
|
|
96
|
-
children: [caption && jsx("tr", {
|
|
97
|
-
"data-test":
|
|
98
|
-
children: jsx("th", {
|
|
97
|
+
children: [caption && /*#__PURE__*/jsx("tr", {
|
|
98
|
+
"data-test": "ring-table-header-row",
|
|
99
|
+
children: /*#__PURE__*/jsx("th", {
|
|
99
100
|
className: classNames(style.headerCell, style.caption),
|
|
100
101
|
colSpan: regularCells.length + 1,
|
|
101
|
-
"data-test":
|
|
102
|
+
"data-test": "ring-table-header-cell",
|
|
102
103
|
children: caption
|
|
103
104
|
})
|
|
104
|
-
}), jsx("tr", {
|
|
105
|
+
}), /*#__PURE__*/jsx("tr", {
|
|
105
106
|
className: style.subHeader,
|
|
106
|
-
"data-test":
|
|
107
|
+
"data-test": "ring-table-header-row",
|
|
107
108
|
children: regularCells
|
|
108
109
|
})]
|
|
109
110
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
1
|
import { PureComponent, Children, cloneElement } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
class MultiTable extends PureComponent {
|
|
5
5
|
componentDidUpdate(prevProps) {
|
|
@@ -95,8 +95,8 @@ class MultiTable extends PureComponent {
|
|
|
95
95
|
'ctrl+a': this.onCmdAPress
|
|
96
96
|
};
|
|
97
97
|
render() {
|
|
98
|
-
return jsx("div", {
|
|
99
|
-
"data-test":
|
|
98
|
+
return /*#__PURE__*/jsx("div", {
|
|
99
|
+
"data-test": "ring-multitable",
|
|
100
100
|
children: Children.map(this.props.children, child => {
|
|
101
101
|
const props = {
|
|
102
102
|
shortcuts: this.shortcuts
|
|
@@ -14,5 +14,5 @@ export default class RowWithFocusSensorCallbacks<T extends SelectionItem> extend
|
|
|
14
14
|
onSelect: (item: T, selected: boolean) => void;
|
|
15
15
|
onCollapse: () => void;
|
|
16
16
|
onExpand: () => void;
|
|
17
|
-
render(): import("react
|
|
17
|
+
render(): import("react").JSX.Element;
|
|
18
18
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
1
|
import { PureComponent } from 'react';
|
|
3
2
|
import focusSensorHOC from '../global/focus-sensor-hoc.js';
|
|
4
3
|
import Row from './row.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import '../global/compose-refs.js';
|
|
6
6
|
import 'memoize-one';
|
|
7
|
+
import 'react-compiler-runtime';
|
|
7
8
|
import 'classnames';
|
|
8
9
|
import '@jetbrains/icons/chevron-right';
|
|
9
10
|
import '@jetbrains/icons/chevron-down';
|
|
@@ -61,7 +62,7 @@ class RowWithFocusSensorCallbacks extends PureComponent {
|
|
|
61
62
|
this.props.onExpand?.(this.props.item);
|
|
62
63
|
};
|
|
63
64
|
render() {
|
|
64
|
-
return jsx(this.RowWithFocusSensor, {
|
|
65
|
+
return /*#__PURE__*/jsx(this.RowWithFocusSensor, {
|
|
65
66
|
...this.props,
|
|
66
67
|
onFocus: this.onFocus,
|
|
67
68
|
onSelect: this.onSelect,
|
|
@@ -56,6 +56,6 @@ export default class Row<T extends SelectionItem> extends PureComponent<RowProps
|
|
|
56
56
|
row?: HTMLElement | null;
|
|
57
57
|
rowRef: (el: HTMLElement | null) => void;
|
|
58
58
|
composedRowRef: import("memoize-one").MemoizedFn<(...refs: (React.Ref<HTMLElement> | undefined)[]) => (value: T_1 | null) => void>;
|
|
59
|
-
render():
|
|
59
|
+
render(): React.JSX.Element;
|
|
60
60
|
}
|
|
61
61
|
export type RowAttrs<T extends SelectionItem> = React.JSX.LibraryManagedAttributes<typeof Row, RowProps<T>>;
|