@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, { PureComponent } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import Selection$1 from './selection.js';
|
|
@@ -21,152 +21,150 @@ function extractPropTypes(_ref) {
|
|
|
21
21
|
}
|
|
22
22
|
function selectionShortcutsHOC(ComposedComponent) {
|
|
23
23
|
class SelectionShortcuts extends PureComponent {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
});
|
|
169
|
-
}
|
|
24
|
+
onUpPress = () => {
|
|
25
|
+
const {
|
|
26
|
+
selection,
|
|
27
|
+
onSelect
|
|
28
|
+
} = this.props;
|
|
29
|
+
const newSelection = selection.moveUp();
|
|
30
|
+
if (newSelection) {
|
|
31
|
+
onSelect?.(newSelection);
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
};
|
|
35
|
+
onDownPress = () => {
|
|
36
|
+
const {
|
|
37
|
+
selection,
|
|
38
|
+
onSelect
|
|
39
|
+
} = this.props;
|
|
40
|
+
const newSelection = selection.moveDown();
|
|
41
|
+
if (newSelection) {
|
|
42
|
+
onSelect?.(newSelection);
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
};
|
|
46
|
+
shiftSelectionMode;
|
|
47
|
+
onShiftKeyDown = () => {
|
|
48
|
+
const {
|
|
49
|
+
selection
|
|
50
|
+
} = this.props;
|
|
51
|
+
if (selection.isSelected(selection.getFocused())) {
|
|
52
|
+
this.shiftSelectionMode = 'deletion';
|
|
53
|
+
} else {
|
|
54
|
+
this.shiftSelectionMode = 'addition';
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
shiftSelect = selection => {
|
|
58
|
+
if (this.shiftSelectionMode === 'addition') {
|
|
59
|
+
return selection.select();
|
|
60
|
+
} else {
|
|
61
|
+
return selection.deselect();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
onShiftUpPress = e => {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
const {
|
|
67
|
+
selectable,
|
|
68
|
+
selection,
|
|
69
|
+
onSelect
|
|
70
|
+
} = this.props;
|
|
71
|
+
if (!selectable) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const newSelection = this.shiftSelect(selection);
|
|
75
|
+
const newMovedSelection = newSelection.moveUp();
|
|
76
|
+
if (newMovedSelection) {
|
|
77
|
+
onSelect?.(newMovedSelection);
|
|
78
|
+
} else {
|
|
79
|
+
onSelect?.(newSelection);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
onShiftDownPress = e => {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
const {
|
|
85
|
+
selectable,
|
|
86
|
+
selection,
|
|
87
|
+
onSelect
|
|
88
|
+
} = this.props;
|
|
89
|
+
if (!selectable) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const newSelection = this.shiftSelect(selection);
|
|
93
|
+
const newMovedSelection = newSelection.moveDown();
|
|
94
|
+
if (newMovedSelection) {
|
|
95
|
+
onSelect?.(newMovedSelection);
|
|
96
|
+
} else {
|
|
97
|
+
onSelect?.(newSelection);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
onHomePress = () => {
|
|
101
|
+
const {
|
|
102
|
+
selection,
|
|
103
|
+
onSelect
|
|
104
|
+
} = this.props;
|
|
105
|
+
const newSelection = selection.moveStart();
|
|
106
|
+
if (newSelection) {
|
|
107
|
+
onSelect?.(newSelection);
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
};
|
|
111
|
+
onEndPress = () => {
|
|
112
|
+
const {
|
|
113
|
+
selection,
|
|
114
|
+
onSelect
|
|
115
|
+
} = this.props;
|
|
116
|
+
const newSelection = selection.moveEnd();
|
|
117
|
+
if (newSelection) {
|
|
118
|
+
onSelect?.(newSelection);
|
|
119
|
+
}
|
|
120
|
+
return false;
|
|
121
|
+
};
|
|
122
|
+
onSpacePress = () => {
|
|
123
|
+
const {
|
|
124
|
+
selectable,
|
|
125
|
+
selection,
|
|
126
|
+
onSelect
|
|
127
|
+
} = this.props;
|
|
128
|
+
if (!selectable) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
onSelect?.(selection.toggleSelection());
|
|
132
|
+
return false;
|
|
133
|
+
};
|
|
134
|
+
onEscPress = () => {
|
|
135
|
+
const {
|
|
136
|
+
selection,
|
|
137
|
+
onSelect
|
|
138
|
+
} = this.props;
|
|
139
|
+
onSelect?.(selection.reset());
|
|
140
|
+
//this.restoreFocusWithoutScroll();
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
onCmdAPress = () => {
|
|
144
|
+
const {
|
|
145
|
+
selectable,
|
|
146
|
+
selection,
|
|
147
|
+
onSelect
|
|
148
|
+
} = this.props;
|
|
149
|
+
if (!selectable) {
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
onSelect?.(selection.selectAll());
|
|
153
|
+
return false;
|
|
154
|
+
};
|
|
155
|
+
shortcutsMap = {
|
|
156
|
+
up: this.onUpPress,
|
|
157
|
+
down: this.onDownPress,
|
|
158
|
+
shift: this.onShiftKeyDown,
|
|
159
|
+
'shift+up': this.onShiftUpPress,
|
|
160
|
+
'shift+down': this.onShiftDownPress,
|
|
161
|
+
home: this.onHomePress,
|
|
162
|
+
end: this.onEndPress,
|
|
163
|
+
space: this.onSpacePress,
|
|
164
|
+
esc: this.onEscPress,
|
|
165
|
+
'command+a': this.onCmdAPress,
|
|
166
|
+
'ctrl+a': this.onCmdAPress
|
|
167
|
+
};
|
|
170
168
|
render() {
|
|
171
169
|
const {
|
|
172
170
|
selection,
|
package/dist/table/selection.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
|
|
3
1
|
let Selection$1 = class Selection {
|
|
2
|
+
_rawData;
|
|
3
|
+
_getChildren;
|
|
4
|
+
_data;
|
|
5
|
+
_selected;
|
|
6
|
+
_focused;
|
|
7
|
+
_getKey;
|
|
8
|
+
_isItemSelectable;
|
|
4
9
|
constructor() {
|
|
5
10
|
let {
|
|
6
11
|
data = [],
|
|
@@ -10,13 +15,6 @@ let Selection$1 = class Selection {
|
|
|
10
15
|
getChildren = () => [],
|
|
11
16
|
isItemSelectable = () => true
|
|
12
17
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13
|
-
_defineProperty(this, "_rawData", void 0);
|
|
14
|
-
_defineProperty(this, "_getChildren", void 0);
|
|
15
|
-
_defineProperty(this, "_data", void 0);
|
|
16
|
-
_defineProperty(this, "_selected", void 0);
|
|
17
|
-
_defineProperty(this, "_focused", void 0);
|
|
18
|
-
_defineProperty(this, "_getKey", void 0);
|
|
19
|
-
_defineProperty(this, "_isItemSelectable", void 0);
|
|
20
18
|
this._rawData = data;
|
|
21
19
|
this._getChildren = getChildren;
|
|
22
20
|
this._data = this._buildData(data);
|
|
@@ -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 TableContainer from './table.js';
|
|
@@ -63,21 +63,20 @@ const {
|
|
|
63
63
|
...restPropTypes
|
|
64
64
|
} = (_Table$propTypes = TableContainer.propTypes) !== null && _Table$propTypes !== void 0 ? _Table$propTypes : {};
|
|
65
65
|
class SmartTable extends PureComponent {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
66
|
+
static propTypes = {
|
|
67
|
+
onSelectionChange: PropTypes.func,
|
|
68
|
+
isItemSelectable: PropTypes.func,
|
|
69
|
+
...restPropTypes
|
|
70
|
+
};
|
|
71
|
+
static defaultProps = {
|
|
72
|
+
onSelectionChange: () => {}
|
|
73
|
+
};
|
|
74
|
+
state = {
|
|
75
|
+
selection: new Selection$1({
|
|
76
|
+
data: this.props.data,
|
|
77
|
+
isItemSelectable: this.props.isItemSelectable
|
|
78
|
+
})
|
|
79
|
+
};
|
|
81
80
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
82
81
|
const {
|
|
83
82
|
data,
|
|
@@ -97,6 +96,12 @@ class SmartTable extends PureComponent {
|
|
|
97
96
|
});
|
|
98
97
|
}
|
|
99
98
|
}
|
|
99
|
+
onSelect = selection => {
|
|
100
|
+
this.setState({
|
|
101
|
+
selection
|
|
102
|
+
});
|
|
103
|
+
this.props.onSelectionChange(selection);
|
|
104
|
+
};
|
|
100
105
|
render() {
|
|
101
106
|
return /*#__PURE__*/React.createElement(TableContainer, _extends({}, this.props, {
|
|
102
107
|
selection: this.state.selection,
|
|
@@ -104,13 +109,5 @@ class SmartTable extends PureComponent {
|
|
|
104
109
|
}));
|
|
105
110
|
}
|
|
106
111
|
}
|
|
107
|
-
_defineProperty(SmartTable, "propTypes", {
|
|
108
|
-
onSelectionChange: PropTypes.func,
|
|
109
|
-
isItemSelectable: PropTypes.func,
|
|
110
|
-
...restPropTypes
|
|
111
|
-
});
|
|
112
|
-
_defineProperty(SmartTable, "defaultProps", {
|
|
113
|
-
onSelectionChange: () => {}
|
|
114
|
-
});
|
|
115
112
|
|
|
116
113
|
export { SmartTable as default };
|
package/dist/table/table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import React, {
|
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React, { Component, PureComponent } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { arrayMove, List } from 'react-movable';
|
|
@@ -59,91 +59,46 @@ import './cell.js';
|
|
|
59
59
|
* Interactive table with selection and keyboard navigation support.
|
|
60
60
|
*/
|
|
61
61
|
class Table extends PureComponent {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
selection,
|
|
92
|
-
onSelect
|
|
93
|
-
} = this.props;
|
|
94
|
-
if (selected) {
|
|
95
|
-
onSelect(selection.select(row));
|
|
96
|
-
} else {
|
|
97
|
-
onSelect(selection.deselect(row));
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
_defineProperty(this, "onSortEnd", _ref => {
|
|
101
|
-
let {
|
|
102
|
-
oldIndex,
|
|
103
|
-
newIndex
|
|
104
|
-
} = _ref;
|
|
105
|
-
const data = arrayMove(this.props.data, oldIndex, newIndex);
|
|
106
|
-
this.props.onReorder({
|
|
107
|
-
data,
|
|
108
|
-
oldIndex,
|
|
109
|
-
newIndex
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
_defineProperty(this, "onCheckboxChange", e => {
|
|
113
|
-
const {
|
|
114
|
-
checked
|
|
115
|
-
} = e.currentTarget;
|
|
116
|
-
const {
|
|
117
|
-
selection,
|
|
118
|
-
onSelect
|
|
119
|
-
} = this.props;
|
|
120
|
-
if (checked) {
|
|
121
|
-
onSelect(selection.selectAll());
|
|
122
|
-
} else {
|
|
123
|
-
onSelect(selection.reset());
|
|
124
|
-
}
|
|
125
|
-
this.restoreFocusWithoutScroll();
|
|
126
|
-
});
|
|
127
|
-
_defineProperty(this, "restoreFocusWithoutScroll", () => {
|
|
128
|
-
const {
|
|
129
|
-
scrollX,
|
|
130
|
-
scrollY
|
|
131
|
-
} = window;
|
|
132
|
-
this.props.onFocusRestore();
|
|
133
|
-
window.scrollTo(scrollX, scrollY);
|
|
134
|
-
});
|
|
135
|
-
}
|
|
62
|
+
static defaultProps = {
|
|
63
|
+
isItemSelectable: () => true,
|
|
64
|
+
loading: false,
|
|
65
|
+
onSort: () => {},
|
|
66
|
+
onReorder: () => {},
|
|
67
|
+
getItemKey: item => item.id,
|
|
68
|
+
sortKey: 'id',
|
|
69
|
+
sortOrder: true,
|
|
70
|
+
draggable: false,
|
|
71
|
+
alwaysShowDragHandle: false,
|
|
72
|
+
stickyHeader: true,
|
|
73
|
+
getItemLevel: () => 0,
|
|
74
|
+
getItemClassName: () => null,
|
|
75
|
+
getItemDataTest: () => null,
|
|
76
|
+
isItemCollapsible: () => false,
|
|
77
|
+
isParentCollapsible: () => false,
|
|
78
|
+
isItemCollapsed: () => false,
|
|
79
|
+
onItemCollapse: () => {},
|
|
80
|
+
onItemExpand: () => {},
|
|
81
|
+
onItemDoubleClick: () => {},
|
|
82
|
+
onItemClick: () => {},
|
|
83
|
+
remoteSelection: false,
|
|
84
|
+
isDisabledSelectionVisible: () => false,
|
|
85
|
+
getCheckboxTooltip: () => undefined
|
|
86
|
+
};
|
|
87
|
+
state = {
|
|
88
|
+
shortcutsScope: getUID('ring-table-'),
|
|
89
|
+
userSelectNone: false
|
|
90
|
+
};
|
|
136
91
|
componentDidMount() {
|
|
137
92
|
document.addEventListener('mouseup', this.onMouseUp);
|
|
138
93
|
}
|
|
139
|
-
componentDidUpdate(
|
|
94
|
+
componentDidUpdate(_ref) {
|
|
140
95
|
let {
|
|
141
96
|
data,
|
|
142
97
|
selection,
|
|
143
98
|
onSelect,
|
|
144
99
|
selectable,
|
|
145
100
|
remoteSelection
|
|
146
|
-
} =
|
|
101
|
+
} = _ref;
|
|
147
102
|
if (data !== this.props.data && remoteSelection) {
|
|
148
103
|
onSelect(selection.cloneWith({
|
|
149
104
|
data: this.props.data
|
|
@@ -156,6 +111,73 @@ class Table extends PureComponent {
|
|
|
156
111
|
componentWillUnmount() {
|
|
157
112
|
document.removeEventListener('mouseup', this.onMouseUp);
|
|
158
113
|
}
|
|
114
|
+
onMouseDown = e => {
|
|
115
|
+
if (e.shiftKey) {
|
|
116
|
+
this.setState({
|
|
117
|
+
userSelectNone: true
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
onMouseUp = () => {
|
|
122
|
+
if (this.state.userSelectNone) {
|
|
123
|
+
this.setState({
|
|
124
|
+
userSelectNone: false
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
onRowFocus = row => {
|
|
129
|
+
const {
|
|
130
|
+
selection,
|
|
131
|
+
onSelect
|
|
132
|
+
} = this.props;
|
|
133
|
+
onSelect(selection.focus(row));
|
|
134
|
+
};
|
|
135
|
+
onRowSelect = (row, selected) => {
|
|
136
|
+
const {
|
|
137
|
+
selection,
|
|
138
|
+
onSelect
|
|
139
|
+
} = this.props;
|
|
140
|
+
if (selected) {
|
|
141
|
+
onSelect(selection.select(row));
|
|
142
|
+
} else {
|
|
143
|
+
onSelect(selection.deselect(row));
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
onSortEnd = _ref2 => {
|
|
147
|
+
let {
|
|
148
|
+
oldIndex,
|
|
149
|
+
newIndex
|
|
150
|
+
} = _ref2;
|
|
151
|
+
const data = arrayMove(this.props.data, oldIndex, newIndex);
|
|
152
|
+
this.props.onReorder({
|
|
153
|
+
data,
|
|
154
|
+
oldIndex,
|
|
155
|
+
newIndex
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
onCheckboxChange = e => {
|
|
159
|
+
const {
|
|
160
|
+
checked
|
|
161
|
+
} = e.currentTarget;
|
|
162
|
+
const {
|
|
163
|
+
selection,
|
|
164
|
+
onSelect
|
|
165
|
+
} = this.props;
|
|
166
|
+
if (checked) {
|
|
167
|
+
onSelect(selection.selectAll());
|
|
168
|
+
} else {
|
|
169
|
+
onSelect(selection.reset());
|
|
170
|
+
}
|
|
171
|
+
this.restoreFocusWithoutScroll();
|
|
172
|
+
};
|
|
173
|
+
restoreFocusWithoutScroll = () => {
|
|
174
|
+
const {
|
|
175
|
+
scrollX,
|
|
176
|
+
scrollY
|
|
177
|
+
} = window;
|
|
178
|
+
this.props.onFocusRestore();
|
|
179
|
+
window.scrollTo(scrollX, scrollY);
|
|
180
|
+
};
|
|
159
181
|
render() {
|
|
160
182
|
const {
|
|
161
183
|
data,
|
|
@@ -311,31 +333,6 @@ class Table extends PureComponent {
|
|
|
311
333
|
})));
|
|
312
334
|
}
|
|
313
335
|
}
|
|
314
|
-
_defineProperty(Table, "defaultProps", {
|
|
315
|
-
isItemSelectable: () => true,
|
|
316
|
-
loading: false,
|
|
317
|
-
onSort: () => {},
|
|
318
|
-
onReorder: () => {},
|
|
319
|
-
getItemKey: item => item.id,
|
|
320
|
-
sortKey: 'id',
|
|
321
|
-
sortOrder: true,
|
|
322
|
-
draggable: false,
|
|
323
|
-
alwaysShowDragHandle: false,
|
|
324
|
-
stickyHeader: true,
|
|
325
|
-
getItemLevel: () => 0,
|
|
326
|
-
getItemClassName: () => null,
|
|
327
|
-
getItemDataTest: () => null,
|
|
328
|
-
isItemCollapsible: () => false,
|
|
329
|
-
isParentCollapsible: () => false,
|
|
330
|
-
isItemCollapsed: () => false,
|
|
331
|
-
onItemCollapse: () => {},
|
|
332
|
-
onItemExpand: () => {},
|
|
333
|
-
onItemDoubleClick: () => {},
|
|
334
|
-
onItemClick: () => {},
|
|
335
|
-
remoteSelection: false,
|
|
336
|
-
isDisabledSelectionVisible: () => false,
|
|
337
|
-
getCheckboxTooltip: () => undefined
|
|
338
|
-
});
|
|
339
336
|
Table.propTypes = {
|
|
340
337
|
className: PropTypes.string,
|
|
341
338
|
loaderClassName: PropTypes.string,
|
|
@@ -382,15 +379,12 @@ Table.propTypes = {
|
|
|
382
379
|
const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(Table)));
|
|
383
380
|
// eslint-disable-next-line react/no-multi-comp
|
|
384
381
|
class TableContainer extends Component {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}
|
|
382
|
+
// https://stackoverflow.com/a/53882322/6304152
|
|
383
|
+
static propTypes = getContainer().propTypes;
|
|
384
|
+
Table = getContainer();
|
|
389
385
|
render() {
|
|
390
386
|
return /*#__PURE__*/React.createElement(this.Table, this.props);
|
|
391
387
|
}
|
|
392
388
|
}
|
|
393
|
-
// https://stackoverflow.com/a/53882322/6304152
|
|
394
|
-
_defineProperty(TableContainer, "propTypes", getContainer().propTypes);
|
|
395
389
|
|
|
396
390
|
export { Table, TableContainer as default };
|
|
@@ -7,7 +7,6 @@ import Selection from './table-legacy-ng__selection.js';
|
|
|
7
7
|
import SelectionNavigateActions from './table-legacy-ng__selection-navigate-actions.js';
|
|
8
8
|
import TableToolbar from './table-legacy-ng__toolbar.js';
|
|
9
9
|
import TablePager from './table-legacy-ng__pager.js';
|
|
10
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
11
10
|
import 'element-resize-detector';
|
|
12
11
|
import '@jetbrains/icons/checkmark-14px';
|
|
13
12
|
import '../icon-ng/icon-ng.js';
|
|
@@ -26,6 +25,7 @@ import 'react-dom';
|
|
|
26
25
|
import '../global/react-dom-renderer.js';
|
|
27
26
|
import 'prop-types';
|
|
28
27
|
import '../pager/pager.js';
|
|
28
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
29
29
|
import 'classnames';
|
|
30
30
|
import '@jetbrains/icons/chevron-left';
|
|
31
31
|
import '@jetbrains/icons/chevron-right';
|