@jetbrains/ring-ui-built 6.0.31 → 6.0.32
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 -567
- package/components/_helpers/anchor.js +7 -6
- package/components/_helpers/button__classes.js +16 -14
- package/components/_helpers/caption.js +14 -20
- package/components/_helpers/card.js +95 -105
- package/components/_helpers/dialog__body-scroll-preventer.js +11 -19
- package/components/_helpers/icon__svg.js +22 -25
- package/components/_helpers/input.js +146 -177
- package/components/_helpers/query-assist__suggestions.js +74 -90
- package/components/_helpers/select__filter.js +48 -69
- package/components/_helpers/services-link.js +29 -37
- package/components/_helpers/sidebar.js +99 -107
- package/components/_helpers/tab-link.js +7 -7
- package/components/_helpers/theme.js +31 -40
- package/components/_helpers/title.js +57 -72
- package/components/alert/alert.js +150 -202
- package/components/alert/container.js +32 -41
- package/components/alert-service/alert-service.js +105 -170
- package/components/analytics/analytics.js +12 -22
- package/components/analytics/analytics__custom-plugin.js +54 -75
- package/components/auth/auth.js +4 -36
- package/components/auth/auth__core.js +746 -1471
- package/components/auth/background-flow.js +87 -127
- package/components/auth/down-notification.js +30 -73
- package/components/auth/iframe-flow.js +75 -133
- package/components/auth/request-builder.js +46 -82
- package/components/auth/response-parser.js +86 -116
- package/components/auth/storage.js +171 -334
- package/components/auth/token-validator.js +137 -242
- package/components/auth/window-flow.js +92 -134
- package/components/auth-dialog/auth-dialog.js +114 -172
- package/components/auth-dialog-service/auth-dialog-service.js +8 -31
- package/components/avatar/avatar-example-datauri.js +23 -1
- package/components/avatar/avatar.js +119 -152
- package/components/avatar/fallback-avatar.js +22 -38
- package/components/badge/badge.js +35 -45
- package/components/button/button.js +86 -107
- package/components/button-group/button-group.js +19 -33
- package/components/button-set/button-set.js +20 -32
- package/components/button-toolbar/button-toolbar.js +19 -31
- package/components/caret/caret.js +186 -220
- package/components/checkbox/checkbox.js +76 -101
- package/components/clipboard/clipboard-fallback.js +10 -10
- package/components/clipboard/clipboard.js +35 -132
- package/components/code/code.js +92 -166
- package/components/collapse/collapse-content.js +42 -64
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +12 -14
- package/components/collapse/collapse.js +11 -17
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +1 -3
- package/components/confirm/confirm.js +66 -104
- package/components/confirm-service/confirm-service.js +37 -59
- package/components/content-layout/content-layout.js +43 -64
- package/components/content-layout/sidebar.js +0 -1
- package/components/contenteditable/contenteditable.js +50 -59
- package/components/control-label/control-label.js +9 -9
- package/components/data-list/data-list.js +129 -182
- package/components/data-list/data-list.mock.js +2 -6
- package/components/data-list/item.js +143 -170
- package/components/data-list/selection.js +76 -136
- package/components/data-list/title.js +1 -12
- package/components/date-picker/consts.js +19 -26
- package/components/date-picker/date-input.js +113 -144
- package/components/date-picker/date-picker.js +227 -282
- package/components/date-picker/date-popup.js +350 -395
- package/components/date-picker/day.js +87 -116
- package/components/date-picker/month-names.js +43 -66
- package/components/date-picker/month-slider.js +51 -76
- package/components/date-picker/month.js +16 -25
- package/components/date-picker/months.js +43 -50
- package/components/date-picker/weekdays.js +12 -22
- package/components/date-picker/years.js +83 -110
- package/components/dialog/dialog.js +142 -190
- package/components/dialog/dialog__body-scroll-preventer.js +0 -4
- package/components/dropdown/anchor.js +0 -9
- package/components/dropdown/dropdown.js +182 -213
- package/components/dropdown-menu/dropdown-menu.js +71 -97
- package/components/editable-heading/editable-heading.js +75 -127
- package/components/error-bubble/error-bubble.js +31 -60
- package/components/error-message/error-message.js +39 -59
- package/components/footer/footer.js +27 -30
- package/components/global/compose.js +1 -10
- package/components/global/composeRefs.js +7 -12
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +15 -15
- package/components/global/data-tests.js +6 -14
- package/components/global/dom.js +47 -86
- package/components/global/focus-sensor-hoc.js +122 -132
- package/components/global/fuzzy-highlight.js +22 -36
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +4 -8
- package/components/global/inject-styles.js +10 -15
- package/components/global/listeners.js +27 -51
- package/components/global/memoize.js +6 -12
- package/components/global/normalize-indent.js +19 -50
- package/components/global/promise-with-timeout.js +6 -8
- package/components/global/prop-types.js +3 -5
- package/components/global/react-dom-renderer.js +28 -44
- package/components/global/react-render-adapter.js +1 -1
- package/components/global/rerender-hoc.js +12 -30
- package/components/global/schedule-raf.js +5 -6
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.js +0 -22
- package/components/global/trivial-template-tag.js +3 -10
- package/components/global/typescript-utils.js +2 -6
- package/components/global/url.js +20 -26
- package/components/global/use-event-callback.js +6 -4
- package/components/grid/col.js +35 -52
- package/components/grid/grid.js +17 -31
- package/components/grid/row.js +35 -47
- package/components/group/group.js +17 -25
- package/components/header/header.js +33 -78
- package/components/header/logo.js +20 -36
- package/components/header/profile.js +166 -199
- package/components/header/services-link.js +0 -4
- package/components/header/services.js +73 -116
- package/components/header/smart-profile.js +111 -203
- package/components/header/smart-services.js +62 -113
- package/components/header/tray-icon.js +21 -37
- package/components/header/tray.js +21 -32
- package/components/heading/heading.js +24 -25
- package/components/http/http.d.ts +1 -3
- package/components/http/http.js +203 -353
- package/components/http/http.mock.js +49 -101
- package/components/hub-source/hub-source.js +83 -190
- package/components/hub-source/hub-source__user.js +11 -44
- package/components/hub-source/hub-source__users-groups.js +37 -65
- package/components/i18n/i18n-context.js +7 -10
- package/components/i18n/i18n.js +7 -10
- package/components/icon/icon.js +76 -93
- package/components/icon/icon__svg.js +0 -8
- package/components/icon/index.js +0 -8
- package/components/input/input.js +0 -13
- package/components/island/adaptive-island-hoc.js +30 -43
- package/components/island/content.js +115 -132
- package/components/island/header.js +57 -70
- package/components/island/island.js +28 -40
- package/components/island-legacy/content-legacy.js +17 -25
- package/components/island-legacy/header-legacy.js +19 -27
- package/components/island-legacy/island-legacy.js +17 -25
- package/components/link/clickableLink.js +44 -59
- package/components/link/link.js +57 -68
- package/components/list/consts.js +2 -2
- package/components/list/list.js +611 -698
- package/components/list/list__custom.js +44 -62
- package/components/list/list__hint.js +10 -19
- package/components/list/list__item.js +133 -174
- package/components/list/list__link.js +37 -50
- package/components/list/list__separator.js +14 -24
- package/components/list/list__title.js +22 -32
- package/components/list/list__users-groups-source.js +54 -126
- package/components/loader/loader.js +43 -74
- package/components/loader/loader__core.js +198 -263
- package/components/loader-inline/loader-inline.js +23 -35
- package/components/loader-screen/loader-screen.js +25 -46
- package/components/login-dialog/login-dialog.js +111 -158
- package/components/login-dialog/service.js +8 -34
- package/components/markdown/markdown.js +15 -23
- package/components/message/message.js +161 -203
- package/components/old-browsers-message/old-browsers-message.js +11 -18
- package/components/old-browsers-message/old-browsers-message__stop.js +0 -7
- package/components/old-browsers-message/white-list.js +8 -16
- package/components/pager/pager.js +212 -271
- package/components/panel/panel.js +17 -25
- package/components/permissions/permissions.js +127 -172
- package/components/permissions/permissions__cache.js +194 -224
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +284 -343
- package/components/popup/popup.target.js +9 -8
- package/components/popup/position.js +96 -106
- package/components/popup-menu/popup-menu.js +44 -80
- package/components/progress-bar/progress-bar.js +87 -104
- package/components/query-assist/query-assist.js +838 -916
- package/components/query-assist/query-assist__suggestions.js +1 -30
- package/components/radio/radio.js +19 -34
- package/components/radio/radio__item.js +52 -69
- package/components/select/select.js +852 -957
- package/components/select/select__filter.js +0 -30
- package/components/select/select__popup.js +373 -487
- package/components/shortcuts/core.js +166 -217
- package/components/shortcuts/shortcut-title.js +6 -11
- package/components/shortcuts/shortcuts-hoc.js +19 -45
- package/components/shortcuts/shortcuts.js +50 -75
- package/components/slider/slider.js +99 -122
- package/components/slider/slider.utils.js +14 -24
- package/components/storage/storage.js +4 -33
- package/components/storage/storage__fallback.js +149 -224
- package/components/storage/storage__local.js +90 -153
- package/components/tab-trap/tab-trap.js +122 -153
- package/components/table/cell.js +14 -26
- package/components/table/disable-hover-hoc.js +33 -51
- package/components/table/header-cell.js +64 -89
- package/components/table/header.js +104 -132
- package/components/table/multitable.js +107 -125
- package/components/table/row-with-focus-sensor.js +25 -69
- package/components/table/row.js +175 -216
- package/components/table/selection-adapter.js +1 -3
- package/components/table/selection-shortcuts-hoc.js +180 -181
- package/components/table/selection.js +156 -226
- package/components/table/smart-table.js +50 -88
- package/components/table/table.js +289 -358
- package/components/tabs/collapsible-more.js +46 -79
- package/components/tabs/collapsible-tab.js +31 -38
- package/components/tabs/collapsible-tabs.js +88 -153
- package/components/tabs/custom-item.js +4 -2
- package/components/tabs/dumb-tabs.js +74 -117
- package/components/tabs/smart-tabs.js +29 -69
- package/components/tabs/tab-link.js +1 -5
- package/components/tabs/tab.js +19 -31
- package/components/tabs/tabs.js +0 -31
- package/components/tag/tag.js +133 -173
- package/components/tags-input/tags-input.js +329 -427
- package/components/tags-list/tags-list.js +57 -78
- package/components/text/text.js +28 -39
- package/components/toggle/toggle.js +56 -70
- package/components/tooltip/tooltip.js +146 -190
- package/components/user-agreement/service.js +228 -371
- package/components/user-agreement/toolbox.eula.js +160 -1
- package/components/user-agreement/user-agreement.js +85 -120
- package/components/user-card/card.js +0 -29
- package/components/user-card/smart-user-card-tooltip.js +51 -111
- package/components/user-card/tooltip.js +47 -84
- package/components/user-card/user-card.js +0 -29
- package/package.json +1 -1
@@ -1,77 +1,56 @@
|
|
1
|
-
import { _ as
|
2
|
-
import '
|
3
|
-
import 'core-js/modules/es.array.filter.js';
|
4
|
-
import 'core-js/modules/es.object.to-string.js';
|
5
|
-
import 'core-js/modules/es.promise.js';
|
6
|
-
import React, { cloneElement, Component } from 'react';
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { Component, cloneElement } from 'react';
|
7
3
|
import PropTypes from 'prop-types';
|
8
4
|
import classNames from 'classnames';
|
9
5
|
import { m as modules_b8a9dd4f, S as Sidebar } from '../_helpers/sidebar.js';
|
10
6
|
import 'react-waypoint';
|
11
7
|
|
12
|
-
var _excluded = ["children", "className", "contentClassName", "responsive"];
|
13
8
|
/**
|
14
9
|
* @name Content Layout
|
15
10
|
*/
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
11
|
+
class ContentLayout extends Component {
|
12
|
+
static propTypes = {
|
13
|
+
children: PropTypes.node,
|
14
|
+
className: PropTypes.string,
|
15
|
+
contentClassName: PropTypes.string,
|
16
|
+
responsive: PropTypes.bool
|
17
|
+
};
|
18
|
+
static defaultProps = {
|
19
|
+
responsive: true
|
20
|
+
};
|
21
|
+
state = {
|
22
|
+
contentNode: null
|
23
|
+
};
|
24
|
+
saveContentNode = contentNode => {
|
25
|
+
this.setState({
|
26
|
+
contentNode
|
26
27
|
});
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
};
|
29
|
+
render() {
|
30
|
+
const {
|
31
|
+
children,
|
32
|
+
className,
|
33
|
+
contentClassName,
|
34
|
+
responsive,
|
35
|
+
...restProps
|
36
|
+
} = this.props;
|
37
|
+
const classes = classNames(modules_b8a9dd4f.contentLayout, className, {
|
38
|
+
[modules_b8a9dd4f.contentLayoutResponsive]: responsive
|
31
39
|
});
|
32
|
-
|
40
|
+
const contentClasses = classNames(modules_b8a9dd4f.contentLayoutContent, contentClassName);
|
41
|
+
const childrenArray = React.Children.toArray(children);
|
42
|
+
const sidebarChild = childrenArray.filter(child => child != null && typeof child === 'object' && 'type' in child && child.type === Sidebar)[0];
|
43
|
+
const sidebar = sidebarChild && /*#__PURE__*/cloneElement(sidebarChild, {
|
44
|
+
contentNode: this.state.contentNode
|
45
|
+
});
|
46
|
+
const contentChildren = childrenArray.filter(child => child !== sidebarChild);
|
47
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
|
48
|
+
className: classes
|
49
|
+
}), sidebar, /*#__PURE__*/React.createElement("main", {
|
50
|
+
className: contentClasses,
|
51
|
+
ref: this.saveContentNode
|
52
|
+
}, contentChildren));
|
33
53
|
}
|
34
|
-
|
35
|
-
return _createClass(ContentLayout, [{
|
36
|
-
key: "render",
|
37
|
-
value: function render() {
|
38
|
-
var _this$props = this.props,
|
39
|
-
children = _this$props.children,
|
40
|
-
className = _this$props.className,
|
41
|
-
contentClassName = _this$props.contentClassName,
|
42
|
-
responsive = _this$props.responsive,
|
43
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
44
|
-
var classes = classNames(modules_b8a9dd4f.contentLayout, className, {
|
45
|
-
[modules_b8a9dd4f.contentLayoutResponsive]: responsive
|
46
|
-
});
|
47
|
-
var contentClasses = classNames(modules_b8a9dd4f.contentLayoutContent, contentClassName);
|
48
|
-
var childrenArray = React.Children.toArray(children);
|
49
|
-
var sidebarChild = childrenArray.filter(function (child) {
|
50
|
-
return child != null && typeof child === 'object' && 'type' in child && child.type === Sidebar;
|
51
|
-
})[0];
|
52
|
-
var sidebar = sidebarChild && /*#__PURE__*/cloneElement(sidebarChild, {
|
53
|
-
contentNode: this.state.contentNode
|
54
|
-
});
|
55
|
-
var contentChildren = childrenArray.filter(function (child) {
|
56
|
-
return child !== sidebarChild;
|
57
|
-
});
|
58
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
|
59
|
-
className: classes
|
60
|
-
}), sidebar, /*#__PURE__*/React.createElement("main", {
|
61
|
-
className: contentClasses,
|
62
|
-
ref: this.saveContentNode
|
63
|
-
}, contentChildren));
|
64
|
-
}
|
65
|
-
}]);
|
66
|
-
}(Component);
|
67
|
-
_defineProperty(ContentLayout, "propTypes", {
|
68
|
-
children: PropTypes.node,
|
69
|
-
className: PropTypes.string,
|
70
|
-
contentClassName: PropTypes.string,
|
71
|
-
responsive: PropTypes.bool
|
72
|
-
});
|
73
|
-
_defineProperty(ContentLayout, "defaultProps", {
|
74
|
-
responsive: true
|
75
|
-
});
|
54
|
+
}
|
76
55
|
|
77
56
|
export { Sidebar, ContentLayout as default };
|
@@ -1,15 +1,13 @@
|
|
1
|
-
import { _ as
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import React, { Component } from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import { renderToStaticMarkup } from 'react-dom/server';
|
5
5
|
|
6
|
-
var _excluded = ["__html", "onComponentUpdate", "disabled", "tabIndex", "inputRef"],
|
7
|
-
_excluded2 = ["children"];
|
8
6
|
/**
|
9
7
|
* @name ContentEditable
|
10
8
|
*/
|
11
9
|
function noop() {}
|
12
|
-
|
10
|
+
const commonPropTypes = {
|
13
11
|
disabled: PropTypes.bool,
|
14
12
|
tabIndex: PropTypes.number,
|
15
13
|
componentDidUpdate: PropTypes.func,
|
@@ -17,66 +15,59 @@ var commonPropTypes = {
|
|
17
15
|
className: PropTypes.string,
|
18
16
|
inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
19
17
|
};
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
class ContentEditableBase extends Component {
|
19
|
+
static propTypes = {
|
20
|
+
...commonPropTypes,
|
21
|
+
__html: PropTypes.string
|
22
|
+
};
|
23
|
+
static defaultProps = {
|
24
|
+
disabled: false,
|
25
|
+
tabIndex: 0,
|
26
|
+
onInput: noop,
|
27
|
+
onComponentUpdate: noop
|
28
|
+
};
|
29
|
+
shouldComponentUpdate(nextProps) {
|
30
|
+
return nextProps.disabled !== this.props.disabled || nextProps.__html !== this.props.__html;
|
24
31
|
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
}
|
58
|
-
}));
|
59
|
-
}
|
60
|
-
}]);
|
61
|
-
}(Component);
|
62
|
-
_defineProperty(ContentEditableBase, "propTypes", _objectSpread2(_objectSpread2({}, commonPropTypes), {}, {
|
63
|
-
__html: PropTypes.string
|
64
|
-
}));
|
65
|
-
_defineProperty(ContentEditableBase, "defaultProps", {
|
66
|
-
disabled: false,
|
67
|
-
tabIndex: 0,
|
68
|
-
onInput: noop,
|
69
|
-
onComponentUpdate: noop
|
70
|
-
});
|
71
|
-
var ContentEditable = function ContentEditable(_ref) {
|
72
|
-
var children = _ref.children,
|
73
|
-
props = _objectWithoutProperties(_ref, _excluded2);
|
32
|
+
componentDidUpdate(prevProps) {
|
33
|
+
this.props.onComponentUpdate(prevProps);
|
34
|
+
}
|
35
|
+
render() {
|
36
|
+
const {
|
37
|
+
__html,
|
38
|
+
onComponentUpdate,
|
39
|
+
disabled,
|
40
|
+
tabIndex,
|
41
|
+
inputRef,
|
42
|
+
...props
|
43
|
+
} = this.props;
|
44
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
45
|
+
ref: inputRef
|
46
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
47
|
+
// @ts-ignore
|
48
|
+
,
|
49
|
+
disabled: disabled,
|
50
|
+
role: "textbox",
|
51
|
+
tabIndex: disabled ? undefined : tabIndex,
|
52
|
+
contentEditable: !this.props.disabled,
|
53
|
+
dangerouslySetInnerHTML: {
|
54
|
+
__html
|
55
|
+
}
|
56
|
+
}));
|
57
|
+
}
|
58
|
+
}
|
59
|
+
const ContentEditable = _ref => {
|
60
|
+
let {
|
61
|
+
children,
|
62
|
+
...props
|
63
|
+
} = _ref;
|
74
64
|
return /*#__PURE__*/React.createElement(ContentEditableBase, _extends({}, props, {
|
75
65
|
__html: renderToStaticMarkup(children)
|
76
66
|
}));
|
77
67
|
};
|
78
|
-
ContentEditable.propTypes =
|
68
|
+
ContentEditable.propTypes = {
|
69
|
+
...commonPropTypes,
|
79
70
|
children: PropTypes.node
|
80
|
-
}
|
71
|
+
};
|
81
72
|
|
82
73
|
export { ContentEditable as default };
|
@@ -1,26 +1,26 @@
|
|
1
|
-
import {
|
1
|
+
import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import React from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import classNames from 'classnames';
|
5
5
|
|
6
6
|
var modules_9eb96a10 = {"label":"label_rui_fe46","formLabel":"formLabel_rui_fe46","secondaryLabel":"secondaryLabel_rui_fe46","disabledLabel":"disabledLabel_rui_fe46"};
|
7
7
|
|
8
|
-
var _excluded = ["children", "type", "disabled"];
|
9
8
|
var LabelType;
|
10
9
|
(function (LabelType) {
|
11
10
|
LabelType["SECONDARY"] = "secondary";
|
12
11
|
LabelType["FORM"] = "form";
|
13
12
|
})(LabelType || (LabelType = {}));
|
14
|
-
|
13
|
+
const classNameByType = {
|
15
14
|
[LabelType.SECONDARY]: modules_9eb96a10.secondaryLabel,
|
16
15
|
[LabelType.FORM]: modules_9eb96a10.formLabel
|
17
16
|
};
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
type =
|
22
|
-
disabled
|
23
|
-
rest
|
17
|
+
const ControlLabel = _ref => {
|
18
|
+
let {
|
19
|
+
children,
|
20
|
+
type = LabelType.SECONDARY,
|
21
|
+
disabled,
|
22
|
+
...rest
|
23
|
+
} = _ref;
|
24
24
|
return /*#__PURE__*/React.createElement("label", _extends({
|
25
25
|
className: classNames(modules_9eb96a10.label, classNameByType[type], {
|
26
26
|
[modules_9eb96a10.disabledLabel]: disabled
|
@@ -1,7 +1,4 @@
|
|
1
|
-
import
|
2
|
-
import 'core-js/modules/es.array.concat.js';
|
3
|
-
import 'core-js/modules/es.array.map.js';
|
4
|
-
import React, { PureComponent, Component } from 'react';
|
1
|
+
import React, { Component, PureComponent } from 'react';
|
5
2
|
import PropTypes from 'prop-types';
|
6
3
|
import classNames from 'classnames';
|
7
4
|
import focusSensorHOC from '../global/focus-sensor-hoc.js';
|
@@ -14,35 +11,16 @@ import { refObject } from '../global/prop-types.js';
|
|
14
11
|
import Item, { moreLessButtonStates } from './item.js';
|
15
12
|
import { m as modules_09d014b4 } from '../_helpers/title.js';
|
16
13
|
import Selection from './selection.js';
|
14
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
17
15
|
import '../global/composeRefs.js';
|
18
|
-
import 'core-js/modules/es.object.to-string.js';
|
19
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
20
16
|
import '../table/selection.js';
|
21
|
-
import 'core-js/modules/es.array.filter.js';
|
22
|
-
import 'core-js/modules/es.array.index-of.js';
|
23
|
-
import 'core-js/modules/es.array.iterator.js';
|
24
|
-
import 'core-js/modules/es.set.js';
|
25
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
26
|
-
import 'core-js/modules/es.array.includes.js';
|
27
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
28
17
|
import '../shortcuts/core.js';
|
29
|
-
import 'core-js/modules/es.array.find-index.js';
|
30
|
-
import 'core-js/modules/es.array.slice.js';
|
31
|
-
import 'core-js/modules/es.array.splice.js';
|
32
|
-
import 'core-js/modules/es.object.assign.js';
|
33
|
-
import 'core-js/modules/es.regexp.exec.js';
|
34
|
-
import 'core-js/modules/es.string.includes.js';
|
35
|
-
import 'core-js/modules/es.string.match.js';
|
36
18
|
import 'combokeys';
|
37
19
|
import '../global/sniffer.js';
|
38
20
|
import 'sniffr';
|
39
21
|
import '../global/data-tests.js';
|
40
|
-
import 'core-js/modules/es.array.reduce.js';
|
41
|
-
import 'core-js/modules/es.object.entries.js';
|
42
22
|
import '../loader/loader__core.js';
|
43
|
-
import 'core-js/modules/es.array.fill.js';
|
44
23
|
import '../global/dom.js';
|
45
|
-
import 'core-js/modules/es.string.split.js';
|
46
24
|
import '@jetbrains/icons/chevron-right';
|
47
25
|
import '@jetbrains/icons/chevron-down';
|
48
26
|
import '../link/link.js';
|
@@ -56,152 +34,136 @@ import '../icon/icon.js';
|
|
56
34
|
import 'util-deprecate';
|
57
35
|
import '../icon/icon__constants.js';
|
58
36
|
import '../_helpers/icon__svg.js';
|
59
|
-
import 'core-js/modules/es.string.replace.js';
|
60
|
-
import 'core-js/modules/es.string.starts-with.js';
|
61
37
|
import '../global/memoize.js';
|
62
|
-
import 'core-js/modules/es.map.js';
|
63
|
-
import 'core-js/modules/es.weak-map.js';
|
64
38
|
import '../global/controls-height.js';
|
65
39
|
import '../_helpers/button__classes.js';
|
66
40
|
import '../checkbox/checkbox.js';
|
67
41
|
import '@jetbrains/icons/checkmark-12px';
|
68
42
|
import '@jetbrains/icons/remove-12px';
|
69
|
-
import 'core-js/modules/es.array.find.js';
|
70
43
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
44
|
+
class DataList extends PureComponent {
|
45
|
+
static defaultProps = {
|
46
|
+
loading: false,
|
47
|
+
onItemMoreLess: () => {},
|
48
|
+
itemMoreLessState: () => moreLessButtonStates.UNUSED,
|
49
|
+
remoteSelection: false
|
50
|
+
};
|
51
|
+
componentDidUpdate(prevProps) {
|
52
|
+
const {
|
53
|
+
data,
|
54
|
+
selection,
|
55
|
+
onSelect,
|
56
|
+
selectable
|
57
|
+
} = this.props;
|
58
|
+
if (data !== prevProps.data && !prevProps.remoteSelection) {
|
59
|
+
onSelect(selection.cloneWith({
|
60
|
+
data
|
61
|
+
}));
|
62
|
+
}
|
63
|
+
if (!selectable && prevProps.selectable) {
|
64
|
+
onSelect(selection.resetSelection());
|
77
65
|
}
|
78
|
-
_this = _callSuper(this, DataList, [].concat(args));
|
79
|
-
_defineProperty(_this, "shortcutsScope", getUID('ring-data-list-'));
|
80
|
-
_defineProperty(_this, "onItemFocus", function (item) {
|
81
|
-
var _this$props = _this.props,
|
82
|
-
selection = _this$props.selection,
|
83
|
-
onSelect = _this$props.onSelect;
|
84
|
-
onSelect(selection.focus(item));
|
85
|
-
});
|
86
|
-
_defineProperty(_this, "onItemSelect", function (item, selected) {
|
87
|
-
var _this$props2 = _this.props,
|
88
|
-
selection = _this$props2.selection,
|
89
|
-
onSelect = _this$props2.onSelect;
|
90
|
-
if (selected) {
|
91
|
-
onSelect(selection.select(item));
|
92
|
-
} else {
|
93
|
-
onSelect(selection.deselect(item));
|
94
|
-
}
|
95
|
-
});
|
96
|
-
_defineProperty(_this, "onEqualPress", function () {
|
97
|
-
var _this$props3 = _this.props,
|
98
|
-
selection = _this$props3.selection,
|
99
|
-
itemFormatter = _this$props3.itemFormatter;
|
100
|
-
var focused = selection.getFocused();
|
101
|
-
if (focused == null) {
|
102
|
-
throw new Error('No focused item');
|
103
|
-
}
|
104
|
-
var item = itemFormatter(focused);
|
105
|
-
if (item.collapsed) {
|
106
|
-
var _item$onExpand;
|
107
|
-
(_item$onExpand = item.onExpand) === null || _item$onExpand === void 0 || _item$onExpand.call(item);
|
108
|
-
} else {
|
109
|
-
var _item$onCollapse;
|
110
|
-
(_item$onCollapse = item.onCollapse) === null || _item$onCollapse === void 0 || _item$onCollapse.call(item);
|
111
|
-
}
|
112
|
-
});
|
113
|
-
_defineProperty(_this, "shortcutsMap", {
|
114
|
-
'=': _this.onEqualPress
|
115
|
-
});
|
116
|
-
return _this;
|
117
66
|
}
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
67
|
+
shortcutsScope = getUID('ring-data-list-');
|
68
|
+
onItemFocus = item => {
|
69
|
+
const {
|
70
|
+
selection,
|
71
|
+
onSelect
|
72
|
+
} = this.props;
|
73
|
+
onSelect(selection.focus(item));
|
74
|
+
};
|
75
|
+
onItemSelect = (item, selected) => {
|
76
|
+
const {
|
77
|
+
selection,
|
78
|
+
onSelect
|
79
|
+
} = this.props;
|
80
|
+
if (selected) {
|
81
|
+
onSelect(selection.select(item));
|
82
|
+
} else {
|
83
|
+
onSelect(selection.deselect(item));
|
135
84
|
}
|
136
|
-
}
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
[modules_09d014b4.dataList]: true,
|
152
|
-
[modules_09d014b4.disabledHover]: disabledHover,
|
153
|
-
[modules_09d014b4.multiSelection]: selection.getSelected().size > 0
|
154
|
-
});
|
155
|
-
return /*#__PURE__*/React.createElement("div", {
|
156
|
-
className: modules_09d014b4.dataListWrapper,
|
157
|
-
"data-test": "ring-data-list",
|
158
|
-
ref: innerRef
|
159
|
-
}, focused && /*#__PURE__*/React.createElement(Shortcuts, {
|
160
|
-
map: shortcutsMap,
|
161
|
-
scope: this.shortcutsScope
|
162
|
-
}), /*#__PURE__*/React.createElement("ul", {
|
163
|
-
className: classes
|
164
|
-
}, data.map(function (model) {
|
165
|
-
var _this2$props$itemMore, _this2$props;
|
166
|
-
var item = itemFormatter(model);
|
167
|
-
var id = item.id,
|
168
|
-
key = item.key,
|
169
|
-
title = item.title,
|
170
|
-
items = item.items;
|
171
|
-
var showMoreLessButton = (_this2$props$itemMore = (_this2$props = _this2.props).itemMoreLessState) === null || _this2$props$itemMore === void 0 ? void 0 : _this2$props$itemMore.call(_this2$props, item);
|
172
|
-
return /*#__PURE__*/React.createElement(Item, {
|
173
|
-
key: key || id,
|
174
|
-
item: model,
|
175
|
-
title: title,
|
176
|
-
items: items,
|
177
|
-
itemFormatter: itemFormatter,
|
178
|
-
collapsible: item.collapsible,
|
179
|
-
collapsed: item.collapsed,
|
180
|
-
onCollapse: item.onCollapse,
|
181
|
-
onExpand: item.onExpand,
|
182
|
-
showFocus: selection.isFocused(model),
|
183
|
-
onFocus: _this2.onItemFocus,
|
184
|
-
selection: selection,
|
185
|
-
selectable: item.selectable,
|
186
|
-
selected: selection.isSelected(model),
|
187
|
-
onSelect: _this2.onItemSelect,
|
188
|
-
showMoreLessButton: showMoreLessButton,
|
189
|
-
onItemMoreLess: _this2.props.onItemMoreLess
|
190
|
-
});
|
191
|
-
})), loading && /*#__PURE__*/React.createElement("div", {
|
192
|
-
className: data.length > 0 ? modules_09d014b4.loadingOverlay : undefined
|
193
|
-
}, /*#__PURE__*/React.createElement(Loader, null)));
|
85
|
+
};
|
86
|
+
onEqualPress = () => {
|
87
|
+
const {
|
88
|
+
selection,
|
89
|
+
itemFormatter
|
90
|
+
} = this.props;
|
91
|
+
const focused = selection.getFocused();
|
92
|
+
if (focused == null) {
|
93
|
+
throw new Error('No focused item');
|
94
|
+
}
|
95
|
+
const item = itemFormatter(focused);
|
96
|
+
if (item.collapsed) {
|
97
|
+
item.onExpand?.();
|
98
|
+
} else {
|
99
|
+
item.onCollapse?.();
|
194
100
|
}
|
195
|
-
}
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
101
|
+
};
|
102
|
+
shortcutsMap = {
|
103
|
+
'=': this.onEqualPress
|
104
|
+
};
|
105
|
+
render() {
|
106
|
+
const {
|
107
|
+
data,
|
108
|
+
className,
|
109
|
+
loading,
|
110
|
+
selection,
|
111
|
+
disabledHover,
|
112
|
+
itemFormatter,
|
113
|
+
focused,
|
114
|
+
innerRef
|
115
|
+
} = this.props;
|
116
|
+
const shortcutsMap = {
|
117
|
+
...this.shortcutsMap,
|
118
|
+
...this.props.shortcutsMap
|
119
|
+
};
|
120
|
+
const classes = classNames(className, {
|
121
|
+
[modules_09d014b4.dataList]: true,
|
122
|
+
[modules_09d014b4.disabledHover]: disabledHover,
|
123
|
+
[modules_09d014b4.multiSelection]: selection.getSelected().size > 0
|
124
|
+
});
|
125
|
+
return /*#__PURE__*/React.createElement("div", {
|
126
|
+
className: modules_09d014b4.dataListWrapper,
|
127
|
+
"data-test": "ring-data-list",
|
128
|
+
ref: innerRef
|
129
|
+
}, focused && /*#__PURE__*/React.createElement(Shortcuts, {
|
130
|
+
map: shortcutsMap,
|
131
|
+
scope: this.shortcutsScope
|
132
|
+
}), /*#__PURE__*/React.createElement("ul", {
|
133
|
+
className: classes
|
134
|
+
}, data.map(model => {
|
135
|
+
const item = itemFormatter(model);
|
136
|
+
const {
|
137
|
+
id,
|
138
|
+
key,
|
139
|
+
title,
|
140
|
+
items
|
141
|
+
} = item;
|
142
|
+
const showMoreLessButton = this.props.itemMoreLessState?.(item);
|
143
|
+
return /*#__PURE__*/React.createElement(Item, {
|
144
|
+
key: key || id,
|
145
|
+
item: model,
|
146
|
+
title: title,
|
147
|
+
items: items,
|
148
|
+
itemFormatter: itemFormatter,
|
149
|
+
collapsible: item.collapsible,
|
150
|
+
collapsed: item.collapsed,
|
151
|
+
onCollapse: item.onCollapse,
|
152
|
+
onExpand: item.onExpand,
|
153
|
+
showFocus: selection.isFocused(model),
|
154
|
+
onFocus: this.onItemFocus,
|
155
|
+
selection: selection,
|
156
|
+
selectable: item.selectable,
|
157
|
+
selected: selection.isSelected(model),
|
158
|
+
onSelect: this.onItemSelect,
|
159
|
+
showMoreLessButton: showMoreLessButton,
|
160
|
+
onItemMoreLess: this.props.onItemMoreLess
|
161
|
+
});
|
162
|
+
})), loading && /*#__PURE__*/React.createElement("div", {
|
163
|
+
className: data.length > 0 ? modules_09d014b4.loadingOverlay : undefined
|
164
|
+
}, /*#__PURE__*/React.createElement(Loader, null)));
|
165
|
+
}
|
166
|
+
}
|
205
167
|
DataList.propTypes = {
|
206
168
|
className: PropTypes.string,
|
207
169
|
data: PropTypes.array.isRequired,
|
@@ -218,30 +180,15 @@ DataList.propTypes = {
|
|
218
180
|
onSelect: PropTypes.func.isRequired,
|
219
181
|
remoteSelection: PropTypes.bool
|
220
182
|
};
|
221
|
-
|
222
|
-
return disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(DataList)));
|
223
|
-
};
|
183
|
+
const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(DataList)));
|
224
184
|
// eslint-disable-next-line react/no-multi-comp
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
}
|
232
|
-
_this3 = _callSuper(this, DataListContainer, [].concat(args));
|
233
|
-
// https://stackoverflow.com/a/53882322/6304152
|
234
|
-
_defineProperty(_this3, "DataList", getContainer());
|
235
|
-
return _this3;
|
185
|
+
class DataListContainer extends Component {
|
186
|
+
static propTypes = getContainer().propTypes;
|
187
|
+
// https://stackoverflow.com/a/53882322/6304152
|
188
|
+
DataList = getContainer();
|
189
|
+
render() {
|
190
|
+
return /*#__PURE__*/React.createElement(this.DataList, this.props);
|
236
191
|
}
|
237
|
-
|
238
|
-
return _createClass(DataListContainer, [{
|
239
|
-
key: "render",
|
240
|
-
value: function render() {
|
241
|
-
return /*#__PURE__*/React.createElement(this.DataList, this.props);
|
242
|
-
}
|
243
|
-
}]);
|
244
|
-
}(Component);
|
245
|
-
_defineProperty(DataListContainer, "propTypes", getContainer().propTypes);
|
192
|
+
}
|
246
193
|
|
247
194
|
export { DataListContainer as default };
|