@jetbrains/ring-ui 5.0.126 → 5.0.128
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/alert/alert.js +2 -1
- package/components/alert/container.js +2 -1
- package/components/auth/auth__core.js +2 -1
- package/components/auth/request-builder.js +2 -1
- package/components/auth/response-parser.js +2 -1
- package/components/auth/token-validator.js +2 -1
- package/components/auth-dialog/auth-dialog.js +2 -1
- package/components/avatar/avatar.js +2 -1
- package/components/badge/badge.js +2 -1
- package/components/button/button.js +2 -1
- package/components/button-group/button-group.js +2 -1
- package/components/button-group/caption.js +2 -1
- package/components/button-set/button-set.js +2 -1
- package/components/button-toolbar/button-toolbar.js +2 -1
- package/components/caret/caret.js +2 -1
- package/components/checkbox/checkbox.js +2 -1
- package/components/code/code.js +2 -1
- package/components/confirm/confirm.js +2 -1
- package/components/content-layout/content-layout.js +2 -1
- package/components/content-layout/sidebar.js +2 -1
- package/components/data-list/data-list.js +2 -1
- package/components/data-list/item.js +2 -1
- package/components/date-picker/date-input.js +2 -1
- package/components/date-picker/date-picker.js +2 -1
- package/components/date-picker/date-popup.js +2 -1
- package/components/date-picker/day.js +2 -1
- package/components/date-picker/month-slider.js +2 -1
- package/components/date-picker/years.js +2 -1
- package/components/dialog/dialog.d.ts +4 -16
- package/components/dialog/dialog.js +6 -3
- package/components/dropdown/dropdown.js +2 -1
- package/components/editable-heading/editable-heading.css +2 -0
- package/components/error-bubble/error-bubble.js +2 -1
- package/components/error-message/error-message.js +2 -1
- package/components/footer/footer.js +1 -0
- package/components/global/react-dom-renderer.js +2 -1
- package/components/grid/col.js +2 -1
- package/components/grid/grid.js +2 -1
- package/components/grid/row.js +2 -1
- package/components/group/group.js +2 -1
- package/components/header/logo.js +2 -1
- package/components/header/profile.js +2 -1
- package/components/header/services-link.js +2 -1
- package/components/header/services.js +2 -1
- package/components/header/smart-profile.js +2 -1
- package/components/header/smart-services.js +2 -1
- package/components/header/tray-icon.js +2 -1
- package/components/header/tray.js +2 -1
- package/components/hub-source/hub-source.js +2 -1
- package/components/icon/icon.js +2 -1
- package/components/input/input.js +2 -1
- package/components/island/island.js +2 -1
- package/components/island-legacy/content-legacy.js +2 -1
- package/components/island-legacy/header-legacy.js +2 -1
- package/components/island-legacy/island-legacy.js +2 -1
- package/components/link/clickableLink.js +2 -1
- package/components/list/list.js +2 -1
- package/components/list/list__hint.js +2 -1
- package/components/list/list__users-groups-source.js +2 -1
- package/components/loader/loader.js +2 -1
- package/components/loader/loader__core.js +2 -1
- package/components/loader-screen/loader-screen.js +2 -1
- package/components/login-dialog/login-dialog.js +2 -1
- package/components/message/message.js +2 -1
- package/components/pager/pager.js +2 -1
- package/components/panel/panel.js +2 -1
- package/components/permissions/permissions.js +2 -1
- package/components/permissions/permissions__cache.js +2 -1
- package/components/popup/popup.js +2 -1
- package/components/popup-menu/popup-menu.js +2 -1
- package/components/progress-bar/progress-bar.js +2 -1
- package/components/query-assist/query-assist.js +4 -3
- package/components/radio/radio.js +2 -1
- package/components/radio/radio__item.js +2 -1
- package/components/select/select.js +3 -2
- package/components/select/select__filter.js +2 -1
- package/components/select/select__popup.js +4 -2
- package/components/shortcuts/shortcuts.js +2 -1
- package/components/storage/storage__fallback.js +2 -1
- package/components/tab-trap/tab-trap.js +2 -1
- package/components/table/cell.js +2 -1
- package/components/table/header-cell.js +2 -1
- package/components/table/header.js +2 -1
- package/components/table/multitable.js +2 -1
- package/components/table/row.js +3 -2
- package/components/table/table.js +4 -2
- package/components/tabs/smart-tabs.js +2 -1
- package/components/tabs/tab.js +2 -1
- package/components/tag/tag.js +2 -1
- package/components/tags-input/tags-input.d.ts +1 -1
- package/components/tags-input/tags-input.js +3 -2
- package/components/tags-list/tags-list.js +2 -1
- package/components/text/text.js +2 -1
- package/components/tooltip/tooltip.js +2 -1
- package/components/user-agreement/user-agreement.js +2 -1
- package/components/user-card/card.js +2 -1
- package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
- package/components/user-card/smart-user-card-tooltip.js +2 -1
- package/components/user-card/tooltip.js +2 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +1 -29
- package/dist/_helpers/anchor.js +1 -1
- package/dist/_helpers/card.js +44 -47
- package/dist/_helpers/footer.js +1 -0
- package/dist/_helpers/select__filter.js +10 -13
- package/dist/_helpers/services-link.js +10 -10
- package/dist/_helpers/sidebar.js +34 -37
- package/dist/_helpers/theme.js +1 -1
- package/dist/_helpers/title.js +12 -16
- package/dist/alert/alert.js +63 -66
- package/dist/alert/container.js +5 -5
- package/dist/alert-service/alert-service.js +5 -7
- package/dist/analytics/analytics.js +1 -2
- package/dist/analytics/analytics__custom-plugin.js +6 -8
- package/dist/auth/auth.js +1 -1
- package/dist/auth/auth__core.js +26 -26
- package/dist/auth/background-flow.js +4 -5
- package/dist/auth/iframe-flow.js +12 -12
- package/dist/auth/landing.js +1 -1
- package/dist/auth/request-builder.js +3 -5
- package/dist/auth/response-parser.js +5 -6
- package/dist/auth/storage.js +12 -12
- package/dist/auth/token-validator.js +13 -16
- package/dist/auth/window-flow.js +18 -19
- package/dist/auth-dialog/auth-dialog.js +54 -57
- package/dist/auth-dialog-service/auth-dialog-service.js +1 -1
- package/dist/auth-ng/auth-ng.js +1 -1
- package/dist/avatar/avatar.js +30 -33
- package/dist/avatar-ng/avatar-ng.js +1 -1
- package/dist/badge/badge.js +10 -10
- package/dist/badge-ng/badge-ng.js +1 -1
- package/dist/breadcrumb-ng/breadcrumb-ng.js +0 -1
- package/dist/button/button.js +24 -27
- package/dist/button-group/button-group.js +5 -5
- package/dist/button-group/caption.js +4 -4
- package/dist/button-ng/button-ng.js +68 -69
- package/dist/button-set/button-set.js +6 -6
- package/dist/button-toolbar/button-toolbar.js +6 -6
- package/dist/caret/caret.js +2 -4
- package/dist/checkbox/checkbox.js +27 -30
- package/dist/checkbox-ng/checkbox-ng.js +0 -1
- package/dist/code/code.js +17 -21
- package/dist/confirm/confirm.js +31 -34
- package/dist/confirm-ng/confirm-ng.js +1 -1
- package/dist/confirm-service/confirm-service.js +1 -1
- package/dist/content-layout/content-layout.js +17 -20
- package/dist/contenteditable/contenteditable.js +11 -11
- package/dist/data-list/data-list.js +49 -55
- package/dist/data-list/item.js +64 -67
- package/dist/data-list/selection.js +0 -1
- package/dist/data-list/title.js +1 -1
- package/dist/data-list-ng/data-list-ng.js +1 -1
- package/dist/date-picker/date-input.js +39 -42
- package/dist/date-picker/date-picker.js +162 -165
- package/dist/date-picker/date-popup.js +119 -119
- package/dist/date-picker/day.js +34 -38
- package/dist/date-picker/month-names.js +11 -14
- package/dist/date-picker/month-slider.js +24 -28
- package/dist/date-picker/month.js +1 -1
- package/dist/date-picker/months.js +1 -1
- package/dist/date-picker/years.js +9 -13
- package/dist/dialog/dialog.d.ts +4 -16
- package/dist/dialog/dialog.js +68 -65
- package/dist/dialog-ng/dialog-ng.js +21 -22
- package/dist/docked-panel-ng/docked-panel-ng.js +0 -1
- package/dist/dropdown/dropdown.js +101 -104
- package/dist/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/editable-heading/editable-heading.js +1 -1
- package/dist/error-bubble/error-bubble.js +6 -6
- package/dist/error-message/error-message.js +10 -10
- package/dist/error-message-ng/error-message-ng.js +0 -1
- package/dist/footer-ng/footer-ng.js +19 -21
- package/dist/global/angular-component-factory.js +2 -3
- package/dist/global/dom.js +1 -5
- package/dist/global/focus-sensor-hoc.js +58 -61
- package/dist/global/listeners.js +1 -5
- package/dist/global/react-dom-renderer.js +8 -12
- package/dist/global/rerender-hoc.js +1 -5
- package/dist/global/ring-angular-component.js +1 -3
- package/dist/grid/col.js +13 -14
- package/dist/grid/grid.js +5 -5
- package/dist/grid/row.js +16 -17
- package/dist/group/group.js +5 -5
- package/dist/header/header.js +10 -10
- package/dist/header/logo.js +9 -9
- package/dist/header/profile.js +58 -58
- package/dist/header/services.js +19 -22
- package/dist/header/smart-profile.js +40 -43
- package/dist/header/smart-services.js +28 -31
- package/dist/header/tray-icon.js +6 -6
- package/dist/header/tray.js +5 -5
- package/dist/heading/heading.js +1 -1
- package/dist/heading-ng/heading-ng.js +1 -1
- package/dist/http/http.js +111 -107
- package/dist/http/http.mock.js +3 -4
- package/dist/hub-source/hub-source.js +7 -9
- package/dist/hub-source/hub-source__user.js +0 -1
- package/dist/hub-source/hub-source__users-groups.js +4 -5
- package/dist/icon/icon.js +18 -18
- package/dist/icon/icon__svg.js +1 -1
- package/dist/icon-ng/icon-ng.js +0 -1
- package/dist/input/input.js +35 -38
- package/dist/input-ng/input-ng.js +25 -26
- package/dist/island/adaptive-island-hoc.js +21 -25
- package/dist/island/content.js +62 -65
- package/dist/island/header.js +11 -11
- package/dist/island/island.js +8 -8
- package/dist/island-legacy/content-legacy.js +5 -5
- package/dist/island-legacy/header-legacy.js +5 -5
- package/dist/island-legacy/island-legacy.js +5 -5
- package/dist/link/clickableLink.js +27 -30
- package/dist/link/link.js +16 -16
- package/dist/list/list.js +389 -391
- package/dist/list/list__custom.js +6 -10
- package/dist/list/list__hint.js +3 -4
- package/dist/list/list__item.js +4 -7
- package/dist/list/list__link.js +1 -1
- package/dist/list/list__users-groups-source.js +3 -3
- package/dist/loader/loader.js +16 -19
- package/dist/loader/loader__core.js +62 -62
- package/dist/loader-inline/loader-inline.js +6 -6
- package/dist/loader-ng/loader-ng.js +3 -4
- package/dist/loader-screen/loader-screen.js +6 -6
- package/dist/loader-screen-ng/loader-screen-ng.js +0 -1
- package/dist/login-dialog/login-dialog.js +55 -58
- package/dist/login-dialog/service.js +1 -1
- package/dist/markdown/code.js +0 -1
- package/dist/markdown/markdown.js +1 -1
- package/dist/message/message.js +22 -25
- package/dist/old-browsers-message/white-list.js +2 -2
- package/dist/pager/pager.js +55 -58
- package/dist/pager-ng/pager-ng.js +1 -1
- package/dist/panel/panel.js +5 -5
- package/dist/panel-ng/panel-ng.js +0 -1
- package/dist/permissions/permissions.js +14 -16
- package/dist/permissions/permissions__cache.js +4 -6
- package/dist/permissions-ng/permissions-ng.js +1 -1
- package/dist/place-under-ng/place-under-ng.js +0 -1
- package/dist/popup/popup.js +118 -121
- package/dist/popup/popup.target.js +1 -1
- package/dist/popup/position.js +0 -1
- package/dist/popup-menu/popup-menu.js +19 -22
- package/dist/progress-bar/progress-bar.js +41 -44
- package/dist/progress-bar-ng/progress-bar-ng.js +1 -1
- package/dist/promised-click-ng/promised-click-ng.js +0 -1
- package/dist/query-assist/query-assist.js +507 -501
- package/dist/query-assist/query-assist__suggestions.js +1 -1
- package/dist/query-assist-ng/query-assist-ng.js +1 -1
- package/dist/radio/radio.js +10 -13
- package/dist/radio/radio__item.js +19 -22
- package/dist/select/select.js +351 -350
- package/dist/select/select__popup.js +148 -152
- package/dist/select-ng/select-ng.js +1 -1
- package/dist/select-ng/select-ng__lazy.js +4 -4
- package/dist/select-ng/select-ng__options.js +14 -15
- package/dist/shortcuts/core.js +35 -36
- package/dist/shortcuts/shortcuts-hoc.js +7 -11
- package/dist/shortcuts/shortcuts.js +10 -11
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -1
- package/dist/shortcuts-ng/shortcuts-ng.js +0 -1
- package/dist/sidebar-ng/sidebar-ng.js +0 -1
- package/dist/storage/storage.js +1 -1
- package/dist/storage/storage__fallback.js +8 -10
- package/dist/storage/storage__local.js +2 -2
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +84 -86
- package/dist/table/cell.js +6 -6
- package/dist/table/disable-hover-hoc.js +23 -25
- package/dist/table/header-cell.js +28 -31
- package/dist/table/header.js +58 -61
- package/dist/table/multitable.js +91 -95
- package/dist/table/row-with-focus-sensor.js +15 -18
- package/dist/table/row.js +51 -54
- package/dist/table/selection-shortcuts-hoc.js +145 -147
- package/dist/table/selection.js +7 -9
- package/dist/table/smart-table.js +21 -24
- package/dist/table/table.js +103 -109
- package/dist/table-legacy-ng/table-legacy-ng.js +1 -1
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +1 -1
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +1 -3
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +0 -1
- package/dist/table-ng/smart-table-ng.js +1 -1
- package/dist/table-ng/table-ng.js +1 -1
- package/dist/tabs/collapsible-more.js +1 -1
- package/dist/tabs/collapsible-tab.js +1 -1
- package/dist/tabs/dumb-tabs.js +46 -49
- package/dist/tabs/smart-tabs.js +10 -10
- package/dist/tabs/tab.js +7 -8
- package/dist/tag/tag.js +42 -45
- package/dist/tags-input/tags-input.d.ts +1 -1
- package/dist/tags-input/tags-input.js +214 -213
- package/dist/tags-input-ng/tags-input-ng.js +1 -1
- package/dist/tags-list/tags-list.js +20 -20
- package/dist/template-ng/template-ng.js +25 -26
- package/dist/text/text.js +6 -6
- package/dist/toggle/toggle.js +19 -19
- package/dist/toggle-ng/toggle-ng.js +1 -1
- package/dist/tooltip/tooltip.js +86 -89
- package/dist/tooltip-ng/tooltip-ng.js +1 -1
- package/dist/user-agreement/service.js +207 -205
- package/dist/user-agreement/user-agreement.js +39 -42
- package/dist/user-card/smart-user-card-tooltip.d.ts +1 -1
- package/dist/user-card/smart-user-card-tooltip.js +32 -35
- package/dist/user-card/tooltip.js +26 -26
- package/dist/user-card-ng/user-card-ng.js +1 -1
- package/package.json +15 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React, { Component } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { isNodeInVisiblePartOfPage } from '../global/dom.js';
|
|
@@ -10,30 +10,55 @@ const FOCUSABLE_ELEMENTS = 'input, button, select, textarea, a[href], *[tabindex
|
|
|
10
10
|
* @name TabTrap
|
|
11
11
|
*/
|
|
12
12
|
class TabTrap extends Component {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
13
|
+
static propTypes = {
|
|
14
|
+
children: PropTypes.node.isRequired,
|
|
15
|
+
trapDisabled: PropTypes.bool,
|
|
16
|
+
autoFocusFirst: PropTypes.bool,
|
|
17
|
+
focusBackOnClose: PropTypes.bool,
|
|
18
|
+
focusBackOnExit: PropTypes.bool
|
|
19
|
+
};
|
|
20
|
+
static defaultProps = {
|
|
21
|
+
trapDisabled: false,
|
|
22
|
+
autoFocusFirst: true,
|
|
23
|
+
focusBackOnClose: true,
|
|
24
|
+
focusBackOnExit: false
|
|
25
|
+
};
|
|
26
|
+
componentDidMount() {
|
|
27
|
+
this.previousFocusedNode = document.activeElement;
|
|
28
|
+
if (this.props.autoFocusFirst) {
|
|
29
|
+
this.focusFirst();
|
|
30
|
+
} else if (!this.props.trapDisabled && (!this.node || !this.node.contains(this.previousFocusedNode))) {
|
|
31
|
+
this.trapWithoutFocus = true;
|
|
32
|
+
this.trapButtonNode?.focus();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
componentWillUnmount() {
|
|
36
|
+
if (this.props.focusBackOnClose) {
|
|
37
|
+
this.restoreFocus();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
previousFocusedNode;
|
|
41
|
+
trapWithoutFocus;
|
|
42
|
+
restoreFocus = () => {
|
|
43
|
+
const {
|
|
44
|
+
previousFocusedNode
|
|
45
|
+
} = this;
|
|
46
|
+
if (previousFocusedNode instanceof HTMLElement && previousFocusedNode.focus && isNodeInVisiblePartOfPage(previousFocusedNode)) {
|
|
47
|
+
previousFocusedNode.focus({
|
|
48
|
+
preventScroll: true
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
node;
|
|
53
|
+
containerRef = node => {
|
|
54
|
+
if (!node) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.node = node;
|
|
58
|
+
};
|
|
59
|
+
focusElement = (() => {
|
|
60
|
+
var _this = this;
|
|
61
|
+
return function () {
|
|
37
62
|
let first = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
38
63
|
const {
|
|
39
64
|
node
|
|
@@ -46,58 +71,44 @@ class TabTrap extends Component {
|
|
|
46
71
|
if (toBeFocused) {
|
|
47
72
|
toBeFocused.focus();
|
|
48
73
|
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} else {
|
|
62
|
-
this.focusLast();
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
_defineProperty(this, "handleBlurIfWithoutFocus", event => {
|
|
66
|
-
if (!this.trapWithoutFocus) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
this.trapWithoutFocus = false;
|
|
70
|
-
const newFocused = event.nativeEvent.relatedTarget;
|
|
71
|
-
if (!newFocused) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (newFocused instanceof Element && this.node?.contains(newFocused)) {
|
|
75
|
-
return;
|
|
74
|
+
};
|
|
75
|
+
})();
|
|
76
|
+
focusFirst = () => this.focusElement(true);
|
|
77
|
+
focusLast = () => this.focusElement(false);
|
|
78
|
+
focusLastIfEnabled = event => {
|
|
79
|
+
if (this.trapWithoutFocus) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (this.props.focusBackOnExit) {
|
|
83
|
+
const prevFocused = event.nativeEvent.relatedTarget;
|
|
84
|
+
if (prevFocused != null && this.node != null && prevFocused instanceof Element && this.node.contains(prevFocused)) {
|
|
85
|
+
this.restoreFocus();
|
|
76
86
|
}
|
|
87
|
+
} else {
|
|
77
88
|
this.focusLast();
|
|
78
|
-
});
|
|
79
|
-
_defineProperty(this, "trapButtonNode", void 0);
|
|
80
|
-
_defineProperty(this, "trapButtonRef", node => {
|
|
81
|
-
if (!node) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
this.trapButtonNode = node;
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
componentDidMount() {
|
|
88
|
-
this.previousFocusedNode = document.activeElement;
|
|
89
|
-
if (this.props.autoFocusFirst) {
|
|
90
|
-
this.focusFirst();
|
|
91
|
-
} else if (!this.props.trapDisabled && (!this.node || !this.node.contains(this.previousFocusedNode))) {
|
|
92
|
-
this.trapWithoutFocus = true;
|
|
93
|
-
this.trapButtonNode?.focus();
|
|
94
89
|
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (this.
|
|
98
|
-
|
|
90
|
+
};
|
|
91
|
+
handleBlurIfWithoutFocus = event => {
|
|
92
|
+
if (!this.trapWithoutFocus) {
|
|
93
|
+
return;
|
|
99
94
|
}
|
|
100
|
-
|
|
95
|
+
this.trapWithoutFocus = false;
|
|
96
|
+
const newFocused = event.nativeEvent.relatedTarget;
|
|
97
|
+
if (!newFocused) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (newFocused instanceof Element && this.node?.contains(newFocused)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.focusLast();
|
|
104
|
+
};
|
|
105
|
+
trapButtonNode;
|
|
106
|
+
trapButtonRef = node => {
|
|
107
|
+
if (!node) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
this.trapButtonNode = node;
|
|
111
|
+
};
|
|
101
112
|
render() {
|
|
102
113
|
const {
|
|
103
114
|
children,
|
|
@@ -132,18 +143,5 @@ class TabTrap extends Component {
|
|
|
132
143
|
}));
|
|
133
144
|
}
|
|
134
145
|
}
|
|
135
|
-
_defineProperty(TabTrap, "propTypes", {
|
|
136
|
-
children: PropTypes.node.isRequired,
|
|
137
|
-
trapDisabled: PropTypes.bool,
|
|
138
|
-
autoFocusFirst: PropTypes.bool,
|
|
139
|
-
focusBackOnClose: PropTypes.bool,
|
|
140
|
-
focusBackOnExit: PropTypes.bool
|
|
141
|
-
});
|
|
142
|
-
_defineProperty(TabTrap, "defaultProps", {
|
|
143
|
-
trapDisabled: false,
|
|
144
|
-
autoFocusFirst: true,
|
|
145
|
-
focusBackOnClose: true,
|
|
146
|
-
focusBackOnExit: false
|
|
147
|
-
});
|
|
148
146
|
|
|
149
147
|
export { FOCUSABLE_ELEMENTS, TabTrap as default };
|
package/dist/table/cell.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React, { PureComponent } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -6,6 +6,11 @@ import joinDataTestAttributes from '../global/data-tests.js';
|
|
|
6
6
|
import { m as modules_1db4bbca } from '../_helpers/table.js';
|
|
7
7
|
|
|
8
8
|
class Cell extends PureComponent {
|
|
9
|
+
static propTypes = {
|
|
10
|
+
children: PropTypes.any,
|
|
11
|
+
className: PropTypes.string,
|
|
12
|
+
'data-test': PropTypes.string
|
|
13
|
+
};
|
|
9
14
|
render() {
|
|
10
15
|
const classes = classNames(modules_1db4bbca.cell, this.props.className);
|
|
11
16
|
return /*#__PURE__*/React.createElement("td", _extends({}, this.props, {
|
|
@@ -14,10 +19,5 @@ class Cell extends PureComponent {
|
|
|
14
19
|
}), this.props.children);
|
|
15
20
|
}
|
|
16
21
|
}
|
|
17
|
-
_defineProperty(Cell, "propTypes", {
|
|
18
|
-
children: PropTypes.any,
|
|
19
|
-
className: PropTypes.string,
|
|
20
|
-
'data-test': PropTypes.string
|
|
21
|
-
});
|
|
22
22
|
|
|
23
23
|
export { Cell as default };
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React, { PureComponent } from 'react';
|
|
3
3
|
|
|
4
4
|
function disableHoverHOC(ComposedComponent) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
_defineProperty(this, "onMouseMove", () => {
|
|
13
|
-
if (this.state.disabledHover) {
|
|
14
|
-
this.setState({
|
|
15
|
-
disabledHover: false
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
_defineProperty(this, "onKeyDown", e => {
|
|
20
|
-
const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line @typescript-eslint/no-magic-numbers
|
|
21
|
-
if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
|
|
22
|
-
this.setState({
|
|
23
|
-
disabledHover: true
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
5
|
+
return class DisableHover extends PureComponent {
|
|
6
|
+
static propTypes = ComposedComponent.propTypes;
|
|
7
|
+
static defaultProps = ComposedComponent.defaultProps;
|
|
8
|
+
state = {
|
|
9
|
+
disabledHover: false
|
|
10
|
+
};
|
|
28
11
|
componentDidMount() {
|
|
29
12
|
document.addEventListener('mousemove', this.onMouseMove);
|
|
30
13
|
document.addEventListener('keydown', this.onKeyDown, true);
|
|
@@ -33,12 +16,27 @@ function disableHoverHOC(ComposedComponent) {
|
|
|
33
16
|
document.removeEventListener('mousemove', this.onMouseMove);
|
|
34
17
|
document.removeEventListener('keydown', this.onKeyDown, true);
|
|
35
18
|
}
|
|
19
|
+
onMouseMove = () => {
|
|
20
|
+
if (this.state.disabledHover) {
|
|
21
|
+
this.setState({
|
|
22
|
+
disabledHover: false
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
onKeyDown = e => {
|
|
27
|
+
const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line @typescript-eslint/no-magic-numbers
|
|
28
|
+
if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
|
|
29
|
+
this.setState({
|
|
30
|
+
disabledHover: true
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
36
34
|
render() {
|
|
37
35
|
return /*#__PURE__*/React.createElement(ComposedComponent, _extends({}, this.props, {
|
|
38
36
|
disabledHover: this.state.disabledHover
|
|
39
37
|
}));
|
|
40
38
|
}
|
|
41
|
-
}
|
|
39
|
+
};
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
export { disableHoverHOC as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React, { PureComponent } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -14,24 +14,33 @@ import '../icon/icon__svg.js';
|
|
|
14
14
|
import '../global/memoize.js';
|
|
15
15
|
|
|
16
16
|
class HeaderCell extends PureComponent {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
static propTypes = {
|
|
18
|
+
children: PropTypes.any,
|
|
19
|
+
className: PropTypes.string,
|
|
20
|
+
column: PropTypes.object.isRequired,
|
|
21
|
+
onSort: PropTypes.func,
|
|
22
|
+
sortKey: PropTypes.string,
|
|
23
|
+
sortOrder: PropTypes.bool,
|
|
24
|
+
'data-test': PropTypes.string
|
|
25
|
+
};
|
|
26
|
+
static defaultProps = {
|
|
27
|
+
onSort: () => {}
|
|
28
|
+
};
|
|
29
|
+
sortable;
|
|
30
|
+
sorted;
|
|
31
|
+
onClick = () => {
|
|
32
|
+
if (this.sortable) {
|
|
33
|
+
const {
|
|
34
|
+
column,
|
|
35
|
+
onSort,
|
|
36
|
+
sortOrder
|
|
37
|
+
} = this.props;
|
|
38
|
+
onSort({
|
|
39
|
+
column,
|
|
40
|
+
order: !(this.sorted && sortOrder)
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
35
44
|
onChildrenClick(e) {
|
|
36
45
|
e.stopPropagation();
|
|
37
46
|
}
|
|
@@ -70,17 +79,5 @@ class HeaderCell extends PureComponent {
|
|
|
70
79
|
})));
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
|
-
_defineProperty(HeaderCell, "propTypes", {
|
|
74
|
-
children: PropTypes.any,
|
|
75
|
-
className: PropTypes.string,
|
|
76
|
-
column: PropTypes.object.isRequired,
|
|
77
|
-
onSort: PropTypes.func,
|
|
78
|
-
sortKey: PropTypes.string,
|
|
79
|
-
sortOrder: PropTypes.bool,
|
|
80
|
-
'data-test': PropTypes.string
|
|
81
|
-
});
|
|
82
|
-
_defineProperty(HeaderCell, "defaultProps", {
|
|
83
|
-
onSort: () => {}
|
|
84
|
-
});
|
|
85
82
|
|
|
86
83
|
export { HeaderCell as default };
|
package/dist/table/header.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React, { PureComponent } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -23,43 +23,65 @@ import '@jetbrains/icons/chevron-10px';
|
|
|
23
23
|
import '../global/data-tests.js';
|
|
24
24
|
|
|
25
25
|
class Header extends PureComponent {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
26
|
+
static propTypes = {
|
|
27
|
+
caption: PropTypes.string,
|
|
28
|
+
selectable: PropTypes.bool,
|
|
29
|
+
draggable: PropTypes.bool,
|
|
30
|
+
checked: PropTypes.bool,
|
|
31
|
+
checkboxDisabled: PropTypes.bool,
|
|
32
|
+
sticky: PropTypes.bool,
|
|
33
|
+
topStickOffset: PropTypes.string,
|
|
34
|
+
onCheckboxChange: PropTypes.func,
|
|
35
|
+
columns: PropTypes.array.isRequired,
|
|
36
|
+
onSort: PropTypes.func,
|
|
37
|
+
sortKey: PropTypes.string,
|
|
38
|
+
sortOrder: PropTypes.bool
|
|
39
|
+
};
|
|
40
|
+
static defaultProps = {
|
|
41
|
+
selectable: true,
|
|
42
|
+
draggable: false,
|
|
43
|
+
checked: true,
|
|
44
|
+
sticky: true,
|
|
45
|
+
topStickOffset: '0px',
|
|
46
|
+
onSort: () => {},
|
|
47
|
+
onCheckboxChange: () => {},
|
|
48
|
+
sortKey: 'id',
|
|
49
|
+
sortOrder: true
|
|
50
|
+
};
|
|
51
|
+
state = {
|
|
52
|
+
fixed: false,
|
|
53
|
+
headerWidth: undefined,
|
|
54
|
+
widths: []
|
|
55
|
+
};
|
|
56
|
+
id = getUID('table-header-');
|
|
57
|
+
onCheckboxFocus = event => {
|
|
58
|
+
event.currentTarget.blur();
|
|
59
|
+
};
|
|
60
|
+
_columnsRowNode;
|
|
61
|
+
storeColumnsRowNode = node => {
|
|
62
|
+
if (node) {
|
|
63
|
+
this._columnsRowNode = node;
|
|
64
|
+
this.calculateColumnsWidths(node);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
onScrollIn = () => {
|
|
68
|
+
this.calculateColumnsWidths(this._columnsRowNode);
|
|
69
|
+
this.setState({
|
|
70
|
+
fixed: false
|
|
49
71
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
};
|
|
73
|
+
onScrollOut = _ref => {
|
|
74
|
+
let {
|
|
75
|
+
currentPosition
|
|
76
|
+
} = _ref;
|
|
77
|
+
if (currentPosition !== 'above') {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this.calculateColumnsWidths(this._columnsRowNode);
|
|
81
|
+
this.setState({
|
|
82
|
+
fixed: true
|
|
61
83
|
});
|
|
62
|
-
}
|
|
84
|
+
};
|
|
63
85
|
calculateColumnsWidths(columnsRowNode) {
|
|
64
86
|
var _columnsRowNode$child;
|
|
65
87
|
this.setState({
|
|
@@ -152,30 +174,5 @@ class Header extends PureComponent {
|
|
|
152
174
|
}, this.createCells(widths)));
|
|
153
175
|
}
|
|
154
176
|
}
|
|
155
|
-
_defineProperty(Header, "propTypes", {
|
|
156
|
-
caption: PropTypes.string,
|
|
157
|
-
selectable: PropTypes.bool,
|
|
158
|
-
draggable: PropTypes.bool,
|
|
159
|
-
checked: PropTypes.bool,
|
|
160
|
-
checkboxDisabled: PropTypes.bool,
|
|
161
|
-
sticky: PropTypes.bool,
|
|
162
|
-
topStickOffset: PropTypes.string,
|
|
163
|
-
onCheckboxChange: PropTypes.func,
|
|
164
|
-
columns: PropTypes.array.isRequired,
|
|
165
|
-
onSort: PropTypes.func,
|
|
166
|
-
sortKey: PropTypes.string,
|
|
167
|
-
sortOrder: PropTypes.bool
|
|
168
|
-
});
|
|
169
|
-
_defineProperty(Header, "defaultProps", {
|
|
170
|
-
selectable: true,
|
|
171
|
-
draggable: false,
|
|
172
|
-
checked: true,
|
|
173
|
-
sticky: true,
|
|
174
|
-
topStickOffset: '0px',
|
|
175
|
-
onSort: () => {},
|
|
176
|
-
onCheckboxChange: () => {},
|
|
177
|
-
sortKey: 'id',
|
|
178
|
-
sortOrder: true
|
|
179
|
-
});
|
|
180
177
|
|
|
181
178
|
export { Header as default };
|