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