@jetbrains/ring-ui-built 7.0.0-beta.1 → 7.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/_helpers/_rollupPluginBabelHelpers.js +1 -504
- package/components/_helpers/anchor.js +7 -5
- package/components/_helpers/button__classes.js +15 -13
- package/components/_helpers/caption.js +11 -17
- package/components/_helpers/card.js +92 -96
- package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
- package/components/_helpers/header.js +1 -1
- package/components/_helpers/icon__svg.js +27 -23
- package/components/_helpers/input.js +150 -171
- package/components/_helpers/query-assist__suggestions.js +78 -93
- package/components/_helpers/select__filter.js +56 -67
- package/components/_helpers/services-link.js +23 -29
- package/components/_helpers/sidebar.js +91 -93
- package/components/_helpers/tab-link.js +8 -6
- package/components/_helpers/theme.js +55 -51
- package/components/_helpers/title.js +59 -69
- package/components/alert/alert.js +112 -156
- package/components/alert/container.js +32 -39
- package/components/alert-service/alert-service.js +104 -161
- package/components/analytics/analytics.js +12 -20
- package/components/analytics/analytics__custom-plugin.js +52 -68
- package/components/auth/auth.js +2 -27
- package/components/auth/auth__core.d.ts +1 -1
- package/components/auth/auth__core.js +742 -1428
- package/components/auth/background-flow.js +84 -121
- package/components/auth/down-notification.js +31 -69
- package/components/auth/iframe-flow.js +70 -123
- package/components/auth/request-builder.js +46 -77
- package/components/auth/response-parser.js +84 -112
- package/components/auth/storage.js +160 -318
- package/components/auth/token-validator.js +132 -227
- package/components/auth/window-flow.js +84 -121
- package/components/auth-dialog/auth-dialog.js +99 -150
- package/components/auth-dialog-service/auth-dialog-service.js +6 -26
- package/components/avatar/avatar-example-datauri.js +1 -1
- package/components/avatar/avatar.js +94 -123
- package/components/avatar/fallback-avatar.js +20 -34
- package/components/badge/badge.js +32 -38
- package/components/breadcrumbs/breadcrumbs.js +13 -17
- package/components/button/button.js +67 -80
- package/components/button-group/button-group.js +27 -36
- package/components/button-set/button-set.js +19 -27
- package/components/button-toolbar/button-toolbar.js +17 -25
- package/components/caret/caret.js +184 -211
- package/components/checkbox/checkbox.js +69 -86
- package/components/clipboard/clipboard-fallback.js +7 -7
- package/components/clipboard/clipboard.js +36 -128
- package/components/code/code.js +83 -151
- package/components/collapse/collapse-content.js +42 -60
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +12 -12
- package/components/collapse/collapse.js +12 -17
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +1 -3
- package/components/confirm/confirm.js +57 -87
- package/components/confirm-service/confirm-service.js +23 -44
- package/components/content-layout/content-layout.js +41 -56
- package/components/content-layout/sidebar.js +1 -1
- package/components/contenteditable/contenteditable.js +38 -46
- package/components/control-help/control-help.js +5 -3
- package/components/control-label/control-label.js +9 -8
- package/components/data-list/data-list.js +113 -156
- package/components/data-list/data-list.mock.js +3 -5
- package/components/data-list/item.js +120 -140
- package/components/data-list/selection.js +77 -135
- package/components/data-list/title.js +2 -10
- package/components/date-picker/consts.js +16 -22
- package/components/date-picker/date-input.js +99 -124
- package/components/date-picker/date-picker.js +140 -184
- package/components/date-picker/date-popup.js +280 -327
- package/components/date-picker/day.js +71 -94
- package/components/date-picker/month-names.js +41 -59
- package/components/date-picker/month-slider.js +42 -61
- package/components/date-picker/month.js +17 -24
- package/components/date-picker/months.js +44 -49
- package/components/date-picker/weekdays.js +12 -21
- package/components/date-picker/years.js +77 -98
- package/components/dialog/dialog.js +151 -187
- package/components/dialog/dialog__body-scroll-preventer.js +0 -3
- package/components/dropdown/anchor.js +0 -6
- package/components/dropdown/dropdown.js +134 -154
- package/components/dropdown-menu/dropdown-menu.js +59 -87
- package/components/editable-heading/editable-heading.js +69 -116
- package/components/error-bubble/error-bubble.js +29 -54
- package/components/error-message/error-message.js +34 -49
- package/components/footer/footer.js +27 -28
- package/components/global/compose.js +1 -8
- package/components/global/composeRefs.d.ts +0 -3
- package/components/global/composeRefs.js +8 -15
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +14 -13
- package/components/global/data-tests.js +7 -12
- package/components/global/dom.js +49 -82
- package/components/global/focus-sensor-hoc.js +99 -106
- package/components/global/fuzzy-highlight.js +23 -34
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +3 -7
- package/components/global/inject-styles.js +7 -14
- package/components/global/listeners.js +28 -47
- package/components/global/memoize.js +6 -10
- package/components/global/normalize-indent.js +19 -46
- package/components/global/promise-with-timeout.js +6 -8
- package/components/global/prop-types.js +3 -5
- package/components/global/react-dom-renderer.js +29 -40
- package/components/global/rerender-hoc.js +16 -32
- package/components/global/schedule-raf.js +4 -4
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.d.ts +3 -0
- package/components/global/theme.js +2 -19
- package/components/global/trivial-template-tag.js +4 -9
- package/components/global/typescript-utils.js +2 -6
- package/components/global/url.js +20 -23
- package/components/global/use-event-callback.js +7 -4
- package/components/grid/col.js +27 -39
- package/components/grid/grid.js +18 -27
- package/components/grid/row.js +23 -30
- package/components/group/group.js +16 -22
- package/components/header/header-icon.js +19 -31
- package/components/header/header.d.ts +0 -1
- package/components/header/header.js +30 -64
- package/components/header/links.d.ts +2 -0
- package/components/header/links.js +20 -0
- package/components/header/logo.js +15 -26
- package/components/header/profile.js +124 -150
- package/components/header/services-link.js +1 -3
- package/components/header/services.js +64 -97
- package/components/header/smart-profile.js +101 -178
- package/components/header/smart-services.js +55 -90
- package/components/header/tray.js +21 -30
- package/components/heading/heading.js +21 -20
- package/components/http/http.js +162 -319
- package/components/http/http.mock.js +50 -98
- package/components/hub-source/hub-source.js +77 -182
- package/components/hub-source/hub-source__user.js +9 -37
- package/components/hub-source/hub-source__users-groups.js +34 -60
- package/components/i18n/i18n-context.js +7 -8
- package/components/i18n/i18n.js +3 -6
- package/components/icon/icon.js +60 -74
- package/components/icon/icon__svg.js +0 -5
- package/components/icon/index.js +0 -5
- package/components/input/input.js +1 -11
- package/components/island/adaptive-island-hoc.js +29 -37
- package/components/island/content.js +100 -110
- package/components/island/header.js +56 -66
- package/components/island/island.js +25 -33
- package/components/island-legacy/content-legacy.js +16 -22
- package/components/island-legacy/header-legacy.js +19 -25
- package/components/island-legacy/island-legacy.js +16 -22
- package/components/link/clickableLink.js +33 -42
- package/components/link/link.js +47 -55
- package/components/list/consts.js +2 -2
- package/components/list/list.js +399 -486
- package/components/list/list__custom.js +51 -61
- package/components/list/list__hint.js +9 -17
- package/components/list/list__item.js +147 -178
- package/components/list/list__link.js +38 -47
- package/components/list/list__separator.js +15 -24
- package/components/list/list__title.js +25 -34
- package/components/list/list__users-groups-source.js +55 -121
- package/components/loader/loader.js +38 -60
- package/components/loader/loader__core.js +123 -184
- package/components/loader-inline/loader-inline.js +24 -32
- package/components/loader-screen/loader-screen.js +24 -40
- package/components/login-dialog/login-dialog.js +81 -121
- package/components/login-dialog/service.js +6 -29
- package/components/markdown/markdown.js +16 -24
- package/components/message/message.js +170 -201
- package/components/old-browsers-message/old-browsers-message.js +11 -14
- package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
- package/components/old-browsers-message/white-list.js +8 -13
- package/components/pager/pager.js +212 -257
- package/components/panel/panel.js +16 -22
- package/components/permissions/permissions.js +118 -161
- package/components/permissions/permissions__cache.js +191 -218
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +237 -288
- package/components/popup/popup.target.js +9 -7
- package/components/popup/position.js +94 -101
- package/components/popup-menu/popup-menu.js +33 -67
- package/components/progress-bar/progress-bar.js +57 -68
- package/components/query-assist/query-assist.js +583 -652
- package/components/query-assist/query-assist__suggestions.js +2 -26
- package/components/radio/radio.js +15 -27
- package/components/radio/radio__item.js +52 -62
- package/components/scrollable-section/scrollable-section.js +53 -0
- package/components/select/select.js +701 -796
- package/components/select/select__filter.js +1 -26
- package/components/select/select__popup.js +316 -413
- package/components/shortcuts/core.js +147 -195
- package/components/shortcuts/shortcut-title.js +6 -10
- package/components/shortcuts/shortcuts-hoc.js +23 -41
- package/components/shortcuts/shortcuts.js +41 -64
- package/components/slider/slider.js +93 -112
- package/components/slider/slider.utils.js +16 -23
- package/components/storage/storage.js +3 -27
- package/components/storage/storage__fallback.js +137 -210
- package/components/storage/storage__local.js +89 -147
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +35 -53
- package/components/table/cell.js +11 -21
- package/components/table/disable-hover-hoc.js +27 -42
- package/components/table/header-cell.js +59 -75
- package/components/table/header.js +89 -110
- package/components/table/multitable.js +83 -89
- package/components/table/row-with-focus-sensor.js +25 -57
- package/components/table/row.js +169 -200
- package/components/table/selection-adapter.js +2 -2
- package/components/table/selection-shortcuts-hoc.js +108 -113
- package/components/table/selection.js +150 -217
- package/components/table/simple-table.js +19 -55
- package/components/table/smart-table.js +42 -76
- package/components/table/table.js +267 -327
- package/components/tabs/collapsible-more.js +47 -73
- package/components/tabs/collapsible-tab.js +32 -36
- package/components/tabs/collapsible-tabs.js +89 -148
- package/components/tabs/custom-item.js +4 -2
- package/components/tabs/dumb-tabs.js +60 -92
- package/components/tabs/smart-tabs.js +29 -61
- package/components/tabs/tab-link.js +1 -3
- package/components/tabs/tab.js +15 -24
- package/components/tabs/tabs.js +1 -26
- package/components/tag/tag.d.ts +0 -2
- package/components/tag/tag.js +120 -162
- package/components/tags-input/tags-input.js +222 -304
- package/components/tags-list/tags-list.js +45 -61
- package/components/text/text.js +28 -37
- package/components/toggle/toggle.js +51 -61
- package/components/tooltip/tooltip.js +109 -141
- package/components/user-agreement/service.js +259 -400
- package/components/user-agreement/user-agreement.js +80 -108
- package/components/user-card/card.js +1 -25
- package/components/user-card/smart-user-card-tooltip.js +52 -103
- package/components/user-card/tooltip.js +35 -65
- package/components/user-card/user-card.js +1 -25
- package/package.json +1 -1
- package/components/global/react-render-adapter.d.ts +0 -1
- package/components/global/react-render-adapter.js +0 -6
- package/components/header/scrollable-section.js +0 -47
- package/components/header/tray-icon.d.ts +0 -1
- package/components/header/tray-icon.js +0 -26
- /package/components/{header → scrollable-section}/scrollable-section.d.ts +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import 'core-js/modules/
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
3
|
import { PureComponent } from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import classNames from 'classnames';
|
@@ -8,70 +8,60 @@ import getEventKey from '../global/get-event-key.js';
|
|
8
8
|
import { m as modules_3b67a421 } from '../_helpers/list.js';
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
10
10
|
import 'core-js/modules/es.array.reduce.js';
|
11
|
-
import 'core-js/modules/es.object.entries.js';
|
12
|
-
import 'core-js/modules/es.object.to-string.js';
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
args[_key] = arguments[_key];
|
21
|
-
}
|
22
|
-
_this = _callSuper(this, ListCustom, [].concat(args));
|
23
|
-
_defineProperty(_this, "handleKeyPress", function (event) {
|
24
|
-
var key = getEventKey(event);
|
12
|
+
const _excluded = ["scrolling", "hover", "className", "disabled", "template", "rgItemType", "tabIndex", "onClick", "onCheckboxChange", "onMouseOver", "onMouseUp", "role", "tagName"];
|
13
|
+
class ListCustom extends PureComponent {
|
14
|
+
constructor() {
|
15
|
+
super(...arguments);
|
16
|
+
_defineProperty(this, "handleKeyPress", event => {
|
17
|
+
const key = getEventKey(event);
|
25
18
|
if (key === 'Enter' || key === ' ') {
|
26
|
-
|
19
|
+
this.props.onClick(event);
|
27
20
|
}
|
28
21
|
});
|
29
|
-
return _this;
|
30
22
|
}
|
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
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
}]);
|
74
|
-
}(PureComponent);
|
23
|
+
render() {
|
24
|
+
const _this$props = this.props,
|
25
|
+
{
|
26
|
+
scrolling,
|
27
|
+
hover,
|
28
|
+
className,
|
29
|
+
disabled,
|
30
|
+
template,
|
31
|
+
rgItemType,
|
32
|
+
tabIndex,
|
33
|
+
onClick,
|
34
|
+
onCheckboxChange,
|
35
|
+
onMouseOver,
|
36
|
+
onMouseUp,
|
37
|
+
role,
|
38
|
+
tagName
|
39
|
+
} = _this$props,
|
40
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
41
|
+
const classes = classNames(modules_3b67a421.item, className, {
|
42
|
+
[modules_3b67a421.action]: !disabled,
|
43
|
+
[modules_3b67a421.hover]: hover && !disabled,
|
44
|
+
[modules_3b67a421.scrolling]: scrolling
|
45
|
+
});
|
46
|
+
const dataTest = joinDataTestAttributes('ring-list-item-custom', {
|
47
|
+
'ring-list-item-action': !disabled
|
48
|
+
}, restProps['data-test']);
|
49
|
+
const content = typeof template === 'function' ? template(this.props) : template;
|
50
|
+
const TagName = tagName || 'span';
|
51
|
+
return /*#__PURE__*/jsx(TagName, {
|
52
|
+
role: role || 'button',
|
53
|
+
tabIndex: tabIndex,
|
54
|
+
onClick: onClick,
|
55
|
+
onKeyPress: this.handleKeyPress,
|
56
|
+
onMouseOver: onMouseOver,
|
57
|
+
onFocus: onMouseOver,
|
58
|
+
onMouseUp: onMouseUp,
|
59
|
+
className: classes,
|
60
|
+
"data-test": dataTest,
|
61
|
+
children: content
|
62
|
+
});
|
63
|
+
}
|
64
|
+
}
|
75
65
|
ListCustom.propTypes = {
|
76
66
|
scrolling: PropTypes.bool.isRequired,
|
77
67
|
hover: PropTypes.bool.isRequired,
|
@@ -1,27 +1,19 @@
|
|
1
|
-
import { _ as _defineProperty
|
1
|
+
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import { PureComponent } from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import classNames from 'classnames';
|
5
5
|
import { m as modules_3b67a421 } from '../_helpers/list.js';
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
class ListHint extends PureComponent {
|
9
|
+
render() {
|
10
|
+
return /*#__PURE__*/jsx("span", {
|
11
|
+
className: classNames(modules_3b67a421.item, modules_3b67a421.hint),
|
12
|
+
"data-test": "ring-list-hint",
|
13
|
+
children: this.props.label
|
14
|
+
});
|
12
15
|
}
|
13
|
-
|
14
|
-
return _createClass(ListHint, [{
|
15
|
-
key: "render",
|
16
|
-
value: function render() {
|
17
|
-
return /*#__PURE__*/jsx("span", {
|
18
|
-
className: classNames(modules_3b67a421.item, modules_3b67a421.hint),
|
19
|
-
"data-test": "ring-list-hint",
|
20
|
-
children: this.props.label
|
21
|
-
});
|
22
|
-
}
|
23
|
-
}]);
|
24
|
-
}(PureComponent);
|
16
|
+
}
|
25
17
|
_defineProperty(ListHint, "propTypes", {
|
26
18
|
label: PropTypes.node
|
27
19
|
});
|
@@ -1,8 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import 'core-js/modules/es.symbol.js';
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties } from '../_helpers/_rollupPluginBabelHelpers.js';
|
3
2
|
import 'core-js/modules/es.symbol.description.js';
|
4
|
-
import 'core-js/modules/
|
5
|
-
import 'core-js/modules/es.array.index-of.js';
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
6
4
|
import { PureComponent } from 'react';
|
7
5
|
import PropTypes from 'prop-types';
|
8
6
|
import classNames from 'classnames';
|
@@ -14,203 +12,174 @@ import getUID from '../global/get-uid.js';
|
|
14
12
|
import { m as modules_3b67a421 } from '../_helpers/list.js';
|
15
13
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
16
14
|
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';
|
19
15
|
import '../global/url.js';
|
20
16
|
import 'core-js/modules/es.regexp.exec.js';
|
21
|
-
import 'core-js/modules/es.string.match.js';
|
22
17
|
import 'core-js/modules/es.string.replace.js';
|
23
18
|
import '../global/dom.js';
|
24
|
-
import 'core-js/modules/es.array.filter.js';
|
25
|
-
import 'core-js/modules/es.array.iterator.js';
|
26
|
-
import 'core-js/modules/es.object.assign.js';
|
27
|
-
import 'core-js/modules/es.set.js';
|
28
|
-
import 'core-js/modules/es.string.split.js';
|
29
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
30
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
31
19
|
import '../avatar/fallback-avatar.js';
|
32
|
-
import 'core-js/modules/es.array.from.js';
|
33
|
-
import 'core-js/modules/es.array.map.js';
|
34
|
-
import 'core-js/modules/es.array.slice.js';
|
35
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
36
20
|
import '@jetbrains/icons/checkmark-12px';
|
37
21
|
import '@jetbrains/icons/remove-12px';
|
38
22
|
import '../global/prop-types.js';
|
39
23
|
import '../global/composeRefs.js';
|
40
24
|
import 'memoize-one';
|
41
|
-
import 'util-deprecate';
|
42
25
|
import '../control-help/control-help.js';
|
26
|
+
import 'util-deprecate';
|
43
27
|
import '../icon/icon__constants.js';
|
44
28
|
import '../_helpers/icon__svg.js';
|
45
|
-
import 'core-js/modules/es.string.starts-with.js';
|
46
29
|
import '../global/memoize.js';
|
47
|
-
import 'core-js/modules/es.map.js';
|
48
|
-
import 'core-js/modules/es.weak-map.js';
|
49
30
|
|
50
31
|
var modules_5b0fb3e8 = {"footer-height":"calc(var(--ring-unit)*8)","breakpoint-small":"640px","breakpoint-middle":"960px","breakpoint-large":"1200px","extra-small-screen-media":"(max-width: 639px)","small-screen-media":"(min-width: 640px) and (max-width: 959px)","middle-screen-media":"(min-width: 960px) and (max-width: 1199px)","large-screen-media":"(min-width: 1200px)","clearfix":"clearfix_rui_f295","font":"font_rui_f295","font-lower":"font-lower_rui_f295 font_rui_f295","font-smaller":"font-smaller_rui_f295 font-lower_rui_f295 font_rui_f295","font-smaller-lower":"font-smaller-lower_rui_f295 font-smaller_rui_f295 font-lower_rui_f295 font_rui_f295","font-larger-lower":"font-larger-lower_rui_f295 font-lower_rui_f295 font_rui_f295","font-larger":"font-larger_rui_f295 font-larger-lower_rui_f295 font-lower_rui_f295 font_rui_f295","thin-font":"thin-font_rui_f295","monospace-font":"monospace-font_rui_f295","ellipsis":"ellipsis_rui_f295","resetButton":"resetButton_rui_f295"};
|
51
32
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
33
|
+
const _excluded = ["scrolling", "className", "disabled", "checkbox", "avatar", "subavatar", "glyph", "icon", "rightGlyph", "description", "label", "title", "details", "hover", "rgItemType", "level", "tabIndex", "compact", "onClick", "onCheckboxChange", "onMouseOver", "onMouseDown", "onMouseUp", "rightNodes", "leftNodes", "showGeneratedAvatar", "username", "labelWrapper"];
|
34
|
+
const RING_UNIT = 8;
|
35
|
+
const DEFAULT_PADDING = 16;
|
36
|
+
const CHECKBOX_WIDTH = 28;
|
37
|
+
class ListItem extends PureComponent {
|
38
|
+
constructor() {
|
39
|
+
super(...arguments);
|
40
|
+
_defineProperty(this, "id", getUID('list-item-'));
|
41
|
+
_defineProperty(this, "stopBubbling", e => e.stopPropagation());
|
42
|
+
_defineProperty(this, "_isString", val => typeof val === 'string' || val instanceof String);
|
43
|
+
}
|
44
|
+
render() {
|
45
|
+
const _this$props = this.props,
|
46
|
+
{
|
47
|
+
scrolling,
|
48
|
+
className,
|
49
|
+
disabled,
|
50
|
+
checkbox,
|
51
|
+
avatar,
|
52
|
+
subavatar,
|
53
|
+
glyph,
|
54
|
+
icon,
|
55
|
+
rightGlyph,
|
56
|
+
description,
|
57
|
+
label,
|
58
|
+
title,
|
59
|
+
details,
|
60
|
+
hover,
|
61
|
+
rgItemType,
|
62
|
+
level,
|
63
|
+
tabIndex,
|
64
|
+
compact,
|
65
|
+
onClick,
|
66
|
+
onCheckboxChange,
|
67
|
+
onMouseOver,
|
68
|
+
onMouseDown,
|
69
|
+
onMouseUp,
|
70
|
+
rightNodes,
|
71
|
+
leftNodes,
|
72
|
+
showGeneratedAvatar,
|
73
|
+
username,
|
74
|
+
labelWrapper
|
75
|
+
} = _this$props,
|
76
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
77
|
+
const checkable = checkbox !== undefined;
|
78
|
+
const shouldShowGeneratedAvatar = showGeneratedAvatar && username != null;
|
79
|
+
const hasLeftNodes = leftNodes || glyph || avatar || shouldShowGeneratedAvatar;
|
80
|
+
const showCheckbox = checkable && (checkbox || !hasLeftNodes || hover && !disabled);
|
81
|
+
const classes = classNames(modules_3b67a421.item, modules_5b0fb3e8.resetButton, className, {
|
82
|
+
[modules_3b67a421.action]: !disabled,
|
83
|
+
[modules_3b67a421.hover]: hover && !disabled,
|
84
|
+
[modules_3b67a421.compact]: compact,
|
85
|
+
[modules_3b67a421.scrolling]: scrolling,
|
86
|
+
[modules_3b67a421.disabled]: disabled
|
67
87
|
});
|
68
|
-
|
69
|
-
|
88
|
+
const detailsClasses = classNames({
|
89
|
+
[modules_3b67a421.details]: details,
|
90
|
+
[modules_3b67a421.padded]: icon !== undefined || checkbox !== undefined || glyph !== undefined
|
70
91
|
});
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
leftNodes = _this$props.leftNodes,
|
103
|
-
showGeneratedAvatar = _this$props.showGeneratedAvatar,
|
104
|
-
username = _this$props.username,
|
105
|
-
labelWrapper = _this$props.labelWrapper,
|
106
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
107
|
-
var checkable = checkbox !== undefined;
|
108
|
-
var shouldShowGeneratedAvatar = showGeneratedAvatar && username != null;
|
109
|
-
var hasLeftNodes = leftNodes || glyph || avatar || shouldShowGeneratedAvatar;
|
110
|
-
var showCheckbox = checkable && (checkbox || !hasLeftNodes || hover && !disabled);
|
111
|
-
var classes = classNames(modules_3b67a421.item, modules_5b0fb3e8.resetButton, className, {
|
112
|
-
[modules_3b67a421.action]: !disabled,
|
113
|
-
[modules_3b67a421.hover]: hover && !disabled,
|
114
|
-
[modules_3b67a421.compact]: compact,
|
115
|
-
[modules_3b67a421.scrolling]: scrolling,
|
116
|
-
[modules_3b67a421.disabled]: disabled
|
117
|
-
});
|
118
|
-
var detailsClasses = classNames({
|
119
|
-
[modules_3b67a421.details]: details,
|
120
|
-
[modules_3b67a421.padded]: icon !== undefined || checkbox !== undefined || glyph !== undefined
|
121
|
-
});
|
122
|
-
var style = {
|
123
|
-
paddingLeft: "".concat((Number(level) || 0) * RING_UNIT + DEFAULT_PADDING + (showCheckbox ? CHECKBOX_WIDTH : 0), "px")
|
124
|
-
};
|
125
|
-
var computedTitle = null;
|
126
|
-
if (this._isString(title)) {
|
127
|
-
// if title is specified and is a string then use it
|
128
|
-
computedTitle = title;
|
129
|
-
} else {
|
130
|
-
// otherwise use label if it is a string;
|
131
|
-
// label can also be an element, use empty string in this case
|
132
|
-
computedTitle = this._isString(label) ? label : '';
|
133
|
-
}
|
134
|
-
var dataTest = joinDataTestAttributes({
|
135
|
-
'ring-list-item': (restProps['data-test'] || '').indexOf('ring-list-item') === -1,
|
136
|
-
'ring-list-item-action': !disabled,
|
137
|
-
'ring-list-item-selected': checkbox
|
138
|
-
}, restProps['data-test']);
|
139
|
-
var labelElement = /*#__PURE__*/jsx("span", {
|
140
|
-
className: modules_3b67a421.label,
|
141
|
-
title: computedTitle,
|
142
|
-
"data-test": "ring-list-item-label",
|
143
|
-
children: label
|
144
|
-
});
|
145
|
-
return /*#__PURE__*/jsxs("div", {
|
146
|
-
className: modules_3b67a421.itemContainer,
|
147
|
-
"data-test": dataTest,
|
148
|
-
children: [showCheckbox && /*#__PURE__*/jsx("div", {
|
149
|
-
className: modules_3b67a421.checkboxContainer,
|
150
|
-
children: /*#__PURE__*/jsx(Checkbox, {
|
151
|
-
"aria-labelledby": this.id,
|
152
|
-
checked: checkbox,
|
153
|
-
disabled: disabled,
|
154
|
-
onChange: onCheckboxChange,
|
155
|
-
onClick: this.stopBubbling
|
156
|
-
})
|
157
|
-
}), /*#__PURE__*/jsxs("button", {
|
158
|
-
id: this.id,
|
159
|
-
type: "button",
|
160
|
-
tabIndex: tabIndex,
|
161
|
-
onClick: onClick,
|
162
|
-
onMouseOver: onMouseOver,
|
163
|
-
onMouseDown: onMouseDown,
|
164
|
-
onFocus: onMouseOver,
|
165
|
-
onMouseUp: onMouseUp,
|
166
|
-
className: classes,
|
167
|
-
style: style,
|
92
|
+
const style = {
|
93
|
+
paddingLeft: "".concat((Number(level) || 0) * RING_UNIT + DEFAULT_PADDING + (showCheckbox ? CHECKBOX_WIDTH : 0), "px")
|
94
|
+
};
|
95
|
+
let computedTitle = null;
|
96
|
+
if (this._isString(title)) {
|
97
|
+
// if title is specified and is a string then use it
|
98
|
+
computedTitle = title;
|
99
|
+
} else {
|
100
|
+
// otherwise use label if it is a string;
|
101
|
+
// label can also be an element, use empty string in this case
|
102
|
+
computedTitle = this._isString(label) ? label : '';
|
103
|
+
}
|
104
|
+
const dataTest = joinDataTestAttributes({
|
105
|
+
'ring-list-item': (restProps['data-test'] || '').indexOf('ring-list-item') === -1,
|
106
|
+
'ring-list-item-action': !disabled,
|
107
|
+
'ring-list-item-selected': checkbox
|
108
|
+
}, restProps['data-test']);
|
109
|
+
const labelElement = /*#__PURE__*/jsx("span", {
|
110
|
+
className: modules_3b67a421.label,
|
111
|
+
title: computedTitle,
|
112
|
+
"data-test": "ring-list-item-label",
|
113
|
+
children: label
|
114
|
+
});
|
115
|
+
return /*#__PURE__*/jsxs("div", {
|
116
|
+
className: modules_3b67a421.itemContainer,
|
117
|
+
"data-test": dataTest,
|
118
|
+
children: [showCheckbox && /*#__PURE__*/jsx("div", {
|
119
|
+
className: modules_3b67a421.checkboxContainer,
|
120
|
+
children: /*#__PURE__*/jsx(Checkbox, {
|
121
|
+
"aria-labelledby": this.id,
|
122
|
+
checked: checkbox,
|
168
123
|
disabled: disabled,
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
backgroundImage: "url(\"".concat(icon, "\")")
|
202
|
-
}
|
203
|
-
}), rightNodes]
|
124
|
+
onChange: onCheckboxChange,
|
125
|
+
onClick: this.stopBubbling
|
126
|
+
})
|
127
|
+
}), /*#__PURE__*/jsxs("button", {
|
128
|
+
id: this.id,
|
129
|
+
type: "button",
|
130
|
+
tabIndex: tabIndex,
|
131
|
+
onClick: onClick,
|
132
|
+
onMouseOver: onMouseOver,
|
133
|
+
onMouseDown: onMouseDown,
|
134
|
+
onFocus: onMouseOver,
|
135
|
+
onMouseUp: onMouseUp,
|
136
|
+
className: classes,
|
137
|
+
style: style,
|
138
|
+
disabled: disabled,
|
139
|
+
children: [/*#__PURE__*/jsxs("div", {
|
140
|
+
className: modules_3b67a421.top,
|
141
|
+
onMouseOut: this.stopBubbling,
|
142
|
+
onBlur: this.stopBubbling,
|
143
|
+
children: [!showCheckbox && /*#__PURE__*/jsxs("div", {
|
144
|
+
className: modules_3b67a421.left,
|
145
|
+
children: [leftNodes, glyph && /*#__PURE__*/jsx(Icon, {
|
146
|
+
className: modules_3b67a421.glyph,
|
147
|
+
glyph: glyph,
|
148
|
+
size: this.props.iconSize,
|
149
|
+
suppressSizeWarning: this.props.suppressSizeWarning
|
150
|
+
}), (avatar || shouldShowGeneratedAvatar) && /*#__PURE__*/jsx(Avatar, {
|
151
|
+
className: modules_3b67a421.avatar,
|
152
|
+
url: avatar,
|
153
|
+
size: Size.Size20,
|
154
|
+
subavatar: subavatar,
|
155
|
+
username: username
|
204
156
|
})]
|
205
|
-
}),
|
206
|
-
className:
|
207
|
-
|
157
|
+
}), labelWrapper ? labelWrapper(labelElement) : labelElement, description && /*#__PURE__*/jsx("span", {
|
158
|
+
className: modules_3b67a421.description,
|
159
|
+
"data-test": "ring-list-item-description",
|
160
|
+
children: description
|
161
|
+
}), /*#__PURE__*/jsxs("div", {
|
162
|
+
className: modules_3b67a421.right,
|
163
|
+
children: [rightGlyph && /*#__PURE__*/jsx(Icon, {
|
164
|
+
className: modules_3b67a421.rightGlyph,
|
165
|
+
glyph: rightGlyph,
|
166
|
+
suppressSizeWarning: this.props.suppressSizeWarning,
|
167
|
+
size: this.props.iconSize
|
168
|
+
}), icon && /*#__PURE__*/jsx("div", {
|
169
|
+
className: modules_3b67a421.icon,
|
170
|
+
style: {
|
171
|
+
backgroundImage: "url(\"".concat(icon, "\")")
|
172
|
+
}
|
173
|
+
}), rightNodes]
|
208
174
|
})]
|
175
|
+
}), details && /*#__PURE__*/jsx("div", {
|
176
|
+
className: detailsClasses,
|
177
|
+
children: details
|
209
178
|
})]
|
210
|
-
})
|
211
|
-
}
|
212
|
-
}
|
213
|
-
}
|
179
|
+
})]
|
180
|
+
});
|
181
|
+
}
|
182
|
+
}
|
214
183
|
ListItem.propTypes = {
|
215
184
|
scrolling: PropTypes.bool,
|
216
185
|
hover: PropTypes.bool,
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import 'core-js/modules/es.symbol.js';
|
1
|
+
import { b as _objectSpread2, a as _objectWithoutProperties } from '../_helpers/_rollupPluginBabelHelpers.js';
|
3
2
|
import 'core-js/modules/es.symbol.description.js';
|
4
3
|
import { Component, PureComponent } from 'react';
|
5
4
|
import PropTypes from 'prop-types';
|
@@ -9,55 +8,47 @@ import joinDataTestAttributes from '../global/data-tests.js';
|
|
9
8
|
import { m as modules_3b67a421 } from '../_helpers/list.js';
|
10
9
|
import { jsx } from 'react/jsx-runtime';
|
11
10
|
import '../link/clickableLink.js';
|
12
|
-
import 'core-js/modules/
|
11
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
13
12
|
import '../_helpers/link.js';
|
14
13
|
import 'core-js/modules/es.array.reduce.js';
|
15
|
-
import 'core-js/modules/es.object.entries.js';
|
16
|
-
import 'core-js/modules/es.object.to-string.js';
|
17
14
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
const _excluded = ["scrolling", "data-test", "className", "label", "hover", "description", "rgItemType", "url", "onCheckboxChange", "disabled", "LinkComponent", "compact", "hoverClassName", "children"];
|
16
|
+
class ListLink extends PureComponent {
|
17
|
+
render() {
|
18
|
+
const _this$props = this.props,
|
19
|
+
{
|
20
|
+
scrolling,
|
21
|
+
'data-test': dataTest,
|
22
|
+
className,
|
23
|
+
label,
|
24
|
+
hover,
|
25
|
+
description,
|
26
|
+
rgItemType,
|
27
|
+
url,
|
28
|
+
onCheckboxChange,
|
29
|
+
disabled,
|
30
|
+
LinkComponent,
|
31
|
+
compact,
|
32
|
+
hoverClassName,
|
33
|
+
children
|
34
|
+
} = _this$props,
|
35
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
36
|
+
const classes = classNames(modules_3b67a421.item, className, {
|
37
|
+
[modules_3b67a421.actionLink]: !disabled,
|
38
|
+
[modules_3b67a421.compact]: compact,
|
39
|
+
[modules_3b67a421.scrolling]: scrolling
|
40
|
+
});
|
41
|
+
const Comp = LinkComponent ? linkHOC(LinkComponent) : Link;
|
42
|
+
return /*#__PURE__*/jsx(Comp, _objectSpread2(_objectSpread2({
|
43
|
+
pseudo: !this.props.href
|
44
|
+
}, restProps), {}, {
|
45
|
+
hover: hover && !disabled,
|
46
|
+
className: classes,
|
47
|
+
"data-test": joinDataTestAttributes('ring-list-link', dataTest),
|
48
|
+
children: label !== null && label !== void 0 ? label : children
|
49
|
+
}));
|
23
50
|
}
|
24
|
-
|
25
|
-
return _createClass(ListLink, [{
|
26
|
-
key: "render",
|
27
|
-
value: function render() {
|
28
|
-
var _this$props = this.props,
|
29
|
-
scrolling = _this$props.scrolling,
|
30
|
-
dataTest = _this$props['data-test'],
|
31
|
-
className = _this$props.className,
|
32
|
-
label = _this$props.label,
|
33
|
-
hover = _this$props.hover;
|
34
|
-
_this$props.description;
|
35
|
-
_this$props.rgItemType;
|
36
|
-
_this$props.url;
|
37
|
-
_this$props.onCheckboxChange;
|
38
|
-
var disabled = _this$props.disabled,
|
39
|
-
LinkComponent = _this$props.LinkComponent,
|
40
|
-
compact = _this$props.compact;
|
41
|
-
_this$props.hoverClassName;
|
42
|
-
var children = _this$props.children,
|
43
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
44
|
-
var classes = classNames(modules_3b67a421.item, className, {
|
45
|
-
[modules_3b67a421.actionLink]: !disabled,
|
46
|
-
[modules_3b67a421.compact]: compact,
|
47
|
-
[modules_3b67a421.scrolling]: scrolling
|
48
|
-
});
|
49
|
-
var Comp = LinkComponent ? linkHOC(LinkComponent) : Link;
|
50
|
-
return /*#__PURE__*/jsx(Comp, _objectSpread2(_objectSpread2({
|
51
|
-
pseudo: !this.props.href
|
52
|
-
}, restProps), {}, {
|
53
|
-
hover: hover && !disabled,
|
54
|
-
className: classes,
|
55
|
-
"data-test": joinDataTestAttributes('ring-list-link', dataTest),
|
56
|
-
children: label !== null && label !== void 0 ? label : children
|
57
|
-
}));
|
58
|
-
}
|
59
|
-
}]);
|
60
|
-
}(PureComponent);
|
51
|
+
}
|
61
52
|
ListLink.propTypes = _objectSpread2(_objectSpread2({}, Link.propTypes), {}, {
|
62
53
|
description: PropTypes.string,
|
63
54
|
label: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.func]),
|