@jetbrains/ring-ui-built 6.0.32 → 6.0.33
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 +567 -1
- package/components/_helpers/anchor.js +6 -7
- package/components/_helpers/button__classes.js +14 -16
- package/components/_helpers/caption.js +20 -14
- package/components/_helpers/card.js +105 -95
- package/components/_helpers/dialog__body-scroll-preventer.js +19 -11
- package/components/_helpers/icon__svg.js +25 -22
- package/components/_helpers/input.js +177 -146
- package/components/_helpers/query-assist__suggestions.js +90 -74
- package/components/_helpers/select__filter.js +69 -48
- package/components/_helpers/services-link.js +37 -29
- package/components/_helpers/sidebar.js +107 -99
- package/components/_helpers/tab-link.js +7 -7
- package/components/_helpers/theme.js +40 -31
- package/components/_helpers/title.js +72 -57
- package/components/alert/alert.js +202 -150
- package/components/alert/container.js +41 -32
- package/components/alert-service/alert-service.js +170 -105
- package/components/analytics/analytics.js +22 -12
- package/components/analytics/analytics__custom-plugin.js +75 -54
- package/components/auth/auth.js +36 -4
- package/components/auth/auth__core.js +1471 -746
- package/components/auth/background-flow.js +127 -87
- package/components/auth/down-notification.js +73 -30
- package/components/auth/iframe-flow.js +133 -75
- package/components/auth/request-builder.js +82 -46
- package/components/auth/response-parser.js +116 -86
- package/components/auth/storage.js +334 -171
- package/components/auth/token-validator.js +242 -137
- package/components/auth/window-flow.js +134 -92
- package/components/auth-dialog/auth-dialog.js +172 -114
- package/components/auth-dialog-service/auth-dialog-service.js +31 -8
- package/components/avatar/avatar-example-datauri.js +1 -23
- package/components/avatar/avatar.js +152 -119
- package/components/avatar/fallback-avatar.js +38 -22
- package/components/badge/badge.js +45 -35
- package/components/button/button.js +107 -86
- package/components/button-group/button-group.js +33 -19
- package/components/button-set/button-set.js +32 -20
- package/components/button-toolbar/button-toolbar.js +31 -19
- package/components/caret/caret.js +220 -186
- package/components/checkbox/checkbox.js +101 -76
- package/components/clipboard/clipboard-fallback.js +10 -10
- package/components/clipboard/clipboard.js +132 -35
- package/components/code/code.js +166 -92
- package/components/collapse/collapse-content.js +64 -42
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +14 -12
- package/components/collapse/collapse.js +17 -11
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +3 -1
- package/components/confirm/confirm.js +104 -66
- package/components/confirm-service/confirm-service.js +59 -37
- package/components/content-layout/content-layout.js +64 -43
- package/components/content-layout/sidebar.js +1 -0
- package/components/contenteditable/contenteditable.js +59 -50
- package/components/control-label/control-label.js +9 -9
- package/components/data-list/data-list.js +182 -129
- package/components/data-list/data-list.mock.js +6 -2
- package/components/data-list/item.js +170 -143
- package/components/data-list/selection.js +136 -76
- package/components/data-list/title.js +12 -1
- package/components/date-picker/consts.js +26 -19
- package/components/date-picker/date-input.js +144 -113
- package/components/date-picker/date-picker.js +282 -227
- package/components/date-picker/date-popup.js +395 -350
- package/components/date-picker/day.js +116 -87
- package/components/date-picker/month-names.js +66 -43
- package/components/date-picker/month-slider.js +76 -51
- package/components/date-picker/month.js +25 -16
- package/components/date-picker/months.js +50 -43
- package/components/date-picker/weekdays.js +22 -12
- package/components/date-picker/years.js +110 -83
- package/components/dialog/dialog.js +190 -142
- package/components/dialog/dialog__body-scroll-preventer.js +4 -0
- package/components/dropdown/anchor.js +9 -0
- package/components/dropdown/dropdown.js +213 -182
- package/components/dropdown-menu/dropdown-menu.js +97 -71
- package/components/editable-heading/editable-heading.js +127 -75
- package/components/error-bubble/error-bubble.js +60 -31
- package/components/error-message/error-message.js +59 -39
- package/components/footer/footer.js +30 -27
- package/components/global/compose.js +10 -1
- package/components/global/composeRefs.js +12 -7
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +15 -15
- package/components/global/data-tests.js +14 -6
- package/components/global/dom.js +86 -47
- package/components/global/focus-sensor-hoc.js +132 -122
- package/components/global/fuzzy-highlight.js +36 -22
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +8 -4
- package/components/global/inject-styles.js +15 -10
- package/components/global/listeners.js +51 -27
- package/components/global/memoize.js +12 -6
- package/components/global/normalize-indent.js +50 -19
- package/components/global/promise-with-timeout.js +8 -6
- package/components/global/prop-types.js +5 -3
- package/components/global/react-dom-renderer.js +44 -28
- package/components/global/react-render-adapter.js +1 -1
- package/components/global/rerender-hoc.js +30 -12
- package/components/global/schedule-raf.js +6 -5
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.js +22 -0
- package/components/global/trivial-template-tag.js +10 -3
- package/components/global/typescript-utils.js +6 -2
- package/components/global/url.js +26 -20
- package/components/global/use-event-callback.js +4 -6
- package/components/grid/col.js +52 -35
- package/components/grid/grid.js +31 -17
- package/components/grid/row.js +47 -35
- package/components/group/group.js +25 -17
- package/components/header/header.js +78 -33
- package/components/header/logo.js +36 -20
- package/components/header/profile.js +199 -166
- package/components/header/services-link.js +4 -0
- package/components/header/services.js +116 -73
- package/components/header/smart-profile.js +203 -111
- package/components/header/smart-services.js +113 -62
- package/components/header/tray-icon.js +37 -21
- package/components/header/tray.js +32 -21
- package/components/heading/heading.js +25 -24
- package/components/http/http.js +353 -203
- package/components/http/http.mock.js +101 -49
- package/components/hub-source/hub-source.js +190 -83
- package/components/hub-source/hub-source__user.js +44 -11
- package/components/hub-source/hub-source__users-groups.js +65 -37
- package/components/i18n/i18n-context.js +10 -7
- package/components/i18n/i18n.js +10 -7
- package/components/icon/icon.js +93 -76
- package/components/icon/icon__svg.js +8 -0
- package/components/icon/index.js +8 -0
- package/components/input/input.js +13 -0
- package/components/island/adaptive-island-hoc.js +43 -30
- package/components/island/content.js +132 -115
- package/components/island/header.js +70 -57
- package/components/island/island.js +40 -28
- package/components/island-legacy/content-legacy.js +25 -17
- package/components/island-legacy/header-legacy.js +27 -19
- package/components/island-legacy/island-legacy.js +25 -17
- package/components/link/clickableLink.js +59 -44
- package/components/link/link.js +68 -57
- package/components/list/consts.js +2 -2
- package/components/list/list.js +698 -611
- package/components/list/list__custom.js +62 -44
- package/components/list/list__hint.js +19 -10
- package/components/list/list__item.js +174 -133
- package/components/list/list__link.js +50 -37
- package/components/list/list__separator.js +24 -14
- package/components/list/list__title.js +32 -22
- package/components/list/list__users-groups-source.js +126 -54
- package/components/loader/loader.js +74 -43
- package/components/loader/loader__core.js +263 -198
- package/components/loader-inline/loader-inline.js +35 -23
- package/components/loader-screen/loader-screen.js +46 -25
- package/components/login-dialog/login-dialog.js +158 -111
- package/components/login-dialog/service.js +34 -8
- package/components/markdown/markdown.js +23 -15
- package/components/message/message.js +203 -161
- package/components/old-browsers-message/old-browsers-message.js +18 -11
- package/components/old-browsers-message/old-browsers-message__stop.js +7 -0
- package/components/old-browsers-message/white-list.js +16 -8
- package/components/pager/pager.js +271 -212
- package/components/panel/panel.js +25 -17
- package/components/permissions/permissions.js +172 -127
- package/components/permissions/permissions__cache.js +224 -194
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +343 -284
- package/components/popup/popup.target.js +8 -9
- package/components/popup/position.js +106 -96
- package/components/popup-menu/popup-menu.js +81 -44
- package/components/progress-bar/progress-bar.js +104 -87
- package/components/query-assist/query-assist.js +916 -838
- package/components/query-assist/query-assist__suggestions.js +30 -1
- package/components/radio/radio.js +34 -19
- package/components/radio/radio__item.js +69 -52
- package/components/select/select.js +957 -852
- package/components/select/select__filter.js +30 -0
- package/components/select/select__popup.js +487 -373
- package/components/shortcuts/core.js +217 -166
- package/components/shortcuts/shortcut-title.js +11 -6
- package/components/shortcuts/shortcuts-hoc.js +45 -19
- package/components/shortcuts/shortcuts.js +75 -50
- package/components/slider/slider.js +122 -99
- package/components/slider/slider.utils.js +24 -14
- package/components/storage/storage.js +33 -4
- package/components/storage/storage__fallback.js +224 -149
- package/components/storage/storage__local.js +153 -90
- package/components/tab-trap/tab-trap.js +153 -122
- package/components/table/cell.js +26 -14
- package/components/table/disable-hover-hoc.js +51 -33
- package/components/table/header-cell.js +89 -64
- package/components/table/header.js +132 -104
- package/components/table/multitable.js +125 -107
- package/components/table/row-with-focus-sensor.js +69 -25
- package/components/table/row.js +216 -175
- package/components/table/selection-adapter.js +3 -1
- package/components/table/selection-shortcuts-hoc.js +181 -180
- package/components/table/selection.js +226 -156
- package/components/table/smart-table.js +88 -50
- package/components/table/table.js +358 -289
- package/components/tabs/collapsible-more.js +79 -46
- package/components/tabs/collapsible-tab.js +38 -31
- package/components/tabs/collapsible-tabs.js +153 -88
- package/components/tabs/custom-item.js +2 -4
- package/components/tabs/dumb-tabs.js +117 -74
- package/components/tabs/smart-tabs.js +69 -29
- package/components/tabs/tab-link.js +5 -1
- package/components/tabs/tab.js +31 -19
- package/components/tabs/tabs.js +31 -0
- package/components/tag/tag.js +173 -133
- package/components/tags-input/tags-input.js +427 -329
- package/components/tags-list/tags-list.js +78 -57
- package/components/text/text.js +39 -28
- package/components/toggle/toggle.js +70 -56
- package/components/tooltip/tooltip.js +190 -146
- package/components/user-agreement/service.js +371 -228
- package/components/user-agreement/toolbox.eula.js +1 -160
- package/components/user-agreement/user-agreement.js +120 -85
- package/components/user-card/card.js +29 -0
- package/components/user-card/smart-user-card-tooltip.js +111 -51
- package/components/user-card/tooltip.js +84 -47
- package/components/user-card/user-card.js +29 -0
- package/package.json +1 -1
@@ -5,11 +5,15 @@ import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
5
5
|
import 'prop-types';
|
6
6
|
import 'classnames';
|
7
7
|
import '../global/data-tests.js';
|
8
|
+
import 'core-js/modules/es.array.concat.js';
|
9
|
+
import 'core-js/modules/es.array.reduce.js';
|
10
|
+
import 'core-js/modules/es.object.entries.js';
|
11
|
+
import 'core-js/modules/es.object.to-string.js';
|
8
12
|
import '../link/clickableLink.js';
|
9
13
|
import '../_helpers/link.js';
|
10
14
|
import '../_helpers/badge.js';
|
11
15
|
|
12
|
-
|
16
|
+
var items = [{
|
13
17
|
id: 1,
|
14
18
|
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("strong", null, "Assigner"), " in 60 projects"),
|
15
19
|
collapsible: true,
|
@@ -165,7 +169,7 @@ const items = [{
|
|
165
169
|
selectable: true,
|
166
170
|
collapsible: true
|
167
171
|
}];
|
168
|
-
|
172
|
+
var moreItems = [{
|
169
173
|
id: 91,
|
170
174
|
selectable: true,
|
171
175
|
collapsible: true,
|
@@ -1,3 +1,6 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createClass, f as _classCallCheck, g as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import 'core-js/modules/es.array.map.js';
|
1
4
|
import React, { PureComponent } from 'react';
|
2
5
|
import PropTypes from 'prop-types';
|
3
6
|
import chevronRightIcon from '@jetbrains/icons/chevron-right';
|
@@ -6,11 +9,13 @@ import Link from '../link/link.js';
|
|
6
9
|
import Text from '../text/text.js';
|
7
10
|
import LoaderInline from '../loader-inline/loader-inline.js';
|
8
11
|
import { Button } from '../button/button.js';
|
9
|
-
import Selection
|
12
|
+
import Selection from '../table/selection.js';
|
10
13
|
import { m as modules_09d014b4, T as Title } from '../_helpers/title.js';
|
11
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
12
14
|
import 'classnames';
|
13
15
|
import '../global/data-tests.js';
|
16
|
+
import 'core-js/modules/es.array.reduce.js';
|
17
|
+
import 'core-js/modules/es.object.entries.js';
|
18
|
+
import 'core-js/modules/es.object.to-string.js';
|
14
19
|
import '../link/clickableLink.js';
|
15
20
|
import '../_helpers/link.js';
|
16
21
|
import '@jetbrains/icons/chevron-10px';
|
@@ -18,16 +23,28 @@ import '../icon/icon.js';
|
|
18
23
|
import 'util-deprecate';
|
19
24
|
import '../icon/icon__constants.js';
|
20
25
|
import '../_helpers/icon__svg.js';
|
26
|
+
import 'core-js/modules/es.regexp.exec.js';
|
27
|
+
import 'core-js/modules/es.string.replace.js';
|
28
|
+
import 'core-js/modules/es.string.starts-with.js';
|
21
29
|
import '../global/memoize.js';
|
30
|
+
import 'core-js/modules/es.array.iterator.js';
|
31
|
+
import 'core-js/modules/es.map.js';
|
32
|
+
import 'core-js/modules/es.weak-map.js';
|
33
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
22
34
|
import '../global/controls-height.js';
|
23
35
|
import '../_helpers/button__classes.js';
|
36
|
+
import 'core-js/modules/es.array.filter.js';
|
37
|
+
import 'core-js/modules/es.array.index-of.js';
|
38
|
+
import 'core-js/modules/es.set.js';
|
24
39
|
import '../global/focus-sensor-hoc.js';
|
25
40
|
import '../global/prop-types.js';
|
26
41
|
import '../global/composeRefs.js';
|
42
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
27
43
|
import '../checkbox/checkbox.js';
|
28
44
|
import '@jetbrains/icons/checkmark-12px';
|
29
45
|
import '@jetbrains/icons/remove-12px';
|
30
46
|
import '../global/get-uid.js';
|
47
|
+
import 'core-js/modules/es.regexp.to-string.js';
|
31
48
|
|
32
49
|
var moreLessButtonStates;
|
33
50
|
(function (moreLessButtonStates) {
|
@@ -36,149 +53,159 @@ var moreLessButtonStates;
|
|
36
53
|
moreLessButtonStates[moreLessButtonStates["MORE_LOADING"] = 2] = "MORE_LOADING";
|
37
54
|
moreLessButtonStates[moreLessButtonStates["LESS"] = 3] = "LESS";
|
38
55
|
})(moreLessButtonStates || (moreLessButtonStates = {}));
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
onItemMoreLess: () => {}
|
48
|
-
};
|
49
|
-
onShowMore = () => {
|
50
|
-
const {
|
51
|
-
onItemMoreLess,
|
52
|
-
item
|
53
|
-
} = this.props;
|
54
|
-
onItemMoreLess(item, true);
|
55
|
-
};
|
56
|
-
onShowLess = () => {
|
57
|
-
const {
|
58
|
-
onItemMoreLess,
|
59
|
-
item
|
60
|
-
} = this.props;
|
61
|
-
onItemMoreLess(item, false);
|
62
|
-
};
|
63
|
-
onFocus = () => {
|
64
|
-
const {
|
65
|
-
onFocus,
|
66
|
-
item
|
67
|
-
} = this.props;
|
68
|
-
onFocus(item);
|
69
|
-
};
|
70
|
-
onSelect = selected => {
|
71
|
-
const {
|
72
|
-
onSelect,
|
73
|
-
item
|
74
|
-
} = this.props;
|
75
|
-
onSelect(item, selected);
|
76
|
-
};
|
77
|
-
renderItem = (model, parentShift) => {
|
78
|
-
const {
|
79
|
-
onFocus,
|
80
|
-
onSelect,
|
81
|
-
selection,
|
82
|
-
level,
|
83
|
-
itemFormatter
|
84
|
-
} = this.props;
|
85
|
-
const item = itemFormatter(model);
|
86
|
-
return /*#__PURE__*/React.createElement(Item, {
|
87
|
-
key: item.key || item.id,
|
88
|
-
item: model,
|
89
|
-
title: item.title,
|
90
|
-
items: item.items,
|
91
|
-
level: level + 1,
|
92
|
-
parentShift: parentShift,
|
93
|
-
itemFormatter: itemFormatter,
|
94
|
-
collapsible: item.collapsible,
|
95
|
-
collapsed: item.collapsed,
|
96
|
-
onCollapse: item.onCollapse,
|
97
|
-
onExpand: item.onExpand,
|
98
|
-
showFocus: selection.isFocused(model),
|
99
|
-
onFocus: onFocus,
|
100
|
-
selection: selection,
|
101
|
-
selectable: item.selectable,
|
102
|
-
selected: selection.isSelected(model),
|
103
|
-
onSelect: onSelect
|
104
|
-
});
|
105
|
-
};
|
106
|
-
render() {
|
107
|
-
const {
|
108
|
-
title,
|
109
|
-
items,
|
110
|
-
showMoreLessButton,
|
111
|
-
level,
|
112
|
-
parentShift,
|
113
|
-
showFocus,
|
114
|
-
selectable,
|
115
|
-
selected,
|
116
|
-
collapsible,
|
117
|
-
collapsed,
|
118
|
-
onCollapse,
|
119
|
-
onExpand
|
120
|
-
} = this.props;
|
121
|
-
let moreLessButton;
|
122
|
-
if (showMoreLessButton === moreLessButtonStates.MORE || showMoreLessButton === moreLessButtonStates.MORE_LOADING) {
|
123
|
-
moreLessButton = /*#__PURE__*/React.createElement(Text, {
|
124
|
-
info: true
|
125
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
126
|
-
inherit: true,
|
127
|
-
pseudo: true,
|
128
|
-
onClick: this.onShowMore
|
129
|
-
}, 'Show more'), showMoreLessButton === moreLessButtonStates.MORE_LOADING && /*#__PURE__*/React.createElement(LoaderInline, {
|
130
|
-
className: modules_09d014b4.showMoreLoader
|
131
|
-
}));
|
132
|
-
} else if (showMoreLessButton === moreLessButtonStates.LESS) {
|
133
|
-
moreLessButton = /*#__PURE__*/React.createElement(Text, {
|
134
|
-
info: true
|
135
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
136
|
-
inherit: true,
|
137
|
-
pseudo: true,
|
138
|
-
onClick: this.onShowLess
|
139
|
-
}, 'Show less'));
|
56
|
+
var ITEM_LEFT_OFFSET = 32;
|
57
|
+
var LIST_LEFT_OFFSET = 24;
|
58
|
+
var Item = /*#__PURE__*/function (_PureComponent) {
|
59
|
+
function Item() {
|
60
|
+
var _this;
|
61
|
+
_classCallCheck(this, Item);
|
62
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
63
|
+
args[_key] = arguments[_key];
|
140
64
|
}
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
65
|
+
_this = _callSuper(this, Item, [].concat(args));
|
66
|
+
_defineProperty(_this, "onShowMore", function () {
|
67
|
+
var _this$props = _this.props,
|
68
|
+
onItemMoreLess = _this$props.onItemMoreLess,
|
69
|
+
item = _this$props.item;
|
70
|
+
onItemMoreLess(item, true);
|
71
|
+
});
|
72
|
+
_defineProperty(_this, "onShowLess", function () {
|
73
|
+
var _this$props2 = _this.props,
|
74
|
+
onItemMoreLess = _this$props2.onItemMoreLess,
|
75
|
+
item = _this$props2.item;
|
76
|
+
onItemMoreLess(item, false);
|
77
|
+
});
|
78
|
+
_defineProperty(_this, "onFocus", function () {
|
79
|
+
var _this$props3 = _this.props,
|
80
|
+
onFocus = _this$props3.onFocus,
|
81
|
+
item = _this$props3.item;
|
82
|
+
onFocus(item);
|
83
|
+
});
|
84
|
+
_defineProperty(_this, "onSelect", function (selected) {
|
85
|
+
var _this$props4 = _this.props,
|
86
|
+
onSelect = _this$props4.onSelect,
|
87
|
+
item = _this$props4.item;
|
88
|
+
onSelect(item, selected);
|
89
|
+
});
|
90
|
+
_defineProperty(_this, "renderItem", function (model, parentShift) {
|
91
|
+
var _this$props5 = _this.props,
|
92
|
+
onFocus = _this$props5.onFocus,
|
93
|
+
onSelect = _this$props5.onSelect,
|
94
|
+
selection = _this$props5.selection,
|
95
|
+
level = _this$props5.level,
|
96
|
+
itemFormatter = _this$props5.itemFormatter;
|
97
|
+
var item = itemFormatter(model);
|
98
|
+
return /*#__PURE__*/React.createElement(Item, {
|
99
|
+
key: item.key || item.id,
|
100
|
+
item: model,
|
101
|
+
title: item.title,
|
102
|
+
items: item.items,
|
103
|
+
level: level + 1,
|
104
|
+
parentShift: parentShift,
|
105
|
+
itemFormatter: itemFormatter,
|
106
|
+
collapsible: item.collapsible,
|
107
|
+
collapsed: item.collapsed,
|
108
|
+
onCollapse: item.onCollapse,
|
109
|
+
onExpand: item.onExpand,
|
110
|
+
showFocus: selection.isFocused(model),
|
111
|
+
onFocus: onFocus,
|
112
|
+
selection: selection,
|
113
|
+
selectable: item.selectable,
|
114
|
+
selected: selection.isSelected(model),
|
115
|
+
onSelect: onSelect
|
116
|
+
});
|
117
|
+
});
|
118
|
+
return _this;
|
119
|
+
}
|
120
|
+
_inherits(Item, _PureComponent);
|
121
|
+
return _createClass(Item, [{
|
122
|
+
key: "render",
|
123
|
+
value: function render() {
|
124
|
+
var _this2 = this;
|
125
|
+
var _this$props6 = this.props,
|
126
|
+
title = _this$props6.title,
|
127
|
+
items = _this$props6.items,
|
128
|
+
showMoreLessButton = _this$props6.showMoreLessButton,
|
129
|
+
level = _this$props6.level,
|
130
|
+
parentShift = _this$props6.parentShift,
|
131
|
+
showFocus = _this$props6.showFocus,
|
132
|
+
selectable = _this$props6.selectable,
|
133
|
+
selected = _this$props6.selected,
|
134
|
+
collapsible = _this$props6.collapsible,
|
135
|
+
collapsed = _this$props6.collapsed,
|
136
|
+
onCollapse = _this$props6.onCollapse,
|
137
|
+
onExpand = _this$props6.onExpand;
|
138
|
+
var moreLessButton;
|
139
|
+
if (showMoreLessButton === moreLessButtonStates.MORE || showMoreLessButton === moreLessButtonStates.MORE_LOADING) {
|
140
|
+
moreLessButton = /*#__PURE__*/React.createElement(Text, {
|
141
|
+
info: true
|
142
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
143
|
+
inherit: true,
|
144
|
+
pseudo: true,
|
145
|
+
onClick: this.onShowMore
|
146
|
+
}, 'Show more'), showMoreLessButton === moreLessButtonStates.MORE_LOADING && /*#__PURE__*/React.createElement(LoaderInline, {
|
147
|
+
className: modules_09d014b4.showMoreLoader
|
148
|
+
}));
|
149
|
+
} else if (showMoreLessButton === moreLessButtonStates.LESS) {
|
150
|
+
moreLessButton = /*#__PURE__*/React.createElement(Text, {
|
151
|
+
info: true
|
152
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
153
|
+
inherit: true,
|
154
|
+
pseudo: true,
|
155
|
+
onClick: this.onShowLess
|
156
|
+
}, 'Show less'));
|
161
157
|
}
|
158
|
+
var collapserExpander = null;
|
159
|
+
if (collapsible) {
|
160
|
+
if (collapsed) {
|
161
|
+
collapserExpander = /*#__PURE__*/React.createElement(Button, {
|
162
|
+
title: "Expand",
|
163
|
+
onClick: onExpand,
|
164
|
+
icon: chevronRightIcon,
|
165
|
+
className: modules_09d014b4.collapseButton,
|
166
|
+
iconClassName: modules_09d014b4.collapseIcon,
|
167
|
+
"data-test": "ring-data-list-expand"
|
168
|
+
});
|
169
|
+
} else {
|
170
|
+
collapserExpander = /*#__PURE__*/React.createElement(Button, {
|
171
|
+
title: "Collapse",
|
172
|
+
onClick: onCollapse,
|
173
|
+
icon: chevronDownIcon,
|
174
|
+
className: modules_09d014b4.collapseButton,
|
175
|
+
iconClassName: modules_09d014b4.collapseIcon,
|
176
|
+
"data-test": "ring-data-list-collapse"
|
177
|
+
});
|
178
|
+
}
|
179
|
+
}
|
180
|
+
var itemIsEmpty = !(items !== null && items !== void 0 && items.length) || collapsible && collapsed;
|
181
|
+
var offset = level * LIST_LEFT_OFFSET + ITEM_LEFT_OFFSET + parentShift;
|
182
|
+
return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Title, {
|
183
|
+
title: title,
|
184
|
+
focused: showFocus,
|
185
|
+
showFocus: showFocus,
|
186
|
+
selectable: selectable,
|
187
|
+
selected: selected,
|
188
|
+
collapserExpander: collapserExpander,
|
189
|
+
onFocus: this.onFocus,
|
190
|
+
onSelect: this.onSelect,
|
191
|
+
offset: offset
|
192
|
+
}), !itemIsEmpty ? /*#__PURE__*/React.createElement("ul", {
|
193
|
+
className: modules_09d014b4.itemContent
|
194
|
+
}, items.map(function (model) {
|
195
|
+
return _this2.renderItem(model, parentShift);
|
196
|
+
}), showMoreLessButton !== moreLessButtonStates.UNUSED ? /*#__PURE__*/React.createElement("li", {
|
197
|
+
className: modules_09d014b4.showMore
|
198
|
+
}, moreLessButton) : null) : null);
|
162
199
|
}
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
onFocus: this.onFocus,
|
173
|
-
onSelect: this.onSelect,
|
174
|
-
offset: offset
|
175
|
-
}), !itemIsEmpty ? /*#__PURE__*/React.createElement("ul", {
|
176
|
-
className: modules_09d014b4.itemContent
|
177
|
-
}, items.map(model => this.renderItem(model, parentShift)), showMoreLessButton !== moreLessButtonStates.UNUSED ? /*#__PURE__*/React.createElement("li", {
|
178
|
-
className: modules_09d014b4.showMore
|
179
|
-
}, moreLessButton) : null) : null);
|
180
|
-
}
|
181
|
-
}
|
200
|
+
}]);
|
201
|
+
}(PureComponent);
|
202
|
+
_defineProperty(Item, "defaultProps", {
|
203
|
+
items: [],
|
204
|
+
level: 0,
|
205
|
+
parentShift: 0,
|
206
|
+
showMoreLessButton: moreLessButtonStates.UNUSED,
|
207
|
+
onItemMoreLess: function onItemMoreLess() {}
|
208
|
+
});
|
182
209
|
Item.propTypes = {
|
183
210
|
item: PropTypes.shape({
|
184
211
|
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
@@ -195,7 +222,7 @@ Item.propTypes = {
|
|
195
222
|
onExpand: PropTypes.func,
|
196
223
|
showFocus: PropTypes.bool,
|
197
224
|
onFocus: PropTypes.func.isRequired,
|
198
|
-
selection: PropTypes.instanceOf(Selection
|
225
|
+
selection: PropTypes.instanceOf(Selection).isRequired,
|
199
226
|
selectable: PropTypes.bool,
|
200
227
|
selected: PropTypes.bool,
|
201
228
|
onSelect: PropTypes.func.isRequired,
|
@@ -1,86 +1,146 @@
|
|
1
|
+
import { a as _inherits, b as _createClass, k as _toConsumableArray, m as _get, n as _getPrototypeOf, f as _classCallCheck, g as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import 'core-js/modules/es.array.filter.js';
|
4
|
+
import 'core-js/modules/es.array.find.js';
|
5
|
+
import 'core-js/modules/es.array.includes.js';
|
6
|
+
import 'core-js/modules/es.array.iterator.js';
|
7
|
+
import 'core-js/modules/es.object.to-string.js';
|
8
|
+
import 'core-js/modules/es.set.js';
|
9
|
+
import 'core-js/modules/es.string.includes.js';
|
10
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
11
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
1
12
|
import Selection$1 from '../table/selection.js';
|
13
|
+
import 'core-js/modules/es.array.index-of.js';
|
2
14
|
|
3
|
-
|
4
|
-
|
5
|
-
|
15
|
+
var Selection = /*#__PURE__*/function (_TableSelection) {
|
16
|
+
function Selection() {
|
17
|
+
_classCallCheck(this, Selection);
|
18
|
+
return _callSuper(this, Selection, arguments);
|
6
19
|
}
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
20
|
+
_inherits(Selection, _TableSelection);
|
21
|
+
return _createClass(Selection, [{
|
22
|
+
key: "_buildData",
|
23
|
+
value: function _buildData(data) {
|
24
|
+
return new Set(this._getDescendants(data));
|
25
|
+
}
|
26
|
+
}, {
|
27
|
+
key: "_buildSelected",
|
28
|
+
value: function _buildSelected(data, selected) {
|
29
|
+
var _this = this;
|
30
|
+
var _selected = new Set(selected);
|
31
|
+
_toConsumableArray(data).forEach(function (item) {
|
32
|
+
if (_selected.has(item)) {
|
33
|
+
_this._selectDescendants(item, _selected);
|
34
|
+
}
|
35
|
+
});
|
36
|
+
return _selected;
|
37
|
+
}
|
38
|
+
}, {
|
39
|
+
key: "_getDescendants",
|
40
|
+
value: function _getDescendants(items) {
|
41
|
+
var _this2 = this;
|
42
|
+
var result = [];
|
43
|
+
items.forEach(function (item) {
|
44
|
+
result.push(item);
|
45
|
+
result = [].concat(_toConsumableArray(result), _toConsumableArray(_this2._getDescendants(_this2._getChildren(item))));
|
46
|
+
});
|
47
|
+
return result;
|
48
|
+
}
|
49
|
+
}, {
|
50
|
+
key: "_getAncestors",
|
51
|
+
value: function _getAncestors(item) {
|
52
|
+
var _this3 = this;
|
53
|
+
var result = [];
|
54
|
+
var parent = _toConsumableArray(this._data).find(function (it) {
|
55
|
+
return _this3._getChildren(it).includes(item);
|
56
|
+
});
|
57
|
+
if (parent) {
|
58
|
+
result = [parent].concat(_toConsumableArray(this._getAncestors(parent)));
|
12
59
|
}
|
13
|
-
|
14
|
-
return _selected;
|
15
|
-
}
|
16
|
-
_getDescendants(items) {
|
17
|
-
let result = [];
|
18
|
-
items.forEach(item => {
|
19
|
-
result.push(item);
|
20
|
-
result = [...result, ...this._getDescendants(this._getChildren(item))];
|
21
|
-
});
|
22
|
-
return result;
|
23
|
-
}
|
24
|
-
_getAncestors(item) {
|
25
|
-
let result = [];
|
26
|
-
const parent = [...this._data].find(it => this._getChildren(it).includes(item));
|
27
|
-
if (parent) {
|
28
|
-
result = [parent, ...this._getAncestors(parent)];
|
60
|
+
return result;
|
29
61
|
}
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
}
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
62
|
+
}, {
|
63
|
+
key: "_selectDescendants",
|
64
|
+
value: function _selectDescendants(item, selected) {
|
65
|
+
this._getDescendants(this._getChildren(item)).forEach(function (it) {
|
66
|
+
return selected.add(it);
|
67
|
+
});
|
68
|
+
}
|
69
|
+
}, {
|
70
|
+
key: "_deselectDescendants",
|
71
|
+
value: function _deselectDescendants(item, selected) {
|
72
|
+
this._getDescendants(this._getChildren(item)).forEach(function (it) {
|
73
|
+
return selected.delete(it);
|
74
|
+
});
|
75
|
+
}
|
76
|
+
}, {
|
77
|
+
key: "_selectAncestors",
|
78
|
+
value: function _selectAncestors(item, selected) {
|
79
|
+
var _this4 = this;
|
80
|
+
this._getAncestors(item).forEach(function (ancestor) {
|
81
|
+
var groupIsSelected = _this4._getChildren(ancestor).filter(function (it) {
|
82
|
+
return _this4._isItemSelectable(it);
|
83
|
+
}).every(function (it) {
|
84
|
+
return selected.has(it);
|
85
|
+
});
|
86
|
+
if (groupIsSelected) {
|
87
|
+
selected.add(ancestor);
|
88
|
+
}
|
89
|
+
});
|
90
|
+
}
|
91
|
+
}, {
|
92
|
+
key: "_deselectAncestors",
|
93
|
+
value: function _deselectAncestors(item, selected) {
|
94
|
+
this._getAncestors(item).forEach(function (it) {
|
95
|
+
return selected.delete(it);
|
96
|
+
});
|
97
|
+
}
|
98
|
+
}, {
|
99
|
+
key: "select",
|
100
|
+
value: function select() {
|
101
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
102
|
+
if (!value || !this._isItemSelectable(value)) {
|
103
|
+
return this;
|
43
104
|
}
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
if (!value || !this._isItemSelectable(value)) {
|
52
|
-
return this;
|
105
|
+
var selected = new Set(this._selected);
|
106
|
+
selected.add(value);
|
107
|
+
this._selectDescendants(value, selected);
|
108
|
+
this._selectAncestors(value, selected);
|
109
|
+
return this.cloneWith({
|
110
|
+
selected
|
111
|
+
});
|
53
112
|
}
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
return this.cloneWith({
|
59
|
-
selected
|
60
|
-
});
|
61
|
-
}
|
62
|
-
focus(value) {
|
63
|
-
return super.focus(value);
|
64
|
-
}
|
65
|
-
resetSelection() {
|
66
|
-
return super.resetSelection();
|
67
|
-
}
|
68
|
-
cloneWith(config) {
|
69
|
-
return super.cloneWith(config);
|
70
|
-
}
|
71
|
-
deselect() {
|
72
|
-
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
73
|
-
if (!value || !this._isItemSelectable(value)) {
|
74
|
-
return this;
|
113
|
+
}, {
|
114
|
+
key: "focus",
|
115
|
+
value: function focus(value) {
|
116
|
+
return _get(_getPrototypeOf(Selection.prototype), "focus", this).call(this, value);
|
75
117
|
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
118
|
+
}, {
|
119
|
+
key: "resetSelection",
|
120
|
+
value: function resetSelection() {
|
121
|
+
return _get(_getPrototypeOf(Selection.prototype), "resetSelection", this).call(this);
|
122
|
+
}
|
123
|
+
}, {
|
124
|
+
key: "cloneWith",
|
125
|
+
value: function cloneWith(config) {
|
126
|
+
return _get(_getPrototypeOf(Selection.prototype), "cloneWith", this).call(this, config);
|
127
|
+
}
|
128
|
+
}, {
|
129
|
+
key: "deselect",
|
130
|
+
value: function deselect() {
|
131
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._focused;
|
132
|
+
if (!value || !this._isItemSelectable(value)) {
|
133
|
+
return this;
|
134
|
+
}
|
135
|
+
var selected = new Set(this._selected);
|
136
|
+
selected.delete(value);
|
137
|
+
this._deselectDescendants(value, selected);
|
138
|
+
this._deselectAncestors(value, selected);
|
139
|
+
return this.cloneWith({
|
140
|
+
selected
|
141
|
+
});
|
142
|
+
}
|
143
|
+
}]);
|
144
|
+
}(Selection$1);
|
85
145
|
|
86
146
|
export { Selection as default };
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
1
3
|
import 'react';
|
2
4
|
import 'prop-types';
|
3
5
|
import 'classnames';
|
@@ -6,12 +8,21 @@ import '../checkbox/checkbox.js';
|
|
6
8
|
import '../global/get-uid.js';
|
7
9
|
import '../global/prop-types.js';
|
8
10
|
export { T as default } from '../_helpers/title.js';
|
9
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
10
11
|
import '../global/composeRefs.js';
|
12
|
+
import 'core-js/modules/es.object.to-string.js';
|
13
|
+
import 'core-js/modules/web.dom-collections.for-each.js';
|
11
14
|
import '@jetbrains/icons/checkmark-12px';
|
12
15
|
import '@jetbrains/icons/remove-12px';
|
13
16
|
import '../icon/icon.js';
|
14
17
|
import 'util-deprecate';
|
15
18
|
import '../icon/icon__constants.js';
|
16
19
|
import '../_helpers/icon__svg.js';
|
20
|
+
import 'core-js/modules/es.regexp.exec.js';
|
21
|
+
import 'core-js/modules/es.string.replace.js';
|
22
|
+
import 'core-js/modules/es.string.starts-with.js';
|
17
23
|
import '../global/memoize.js';
|
24
|
+
import 'core-js/modules/es.array.iterator.js';
|
25
|
+
import 'core-js/modules/es.map.js';
|
26
|
+
import 'core-js/modules/es.weak-map.js';
|
27
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
28
|
+
import 'core-js/modules/es.regexp.to-string.js';
|