@jetbrains/ring-ui-built 7.0.0-beta.1 → 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/header.js +1 -1
- 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 +55 -51
- 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.d.ts +3 -0
- package/components/global/theme.js +2 -19
- 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.d.ts +2 -0
- package/components/header/links.js +20 -0
- 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 +53 -0
- package/components/select/select.js +701 -796
- 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/scrollable-section.js +0 -47
- package/components/header/tray-icon.d.ts +0 -1
- package/components/header/tray-icon.js +0 -26
- /package/components/{header → scrollable-section}/scrollable-section.d.ts +0 -0
package/components/table/row.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
2
|
-
import 'core-js/modules/
|
3
|
-
import 'core-js/modules/es.array.map.js';
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, 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';
|
@@ -24,37 +23,18 @@ import '../icon/icon__constants.js';
|
|
24
23
|
import '../_helpers/icon__svg.js';
|
25
24
|
import 'core-js/modules/es.regexp.exec.js';
|
26
25
|
import 'core-js/modules/es.string.replace.js';
|
27
|
-
import 'core-js/modules/es.string.starts-with.js';
|
28
26
|
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.object.to-string.js';
|
32
|
-
import 'core-js/modules/es.weak-map.js';
|
33
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
34
27
|
import '../global/prop-types.js';
|
35
28
|
import '../control-help/control-help.js';
|
36
29
|
import '../link/clickableLink.js';
|
37
30
|
import '../global/controls-height.js';
|
38
31
|
import '../_helpers/button__classes.js';
|
39
32
|
import '../popup/popup.js';
|
40
|
-
import 'core-js/modules/es.object.entries.js';
|
41
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
42
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
43
33
|
import 'react-dom';
|
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';
|
@@ -66,12 +46,13 @@ import '../popup/popup.target.js';
|
|
66
46
|
import 'core-js/modules/es.array.reduce.js';
|
67
47
|
import 'memoize-one';
|
68
48
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
dragHandleTitle =
|
74
|
-
|
49
|
+
const _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"];
|
50
|
+
const DragHandle = _ref => {
|
51
|
+
let {
|
52
|
+
alwaysShowDragHandle,
|
53
|
+
dragHandleTitle = 'Drag to reorder'
|
54
|
+
} = _ref;
|
55
|
+
const classes = classNames(modules_1db4bbca.dragHandle, {
|
75
56
|
[modules_1db4bbca.visibleDragHandle]: alwaysShowDragHandle
|
76
57
|
});
|
77
58
|
return /*#__PURE__*/jsx(Button, {
|
@@ -85,199 +66,187 @@ DragHandle.propTypes = {
|
|
85
66
|
alwaysShowDragHandle: PropTypes.bool,
|
86
67
|
dragHandleTitle: PropTypes.string
|
87
68
|
};
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
_defineProperty(_this, "onMouseEnter", function (e) {
|
98
|
-
var _this$props = _this.props,
|
99
|
-
item = _this$props.item,
|
100
|
-
onHover = _this$props.onHover;
|
69
|
+
class Row extends PureComponent {
|
70
|
+
constructor() {
|
71
|
+
super(...arguments);
|
72
|
+
_defineProperty(this, "id", getUID('table-row-'));
|
73
|
+
_defineProperty(this, "onMouseEnter", e => {
|
74
|
+
const {
|
75
|
+
item,
|
76
|
+
onHover
|
77
|
+
} = this.props;
|
101
78
|
onHover(item, e);
|
102
79
|
});
|
103
|
-
_defineProperty(
|
104
|
-
|
105
|
-
|
80
|
+
_defineProperty(this, "onClick", e => {
|
81
|
+
const {
|
82
|
+
item
|
83
|
+
} = this.props;
|
84
|
+
this.props.onClick(item, e);
|
106
85
|
if (e.shiftKey) {
|
107
|
-
|
86
|
+
this.toggleSelection();
|
108
87
|
}
|
109
88
|
});
|
110
|
-
_defineProperty(
|
111
|
-
|
89
|
+
_defineProperty(this, "onCheckboxFocus", () => {
|
90
|
+
this.props.onFocusRestore();
|
112
91
|
});
|
113
|
-
_defineProperty(
|
114
|
-
|
92
|
+
_defineProperty(this, "onCheckboxChange", () => {
|
93
|
+
this.toggleSelection();
|
115
94
|
});
|
116
|
-
_defineProperty(
|
117
|
-
|
118
|
-
|
95
|
+
_defineProperty(this, "onDoubleClick", () => {
|
96
|
+
const {
|
97
|
+
item
|
98
|
+
} = this.props;
|
99
|
+
this.props.onDoubleClick(item);
|
119
100
|
});
|
120
|
-
_defineProperty(
|
121
|
-
_defineProperty(
|
122
|
-
|
101
|
+
_defineProperty(this, "row", void 0);
|
102
|
+
_defineProperty(this, "rowRef", el => {
|
103
|
+
this.row = el;
|
123
104
|
});
|
124
|
-
_defineProperty(
|
125
|
-
return _this;
|
105
|
+
_defineProperty(this, "composedRowRef", createComposedRef());
|
126
106
|
}
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
if (selectable) {
|
137
|
-
onSelect(item, !selected);
|
138
|
-
}
|
139
|
-
}
|
140
|
-
}, {
|
141
|
-
key: "render",
|
142
|
-
value: function render() {
|
143
|
-
var _this$props3 = this.props,
|
144
|
-
item = _this$props3.item,
|
145
|
-
columnProps = _this$props3.columns,
|
146
|
-
selectable = _this$props3.selectable,
|
147
|
-
selected = _this$props3.selected,
|
148
|
-
showFocus = _this$props3.showFocus,
|
149
|
-
draggable = _this$props3.draggable,
|
150
|
-
alwaysShowDragHandle = _this$props3.alwaysShowDragHandle,
|
151
|
-
dragHandleTitle = _this$props3.dragHandleTitle,
|
152
|
-
level = _this$props3.level,
|
153
|
-
collapsible = _this$props3.collapsible,
|
154
|
-
parentCollapsible = _this$props3.parentCollapsible,
|
155
|
-
collapsed = _this$props3.collapsed,
|
156
|
-
maxColSpan = _this$props3.maxColSpan,
|
157
|
-
onCollapse = _this$props3.onCollapse,
|
158
|
-
onExpand = _this$props3.onExpand,
|
159
|
-
showDisabledSelection = _this$props3.showDisabledSelection;
|
160
|
-
_this$props3.onSelect;
|
161
|
-
var checkboxTooltip = _this$props3.checkboxTooltip,
|
162
|
-
innerRef = _this$props3.innerRef;
|
163
|
-
_this$props3.focused;
|
164
|
-
_this$props3.autofocus;
|
165
|
-
_this$props3.onFocusReset;
|
166
|
-
_this$props3.onFocusRestore;
|
167
|
-
_this$props3.onHover;
|
168
|
-
var className = _this$props3.className,
|
169
|
-
metaColumnClassName = _this$props3.metaColumnClassName,
|
170
|
-
dataTest = _this$props3['data-test'],
|
171
|
-
restProps = _objectWithoutProperties(_this$props3, _excluded);
|
172
|
-
var classes = classNames(className, {
|
173
|
-
[modules_1db4bbca.row]: true,
|
174
|
-
[modules_1db4bbca.rowFocused]: showFocus,
|
175
|
-
[modules_1db4bbca.rowSelected]: selected
|
176
|
-
});
|
177
|
-
var testAttrs = {
|
178
|
-
'data-test-focused': showFocus || undefined,
|
179
|
-
'data-test-selected': selected || undefined
|
180
|
-
};
|
181
|
-
var metaColumnClasses = classNames(metaColumnClassName, modules_1db4bbca.metaColumn);
|
182
|
-
var SUBITEM_OFFSET = 30;
|
183
|
-
var COLLAPSIBLE_PARENT_OFFSET = 20;
|
184
|
-
var gap = level * SUBITEM_OFFSET + (parentCollapsible ? COLLAPSIBLE_PARENT_OFFSET : 0);
|
185
|
-
var metaColumnStyle = {
|
186
|
-
paddingLeft: "".concat(gap, "px")
|
187
|
-
};
|
188
|
-
var metaColumn = /*#__PURE__*/jsxs("div", {
|
189
|
-
className: metaColumnClasses,
|
190
|
-
style: metaColumnStyle,
|
191
|
-
children: [draggable && /*#__PURE__*/jsx(DragHandle, {
|
192
|
-
alwaysShowDragHandle: alwaysShowDragHandle,
|
193
|
-
dragHandleTitle: dragHandleTitle
|
194
|
-
}), selectable && /*#__PURE__*/jsx(Tooltip, {
|
195
|
-
title: checkboxTooltip,
|
196
|
-
children: /*#__PURE__*/jsx(Checkbox, {
|
197
|
-
"aria-labelledby": this.id,
|
198
|
-
className: showFocus ? 'ring-checkbox_focus' : '',
|
199
|
-
checked: selected,
|
200
|
-
onFocus: this.onCheckboxFocus,
|
201
|
-
onChange: this.onCheckboxChange,
|
202
|
-
tabIndex: -1
|
203
|
-
})
|
204
|
-
}), !selectable && showDisabledSelection && /*#__PURE__*/jsx(Tooltip, {
|
205
|
-
title: checkboxTooltip,
|
206
|
-
children: /*#__PURE__*/jsx(Checkbox, {
|
207
|
-
"aria-labelledby": this.id,
|
208
|
-
checked: selected,
|
209
|
-
disabled: true
|
210
|
-
})
|
211
|
-
}), collapsible && collapsed && /*#__PURE__*/jsx(Button, {
|
212
|
-
className: modules_1db4bbca.rowCollapseExpandButton,
|
213
|
-
icon: chevronRightIcon,
|
214
|
-
onClick: function onClick() {
|
215
|
-
return onExpand(item);
|
216
|
-
}
|
217
|
-
}), collapsible && !collapsed && /*#__PURE__*/jsx(Button, {
|
218
|
-
className: modules_1db4bbca.rowCollapseExpandButton,
|
219
|
-
icon: chevronDownIcon,
|
220
|
-
onClick: function onClick() {
|
221
|
-
return onCollapse(item);
|
222
|
-
}
|
223
|
-
})]
|
224
|
-
});
|
225
|
-
var columns = typeof columnProps === 'function' ? columnProps(item) : columnProps;
|
226
|
-
var colSpan = 0;
|
227
|
-
var cells = columns.map(function (column, index) {
|
228
|
-
var getValue = column.getValue || function () {
|
229
|
-
return item[column.id];
|
230
|
-
};
|
231
|
-
var getDataTest = column.getDataTest || function () {
|
232
|
-
return column.id;
|
233
|
-
};
|
234
|
-
var value = getValue(item, column);
|
235
|
-
var cellClasses = classNames({
|
236
|
-
[modules_1db4bbca.cellRight]: column.rightAlign
|
237
|
-
}, column.className);
|
238
|
-
var showMetaColumn = draggable || selectable || collapsible || showDisabledSelection || !!level;
|
239
|
-
colSpan += column.colSpan || 1;
|
240
|
-
if (colSpan > (maxColSpan || Infinity)) {
|
241
|
-
return null;
|
242
|
-
}
|
243
|
-
return /*#__PURE__*/jsxs(Cell, {
|
244
|
-
colSpan: column.colSpan,
|
245
|
-
className: cellClasses,
|
246
|
-
"data-test": getDataTest(item, column),
|
247
|
-
children: [index === 0 && showMetaColumn && metaColumn, value]
|
248
|
-
}, column.id);
|
249
|
-
});
|
250
|
-
return /*#__PURE__*/jsx("tr", _objectSpread2(_objectSpread2(_objectSpread2({
|
251
|
-
id: this.id,
|
252
|
-
ref: this.composedRowRef(this.rowRef, innerRef),
|
253
|
-
className: classes,
|
254
|
-
tabIndex: 0,
|
255
|
-
"data-test": joinDataTestAttributes('ring-table-row', dataTest)
|
256
|
-
}, testAttrs), restProps), {}, {
|
257
|
-
onMouseMove: this.onMouseEnter,
|
258
|
-
onClick: this.onClick,
|
259
|
-
onDoubleClick: this.onDoubleClick,
|
260
|
-
children: cells
|
261
|
-
}));
|
107
|
+
toggleSelection() {
|
108
|
+
const {
|
109
|
+
selectable,
|
110
|
+
selected,
|
111
|
+
onSelect,
|
112
|
+
item
|
113
|
+
} = this.props;
|
114
|
+
if (selectable) {
|
115
|
+
onSelect(item, !selected);
|
262
116
|
}
|
263
|
-
}
|
264
|
-
|
117
|
+
}
|
118
|
+
render() {
|
119
|
+
const _this$props = this.props,
|
120
|
+
{
|
121
|
+
item,
|
122
|
+
columns: columnProps,
|
123
|
+
selectable,
|
124
|
+
selected,
|
125
|
+
showFocus,
|
126
|
+
draggable,
|
127
|
+
alwaysShowDragHandle,
|
128
|
+
dragHandleTitle,
|
129
|
+
level,
|
130
|
+
collapsible,
|
131
|
+
parentCollapsible,
|
132
|
+
collapsed,
|
133
|
+
maxColSpan,
|
134
|
+
onCollapse,
|
135
|
+
onExpand,
|
136
|
+
showDisabledSelection,
|
137
|
+
onSelect,
|
138
|
+
checkboxTooltip,
|
139
|
+
innerRef,
|
140
|
+
focused,
|
141
|
+
autofocus,
|
142
|
+
onFocusReset,
|
143
|
+
onFocusRestore,
|
144
|
+
onHover,
|
145
|
+
className,
|
146
|
+
metaColumnClassName,
|
147
|
+
'data-test': dataTest
|
148
|
+
} = _this$props,
|
149
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
150
|
+
const classes = classNames(className, {
|
151
|
+
[modules_1db4bbca.row]: true,
|
152
|
+
[modules_1db4bbca.rowFocused]: showFocus,
|
153
|
+
[modules_1db4bbca.rowSelected]: selected
|
154
|
+
});
|
155
|
+
const testAttrs = {
|
156
|
+
'data-test-focused': showFocus || undefined,
|
157
|
+
'data-test-selected': selected || undefined
|
158
|
+
};
|
159
|
+
const metaColumnClasses = classNames(metaColumnClassName, modules_1db4bbca.metaColumn);
|
160
|
+
const SUBITEM_OFFSET = 30;
|
161
|
+
const COLLAPSIBLE_PARENT_OFFSET = 20;
|
162
|
+
const gap = level * SUBITEM_OFFSET + (parentCollapsible ? COLLAPSIBLE_PARENT_OFFSET : 0);
|
163
|
+
const metaColumnStyle = {
|
164
|
+
paddingLeft: "".concat(gap, "px")
|
165
|
+
};
|
166
|
+
const metaColumn = /*#__PURE__*/jsxs("div", {
|
167
|
+
className: metaColumnClasses,
|
168
|
+
style: metaColumnStyle,
|
169
|
+
children: [draggable && /*#__PURE__*/jsx(DragHandle, {
|
170
|
+
alwaysShowDragHandle: alwaysShowDragHandle,
|
171
|
+
dragHandleTitle: dragHandleTitle
|
172
|
+
}), selectable && /*#__PURE__*/jsx(Tooltip, {
|
173
|
+
title: checkboxTooltip,
|
174
|
+
children: /*#__PURE__*/jsx(Checkbox, {
|
175
|
+
"aria-labelledby": this.id,
|
176
|
+
className: showFocus ? 'ring-checkbox_focus' : '',
|
177
|
+
checked: selected,
|
178
|
+
onFocus: this.onCheckboxFocus,
|
179
|
+
onChange: this.onCheckboxChange,
|
180
|
+
tabIndex: -1
|
181
|
+
})
|
182
|
+
}), !selectable && showDisabledSelection && /*#__PURE__*/jsx(Tooltip, {
|
183
|
+
title: checkboxTooltip,
|
184
|
+
children: /*#__PURE__*/jsx(Checkbox, {
|
185
|
+
"aria-labelledby": this.id,
|
186
|
+
checked: selected,
|
187
|
+
disabled: true
|
188
|
+
})
|
189
|
+
}), collapsible && collapsed && /*#__PURE__*/jsx(Button, {
|
190
|
+
className: modules_1db4bbca.rowCollapseExpandButton,
|
191
|
+
icon: chevronRightIcon,
|
192
|
+
onClick: () => onExpand(item)
|
193
|
+
}), collapsible && !collapsed && /*#__PURE__*/jsx(Button, {
|
194
|
+
className: modules_1db4bbca.rowCollapseExpandButton,
|
195
|
+
icon: chevronDownIcon,
|
196
|
+
onClick: () => onCollapse(item)
|
197
|
+
})]
|
198
|
+
});
|
199
|
+
const columns = typeof columnProps === 'function' ? columnProps(item) : columnProps;
|
200
|
+
let colSpan = 0;
|
201
|
+
const cells = columns.map((column, index) => {
|
202
|
+
const getValue = column.getValue || (() => item[column.id]);
|
203
|
+
const getDataTest = column.getDataTest || (() => column.id);
|
204
|
+
const value = getValue(item, column);
|
205
|
+
const cellClasses = classNames({
|
206
|
+
[modules_1db4bbca.cellRight]: column.rightAlign
|
207
|
+
}, column.className);
|
208
|
+
const showMetaColumn = draggable || selectable || collapsible || showDisabledSelection || !!level;
|
209
|
+
colSpan += column.colSpan || 1;
|
210
|
+
if (colSpan > (maxColSpan || Infinity)) {
|
211
|
+
return null;
|
212
|
+
}
|
213
|
+
return /*#__PURE__*/jsxs(Cell, {
|
214
|
+
colSpan: column.colSpan,
|
215
|
+
className: cellClasses,
|
216
|
+
"data-test": getDataTest(item, column),
|
217
|
+
children: [index === 0 && showMetaColumn && metaColumn, value]
|
218
|
+
}, column.id);
|
219
|
+
});
|
220
|
+
return /*#__PURE__*/jsx("tr", _objectSpread2(_objectSpread2(_objectSpread2({
|
221
|
+
id: this.id,
|
222
|
+
ref: this.composedRowRef(this.rowRef, innerRef),
|
223
|
+
className: classes,
|
224
|
+
tabIndex: 0,
|
225
|
+
"data-test": joinDataTestAttributes('ring-table-row', dataTest)
|
226
|
+
}, testAttrs), restProps), {}, {
|
227
|
+
onMouseMove: this.onMouseEnter,
|
228
|
+
onClick: this.onClick,
|
229
|
+
onDoubleClick: this.onDoubleClick,
|
230
|
+
children: cells
|
231
|
+
}));
|
232
|
+
}
|
233
|
+
}
|
265
234
|
_defineProperty(Row, "defaultProps", {
|
266
235
|
selectable: true,
|
267
236
|
showFocus: false,
|
268
237
|
draggable: false,
|
269
238
|
alwaysShowDragHandle: false,
|
270
239
|
selected: false,
|
271
|
-
onHover:
|
272
|
-
onSelect:
|
273
|
-
onDoubleClick:
|
274
|
-
onClick:
|
240
|
+
onHover: () => {},
|
241
|
+
onSelect: () => {},
|
242
|
+
onDoubleClick: () => {},
|
243
|
+
onClick: () => {},
|
275
244
|
level: 0,
|
276
245
|
collapsible: false,
|
277
246
|
parentCollapsible: false,
|
278
247
|
collapsed: false,
|
279
|
-
onCollapse:
|
280
|
-
onExpand:
|
248
|
+
onCollapse: () => {},
|
249
|
+
onExpand: () => {}
|
281
250
|
});
|
282
251
|
Row.propTypes = {
|
283
252
|
className: PropTypes.string,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
2
2
|
|
3
3
|
function selectionAdapter(getSelection) {
|
4
4
|
return {
|
@@ -6,7 +6,7 @@ function selectionAdapter(getSelection) {
|
|
6
6
|
return getSelection().getActive().size;
|
7
7
|
},
|
8
8
|
get items() {
|
9
|
-
return
|
9
|
+
return [...getSelection().getActive()];
|
10
10
|
}
|
11
11
|
};
|
12
12
|
}
|