@jetbrains/ring-ui 5.0.127 → 5.0.129
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/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 +2 -1
- 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.d.ts +1 -0
- package/components/table/row.js +6 -4
- package/components/table/smart-table.d.ts +1 -0
- package/components/table/table.d.ts +2 -0
- package/components/table/table.js +8 -4
- 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 +350 -349
- 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.d.ts +1 -0
- package/dist/table/row.js +54 -55
- package/dist/table/selection-shortcuts-hoc.js +145 -147
- package/dist/table/selection.js +7 -9
- package/dist/table/smart-table.d.ts +1 -0
- package/dist/table/smart-table.js +21 -24
- package/dist/table/table.d.ts +2 -0
- package/dist/table/table.js +107 -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 +17 -17
package/dist/table/multitable.js
CHANGED
|
@@ -1,99 +1,10 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React, { PureComponent, Children, cloneElement } from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
|
|
5
4
|
class MultiTable extends PureComponent {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const {
|
|
10
|
-
children: tables
|
|
11
|
-
} = this.props;
|
|
12
|
-
const tableIndex = tables.findIndex(_ref => {
|
|
13
|
-
let {
|
|
14
|
-
props: {
|
|
15
|
-
selection
|
|
16
|
-
}
|
|
17
|
-
} = _ref;
|
|
18
|
-
return selection.getFocused();
|
|
19
|
-
});
|
|
20
|
-
const currentTable = tables[tableIndex].props;
|
|
21
|
-
const prevTable = tables[tableIndex - 1] ? tables[tableIndex - 1].props : null;
|
|
22
|
-
let newSelection = currentTable.selection.moveUp();
|
|
23
|
-
if (newSelection) {
|
|
24
|
-
currentTable.onSelect?.(newSelection);
|
|
25
|
-
} else if (prevTable) {
|
|
26
|
-
currentTable.onSelect?.(currentTable.selection.resetFocus());
|
|
27
|
-
newSelection = prevTable.selection.moveUp();
|
|
28
|
-
if (newSelection) {
|
|
29
|
-
prevTable.onSelect?.(newSelection);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return false;
|
|
33
|
-
});
|
|
34
|
-
_defineProperty(this, "onDownPress", () => {
|
|
35
|
-
const {
|
|
36
|
-
children: tables
|
|
37
|
-
} = this.props;
|
|
38
|
-
const tableIndex = tables.findIndex(_ref2 => {
|
|
39
|
-
let {
|
|
40
|
-
props: {
|
|
41
|
-
selection
|
|
42
|
-
}
|
|
43
|
-
} = _ref2;
|
|
44
|
-
return selection.getFocused();
|
|
45
|
-
});
|
|
46
|
-
const currentTable = tables[tableIndex].props;
|
|
47
|
-
const nextTable = tables[tableIndex + 1] ? tables[tableIndex + 1].props : null;
|
|
48
|
-
let newSelection = currentTable.selection.moveDown();
|
|
49
|
-
if (newSelection) {
|
|
50
|
-
currentTable.onSelect?.(newSelection);
|
|
51
|
-
} else if (nextTable) {
|
|
52
|
-
currentTable.onSelect?.(currentTable.selection.resetFocus());
|
|
53
|
-
newSelection = nextTable.selection.moveDown();
|
|
54
|
-
if (newSelection) {
|
|
55
|
-
nextTable.onSelect?.(newSelection);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return false;
|
|
59
|
-
});
|
|
60
|
-
_defineProperty(this, "onEscPress", () => {
|
|
61
|
-
const {
|
|
62
|
-
children
|
|
63
|
-
} = this.props;
|
|
64
|
-
Children.forEach(children, _ref3 => {
|
|
65
|
-
let {
|
|
66
|
-
props: {
|
|
67
|
-
selection,
|
|
68
|
-
onSelect
|
|
69
|
-
}
|
|
70
|
-
} = _ref3;
|
|
71
|
-
onSelect(selection.reset());
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
_defineProperty(this, "onCmdAPress", () => {
|
|
75
|
-
const {
|
|
76
|
-
children
|
|
77
|
-
} = this.props;
|
|
78
|
-
Children.forEach(children, _ref4 => {
|
|
79
|
-
let {
|
|
80
|
-
props: {
|
|
81
|
-
selection,
|
|
82
|
-
onSelect
|
|
83
|
-
}
|
|
84
|
-
} = _ref4;
|
|
85
|
-
onSelect(selection.selectAll());
|
|
86
|
-
});
|
|
87
|
-
return false;
|
|
88
|
-
});
|
|
89
|
-
_defineProperty(this, "shortcuts", {
|
|
90
|
-
up: this.onUpPress,
|
|
91
|
-
down: this.onDownPress,
|
|
92
|
-
esc: this.onEscPress,
|
|
93
|
-
'command+a': this.onCmdAPress,
|
|
94
|
-
'ctrl+a': this.onCmdAPress
|
|
95
|
-
});
|
|
96
|
-
}
|
|
5
|
+
static propTypes = {
|
|
6
|
+
children: PropTypes.any.isRequired
|
|
7
|
+
};
|
|
97
8
|
componentDidUpdate(prevProps) {
|
|
98
9
|
if (prevProps.children) {
|
|
99
10
|
const prevSelections = prevProps.children.map(element => element.props.selection);
|
|
@@ -106,6 +17,94 @@ class MultiTable extends PureComponent {
|
|
|
106
17
|
}
|
|
107
18
|
}
|
|
108
19
|
}
|
|
20
|
+
onUpPress = () => {
|
|
21
|
+
const {
|
|
22
|
+
children: tables
|
|
23
|
+
} = this.props;
|
|
24
|
+
const tableIndex = tables.findIndex(_ref => {
|
|
25
|
+
let {
|
|
26
|
+
props: {
|
|
27
|
+
selection
|
|
28
|
+
}
|
|
29
|
+
} = _ref;
|
|
30
|
+
return selection.getFocused();
|
|
31
|
+
});
|
|
32
|
+
const currentTable = tables[tableIndex].props;
|
|
33
|
+
const prevTable = tables[tableIndex - 1] ? tables[tableIndex - 1].props : null;
|
|
34
|
+
let newSelection = currentTable.selection.moveUp();
|
|
35
|
+
if (newSelection) {
|
|
36
|
+
currentTable.onSelect?.(newSelection);
|
|
37
|
+
} else if (prevTable) {
|
|
38
|
+
currentTable.onSelect?.(currentTable.selection.resetFocus());
|
|
39
|
+
newSelection = prevTable.selection.moveUp();
|
|
40
|
+
if (newSelection) {
|
|
41
|
+
prevTable.onSelect?.(newSelection);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
};
|
|
46
|
+
onDownPress = () => {
|
|
47
|
+
const {
|
|
48
|
+
children: tables
|
|
49
|
+
} = this.props;
|
|
50
|
+
const tableIndex = tables.findIndex(_ref2 => {
|
|
51
|
+
let {
|
|
52
|
+
props: {
|
|
53
|
+
selection
|
|
54
|
+
}
|
|
55
|
+
} = _ref2;
|
|
56
|
+
return selection.getFocused();
|
|
57
|
+
});
|
|
58
|
+
const currentTable = tables[tableIndex].props;
|
|
59
|
+
const nextTable = tables[tableIndex + 1] ? tables[tableIndex + 1].props : null;
|
|
60
|
+
let newSelection = currentTable.selection.moveDown();
|
|
61
|
+
if (newSelection) {
|
|
62
|
+
currentTable.onSelect?.(newSelection);
|
|
63
|
+
} else if (nextTable) {
|
|
64
|
+
currentTable.onSelect?.(currentTable.selection.resetFocus());
|
|
65
|
+
newSelection = nextTable.selection.moveDown();
|
|
66
|
+
if (newSelection) {
|
|
67
|
+
nextTable.onSelect?.(newSelection);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
71
|
+
};
|
|
72
|
+
onEscPress = () => {
|
|
73
|
+
const {
|
|
74
|
+
children
|
|
75
|
+
} = this.props;
|
|
76
|
+
Children.forEach(children, _ref3 => {
|
|
77
|
+
let {
|
|
78
|
+
props: {
|
|
79
|
+
selection,
|
|
80
|
+
onSelect
|
|
81
|
+
}
|
|
82
|
+
} = _ref3;
|
|
83
|
+
onSelect(selection.reset());
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
onCmdAPress = () => {
|
|
87
|
+
const {
|
|
88
|
+
children
|
|
89
|
+
} = this.props;
|
|
90
|
+
Children.forEach(children, _ref4 => {
|
|
91
|
+
let {
|
|
92
|
+
props: {
|
|
93
|
+
selection,
|
|
94
|
+
onSelect
|
|
95
|
+
}
|
|
96
|
+
} = _ref4;
|
|
97
|
+
onSelect(selection.selectAll());
|
|
98
|
+
});
|
|
99
|
+
return false;
|
|
100
|
+
};
|
|
101
|
+
shortcuts = {
|
|
102
|
+
up: this.onUpPress,
|
|
103
|
+
down: this.onDownPress,
|
|
104
|
+
esc: this.onEscPress,
|
|
105
|
+
'command+a': this.onCmdAPress,
|
|
106
|
+
'ctrl+a': this.onCmdAPress
|
|
107
|
+
};
|
|
109
108
|
render() {
|
|
110
109
|
return /*#__PURE__*/React.createElement("div", {
|
|
111
110
|
"data-test": "ring-multitable"
|
|
@@ -117,8 +116,5 @@ class MultiTable extends PureComponent {
|
|
|
117
116
|
}));
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
|
-
_defineProperty(MultiTable, "propTypes", {
|
|
121
|
-
children: PropTypes.any.isRequired
|
|
122
|
-
});
|
|
123
119
|
|
|
124
120
|
export { MultiTable 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 focusSensorHOC from '../global/focus-sensor-hoc.js';
|
|
4
4
|
import Row from './row.js';
|
|
@@ -46,23 +46,20 @@ import '../_helpers/table.js';
|
|
|
46
46
|
|
|
47
47
|
const getContainer = () => focusSensorHOC(Row);
|
|
48
48
|
class RowWithFocusSensorCallbacks extends PureComponent {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this.props.onExpand?.(this.props.item);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
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
|
+
};
|
|
66
63
|
render() {
|
|
67
64
|
return /*#__PURE__*/React.createElement(this.RowWithFocusSensor, _extends({}, this.props, {
|
|
68
65
|
onFocus: this.onFocus,
|
package/dist/table/row.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface RowProps<T extends SelectionItem> extends Omit<HTMLAttributes<H
|
|
|
25
25
|
checkboxTooltip?: string | undefined;
|
|
26
26
|
autofocus?: boolean | null | undefined;
|
|
27
27
|
'data-test'?: string | null | undefined;
|
|
28
|
+
metaColumnClassName?: string | null | undefined;
|
|
28
29
|
}
|
|
29
30
|
export default class Row<T extends SelectionItem> extends PureComponent<RowProps<T>> {
|
|
30
31
|
static defaultProps: {
|
package/dist/table/row.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';
|
|
@@ -62,42 +62,46 @@ DragHandle.propTypes = {
|
|
|
62
62
|
dragHandleTitle: PropTypes.string
|
|
63
63
|
};
|
|
64
64
|
class Row extends PureComponent {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
65
|
+
static defaultProps = {
|
|
66
|
+
selectable: true,
|
|
67
|
+
showFocus: false,
|
|
68
|
+
draggable: false,
|
|
69
|
+
alwaysShowDragHandle: false,
|
|
70
|
+
selected: false,
|
|
71
|
+
onHover: () => {},
|
|
72
|
+
onSelect: () => {},
|
|
73
|
+
onDoubleClick: () => {},
|
|
74
|
+
onClick: () => {},
|
|
75
|
+
level: 0,
|
|
76
|
+
collapsible: false,
|
|
77
|
+
parentCollapsible: false,
|
|
78
|
+
collapsed: false,
|
|
79
|
+
onCollapse: () => {},
|
|
80
|
+
onExpand: () => {}
|
|
81
|
+
};
|
|
82
|
+
id = getUID('table-row-');
|
|
83
|
+
onMouseEnter = e => {
|
|
84
|
+
const {
|
|
85
|
+
item,
|
|
86
|
+
onHover
|
|
87
|
+
} = this.props;
|
|
88
|
+
onHover(item, e);
|
|
89
|
+
};
|
|
90
|
+
onClick = e => {
|
|
91
|
+
const {
|
|
92
|
+
item
|
|
93
|
+
} = this.props;
|
|
94
|
+
this.props.onClick(item, e);
|
|
95
|
+
if (e.shiftKey) {
|
|
88
96
|
this.toggleSelection();
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
_defineProperty(this, "rowRef", el => {
|
|
98
|
-
this.row = el;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
onCheckboxFocus = () => {
|
|
100
|
+
this.props.onFocusRestore();
|
|
101
|
+
};
|
|
102
|
+
onCheckboxChange = () => {
|
|
103
|
+
this.toggleSelection();
|
|
104
|
+
};
|
|
101
105
|
toggleSelection() {
|
|
102
106
|
const {
|
|
103
107
|
selectable,
|
|
@@ -109,6 +113,16 @@ class Row extends PureComponent {
|
|
|
109
113
|
onSelect(item, !selected);
|
|
110
114
|
}
|
|
111
115
|
}
|
|
116
|
+
onDoubleClick = () => {
|
|
117
|
+
const {
|
|
118
|
+
item
|
|
119
|
+
} = this.props;
|
|
120
|
+
this.props.onDoubleClick(item);
|
|
121
|
+
};
|
|
122
|
+
row;
|
|
123
|
+
rowRef = el => {
|
|
124
|
+
this.row = el;
|
|
125
|
+
};
|
|
112
126
|
render() {
|
|
113
127
|
const {
|
|
114
128
|
item,
|
|
@@ -135,6 +149,7 @@ class Row extends PureComponent {
|
|
|
135
149
|
onFocusRestore,
|
|
136
150
|
onHover,
|
|
137
151
|
className,
|
|
152
|
+
metaColumnClassName,
|
|
138
153
|
'data-test': dataTest,
|
|
139
154
|
...restProps
|
|
140
155
|
} = this.props;
|
|
@@ -147,7 +162,7 @@ class Row extends PureComponent {
|
|
|
147
162
|
'data-test-focused': showFocus || undefined,
|
|
148
163
|
'data-test-selected': selected || undefined
|
|
149
164
|
};
|
|
150
|
-
const metaColumnClasses = modules_1db4bbca.metaColumn;
|
|
165
|
+
const metaColumnClasses = classNames(metaColumnClassName, modules_1db4bbca.metaColumn);
|
|
151
166
|
const SUBITEM_OFFSET = 30;
|
|
152
167
|
const COLLAPSIBLE_PARENT_OFFSET = 20;
|
|
153
168
|
const gap = level * SUBITEM_OFFSET + (parentCollapsible ? COLLAPSIBLE_PARENT_OFFSET : 0);
|
|
@@ -191,7 +206,7 @@ class Row extends PureComponent {
|
|
|
191
206
|
const cellClasses = classNames({
|
|
192
207
|
[modules_1db4bbca.cellRight]: column.rightAlign
|
|
193
208
|
}, column.className);
|
|
194
|
-
const showMetaColumn = draggable || selectable || showDisabledSelection || !!level;
|
|
209
|
+
const showMetaColumn = draggable || selectable || collapsible || showDisabledSelection || !!level;
|
|
195
210
|
return /*#__PURE__*/React.createElement(Cell, {
|
|
196
211
|
key: column.id,
|
|
197
212
|
className: cellClasses,
|
|
@@ -211,25 +226,9 @@ class Row extends PureComponent {
|
|
|
211
226
|
}), cells);
|
|
212
227
|
}
|
|
213
228
|
}
|
|
214
|
-
_defineProperty(Row, "defaultProps", {
|
|
215
|
-
selectable: true,
|
|
216
|
-
showFocus: false,
|
|
217
|
-
draggable: false,
|
|
218
|
-
alwaysShowDragHandle: false,
|
|
219
|
-
selected: false,
|
|
220
|
-
onHover: () => {},
|
|
221
|
-
onSelect: () => {},
|
|
222
|
-
onDoubleClick: () => {},
|
|
223
|
-
onClick: () => {},
|
|
224
|
-
level: 0,
|
|
225
|
-
collapsible: false,
|
|
226
|
-
parentCollapsible: false,
|
|
227
|
-
collapsed: false,
|
|
228
|
-
onCollapse: () => {},
|
|
229
|
-
onExpand: () => {}
|
|
230
|
-
});
|
|
231
229
|
Row.propTypes = {
|
|
232
230
|
className: PropTypes.string,
|
|
231
|
+
metaColumnClassName: PropTypes.string,
|
|
233
232
|
item: PropTypes.object.isRequired,
|
|
234
233
|
columns: PropTypes.array.isRequired,
|
|
235
234
|
selectable: PropTypes.bool,
|