@jetbrains/ring-ui-built 6.0.27 → 6.0.29
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 +4 -15
- package/components/_helpers/anchor.js +1 -1
- package/components/_helpers/caption.js +4 -6
- package/components/_helpers/card.js +5 -7
- package/components/_helpers/icon__svg.js +1 -1
- package/components/_helpers/input.js +12 -14
- package/components/_helpers/query-assist__suggestions.js +2 -3
- package/components/_helpers/select__filter.js +6 -8
- package/components/_helpers/services-link.js +4 -6
- package/components/_helpers/sidebar.js +9 -11
- package/components/_helpers/tab-link.js +1 -1
- package/components/_helpers/theme.js +1 -1
- package/components/_helpers/title.js +7 -9
- package/components/alert/alert.js +17 -19
- package/components/alert/container.js +4 -6
- package/components/alert-service/alert-service.js +9 -10
- package/components/analytics/analytics.js +2 -3
- package/components/analytics/analytics__custom-plugin.js +2 -3
- package/components/auth/auth.js +9 -8
- package/components/auth/auth__core.js +16 -16
- package/components/auth/background-flow.js +4 -5
- package/components/auth/down-notification.js +7 -7
- package/components/auth/iframe-flow.js +7 -8
- package/components/auth/request-builder.js +3 -4
- package/components/auth/response-parser.js +10 -12
- package/components/auth/storage.js +10 -11
- package/components/auth/token-validator.js +12 -14
- package/components/auth/window-flow.js +4 -5
- package/components/auth-dialog/auth-dialog.js +13 -15
- package/components/auth-dialog-service/auth-dialog-service.js +7 -7
- package/components/avatar/avatar.js +14 -16
- package/components/avatar/fallback-avatar.js +5 -5
- package/components/badge/badge.js +6 -8
- package/components/button/button.js +7 -9
- package/components/button-group/button-group.js +6 -8
- package/components/button-set/button-set.js +6 -8
- package/components/button-toolbar/button-toolbar.js +6 -8
- package/components/caret/caret.js +7 -8
- package/components/checkbox/checkbox.js +7 -9
- package/components/clipboard/clipboard.js +8 -8
- package/components/code/code.js +12 -14
- package/components/collapse/collapse-content.js +7 -7
- package/components/collapse/collapse-control.js +2 -2
- package/components/collapse/collapse.js +1 -1
- package/components/confirm/confirm.js +11 -13
- package/components/confirm-service/confirm-service.js +6 -6
- package/components/content-layout/content-layout.js +7 -9
- package/components/contenteditable/contenteditable.js +4 -6
- package/components/control-label/control-label.js +1 -1
- package/components/data-list/data-list.js +19 -23
- package/components/data-list/data-list.mock.js +2 -2
- package/components/data-list/item.js +12 -14
- package/components/data-list/selection.js +10 -12
- package/components/data-list/title.js +1 -1
- package/components/date-picker/consts.js +2 -2
- package/components/date-picker/date-input.js +12 -14
- package/components/date-picker/date-picker.js +19 -21
- package/components/date-picker/date-popup.js +23 -25
- package/components/date-picker/day.js +14 -16
- package/components/date-picker/month-names.js +7 -9
- package/components/date-picker/month-slider.js +10 -12
- package/components/date-picker/month.js +5 -5
- package/components/date-picker/months.js +4 -4
- package/components/date-picker/weekdays.js +3 -3
- package/components/date-picker/years.js +12 -14
- package/components/dialog/dialog.js +18 -20
- package/components/dropdown/anchor.js +1 -1
- package/components/dropdown/dropdown.js +13 -15
- package/components/dropdown-menu/dropdown-menu.js +10 -10
- package/components/editable-heading/editable-heading.js +5 -5
- package/components/error-bubble/error-bubble.js +11 -13
- package/components/error-message/error-message.js +6 -8
- package/components/footer/footer.js +2 -2
- package/components/global/create-stateful-context.js +1 -1
- package/components/global/data-tests.js +3 -3
- package/components/global/dom.js +7 -8
- package/components/global/focus-sensor-hoc.js +15 -17
- package/components/global/fuzzy-highlight.js +2 -2
- package/components/global/get-uid.js +1 -1
- package/components/global/inject-styles.js +1 -1
- package/components/global/listeners.js +4 -5
- package/components/global/memoize.js +1 -1
- package/components/global/normalize-indent.js +5 -5
- package/components/global/react-dom-renderer.js +7 -9
- package/components/global/rerender-hoc.js +5 -7
- package/components/global/theme.js +7 -7
- package/components/global/trivial-template-tag.js +2 -2
- package/components/global/url.js +1 -1
- package/components/grid/col.js +7 -9
- package/components/grid/grid.js +6 -8
- package/components/grid/row.js +5 -7
- package/components/group/group.js +4 -6
- package/components/header/header.js +13 -14
- package/components/header/logo.js +5 -7
- package/components/header/profile.js +12 -14
- package/components/header/services-link.js +2 -2
- package/components/header/services.js +12 -14
- package/components/header/smart-profile.js +17 -18
- package/components/header/smart-services.js +16 -17
- package/components/header/tray-icon.js +5 -7
- package/components/header/tray.js +4 -6
- package/components/heading/heading.js +1 -1
- package/components/http/http.js +11 -13
- package/components/http/http.mock.js +15 -17
- package/components/hub-source/hub-source.js +4 -5
- package/components/hub-source/hub-source__user.js +6 -6
- package/components/hub-source/hub-source__users-groups.js +4 -5
- package/components/i18n/i18n.js +1 -1
- package/components/icon/icon.js +5 -7
- package/components/icon/icon__svg.js +1 -1
- package/components/icon/index.js +1 -1
- package/components/input/input.js +1 -1
- package/components/island/adaptive-island-hoc.js +6 -8
- package/components/island/content.js +13 -15
- package/components/island/header.js +4 -6
- package/components/island/island.js +6 -8
- package/components/island-legacy/content-legacy.js +4 -6
- package/components/island-legacy/header-legacy.js +4 -6
- package/components/island-legacy/island-legacy.js +4 -6
- package/components/link/clickableLink.js +5 -7
- package/components/link/link.js +6 -8
- package/components/list/list.js +47 -49
- package/components/list/list__custom.js +6 -8
- package/components/list/list__hint.js +4 -6
- package/components/list/list__item.js +13 -15
- package/components/list/list__link.js +5 -7
- package/components/list/list__separator.js +4 -6
- package/components/list/list__title.js +4 -6
- package/components/list/list__users-groups-source.js +11 -13
- package/components/loader/loader.js +9 -11
- package/components/loader/loader__core.js +7 -9
- package/components/loader-inline/loader-inline.js +6 -8
- package/components/loader-screen/loader-screen.js +7 -9
- package/components/login-dialog/login-dialog.js +12 -14
- package/components/login-dialog/service.js +7 -7
- package/components/markdown/markdown.js +4 -6
- package/components/message/message.js +17 -19
- package/components/old-browsers-message/old-browsers-message.js +1 -1
- package/components/old-browsers-message/old-browsers-message__stop.js +1 -1
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/pager/pager.js +16 -18
- package/components/panel/panel.js +4 -6
- package/components/permissions/permissions.js +4 -5
- package/components/permissions/permissions__cache.js +2 -3
- package/components/popup/popup.js +33 -35
- package/components/popup/popup.target.js +1 -1
- package/components/popup/position.js +9 -9
- package/components/popup-menu/popup-menu.js +14 -16
- package/components/progress-bar/progress-bar.js +8 -10
- package/components/query-assist/query-assist.js +64 -66
- package/components/query-assist/query-assist__suggestions.js +6 -6
- package/components/radio/radio.js +5 -7
- package/components/radio/radio__item.js +9 -11
- package/components/select/select.js +48 -50
- package/components/select/select__filter.js +6 -6
- package/components/select/select__popup.js +36 -38
- package/components/shortcuts/core.js +7 -8
- package/components/shortcuts/shortcuts-hoc.js +8 -10
- package/components/shortcuts/shortcuts.js +8 -10
- package/components/slider/slider.js +6 -6
- package/components/slider/slider.utils.js +4 -4
- package/components/storage/storage.js +8 -8
- package/components/storage/storage__fallback.js +5 -6
- package/components/storage/storage__local.js +9 -10
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +24 -26
- package/components/table/cell.js +6 -8
- package/components/table/disable-hover-hoc.js +7 -9
- package/components/table/header-cell.d.ts +1 -0
- package/components/table/header-cell.js +8 -10
- package/components/table/header.d.ts +2 -1
- package/components/table/header.js +15 -10
- package/components/table/multitable.js +13 -15
- package/components/table/row-with-focus-sensor.js +14 -16
- package/components/table/row.d.ts +2 -1
- package/components/table/row.js +29 -23
- package/components/table/selection-adapter.js +1 -1
- package/components/table/selection-shortcuts-hoc.js +19 -21
- package/components/table/selection.js +4 -5
- package/components/table/smart-table.d.ts +2 -1
- package/components/table/smart-table.js +10 -12
- package/components/table/table.d.ts +2 -1
- package/components/table/table.js +29 -30
- package/components/tabs/collapsible-more.js +8 -8
- package/components/tabs/collapsible-tab.js +3 -3
- package/components/tabs/collapsible-tabs.js +10 -10
- package/components/tabs/dumb-tabs.js +11 -13
- package/components/tabs/smart-tabs.js +13 -15
- package/components/tabs/tab-link.js +2 -2
- package/components/tabs/tab.js +6 -8
- package/components/tabs/tabs.js +5 -5
- package/components/tag/tag.js +9 -11
- package/components/tags-input/tags-input.js +39 -41
- package/components/tags-list/tags-list.js +5 -7
- package/components/text/text.js +4 -6
- package/components/toggle/toggle.js +6 -8
- package/components/tooltip/tooltip.js +27 -29
- package/components/user-agreement/service.js +7 -7
- package/components/user-agreement/user-agreement.js +11 -13
- package/components/user-card/card.js +9 -9
- package/components/user-card/smart-user-card-tooltip.js +14 -16
- package/components/user-card/tooltip.js +11 -13
- package/components/user-card/user-card.js +9 -9
- package/package.json +1 -1
package/components/table/row.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { _ as _defineProperty, a as _inherits, b as
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, e as _extends, f as _classCallCheck, g as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.array.concat.js';
|
3
3
|
import 'core-js/modules/es.array.map.js';
|
4
4
|
import React, { PureComponent } from 'react';
|
@@ -28,32 +28,32 @@ import '../global/memoize.js';
|
|
28
28
|
import 'core-js/modules/es.array.iterator.js';
|
29
29
|
import 'core-js/modules/es.map.js';
|
30
30
|
import 'core-js/modules/es.object.to-string.js';
|
31
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
32
31
|
import 'core-js/modules/es.weak-map.js';
|
32
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
33
33
|
import '../global/prop-types.js';
|
34
34
|
import '@jetbrains/icons/chevron-10px';
|
35
35
|
import '../link/clickableLink.js';
|
36
36
|
import '../global/controls-height.js';
|
37
37
|
import '../_helpers/button__classes.js';
|
38
38
|
import '../popup/popup.js';
|
39
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
40
39
|
import 'core-js/modules/es.object.entries.js';
|
41
40
|
import 'core-js/modules/es.regexp.to-string.js';
|
41
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
42
42
|
import 'react-dom';
|
43
43
|
import '../global/schedule-raf.js';
|
44
44
|
import '../global/dom.js';
|
45
|
-
import 'core-js/modules/es.object.assign.js';
|
46
45
|
import 'core-js/modules/es.array.filter.js';
|
47
|
-
import 'core-js/modules/es.
|
46
|
+
import 'core-js/modules/es.object.assign.js';
|
48
47
|
import 'core-js/modules/es.set.js';
|
48
|
+
import 'core-js/modules/es.string.split.js';
|
49
49
|
import '../shortcuts/shortcuts.js';
|
50
50
|
import '../shortcuts/core.js';
|
51
|
+
import 'core-js/modules/es.array.find-index.js';
|
51
52
|
import 'core-js/modules/es.array.includes.js';
|
52
|
-
import 'core-js/modules/es.string.includes.js';
|
53
53
|
import 'core-js/modules/es.array.slice.js';
|
54
54
|
import 'core-js/modules/es.array.splice.js';
|
55
|
+
import 'core-js/modules/es.string.includes.js';
|
55
56
|
import 'core-js/modules/es.string.match.js';
|
56
|
-
import 'core-js/modules/es.array.find-index.js';
|
57
57
|
import 'combokeys';
|
58
58
|
import '../global/sniffer.js';
|
59
59
|
import 'sniffr';
|
@@ -64,7 +64,7 @@ import '../popup/popup.consts.js';
|
|
64
64
|
import '../popup/popup.target.js';
|
65
65
|
import 'core-js/modules/es.array.reduce.js';
|
66
66
|
|
67
|
-
var _excluded = ["item", "columns", "selectable", "selected", "showFocus", "draggable", "alwaysShowDragHandle", "dragHandleTitle", "level", "collapsible", "parentCollapsible", "collapsed", "onCollapse", "onExpand", "showDisabledSelection", "onSelect", "checkboxTooltip", "innerRef", "focused", "autofocus", "onFocusReset", "onFocusRestore", "onHover", "className", "metaColumnClassName", "data-test"];
|
67
|
+
var _excluded = ["item", "columns", "selectable", "selected", "showFocus", "draggable", "alwaysShowDragHandle", "dragHandleTitle", "level", "collapsible", "parentCollapsible", "collapsed", "maxColSpan", "onCollapse", "onExpand", "showDisabledSelection", "onSelect", "checkboxTooltip", "innerRef", "focused", "autofocus", "onFocusReset", "onFocusRestore", "onHover", "className", "metaColumnClassName", "data-test"];
|
68
68
|
var DragHandle = function DragHandle(_ref) {
|
69
69
|
var alwaysShowDragHandle = _ref.alwaysShowDragHandle,
|
70
70
|
_ref$dragHandleTitle = _ref.dragHandleTitle,
|
@@ -84,46 +84,45 @@ DragHandle.propTypes = {
|
|
84
84
|
dragHandleTitle: PropTypes.string
|
85
85
|
};
|
86
86
|
var Row = /*#__PURE__*/function (_PureComponent) {
|
87
|
-
_inherits(Row, _PureComponent);
|
88
|
-
var _super = _createSuper(Row);
|
89
87
|
function Row() {
|
90
88
|
var _this;
|
91
89
|
_classCallCheck(this, Row);
|
92
90
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
93
91
|
args[_key] = arguments[_key];
|
94
92
|
}
|
95
|
-
_this =
|
96
|
-
_defineProperty(
|
97
|
-
_defineProperty(
|
93
|
+
_this = _callSuper(this, Row, [].concat(args));
|
94
|
+
_defineProperty(_this, "id", getUID('table-row-'));
|
95
|
+
_defineProperty(_this, "onMouseEnter", function (e) {
|
98
96
|
var _this$props = _this.props,
|
99
97
|
item = _this$props.item,
|
100
98
|
onHover = _this$props.onHover;
|
101
99
|
onHover(item, e);
|
102
100
|
});
|
103
|
-
_defineProperty(
|
101
|
+
_defineProperty(_this, "onClick", function (e) {
|
104
102
|
var item = _this.props.item;
|
105
103
|
_this.props.onClick(item, e);
|
106
104
|
if (e.shiftKey) {
|
107
105
|
_this.toggleSelection();
|
108
106
|
}
|
109
107
|
});
|
110
|
-
_defineProperty(
|
108
|
+
_defineProperty(_this, "onCheckboxFocus", function () {
|
111
109
|
_this.props.onFocusRestore();
|
112
110
|
});
|
113
|
-
_defineProperty(
|
111
|
+
_defineProperty(_this, "onCheckboxChange", function () {
|
114
112
|
_this.toggleSelection();
|
115
113
|
});
|
116
|
-
_defineProperty(
|
114
|
+
_defineProperty(_this, "onDoubleClick", function () {
|
117
115
|
var item = _this.props.item;
|
118
116
|
_this.props.onDoubleClick(item);
|
119
117
|
});
|
120
|
-
_defineProperty(
|
121
|
-
_defineProperty(
|
118
|
+
_defineProperty(_this, "row", void 0);
|
119
|
+
_defineProperty(_this, "rowRef", function (el) {
|
122
120
|
_this.row = el;
|
123
121
|
});
|
124
122
|
return _this;
|
125
123
|
}
|
126
|
-
|
124
|
+
_inherits(Row, _PureComponent);
|
125
|
+
return _createClass(Row, [{
|
127
126
|
key: "toggleSelection",
|
128
127
|
value: function toggleSelection() {
|
129
128
|
var _this$props2 = this.props,
|
@@ -140,7 +139,7 @@ var Row = /*#__PURE__*/function (_PureComponent) {
|
|
140
139
|
value: function render() {
|
141
140
|
var _this$props3 = this.props,
|
142
141
|
item = _this$props3.item,
|
143
|
-
|
142
|
+
columnProps = _this$props3.columns,
|
144
143
|
selectable = _this$props3.selectable,
|
145
144
|
selected = _this$props3.selected,
|
146
145
|
showFocus = _this$props3.showFocus,
|
@@ -151,6 +150,7 @@ var Row = /*#__PURE__*/function (_PureComponent) {
|
|
151
150
|
collapsible = _this$props3.collapsible,
|
152
151
|
parentCollapsible = _this$props3.parentCollapsible,
|
153
152
|
collapsed = _this$props3.collapsed,
|
153
|
+
maxColSpan = _this$props3.maxColSpan,
|
154
154
|
onCollapse = _this$props3.onCollapse,
|
155
155
|
onExpand = _this$props3.onExpand,
|
156
156
|
showDisabledSelection = _this$props3.showDisabledSelection;
|
@@ -216,6 +216,8 @@ var Row = /*#__PURE__*/function (_PureComponent) {
|
|
216
216
|
return onCollapse(item);
|
217
217
|
}
|
218
218
|
}));
|
219
|
+
var columns = typeof columnProps === 'function' ? columnProps(item) : columnProps;
|
220
|
+
var colSpan = 0;
|
219
221
|
var cells = columns.map(function (column, index) {
|
220
222
|
var getValue = column.getValue || function () {
|
221
223
|
return item[column.id];
|
@@ -228,7 +230,12 @@ var Row = /*#__PURE__*/function (_PureComponent) {
|
|
228
230
|
[modules_1db4bbca.cellRight]: column.rightAlign
|
229
231
|
}, column.className);
|
230
232
|
var showMetaColumn = draggable || selectable || collapsible || showDisabledSelection || !!level;
|
233
|
+
colSpan += column.colSpan || 1;
|
234
|
+
if (colSpan > (maxColSpan || Infinity)) {
|
235
|
+
return null;
|
236
|
+
}
|
231
237
|
return /*#__PURE__*/React.createElement(Cell, {
|
238
|
+
colSpan: column.colSpan,
|
232
239
|
key: column.id,
|
233
240
|
className: cellClasses,
|
234
241
|
"data-test": getDataTest(item, column)
|
@@ -247,7 +254,6 @@ var Row = /*#__PURE__*/function (_PureComponent) {
|
|
247
254
|
}), cells);
|
248
255
|
}
|
249
256
|
}]);
|
250
|
-
return Row;
|
251
257
|
}(PureComponent);
|
252
258
|
_defineProperty(Row, "defaultProps", {
|
253
259
|
selectable: true,
|
@@ -270,7 +276,7 @@ Row.propTypes = {
|
|
270
276
|
className: PropTypes.string,
|
271
277
|
metaColumnClassName: PropTypes.string,
|
272
278
|
item: PropTypes.object.isRequired,
|
273
|
-
columns: PropTypes.array.isRequired,
|
279
|
+
columns: PropTypes.oneOfType([PropTypes.array, PropTypes.func]).isRequired,
|
274
280
|
selectable: PropTypes.bool,
|
275
281
|
showFocus: PropTypes.bool,
|
276
282
|
draggable: PropTypes.bool,
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import {
|
1
|
+
import { d as _objectSpread2, c as _objectWithoutProperties, a as _inherits, b as _createClass, e as _extends, f as _classCallCheck, g as _callSuper, _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.array.concat.js';
|
3
3
|
import React, { PureComponent } from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import Selection from './selection.js';
|
6
|
+
import 'core-js/modules/es.array.filter.js';
|
7
|
+
import 'core-js/modules/es.array.index-of.js';
|
6
8
|
import 'core-js/modules/es.array.iterator.js';
|
7
9
|
import 'core-js/modules/es.object.to-string.js';
|
8
10
|
import 'core-js/modules/es.set.js';
|
9
11
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
10
|
-
import 'core-js/modules/es.array.filter.js';
|
11
|
-
import 'core-js/modules/es.array.index-of.js';
|
12
12
|
|
13
13
|
var _excluded = ["selection", "selectable", "onSelect", "shortcutsMap"],
|
14
14
|
_excluded2 = ["selection", "selectable", "onSelect", "shortcuts"];
|
@@ -26,16 +26,14 @@ function extractPropTypes(_ref) {
|
|
26
26
|
}
|
27
27
|
function selectionShortcutsHOC(ComposedComponent) {
|
28
28
|
var SelectionShortcuts = /*#__PURE__*/function (_PureComponent) {
|
29
|
-
_inherits(SelectionShortcuts, _PureComponent);
|
30
|
-
var _super = _createSuper(SelectionShortcuts);
|
31
29
|
function SelectionShortcuts() {
|
32
30
|
var _this;
|
33
31
|
_classCallCheck(this, SelectionShortcuts);
|
34
32
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
35
33
|
args[_key] = arguments[_key];
|
36
34
|
}
|
37
|
-
_this =
|
38
|
-
_defineProperty(
|
35
|
+
_this = _callSuper(this, SelectionShortcuts, [].concat(args));
|
36
|
+
_defineProperty(_this, "onUpPress", function () {
|
39
37
|
var _this$props = _this.props,
|
40
38
|
selection = _this$props.selection,
|
41
39
|
onSelect = _this$props.onSelect;
|
@@ -45,7 +43,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
45
43
|
}
|
46
44
|
return false;
|
47
45
|
});
|
48
|
-
_defineProperty(
|
46
|
+
_defineProperty(_this, "onDownPress", function () {
|
49
47
|
var _this$props2 = _this.props,
|
50
48
|
selection = _this$props2.selection,
|
51
49
|
onSelect = _this$props2.onSelect;
|
@@ -55,8 +53,8 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
55
53
|
}
|
56
54
|
return false;
|
57
55
|
});
|
58
|
-
_defineProperty(
|
59
|
-
_defineProperty(
|
56
|
+
_defineProperty(_this, "shiftSelectionMode", void 0);
|
57
|
+
_defineProperty(_this, "onShiftKeyDown", function () {
|
60
58
|
var selection = _this.props.selection;
|
61
59
|
if (selection.isSelected(selection.getFocused())) {
|
62
60
|
_this.shiftSelectionMode = 'deletion';
|
@@ -64,14 +62,14 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
64
62
|
_this.shiftSelectionMode = 'addition';
|
65
63
|
}
|
66
64
|
});
|
67
|
-
_defineProperty(
|
65
|
+
_defineProperty(_this, "shiftSelect", function (selection) {
|
68
66
|
if (_this.shiftSelectionMode === 'addition') {
|
69
67
|
return selection.select();
|
70
68
|
} else {
|
71
69
|
return selection.deselect();
|
72
70
|
}
|
73
71
|
});
|
74
|
-
_defineProperty(
|
72
|
+
_defineProperty(_this, "onShiftUpPress", function (e) {
|
75
73
|
e.preventDefault();
|
76
74
|
var _this$props3 = _this.props,
|
77
75
|
selectable = _this$props3.selectable,
|
@@ -88,7 +86,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
88
86
|
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
89
87
|
}
|
90
88
|
});
|
91
|
-
_defineProperty(
|
89
|
+
_defineProperty(_this, "onShiftDownPress", function (e) {
|
92
90
|
e.preventDefault();
|
93
91
|
var _this$props4 = _this.props,
|
94
92
|
selectable = _this$props4.selectable,
|
@@ -105,7 +103,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
105
103
|
onSelect === null || onSelect === void 0 || onSelect(newSelection);
|
106
104
|
}
|
107
105
|
});
|
108
|
-
_defineProperty(
|
106
|
+
_defineProperty(_this, "onHomePress", function () {
|
109
107
|
var _this$props5 = _this.props,
|
110
108
|
selection = _this$props5.selection,
|
111
109
|
onSelect = _this$props5.onSelect;
|
@@ -115,7 +113,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
115
113
|
}
|
116
114
|
return false;
|
117
115
|
});
|
118
|
-
_defineProperty(
|
116
|
+
_defineProperty(_this, "onEndPress", function () {
|
119
117
|
var _this$props6 = _this.props,
|
120
118
|
selection = _this$props6.selection,
|
121
119
|
onSelect = _this$props6.onSelect;
|
@@ -125,7 +123,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
125
123
|
}
|
126
124
|
return false;
|
127
125
|
});
|
128
|
-
_defineProperty(
|
126
|
+
_defineProperty(_this, "onSpacePress", function () {
|
129
127
|
var _this$props7 = _this.props,
|
130
128
|
selectable = _this$props7.selectable,
|
131
129
|
selection = _this$props7.selection,
|
@@ -136,14 +134,14 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
136
134
|
onSelect === null || onSelect === void 0 || onSelect(selection.toggleSelection());
|
137
135
|
return false;
|
138
136
|
});
|
139
|
-
_defineProperty(
|
137
|
+
_defineProperty(_this, "onEscPress", function () {
|
140
138
|
var _this$props8 = _this.props,
|
141
139
|
selection = _this$props8.selection,
|
142
140
|
onSelect = _this$props8.onSelect;
|
143
141
|
onSelect === null || onSelect === void 0 || onSelect(selection.reset());
|
144
142
|
//this.restoreFocusWithoutScroll();
|
145
143
|
});
|
146
|
-
_defineProperty(
|
144
|
+
_defineProperty(_this, "onCmdAPress", function () {
|
147
145
|
var _this$props9 = _this.props,
|
148
146
|
selectable = _this$props9.selectable,
|
149
147
|
selection = _this$props9.selection,
|
@@ -154,7 +152,7 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
154
152
|
onSelect === null || onSelect === void 0 || onSelect(selection.selectAll());
|
155
153
|
return false;
|
156
154
|
});
|
157
|
-
_defineProperty(
|
155
|
+
_defineProperty(_this, "shortcutsMap", {
|
158
156
|
up: _this.onUpPress,
|
159
157
|
down: _this.onDownPress,
|
160
158
|
shift: _this.onShiftKeyDown,
|
@@ -169,7 +167,8 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
169
167
|
});
|
170
168
|
return _this;
|
171
169
|
}
|
172
|
-
|
170
|
+
_inherits(SelectionShortcuts, _PureComponent);
|
171
|
+
return _createClass(SelectionShortcuts, [{
|
173
172
|
key: "render",
|
174
173
|
value: function render() {
|
175
174
|
var _this$props10 = this.props,
|
@@ -186,7 +185,6 @@ function selectionShortcutsHOC(ComposedComponent) {
|
|
186
185
|
}));
|
187
186
|
}
|
188
187
|
}]);
|
189
|
-
return SelectionShortcuts;
|
190
188
|
}(PureComponent);
|
191
189
|
SelectionShortcuts.propTypes = _objectSpread2(_objectSpread2({}, extractPropTypes(ComposedComponent)), {}, {
|
192
190
|
selection: PropTypes.instanceOf(Selection).isRequired,
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import {
|
1
|
+
import { b as _createClass, k as _toConsumableArray, f as _classCallCheck, _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.filter.js';
|
3
|
+
import 'core-js/modules/es.array.index-of.js';
|
2
4
|
import 'core-js/modules/es.array.iterator.js';
|
3
5
|
import 'core-js/modules/es.object.to-string.js';
|
4
6
|
import 'core-js/modules/es.set.js';
|
5
7
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
6
|
-
import 'core-js/modules/es.array.filter.js';
|
7
|
-
import 'core-js/modules/es.array.index-of.js';
|
8
8
|
|
9
9
|
var Selection = /*#__PURE__*/function () {
|
10
10
|
function Selection() {
|
@@ -43,7 +43,7 @@ var Selection = /*#__PURE__*/function () {
|
|
43
43
|
this._getKey = getKey;
|
44
44
|
this._isItemSelectable = isItemSelectable;
|
45
45
|
}
|
46
|
-
_createClass(Selection, [{
|
46
|
+
return _createClass(Selection, [{
|
47
47
|
key: "_buildData",
|
48
48
|
value: function _buildData(data) {
|
49
49
|
return new Set(data);
|
@@ -251,7 +251,6 @@ var Selection = /*#__PURE__*/function () {
|
|
251
251
|
}
|
252
252
|
}
|
253
253
|
}]);
|
254
|
-
return Selection;
|
255
254
|
}();
|
256
255
|
|
257
256
|
export { Selection as default };
|
@@ -15,7 +15,7 @@ declare class SmartTable<T extends SelectionItem> extends PureComponent<SmartTab
|
|
15
15
|
data?: React.Validator<readonly SelectionItem[]> | undefined;
|
16
16
|
loading?: React.Validator<boolean | null | undefined> | undefined;
|
17
17
|
draggable?: React.Validator<boolean | null | undefined> | undefined;
|
18
|
-
columns?: React.Validator<readonly import("./header-cell").Column<SelectionItem>[]> | undefined;
|
18
|
+
columns?: React.Validator<readonly import("./header-cell").Column<SelectionItem>[] | ((item: SelectionItem | null) => readonly import("./header-cell").Column<SelectionItem>[])> | undefined;
|
19
19
|
focused?: React.Validator<boolean | null | undefined> | undefined;
|
20
20
|
isItemSelectable: PropTypes.Requireable<(...args: any[]) => any> | React.Validator<((item: SelectionItem) => boolean) | null | undefined>;
|
21
21
|
innerRef?: React.Validator<React.Ref<HTMLTableRowElement> | undefined> | undefined;
|
@@ -26,6 +26,7 @@ declare class SmartTable<T extends SelectionItem> extends PureComponent<SmartTab
|
|
26
26
|
onSort?: React.Validator<((params: import("./header-cell").SortParams) => void) | null | undefined> | undefined;
|
27
27
|
sortKey?: React.Validator<string | null | undefined> | undefined;
|
28
28
|
sortOrder?: React.Validator<boolean | null | undefined> | undefined;
|
29
|
+
maxColSpan?: React.Validator<number | null | undefined> | undefined;
|
29
30
|
alwaysShowDragHandle?: React.Validator<boolean | null | undefined> | undefined;
|
30
31
|
dragHandleTitle?: React.Validator<string | null | undefined> | undefined;
|
31
32
|
onReorder?: React.Validator<((params: import("./table").ReorderParams<SelectionItem>) => void) | null | undefined> | undefined;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { c as _objectWithoutProperties, _ as _defineProperty, d as _objectSpread2, a as _inherits, b as _createClass, e as _extends, f as _classCallCheck, g as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.array.concat.js';
|
3
3
|
import React, { PureComponent } from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
@@ -16,14 +16,14 @@ import '../global/get-uid.js';
|
|
16
16
|
import 'core-js/modules/es.regexp.to-string.js';
|
17
17
|
import '../shortcuts/shortcuts.js';
|
18
18
|
import '../shortcuts/core.js';
|
19
|
+
import 'core-js/modules/es.array.find-index.js';
|
19
20
|
import 'core-js/modules/es.array.includes.js';
|
20
|
-
import 'core-js/modules/es.string.includes.js';
|
21
|
-
import 'core-js/modules/es.object.assign.js';
|
22
21
|
import 'core-js/modules/es.array.slice.js';
|
23
22
|
import 'core-js/modules/es.array.splice.js';
|
23
|
+
import 'core-js/modules/es.object.assign.js';
|
24
24
|
import 'core-js/modules/es.regexp.exec.js';
|
25
|
+
import 'core-js/modules/es.string.includes.js';
|
25
26
|
import 'core-js/modules/es.string.match.js';
|
26
|
-
import 'core-js/modules/es.array.find-index.js';
|
27
27
|
import 'combokeys';
|
28
28
|
import '../global/sniffer.js';
|
29
29
|
import 'sniffr';
|
@@ -35,9 +35,9 @@ import '../loader/loader__core.js';
|
|
35
35
|
import 'core-js/modules/es.array.fill.js';
|
36
36
|
import 'core-js/modules/es.array.filter.js';
|
37
37
|
import '../global/dom.js';
|
38
|
-
import 'core-js/modules/es.string.split.js';
|
39
38
|
import 'core-js/modules/es.array.iterator.js';
|
40
39
|
import 'core-js/modules/es.set.js';
|
40
|
+
import 'core-js/modules/es.string.split.js';
|
41
41
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
42
42
|
import './header.js';
|
43
43
|
import '../checkbox/checkbox.js';
|
@@ -85,22 +85,20 @@ var _ref = (_Table$propTypes = TableContainer.propTypes) !== null && _Table$prop
|
|
85
85
|
_ref.onSelect;
|
86
86
|
var restPropTypes = _objectWithoutProperties(_ref, ["selection", "onSelect"]);
|
87
87
|
var SmartTable = /*#__PURE__*/function (_PureComponent) {
|
88
|
-
_inherits(SmartTable, _PureComponent);
|
89
|
-
var _super = _createSuper(SmartTable);
|
90
88
|
function SmartTable() {
|
91
89
|
var _this;
|
92
90
|
_classCallCheck(this, SmartTable);
|
93
91
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
94
92
|
args[_key] = arguments[_key];
|
95
93
|
}
|
96
|
-
_this =
|
97
|
-
_defineProperty(
|
94
|
+
_this = _callSuper(this, SmartTable, [].concat(args));
|
95
|
+
_defineProperty(_this, "state", {
|
98
96
|
selection: new Selection({
|
99
97
|
data: _this.props.data,
|
100
98
|
isItemSelectable: _this.props.isItemSelectable
|
101
99
|
})
|
102
100
|
});
|
103
|
-
_defineProperty(
|
101
|
+
_defineProperty(_this, "onSelect", function (selection) {
|
104
102
|
_this.setState({
|
105
103
|
selection
|
106
104
|
});
|
@@ -108,7 +106,8 @@ var SmartTable = /*#__PURE__*/function (_PureComponent) {
|
|
108
106
|
});
|
109
107
|
return _this;
|
110
108
|
}
|
111
|
-
|
109
|
+
_inherits(SmartTable, _PureComponent);
|
110
|
+
return _createClass(SmartTable, [{
|
112
111
|
key: "UNSAFE_componentWillReceiveProps",
|
113
112
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
114
113
|
var data = nextProps.data,
|
@@ -136,7 +135,6 @@ var SmartTable = /*#__PURE__*/function (_PureComponent) {
|
|
136
135
|
}));
|
137
136
|
}
|
138
137
|
}]);
|
139
|
-
return SmartTable;
|
140
138
|
}(PureComponent);
|
141
139
|
_defineProperty(SmartTable, "propTypes", _objectSpread2({
|
142
140
|
onSelectionChange: PropTypes.func,
|
@@ -15,7 +15,8 @@ export interface ReorderParams<T> {
|
|
15
15
|
}
|
16
16
|
export interface TableProps<T extends SelectionItem> extends FocusSensorAddProps<HTMLTableRowElement>, SelectionShortcutsAddProps<T>, DisableHoverAddProps {
|
17
17
|
data: readonly T[];
|
18
|
-
columns: readonly Column<T>[];
|
18
|
+
columns: readonly Column<T>[] | ((item: T | null) => readonly Column<T>[]);
|
19
|
+
maxColSpan?: number;
|
19
20
|
isItemSelectable: (item: T) => boolean;
|
20
21
|
loading: boolean;
|
21
22
|
onSort: (params: SortParams) => void;
|