@jetbrains/ring-ui-built 7.0.0-beta.2 → 7.0.0-beta.3
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/_rollupPluginBabelHelpers.js +1 -504
- package/components/_helpers/anchor.js +7 -5
- package/components/_helpers/button__classes.js +15 -13
- package/components/_helpers/caption.js +11 -17
- package/components/_helpers/card.js +92 -96
- package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
- package/components/_helpers/icon__svg.js +27 -23
- package/components/_helpers/input.js +150 -171
- package/components/_helpers/query-assist__suggestions.js +78 -93
- package/components/_helpers/select__filter.js +56 -67
- package/components/_helpers/services-link.js +23 -29
- package/components/_helpers/sidebar.js +91 -93
- package/components/_helpers/tab-link.js +8 -6
- package/components/_helpers/theme.js +41 -50
- package/components/_helpers/title.js +59 -69
- package/components/alert/alert.js +112 -156
- package/components/alert/container.js +32 -39
- package/components/alert-service/alert-service.js +104 -161
- package/components/analytics/analytics.js +12 -20
- package/components/analytics/analytics__custom-plugin.js +52 -68
- package/components/auth/auth.js +2 -27
- package/components/auth/auth__core.d.ts +1 -1
- package/components/auth/auth__core.js +742 -1428
- package/components/auth/background-flow.js +84 -121
- package/components/auth/down-notification.js +31 -69
- package/components/auth/iframe-flow.js +70 -123
- package/components/auth/request-builder.js +46 -77
- package/components/auth/response-parser.js +84 -112
- package/components/auth/storage.js +160 -318
- package/components/auth/token-validator.js +132 -227
- package/components/auth/window-flow.js +84 -121
- package/components/auth-dialog/auth-dialog.js +99 -150
- package/components/auth-dialog-service/auth-dialog-service.js +6 -26
- package/components/avatar/avatar-example-datauri.js +1 -1
- package/components/avatar/avatar.js +94 -123
- package/components/avatar/fallback-avatar.js +20 -34
- package/components/badge/badge.js +32 -38
- package/components/breadcrumbs/breadcrumbs.js +13 -17
- package/components/button/button.js +67 -80
- package/components/button-group/button-group.js +27 -36
- package/components/button-set/button-set.js +19 -27
- package/components/button-toolbar/button-toolbar.js +17 -25
- package/components/caret/caret.js +184 -211
- package/components/checkbox/checkbox.js +69 -86
- package/components/clipboard/clipboard-fallback.js +7 -7
- package/components/clipboard/clipboard.js +36 -128
- package/components/code/code.js +83 -151
- package/components/collapse/collapse-content.js +42 -60
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +12 -12
- package/components/collapse/collapse.js +12 -17
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +1 -3
- package/components/confirm/confirm.js +57 -87
- package/components/confirm-service/confirm-service.js +23 -44
- package/components/content-layout/content-layout.js +41 -56
- package/components/content-layout/sidebar.js +1 -1
- package/components/contenteditable/contenteditable.js +38 -46
- package/components/control-help/control-help.js +5 -3
- package/components/control-label/control-label.js +9 -8
- package/components/data-list/data-list.js +113 -156
- package/components/data-list/data-list.mock.js +3 -5
- package/components/data-list/item.js +120 -140
- package/components/data-list/selection.js +77 -135
- package/components/data-list/title.js +2 -10
- package/components/date-picker/consts.js +16 -22
- package/components/date-picker/date-input.js +99 -124
- package/components/date-picker/date-picker.js +140 -184
- package/components/date-picker/date-popup.js +280 -327
- package/components/date-picker/day.js +71 -94
- package/components/date-picker/month-names.js +41 -59
- package/components/date-picker/month-slider.js +42 -61
- package/components/date-picker/month.js +17 -24
- package/components/date-picker/months.js +44 -49
- package/components/date-picker/weekdays.js +12 -21
- package/components/date-picker/years.js +77 -98
- package/components/dialog/dialog.js +151 -187
- package/components/dialog/dialog__body-scroll-preventer.js +0 -3
- package/components/dropdown/anchor.js +0 -6
- package/components/dropdown/dropdown.js +134 -154
- package/components/dropdown-menu/dropdown-menu.js +59 -87
- package/components/editable-heading/editable-heading.js +69 -116
- package/components/error-bubble/error-bubble.js +29 -54
- package/components/error-message/error-message.js +34 -49
- package/components/footer/footer.js +27 -28
- package/components/global/compose.js +1 -8
- package/components/global/composeRefs.d.ts +0 -3
- package/components/global/composeRefs.js +8 -15
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +14 -13
- package/components/global/data-tests.js +7 -12
- package/components/global/dom.js +49 -82
- package/components/global/focus-sensor-hoc.js +99 -106
- package/components/global/fuzzy-highlight.js +23 -34
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +3 -7
- package/components/global/inject-styles.js +7 -14
- package/components/global/listeners.js +28 -47
- package/components/global/memoize.js +6 -10
- package/components/global/normalize-indent.js +19 -46
- package/components/global/promise-with-timeout.js +6 -8
- package/components/global/prop-types.js +3 -5
- package/components/global/react-dom-renderer.js +29 -40
- package/components/global/rerender-hoc.js +16 -32
- package/components/global/schedule-raf.js +4 -4
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.js +1 -18
- package/components/global/trivial-template-tag.js +4 -9
- package/components/global/typescript-utils.js +2 -6
- package/components/global/url.js +20 -23
- package/components/global/use-event-callback.js +7 -4
- package/components/grid/col.js +27 -39
- package/components/grid/grid.js +18 -27
- package/components/grid/row.js +23 -30
- package/components/group/group.js +16 -22
- package/components/header/header-icon.js +19 -31
- package/components/header/header.d.ts +0 -1
- package/components/header/header.js +30 -64
- package/components/header/links.js +6 -3
- package/components/header/logo.js +15 -26
- package/components/header/profile.js +124 -150
- package/components/header/services-link.js +1 -3
- package/components/header/services.js +64 -97
- package/components/header/smart-profile.js +101 -178
- package/components/header/smart-services.js +55 -90
- package/components/header/tray.js +21 -30
- package/components/heading/heading.js +21 -20
- package/components/http/http.js +162 -319
- package/components/http/http.mock.js +50 -98
- package/components/hub-source/hub-source.js +77 -182
- package/components/hub-source/hub-source__user.js +9 -37
- package/components/hub-source/hub-source__users-groups.js +34 -60
- package/components/i18n/i18n-context.js +7 -8
- package/components/i18n/i18n.js +3 -6
- package/components/icon/icon.js +60 -74
- package/components/icon/icon__svg.js +0 -5
- package/components/icon/index.js +0 -5
- package/components/input/input.js +1 -11
- package/components/island/adaptive-island-hoc.js +29 -37
- package/components/island/content.js +100 -110
- package/components/island/header.js +56 -66
- package/components/island/island.js +25 -33
- package/components/island-legacy/content-legacy.js +16 -22
- package/components/island-legacy/header-legacy.js +19 -25
- package/components/island-legacy/island-legacy.js +16 -22
- package/components/link/clickableLink.js +33 -42
- package/components/link/link.js +47 -55
- package/components/list/consts.js +2 -2
- package/components/list/list.js +399 -486
- package/components/list/list__custom.js +51 -61
- package/components/list/list__hint.js +9 -17
- package/components/list/list__item.js +147 -178
- package/components/list/list__link.js +38 -47
- package/components/list/list__separator.js +15 -24
- package/components/list/list__title.js +25 -34
- package/components/list/list__users-groups-source.js +55 -121
- package/components/loader/loader.js +38 -60
- package/components/loader/loader__core.js +123 -184
- package/components/loader-inline/loader-inline.js +24 -32
- package/components/loader-screen/loader-screen.js +24 -40
- package/components/login-dialog/login-dialog.js +81 -121
- package/components/login-dialog/service.js +6 -29
- package/components/markdown/markdown.js +16 -24
- package/components/message/message.js +170 -201
- package/components/old-browsers-message/old-browsers-message.js +11 -14
- package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
- package/components/old-browsers-message/white-list.js +8 -13
- package/components/pager/pager.js +212 -257
- package/components/panel/panel.js +16 -22
- package/components/permissions/permissions.js +118 -161
- package/components/permissions/permissions__cache.js +191 -218
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +237 -288
- package/components/popup/popup.target.js +9 -7
- package/components/popup/position.js +94 -101
- package/components/popup-menu/popup-menu.js +33 -67
- package/components/progress-bar/progress-bar.js +57 -68
- package/components/query-assist/query-assist.js +583 -652
- package/components/query-assist/query-assist__suggestions.js +2 -26
- package/components/radio/radio.js +15 -27
- package/components/radio/radio__item.js +52 -62
- package/components/scrollable-section/scrollable-section.js +22 -32
- package/components/select/select.js +693 -793
- package/components/select/select__filter.js +1 -26
- package/components/select/select__popup.js +316 -413
- package/components/shortcuts/core.js +147 -195
- package/components/shortcuts/shortcut-title.js +6 -10
- package/components/shortcuts/shortcuts-hoc.js +23 -41
- package/components/shortcuts/shortcuts.js +41 -64
- package/components/slider/slider.js +93 -112
- package/components/slider/slider.utils.js +16 -23
- package/components/storage/storage.js +3 -27
- package/components/storage/storage__fallback.js +137 -210
- package/components/storage/storage__local.js +89 -147
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +35 -53
- package/components/table/cell.js +11 -21
- package/components/table/disable-hover-hoc.js +27 -42
- package/components/table/header-cell.js +59 -75
- package/components/table/header.js +89 -110
- package/components/table/multitable.js +83 -89
- package/components/table/row-with-focus-sensor.js +25 -57
- package/components/table/row.js +169 -200
- package/components/table/selection-adapter.js +2 -2
- package/components/table/selection-shortcuts-hoc.js +108 -113
- package/components/table/selection.js +150 -217
- package/components/table/simple-table.js +19 -55
- package/components/table/smart-table.js +42 -76
- package/components/table/table.js +267 -327
- package/components/tabs/collapsible-more.js +47 -73
- package/components/tabs/collapsible-tab.js +32 -36
- package/components/tabs/collapsible-tabs.js +89 -148
- package/components/tabs/custom-item.js +4 -2
- package/components/tabs/dumb-tabs.js +60 -92
- package/components/tabs/smart-tabs.js +29 -61
- package/components/tabs/tab-link.js +1 -3
- package/components/tabs/tab.js +15 -24
- package/components/tabs/tabs.js +1 -26
- package/components/tag/tag.d.ts +0 -2
- package/components/tag/tag.js +120 -162
- package/components/tags-input/tags-input.js +222 -304
- package/components/tags-list/tags-list.js +45 -61
- package/components/text/text.js +28 -37
- package/components/toggle/toggle.js +51 -61
- package/components/tooltip/tooltip.js +109 -141
- package/components/user-agreement/service.js +259 -400
- package/components/user-agreement/user-agreement.js +80 -108
- package/components/user-card/card.js +1 -25
- package/components/user-card/smart-user-card-tooltip.js +52 -103
- package/components/user-card/tooltip.js +35 -65
- package/components/user-card/user-card.js +1 -25
- package/package.json +1 -1
- package/components/global/react-render-adapter.d.ts +0 -1
- package/components/global/react-render-adapter.js +0 -6
- package/components/header/tray-icon.d.ts +0 -1
- package/components/header/tray-icon.js +0 -26
@@ -1,6 +1,5 @@
|
|
1
|
-
import { _ as _defineProperty,
|
2
|
-
import 'core-js/modules/
|
3
|
-
import 'core-js/modules/es.array.map.js';
|
1
|
+
import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
4
3
|
import { PureComponent } from 'react';
|
5
4
|
import PropTypes from 'prop-types';
|
6
5
|
import classNames from 'classnames';
|
@@ -17,125 +16,105 @@ import '../icon/icon__constants.js';
|
|
17
16
|
import '../_helpers/icon__svg.js';
|
18
17
|
import 'core-js/modules/es.regexp.exec.js';
|
19
18
|
import 'core-js/modules/es.string.replace.js';
|
20
|
-
import 'core-js/modules/es.string.starts-with.js';
|
21
19
|
import '../global/memoize.js';
|
22
|
-
import 'core-js/modules/es.array.iterator.js';
|
23
|
-
import 'core-js/modules/es.map.js';
|
24
|
-
import 'core-js/modules/es.object.to-string.js';
|
25
|
-
import 'core-js/modules/es.weak-map.js';
|
26
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
27
20
|
import '../global/prop-types.js';
|
28
21
|
import '../global/composeRefs.js';
|
29
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
30
22
|
import 'memoize-one';
|
31
23
|
import '../control-help/control-help.js';
|
32
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
33
24
|
import '@jetbrains/icons/unsorted-10px';
|
34
25
|
import '@jetbrains/icons/chevron-10px';
|
35
26
|
import '../global/data-tests.js';
|
36
27
|
import 'core-js/modules/es.array.reduce.js';
|
37
|
-
import 'core-js/modules/es.object.entries.js';
|
38
28
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
args[_key] = arguments[_key];
|
45
|
-
}
|
46
|
-
_this = _callSuper(this, Header, [].concat(args));
|
47
|
-
_defineProperty(_this, "id", getUID('table-header-'));
|
48
|
-
_defineProperty(_this, "onCheckboxFocus", function (event) {
|
29
|
+
class Header extends PureComponent {
|
30
|
+
constructor() {
|
31
|
+
super(...arguments);
|
32
|
+
_defineProperty(this, "id", getUID('table-header-'));
|
33
|
+
_defineProperty(this, "onCheckboxFocus", event => {
|
49
34
|
event.currentTarget.blur();
|
50
35
|
});
|
51
|
-
return _this;
|
52
36
|
}
|
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
|
-
|
37
|
+
createCells() {
|
38
|
+
let widths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
39
|
+
const {
|
40
|
+
selectable,
|
41
|
+
draggable,
|
42
|
+
columns,
|
43
|
+
checked,
|
44
|
+
checkboxDisabled,
|
45
|
+
onCheckboxChange,
|
46
|
+
onSort,
|
47
|
+
sortKey,
|
48
|
+
sortOrder
|
49
|
+
} = this.props;
|
50
|
+
const metaColumnClasses = classNames(modules_1db4bbca.metaColumn, modules_1db4bbca.headerMetaColumn);
|
51
|
+
const metaColumn = /*#__PURE__*/jsx("div", {
|
52
|
+
className: metaColumnClasses,
|
53
|
+
children: selectable && /*#__PURE__*/jsx(Checkbox, {
|
54
|
+
"aria-labelledby": this.id,
|
55
|
+
disabled: checkboxDisabled,
|
56
|
+
checked: checked,
|
57
|
+
onChange: onCheckboxChange,
|
58
|
+
onFocus: this.onCheckboxFocus
|
59
|
+
})
|
60
|
+
});
|
61
|
+
let colSpan = 0;
|
62
|
+
return columns.map((column, index) => {
|
63
|
+
const columnStyle = widths[index] ? {
|
64
|
+
width: widths[index]
|
65
|
+
} : undefined;
|
66
|
+
const props = {
|
67
|
+
column,
|
68
|
+
onSort,
|
69
|
+
sortKey,
|
70
|
+
sortOrder,
|
71
|
+
style: columnStyle
|
72
|
+
};
|
73
|
+
colSpan += column.colSpan || 1;
|
74
|
+
if (colSpan > (this.props.maxColSpan || Infinity)) {
|
75
|
+
return null;
|
76
|
+
}
|
77
|
+
return /*#__PURE__*/jsx(HeaderCell, _objectSpread2(_objectSpread2({
|
78
|
+
"data-test": column.id,
|
79
|
+
colSpan: column.colSpan
|
80
|
+
}, props), {}, {
|
81
|
+
children: index === 0 && (draggable || selectable) && metaColumn
|
82
|
+
}), column.id);
|
83
|
+
});
|
84
|
+
}
|
85
|
+
render() {
|
86
|
+
const {
|
87
|
+
caption,
|
88
|
+
sticky,
|
89
|
+
topStickOffset
|
90
|
+
} = this.props;
|
91
|
+
const regularCells = this.createCells();
|
92
|
+
return /*#__PURE__*/jsxs("thead", {
|
93
|
+
id: this.id,
|
94
|
+
"data-test": "ring-table-header",
|
95
|
+
style: {
|
96
|
+
top: topStickOffset
|
97
|
+
},
|
98
|
+
className: classNames({
|
99
|
+
[modules_1db4bbca.tableHead]: true,
|
100
|
+
[modules_1db4bbca.subHeaderSticky]: sticky
|
101
|
+
}),
|
102
|
+
children: [caption && /*#__PURE__*/jsx("tr", {
|
103
|
+
"data-test": "ring-table-header-row",
|
104
|
+
children: /*#__PURE__*/jsx("th", {
|
105
|
+
className: classNames(modules_1db4bbca.headerCell, modules_1db4bbca.caption),
|
106
|
+
colSpan: regularCells.length + 1,
|
107
|
+
"data-test": "ring-table-header-cell",
|
108
|
+
children: caption
|
78
109
|
})
|
79
|
-
})
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
onSort,
|
88
|
-
sortKey,
|
89
|
-
sortOrder,
|
90
|
-
style: columnStyle
|
91
|
-
};
|
92
|
-
colSpan += column.colSpan || 1;
|
93
|
-
if (colSpan > (_this2.props.maxColSpan || Infinity)) {
|
94
|
-
return null;
|
95
|
-
}
|
96
|
-
return /*#__PURE__*/jsx(HeaderCell, _objectSpread2(_objectSpread2({
|
97
|
-
"data-test": column.id,
|
98
|
-
colSpan: column.colSpan
|
99
|
-
}, props), {}, {
|
100
|
-
children: index === 0 && (draggable || selectable) && metaColumn
|
101
|
-
}), column.id);
|
102
|
-
});
|
103
|
-
}
|
104
|
-
}, {
|
105
|
-
key: "render",
|
106
|
-
value: function render() {
|
107
|
-
var _this$props2 = this.props,
|
108
|
-
caption = _this$props2.caption,
|
109
|
-
sticky = _this$props2.sticky,
|
110
|
-
topStickOffset = _this$props2.topStickOffset;
|
111
|
-
var regularCells = this.createCells();
|
112
|
-
return /*#__PURE__*/jsxs("thead", {
|
113
|
-
id: this.id,
|
114
|
-
"data-test": "ring-table-header",
|
115
|
-
style: {
|
116
|
-
top: topStickOffset
|
117
|
-
},
|
118
|
-
className: classNames({
|
119
|
-
[modules_1db4bbca.tableHead]: true,
|
120
|
-
[modules_1db4bbca.subHeaderSticky]: sticky
|
121
|
-
}),
|
122
|
-
children: [caption && /*#__PURE__*/jsx("tr", {
|
123
|
-
"data-test": "ring-table-header-row",
|
124
|
-
children: /*#__PURE__*/jsx("th", {
|
125
|
-
className: classNames(modules_1db4bbca.headerCell, modules_1db4bbca.caption),
|
126
|
-
colSpan: regularCells.length + 1,
|
127
|
-
"data-test": "ring-table-header-cell",
|
128
|
-
children: caption
|
129
|
-
})
|
130
|
-
}), /*#__PURE__*/jsx("tr", {
|
131
|
-
className: modules_1db4bbca.subHeader,
|
132
|
-
"data-test": "ring-table-header-row",
|
133
|
-
children: regularCells
|
134
|
-
})]
|
135
|
-
});
|
136
|
-
}
|
137
|
-
}]);
|
138
|
-
}(PureComponent);
|
110
|
+
}), /*#__PURE__*/jsx("tr", {
|
111
|
+
className: modules_1db4bbca.subHeader,
|
112
|
+
"data-test": "ring-table-header-row",
|
113
|
+
children: regularCells
|
114
|
+
})]
|
115
|
+
});
|
116
|
+
}
|
117
|
+
}
|
139
118
|
_defineProperty(Header, "propTypes", {
|
140
119
|
caption: PropTypes.string,
|
141
120
|
selectable: PropTypes.bool,
|
@@ -156,8 +135,8 @@ _defineProperty(Header, "defaultProps", {
|
|
156
135
|
checked: true,
|
157
136
|
sticky: true,
|
158
137
|
topStickOffset: '0px',
|
159
|
-
onSort:
|
160
|
-
onCheckboxChange:
|
138
|
+
onSort: () => {},
|
139
|
+
onCheckboxChange: () => {},
|
161
140
|
sortKey: 'id',
|
162
141
|
sortOrder: true
|
163
142
|
});
|
@@ -1,33 +1,27 @@
|
|
1
|
-
import { _ as _defineProperty
|
2
|
-
import 'core-js/modules/
|
3
|
-
import '
|
4
|
-
import 'core-js/modules/es.array.find-index.js';
|
5
|
-
import 'core-js/modules/es.array.includes.js';
|
6
|
-
import 'core-js/modules/es.array.map.js';
|
7
|
-
import 'core-js/modules/es.object.to-string.js';
|
8
|
-
import 'core-js/modules/es.string.includes.js';
|
9
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
10
|
-
import { Children, cloneElement, PureComponent } from 'react';
|
1
|
+
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
|
+
import { PureComponent, Children, cloneElement } from 'react';
|
11
4
|
import PropTypes from 'prop-types';
|
12
5
|
import { jsx } from 'react/jsx-runtime';
|
13
6
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
7
|
+
class MultiTable extends PureComponent {
|
8
|
+
constructor() {
|
9
|
+
super(...arguments);
|
10
|
+
_defineProperty(this, "onUpPress", () => {
|
11
|
+
const {
|
12
|
+
children: tables
|
13
|
+
} = this.props;
|
14
|
+
const tableIndex = tables.findIndex(_ref => {
|
15
|
+
let {
|
16
|
+
props: {
|
17
|
+
selection
|
18
|
+
}
|
19
|
+
} = _ref;
|
26
20
|
return selection.getFocused();
|
27
21
|
});
|
28
|
-
|
29
|
-
|
30
|
-
|
22
|
+
const currentTable = tables[tableIndex].props;
|
23
|
+
const prevTable = tables[tableIndex - 1] ? tables[tableIndex - 1].props : null;
|
24
|
+
let newSelection = currentTable.selection.moveUp();
|
31
25
|
if (newSelection) {
|
32
26
|
var _currentTable$onSelec;
|
33
27
|
(_currentTable$onSelec = currentTable.onSelect) === null || _currentTable$onSelec === void 0 || _currentTable$onSelec.call(currentTable, newSelection);
|
@@ -42,15 +36,21 @@ var MultiTable = /*#__PURE__*/function (_PureComponent) {
|
|
42
36
|
}
|
43
37
|
return false;
|
44
38
|
});
|
45
|
-
_defineProperty(
|
46
|
-
|
47
|
-
|
48
|
-
|
39
|
+
_defineProperty(this, "onDownPress", () => {
|
40
|
+
const {
|
41
|
+
children: tables
|
42
|
+
} = this.props;
|
43
|
+
const tableIndex = tables.findIndex(_ref2 => {
|
44
|
+
let {
|
45
|
+
props: {
|
46
|
+
selection
|
47
|
+
}
|
48
|
+
} = _ref2;
|
49
49
|
return selection.getFocused();
|
50
50
|
});
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
const currentTable = tables[tableIndex].props;
|
52
|
+
const nextTable = tables[tableIndex + 1] ? tables[tableIndex + 1].props : null;
|
53
|
+
let newSelection = currentTable.selection.moveDown();
|
54
54
|
if (newSelection) {
|
55
55
|
var _currentTable$onSelec3;
|
56
56
|
(_currentTable$onSelec3 = currentTable.onSelect) === null || _currentTable$onSelec3 === void 0 || _currentTable$onSelec3.call(currentTable, newSelection);
|
@@ -65,74 +65,68 @@ var MultiTable = /*#__PURE__*/function (_PureComponent) {
|
|
65
65
|
}
|
66
66
|
return false;
|
67
67
|
});
|
68
|
-
_defineProperty(
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
68
|
+
_defineProperty(this, "onEscPress", () => {
|
69
|
+
const {
|
70
|
+
children
|
71
|
+
} = this.props;
|
72
|
+
Children.forEach(children, _ref3 => {
|
73
|
+
let {
|
74
|
+
props: {
|
75
|
+
selection,
|
76
|
+
onSelect
|
77
|
+
}
|
78
|
+
} = _ref3;
|
74
79
|
onSelect(selection.reset());
|
75
80
|
});
|
76
81
|
});
|
77
|
-
_defineProperty(
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
82
|
+
_defineProperty(this, "onCmdAPress", () => {
|
83
|
+
const {
|
84
|
+
children
|
85
|
+
} = this.props;
|
86
|
+
Children.forEach(children, _ref4 => {
|
87
|
+
let {
|
88
|
+
props: {
|
89
|
+
selection,
|
90
|
+
onSelect
|
91
|
+
}
|
92
|
+
} = _ref4;
|
83
93
|
onSelect(selection.selectAll());
|
84
94
|
});
|
85
95
|
return false;
|
86
96
|
});
|
87
|
-
_defineProperty(
|
88
|
-
up:
|
89
|
-
down:
|
90
|
-
esc:
|
91
|
-
'command+a':
|
92
|
-
'ctrl+a':
|
97
|
+
_defineProperty(this, "shortcuts", {
|
98
|
+
up: this.onUpPress,
|
99
|
+
down: this.onDownPress,
|
100
|
+
esc: this.onEscPress,
|
101
|
+
'command+a': this.onCmdAPress,
|
102
|
+
'ctrl+a': this.onCmdAPress
|
93
103
|
});
|
94
|
-
return _this;
|
95
104
|
}
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
var
|
105
|
-
|
106
|
-
});
|
107
|
-
var prevFocused = prevSelections[prevFocusedIndex];
|
108
|
-
var currentSelections = this.props.children.map(function (element) {
|
109
|
-
return element.props.selection;
|
110
|
-
});
|
111
|
-
var currentFocused = currentSelections.filter(function (selection) {
|
112
|
-
return selection.getFocused();
|
113
|
-
});
|
114
|
-
if (currentFocused.includes(prevFocused)) {
|
115
|
-
var _prevProps$children$p, _prevProps$children$p2;
|
116
|
-
(_prevProps$children$p = (_prevProps$children$p2 = prevProps.children[prevFocusedIndex].props).onSelect) === null || _prevProps$children$p === void 0 || _prevProps$children$p.call(_prevProps$children$p2, prevFocused.resetFocus());
|
117
|
-
}
|
105
|
+
componentDidUpdate(prevProps) {
|
106
|
+
if (prevProps.children) {
|
107
|
+
const prevSelections = prevProps.children.map(element => element.props.selection);
|
108
|
+
const prevFocusedIndex = prevSelections.findIndex(selection => selection.getFocused());
|
109
|
+
const prevFocused = prevSelections[prevFocusedIndex];
|
110
|
+
const currentSelections = this.props.children.map(element => element.props.selection);
|
111
|
+
const currentFocused = currentSelections.filter(selection => selection.getFocused());
|
112
|
+
if (currentFocused.includes(prevFocused)) {
|
113
|
+
var _prevProps$children$p, _prevProps$children$p2;
|
114
|
+
(_prevProps$children$p = (_prevProps$children$p2 = prevProps.children[prevFocusedIndex].props).onSelect) === null || _prevProps$children$p === void 0 || _prevProps$children$p.call(_prevProps$children$p2, prevFocused.resetFocus());
|
118
115
|
}
|
119
116
|
}
|
120
|
-
}
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
}
|
134
|
-
}]);
|
135
|
-
}(PureComponent);
|
117
|
+
}
|
118
|
+
render() {
|
119
|
+
return /*#__PURE__*/jsx("div", {
|
120
|
+
"data-test": "ring-multitable",
|
121
|
+
children: Children.map(this.props.children, child => {
|
122
|
+
const props = {
|
123
|
+
shortcuts: this.shortcuts
|
124
|
+
};
|
125
|
+
return /*#__PURE__*/cloneElement(child, props);
|
126
|
+
})
|
127
|
+
});
|
128
|
+
}
|
129
|
+
}
|
136
130
|
_defineProperty(MultiTable, "propTypes", {
|
137
131
|
children: PropTypes.any.isRequired
|
138
132
|
});
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import 'core-js/modules/
|
1
|
+
import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
3
|
import { PureComponent } from 'react';
|
4
4
|
import focusSensorHOC from '../global/focus-sensor-hoc.js';
|
5
5
|
import Row from './row.js';
|
@@ -7,11 +7,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
import 'prop-types';
|
8
8
|
import '../global/prop-types.js';
|
9
9
|
import '../global/composeRefs.js';
|
10
|
-
import 'core-js/modules/es.object.to-string.js';
|
11
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
12
10
|
import 'memoize-one';
|
13
|
-
import 'util-deprecate';
|
14
|
-
import 'core-js/modules/es.array.map.js';
|
15
11
|
import 'classnames';
|
16
12
|
import '@jetbrains/icons/chevron-right';
|
17
13
|
import '@jetbrains/icons/chevron-down';
|
@@ -20,16 +16,12 @@ import '../checkbox/checkbox.js';
|
|
20
16
|
import '@jetbrains/icons/checkmark-12px';
|
21
17
|
import '@jetbrains/icons/remove-12px';
|
22
18
|
import '../icon/icon.js';
|
19
|
+
import 'util-deprecate';
|
23
20
|
import '../icon/icon__constants.js';
|
24
21
|
import '../_helpers/icon__svg.js';
|
25
22
|
import 'core-js/modules/es.regexp.exec.js';
|
26
23
|
import 'core-js/modules/es.string.replace.js';
|
27
|
-
import 'core-js/modules/es.string.starts-with.js';
|
28
24
|
import '../global/memoize.js';
|
29
|
-
import 'core-js/modules/es.array.iterator.js';
|
30
|
-
import 'core-js/modules/es.map.js';
|
31
|
-
import 'core-js/modules/es.weak-map.js';
|
32
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
33
25
|
import '../control-help/control-help.js';
|
34
26
|
import '../button/button.js';
|
35
27
|
import '../link/clickableLink.js';
|
@@ -37,24 +29,12 @@ import '../global/controls-height.js';
|
|
37
29
|
import '../_helpers/button__classes.js';
|
38
30
|
import '../tooltip/tooltip.js';
|
39
31
|
import '../popup/popup.js';
|
40
|
-
import 'core-js/modules/es.object.entries.js';
|
41
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
42
32
|
import 'react-dom';
|
43
33
|
import '../global/get-uid.js';
|
44
34
|
import '../global/schedule-raf.js';
|
45
35
|
import '../global/dom.js';
|
46
|
-
import 'core-js/modules/es.array.filter.js';
|
47
|
-
import 'core-js/modules/es.object.assign.js';
|
48
|
-
import 'core-js/modules/es.set.js';
|
49
|
-
import 'core-js/modules/es.string.split.js';
|
50
36
|
import '../shortcuts/shortcuts.js';
|
51
37
|
import '../shortcuts/core.js';
|
52
|
-
import 'core-js/modules/es.array.find-index.js';
|
53
|
-
import 'core-js/modules/es.array.includes.js';
|
54
|
-
import 'core-js/modules/es.array.slice.js';
|
55
|
-
import 'core-js/modules/es.array.splice.js';
|
56
|
-
import 'core-js/modules/es.string.includes.js';
|
57
|
-
import 'core-js/modules/es.string.match.js';
|
58
38
|
import 'combokeys';
|
59
39
|
import '../global/sniffer.js';
|
60
40
|
import 'sniffr';
|
@@ -68,50 +48,38 @@ import '../popup/popup.target.js';
|
|
68
48
|
import './cell.js';
|
69
49
|
import '../_helpers/table.js';
|
70
50
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
function RowWithFocusSensorCallbacks() {
|
76
|
-
var _this;
|
77
|
-
_classCallCheck(this, RowWithFocusSensorCallbacks);
|
78
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
79
|
-
args[_key] = arguments[_key];
|
80
|
-
}
|
81
|
-
_this = _callSuper(this, RowWithFocusSensorCallbacks, [].concat(args));
|
51
|
+
const getContainer = () => focusSensorHOC(Row);
|
52
|
+
class RowWithFocusSensorCallbacks extends PureComponent {
|
53
|
+
constructor() {
|
54
|
+
super(...arguments);
|
82
55
|
// https://stackoverflow.com/a/53882322/6304152
|
83
|
-
_defineProperty(
|
84
|
-
_defineProperty(
|
56
|
+
_defineProperty(this, "RowWithFocusSensor", getContainer());
|
57
|
+
_defineProperty(this, "onFocus", () => {
|
85
58
|
var _this$props$onFocus, _this$props;
|
86
|
-
(_this$props$onFocus = (_this$props =
|
59
|
+
(_this$props$onFocus = (_this$props = this.props).onFocus) === null || _this$props$onFocus === void 0 || _this$props$onFocus.call(_this$props, this.props.item);
|
87
60
|
});
|
88
|
-
_defineProperty(
|
61
|
+
_defineProperty(this, "onSelect", (item, selected) => {
|
89
62
|
var _this$props$onSelect, _this$props2;
|
90
|
-
(_this$props$onSelect = (_this$props2 =
|
63
|
+
(_this$props$onSelect = (_this$props2 = this.props).onSelect) === null || _this$props$onSelect === void 0 || _this$props$onSelect.call(_this$props2, item, selected);
|
91
64
|
});
|
92
|
-
_defineProperty(
|
65
|
+
_defineProperty(this, "onCollapse", () => {
|
93
66
|
var _this$props$onCollaps, _this$props3;
|
94
|
-
(_this$props$onCollaps = (_this$props3 =
|
67
|
+
(_this$props$onCollaps = (_this$props3 = this.props).onCollapse) === null || _this$props$onCollaps === void 0 || _this$props$onCollaps.call(_this$props3, this.props.item);
|
95
68
|
});
|
96
|
-
_defineProperty(
|
69
|
+
_defineProperty(this, "onExpand", () => {
|
97
70
|
var _this$props$onExpand, _this$props4;
|
98
|
-
(_this$props$onExpand = (_this$props4 =
|
71
|
+
(_this$props$onExpand = (_this$props4 = this.props).onExpand) === null || _this$props$onExpand === void 0 || _this$props$onExpand.call(_this$props4, this.props.item);
|
99
72
|
});
|
100
|
-
return _this;
|
101
73
|
}
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
}));
|
112
|
-
}
|
113
|
-
}]);
|
114
|
-
}(PureComponent);
|
74
|
+
render() {
|
75
|
+
return /*#__PURE__*/jsx(this.RowWithFocusSensor, _objectSpread2(_objectSpread2({}, this.props), {}, {
|
76
|
+
onFocus: this.onFocus,
|
77
|
+
onSelect: this.onSelect,
|
78
|
+
onCollapse: this.onCollapse,
|
79
|
+
onExpand: this.onExpand
|
80
|
+
}));
|
81
|
+
}
|
82
|
+
}
|
115
83
|
RowWithFocusSensorCallbacks.propTypes = Row.propTypes;
|
116
84
|
|
117
85
|
export { RowWithFocusSensorCallbacks as default };
|