@jetbrains/ring-ui 4.1.0-beta.9 → 4.1.1
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/CHANGELOG.md +13 -0
- package/README.md +17 -15
- package/babel.config.js +3 -2
- package/components/alert/alert.js +9 -3
- package/components/alert/container.css +1 -1
- package/components/alert-service/alert-service.examples.css +18 -0
- package/components/alert-service/alert-service.examples.js +21 -0
- package/components/alert-service/alert-service.js +10 -3
- package/components/analytics/analytics__fus-plugin.js +1 -1
- package/components/auth/auth.test.js +14 -7
- package/components/auth/auth__core.js +64 -33
- package/components/auth-dialog/auth-dialog.js +1 -0
- package/components/avatar/avatar.css +4 -1
- package/components/avatar/avatar.examples.js +3 -2
- package/components/avatar/avatar.js +31 -6
- package/components/avatar/fallback-avatar.js +136 -0
- package/components/avatar-editor-ng/avatar-editor-ng.css +2 -2
- package/components/avatar-editor-ng/avatar-editor-ng.js +2 -1
- package/components/avatar-editor-ng/{avatar-editor-ng.html → avatar-editor-ng__template.js} +2 -2
- package/components/button/button.css +2 -2
- package/components/button/button.js +4 -1
- package/components/button-group/button-group.js +1 -1
- package/components/button-group/caption.js +1 -1
- package/components/button-ng/button-ng.js +1 -1
- package/components/button-set-ng/button-set-ng.js +3 -1
- package/components/checkbox/checkbox.css +1 -1
- package/components/code/code.js +1 -1
- package/components/confirm/confirm.js +1 -0
- package/components/confirm-service/confirm-service.js +5 -5
- package/components/content-layout/content-layout.css +1 -1
- package/components/data-list/data-list.css +1 -1
- package/components/date-picker/date-input.js +5 -4
- package/components/date-picker/date-picker.css +34 -22
- package/components/date-picker/date-picker.js +16 -14
- package/components/date-picker/date-popup.js +22 -7
- package/components/date-picker/month-names.js +8 -5
- package/components/date-picker/month.js +6 -2
- package/components/date-picker/weekdays.js +10 -2
- package/components/dialog/dialog.examples.js +3 -1
- package/components/dialog/dialog.js +5 -2
- package/components/dialog/dialog.test.js +1 -1
- package/components/dialog/dialog__body-scroll-preventer.js +2 -2
- package/components/dialog-ng/dialog-ng.js +7 -8
- package/components/dialog-ng/{dialog-ng.html → dialog-ng__template.js} +2 -2
- package/components/dropdown/dropdown.examples.js +36 -1
- package/components/dropdown-menu/dropdown-menu.examples.js +47 -0
- package/components/dropdown-menu/dropdown-menu.js +117 -0
- package/components/dropdown-menu/dropdown-menu.test.js +76 -0
- package/components/error-bubble/error-bubble-legacy.css +1 -1
- package/components/error-bubble/error-bubble.css +1 -1
- package/components/error-bubble/error-bubble.examples.js +1 -1
- package/components/error-page/error-page.css +2 -2
- package/components/footer-ng/footer-ng.js +13 -3
- package/components/form/form.css +2 -2
- package/components/form-ng/form-ng.js +3 -1
- package/components/global/global.css +1 -1
- package/components/global/theme.js +1 -1
- package/components/global/variables.css +8 -1
- package/components/grid/grid.css +10 -9
- package/components/header/header.css +1 -1
- package/components/header/header.examples.js +7 -8
- package/components/header/profile.js +10 -11
- package/components/http/http.js +1 -1
- package/components/icon/icon.css +5 -4
- package/components/island/island.css +4 -3
- package/components/island-legacy/island-legacy.css +3 -1
- package/components/list/list.js +6 -1
- package/components/list/list__custom.js +9 -3
- package/components/list/list__item.js +8 -2
- package/components/list/list__link.js +2 -1
- package/components/loader-inline/loader-inline.css +1 -1
- package/components/loader-screen/loader-screen.css +1 -1
- package/components/message/message.css +1 -1
- package/components/message/message.examples.js +8 -5
- package/components/pager/pager.js +5 -3
- package/components/permissions/permissions.js +1 -1
- package/components/progress-bar/progress-bar.css +1 -1
- package/components/progress-bar/progress-bar.examples.js +3 -3
- package/components/progress-bar/progress-bar.js +5 -2
- package/components/progress-bar/progress-bar.test.js +12 -13
- package/components/progress-bar-ng/progress-bar-ng.examples.js +3 -3
- package/components/query-assist/query-assist.css +13 -3
- package/components/query-assist/query-assist.examples.js +3 -1
- package/components/query-assist/query-assist.js +56 -12
- package/components/query-assist/query-assist.test.js +37 -5
- package/components/save-field-ng/save-field-ng.css +0 -3
- package/components/save-field-ng/save-field-ng.js +3 -1
- package/components/save-field-ng/{save-field-ng.html → save-field-ng__template.js} +2 -2
- package/components/select/select.css +12 -7
- package/components/select/select.examples.js +13 -0
- package/components/select/select.js +30 -43
- package/components/select/select.test.js +4 -5
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.css +1 -1
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.js +1 -1
- package/components/shortcuts-hint-ng/{shortcuts-hint-ng.html → shortcuts-hint-ng__template.js} +2 -2
- package/components/sidebar/sidebar.css +1 -0
- package/components/sidebar-ng/sidebar-ng.js +6 -2
- package/components/sidebar-ng/{sidebar-ng__button.html → sidebar-ng__button-template.js} +2 -2
- package/components/sidebar-ng/{sidebar-ng.html → sidebar-ng__template.js} +2 -2
- package/components/table/row.js +2 -1
- package/components/table/table.css +2 -1
- package/components/table-legacy/table-legacy.css +2 -2
- package/components/table-legacy/table-legacy__toolbar.css +2 -2
- package/components/table-legacy-ng/table-legacy-ng.js +38 -5
- package/components/table-legacy-ng/table-legacy-ng__pager.js +7 -1
- package/components/tabs/collapsible-tab.js +2 -2
- package/components/tabs/collapsible-tabs.js +4 -8
- package/components/tabs/tab-link.js +4 -2
- package/components/tabs/tabs.css +27 -0
- package/components/tabs-ng/tabs-ng.js +4 -2
- package/components/tabs-ng/{tabs-ng.html → tabs-ng__template.js} +6 -2
- package/components/tag/tag.css +5 -2
- package/components/tag/tag.examples.js +3 -0
- package/components/tag/tag.js +19 -16
- package/components/tags-input/tag-input.examples.js +1 -1
- package/components/tags-input/tags-input.js +5 -2
- package/components/template-ng/template-ng.js +1 -1
- package/components/tooltip/tooltip.js +7 -2
- package/components/user-agreement/user-agreement.css +1 -1
- package/components/user-agreement/user-agreement.examples.js +7 -4
- package/components/user-agreement/user-agreement.js +1 -0
- package/package.json +75 -78
- package/webpack.config.js +14 -10
- package/components/button-set-ng/button-set-ng.html +0 -1
- package/components/footer-ng/footer-ng.html +0 -13
- package/components/form-ng/form-ng__error-bubble.html +0 -3
- package/components/table-legacy-ng/table-legacy-ng.html +0 -4
- package/components/table-legacy-ng/table-legacy-ng__column.html +0 -12
- package/components/table-legacy-ng/table-legacy-ng__header.html +0 -4
- package/components/table-legacy-ng/table-legacy-ng__pager.html +0 -7
- package/components/table-legacy-ng/table-legacy-ng__row.html +0 -12
- package/components/table-legacy-ng/table-legacy-ng__title.html +0 -9
- package/dist/_helpers/_rollupPluginBabelHelpers.js +0 -127
- package/dist/_helpers/anchor.js +0 -33
- package/dist/_helpers/badge.js +0 -3
- package/dist/_helpers/button__classes.js +0 -39
- package/dist/_helpers/caption.js +0 -25
- package/dist/_helpers/card.js +0 -77
- package/dist/_helpers/date-picker.js +0 -3
- package/dist/_helpers/dialog__body-scroll-preventer.js +0 -56
- package/dist/_helpers/grid.js +0 -3
- package/dist/_helpers/header.js +0 -3
- package/dist/_helpers/icon__svg.js +0 -83
- package/dist/_helpers/inject-styles.js +0 -22
- package/dist/_helpers/island.js +0 -3
- package/dist/_helpers/list.js +0 -3
- package/dist/_helpers/query-assist__suggestions.js +0 -95
- package/dist/_helpers/select__filter.js +0 -78
- package/dist/_helpers/services-link.js +0 -42
- package/dist/_helpers/sidebar.js +0 -127
- package/dist/_helpers/table.js +0 -3
- package/dist/_helpers/tabs.js +0 -3
- package/dist/_helpers/title.js +0 -99
- package/dist/alert/alert.js +0 -254
- package/dist/alert/container.js +0 -50
- package/dist/alert-service/alert-service.js +0 -159
- package/dist/analytics/analytics.js +0 -116
- package/dist/analytics/analytics__custom-plugin.js +0 -127
- package/dist/analytics/analytics__fus-plugin.js +0 -101
- package/dist/analytics/analytics__ga-plugin.js +0 -66
- package/dist/analytics/analytics__plugin-utils.js +0 -79
- package/dist/auth/auth.js +0 -90
- package/dist/auth/auth__core.js +0 -987
- package/dist/auth/background-flow.js +0 -123
- package/dist/auth/down-notification.js +0 -111
- package/dist/auth/iframe-flow.js +0 -147
- package/dist/auth/landing-entry.js +0 -5
- package/dist/auth/landing.js +0 -84
- package/dist/auth/request-builder.js +0 -75
- package/dist/auth/response-parser.js +0 -117
- package/dist/auth/storage.js +0 -279
- package/dist/auth/token-validator.js +0 -176
- package/dist/auth/window-flow.js +0 -133
- package/dist/auth-dialog/auth-dialog.js +0 -132
- package/dist/auth-dialog-service/auth-dialog-service.js +0 -67
- package/dist/avatar/avatar-example-datauri.js +0 -26
- package/dist/avatar/avatar.js +0 -155
- package/dist/badge/badge.js +0 -52
- package/dist/button/button.js +0 -117
- package/dist/button/button__classes.js +0 -5
- package/dist/button-group/button-group.js +0 -30
- package/dist/button-group/caption.js +0 -5
- package/dist/button-set/button-set.js +0 -27
- package/dist/button-toolbar/button-toolbar.js +0 -30
- package/dist/caret/caret.js +0 -264
- package/dist/checkbox/checkbox.js +0 -110
- package/dist/confirm/confirm.js +0 -122
- package/dist/confirm-service/confirm-service.js +0 -112
- package/dist/content-layout/content-layout.js +0 -67
- package/dist/content-layout/sidebar.js +0 -6
- package/dist/contenteditable/contenteditable.js +0 -81
- package/dist/data-list/data-list.js +0 -203
- package/dist/data-list/data-list.mock.js +0 -190
- package/dist/data-list/item.js +0 -225
- package/dist/data-list/selection.js +0 -101
- package/dist/data-list/title.js +0 -16
- package/dist/date-picker/consts.js +0 -70
- package/dist/date-picker/date-input.js +0 -169
- package/dist/date-picker/date-picker.js +0 -356
- package/dist/date-picker/date-popup.js +0 -459
- package/dist/date-picker/day.js +0 -119
- package/dist/date-picker/formats.js +0 -3
- package/dist/date-picker/month-names.js +0 -92
- package/dist/date-picker/month-slider.js +0 -83
- package/dist/date-picker/month.js +0 -48
- package/dist/date-picker/months.js +0 -121
- package/dist/date-picker/weekdays.js +0 -24
- package/dist/date-picker/years.js +0 -109
- package/dist/dialog/dialog.js +0 -197
- package/dist/dialog/dialog__body-scroll-preventer.js +0 -2
- package/dist/dropdown/anchor.js +0 -16
- package/dist/dropdown/dropdown.js +0 -236
- package/dist/error-bubble/error-bubble.js +0 -59
- package/dist/error-message/error-message.js +0 -55
- package/dist/footer/footer.js +0 -127
- package/dist/global/angular-component-factory.js +0 -83
- package/dist/global/compose.js +0 -9
- package/dist/global/composeRefs.js +0 -15
- package/dist/global/conic-gradient.js +0 -37
- package/dist/global/create-stateful-context.js +0 -54
- package/dist/global/data-tests.js +0 -22
- package/dist/global/dom.js +0 -124
- package/dist/global/focus-sensor-hoc.js +0 -147
- package/dist/global/fuzzy-highlight.js +0 -67
- package/dist/global/get-event-key.js +0 -111
- package/dist/global/get-uid.js +0 -15
- package/dist/global/inject-styles.js +0 -17
- package/dist/global/linear-function.js +0 -18
- package/dist/global/listeners.js +0 -42
- package/dist/global/memoize.js +0 -18
- package/dist/global/normalize-indent.js +0 -28
- package/dist/global/promise-with-timeout.js +0 -13
- package/dist/global/radial-gradient-mask.js +0 -49
- package/dist/global/react-dom-renderer.js +0 -45
- package/dist/global/rerender-hoc.js +0 -53
- package/dist/global/ring-angular-component.js +0 -24
- package/dist/global/schedule-raf.js +0 -31
- package/dist/global/sniffer.js +0 -6
- package/dist/global/supports-css.js +0 -20
- package/dist/global/theme.js +0 -56
- package/dist/global/trivial-template-tag.js +0 -15
- package/dist/global/url.js +0 -163
- package/dist/global/variables_dark.js +0 -57
- package/dist/grid/col.js +0 -62
- package/dist/grid/grid.js +0 -35
- package/dist/grid/row.js +0 -66
- package/dist/group/group.js +0 -34
- package/dist/header/header.js +0 -144
- package/dist/header/logo.js +0 -39
- package/dist/header/profile.js +0 -212
- package/dist/header/services-link.js +0 -10
- package/dist/header/services.js +0 -135
- package/dist/header/smart-profile.js +0 -227
- package/dist/header/smart-services.js +0 -159
- package/dist/header/tray-icon.js +0 -45
- package/dist/header/tray.js +0 -33
- package/dist/heading/heading.js +0 -76
- package/dist/http/http.js +0 -216
- package/dist/http/http.mock.js +0 -65
- package/dist/hub-source/hub-source.js +0 -130
- package/dist/hub-source/hub-source__user.js +0 -28
- package/dist/hub-source/hub-source__users-groups.js +0 -62
- package/dist/icon/icon.js +0 -105
- package/dist/icon/icon__constants.js +0 -33
- package/dist/icon/icon__svg.js +0 -6
- package/dist/icon/index.js +0 -9
- package/dist/input/input.js +0 -231
- package/dist/island/adaptive-island-hoc.js +0 -48
- package/dist/island/content.js +0 -158
- package/dist/island/header.js +0 -85
- package/dist/island/island.js +0 -53
- package/dist/island-legacy/content-legacy.js +0 -28
- package/dist/island-legacy/header-legacy.js +0 -30
- package/dist/island-legacy/island-legacy.js +0 -30
- package/dist/link/clickableLink.js +0 -65
- package/dist/link/link.js +0 -118
- package/dist/list/consts.js +0 -26
- package/dist/list/list.js +0 -800
- package/dist/list/list__custom.js +0 -82
- package/dist/list/list__hint.js +0 -26
- package/dist/list/list__item.js +0 -197
- package/dist/list/list__link.js +0 -65
- package/dist/list/list__separator.js +0 -30
- package/dist/list/list__title.js +0 -39
- package/dist/list/list__users-groups-source.js +0 -124
- package/dist/loader/loader.js +0 -72
- package/dist/loader/loader__core.js +0 -272
- package/dist/loader-inline/inject-styles.js +0 -11
- package/dist/loader-inline/loader-inline.js +0 -58
- package/dist/loader-screen/loader-screen.js +0 -46
- package/dist/login-dialog/login-dialog.js +0 -184
- package/dist/login-dialog/service.js +0 -67
- package/dist/message/message.js +0 -232
- package/dist/old-browsers-message/old-browsers-message.js +0 -101
- package/dist/old-browsers-message/old-browsers-message__stop.js +0 -5
- package/dist/old-browsers-message/white-list.js +0 -34
- package/dist/pager/pager.js +0 -352
- package/dist/panel/panel.js +0 -34
- package/dist/permissions/permissions.js +0 -200
- package/dist/permissions/permissions__cache.js +0 -272
- package/dist/popup/popup.consts.js +0 -41
- package/dist/popup/popup.js +0 -389
- package/dist/popup/popup.target.js +0 -27
- package/dist/popup/position.js +0 -280
- package/dist/popup-menu/popup-menu.js +0 -108
- package/dist/progress-bar/progress-bar.js +0 -111
- package/dist/proxy-attrs/proxy-attrs.js +0 -19
- package/dist/query-assist/query-assist.js +0 -1023
- package/dist/query-assist/query-assist__suggestions.js +0 -43
- package/dist/radio/radio.js +0 -39
- package/dist/radio/radio__item.js +0 -82
- package/dist/select/select.js +0 -1335
- package/dist/select/select__filter.js +0 -49
- package/dist/select/select__popup.js +0 -541
- package/dist/shortcuts/core.js +0 -245
- package/dist/shortcuts/shortcut-title.js +0 -51
- package/dist/shortcuts/shortcuts-hoc.js +0 -43
- package/dist/shortcuts/shortcuts.js +0 -72
- package/dist/storage/storage.js +0 -55
- package/dist/storage/storage__fallback.js +0 -214
- package/dist/storage/storage__local.js +0 -150
- package/dist/style.css +0 -1
- package/dist/tab-trap/tab-trap.js +0 -178
- package/dist/table/cell.js +0 -25
- package/dist/table/disable-hover-hoc.js +0 -53
- package/dist/table/header-cell.js +0 -91
- package/dist/table/header.js +0 -189
- package/dist/table/multitable.js +0 -140
- package/dist/table/row-with-focus-sensor.js +0 -79
- package/dist/table/row.js +0 -270
- package/dist/table/selection-adapter.js +0 -14
- package/dist/table/selection-shortcuts-hoc.js +0 -212
- package/dist/table/selection.js +0 -221
- package/dist/table/smart-table.js +0 -113
- package/dist/table/table.js +0 -405
- package/dist/tabs/collapsible-more.js +0 -193
- package/dist/tabs/collapsible-tab.js +0 -90
- package/dist/tabs/collapsible-tabs.js +0 -361
- package/dist/tabs/custom-item.js +0 -13
- package/dist/tabs/dumb-tabs.js +0 -159
- package/dist/tabs/smart-tabs.js +0 -102
- package/dist/tabs/tab-link.js +0 -35
- package/dist/tabs/tab.js +0 -32
- package/dist/tabs/tabs.js +0 -65
- package/dist/tag/tag.js +0 -190
- package/dist/tags-input/tags-input.js +0 -474
- package/dist/tags-list/tags-list.js +0 -94
- package/dist/text/text.js +0 -38
- package/dist/toggle/toggle.js +0 -80
- package/dist/tooltip/tooltip.js +0 -205
- package/dist/user-card/card.js +0 -14
- package/dist/user-card/smart-user-card-tooltip.js +0 -112
- package/dist/user-card/tooltip.js +0 -91
- package/dist/user-card/user-card.js +0 -46
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { _ as _defineProperty, c as _objectSpread2, a as _objectWithoutProperties, b as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { renderToStaticMarkup } from 'react-dom/server';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @name ContentEditable
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
function noop() {}
|
|
11
|
-
|
|
12
|
-
const commonPropTypes = {
|
|
13
|
-
disabled: PropTypes.bool,
|
|
14
|
-
tabIndex: PropTypes.number,
|
|
15
|
-
componentDidUpdate: PropTypes.func,
|
|
16
|
-
onComponentUpdate: PropTypes.func,
|
|
17
|
-
className: PropTypes.string,
|
|
18
|
-
inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
class ContentEditableBase extends Component {
|
|
22
|
-
shouldComponentUpdate(nextProps) {
|
|
23
|
-
return nextProps.disabled !== this.props.disabled || nextProps.__html !== this.props.__html;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
componentDidUpdate(prevProps, prevState) {
|
|
27
|
-
this.props.onComponentUpdate(prevProps, prevState);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
render() {
|
|
31
|
-
const _this$props = this.props,
|
|
32
|
-
{
|
|
33
|
-
__html,
|
|
34
|
-
onComponentUpdate,
|
|
35
|
-
disabled,
|
|
36
|
-
tabIndex,
|
|
37
|
-
inputRef
|
|
38
|
-
} = _this$props,
|
|
39
|
-
props = _objectWithoutProperties(_this$props, ["__html", "onComponentUpdate", "disabled", "tabIndex", "inputRef"]);
|
|
40
|
-
|
|
41
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
42
|
-
ref: inputRef,
|
|
43
|
-
disabled: disabled,
|
|
44
|
-
role: "textbox",
|
|
45
|
-
tabIndex: disabled ? null : tabIndex,
|
|
46
|
-
contentEditable: !this.props.disabled,
|
|
47
|
-
dangerouslySetInnerHTML: {
|
|
48
|
-
__html
|
|
49
|
-
}
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
_defineProperty(ContentEditableBase, "propTypes", _objectSpread2(_objectSpread2({}, commonPropTypes), {}, {
|
|
56
|
-
__html: PropTypes.string
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
_defineProperty(ContentEditableBase, "defaultProps", {
|
|
60
|
-
disabled: false,
|
|
61
|
-
tabIndex: 0,
|
|
62
|
-
onInput: noop,
|
|
63
|
-
onComponentUpdate: noop
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
const ContentEditable = _ref => {
|
|
67
|
-
let {
|
|
68
|
-
children
|
|
69
|
-
} = _ref,
|
|
70
|
-
props = _objectWithoutProperties(_ref, ["children"]);
|
|
71
|
-
|
|
72
|
-
return /*#__PURE__*/React.createElement(ContentEditableBase, _extends({}, props, {
|
|
73
|
-
__html: renderToStaticMarkup(children)
|
|
74
|
-
}));
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
ContentEditable.propTypes = _objectSpread2(_objectSpread2({}, commonPropTypes), {}, {
|
|
78
|
-
children: PropTypes.node
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
export default ContentEditable;
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { _ as _defineProperty, c as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import focusSensorHOC from '../global/focus-sensor-hoc.js';
|
|
6
|
-
import selectionShortcutsHOC from '../table/selection-shortcuts-hoc.js';
|
|
7
|
-
import disableHoverHOC from '../table/disable-hover-hoc.js';
|
|
8
|
-
import getUID from '../global/get-uid.js';
|
|
9
|
-
import Shortcuts from '../shortcuts/shortcuts.js';
|
|
10
|
-
import Loader from '../loader/loader.js';
|
|
11
|
-
import Item, { moreLessButtonStates } from './item.js';
|
|
12
|
-
import { m as modules_09d014b4 } from '../_helpers/title.js';
|
|
13
|
-
import '../global/composeRefs.js';
|
|
14
|
-
import '../table/selection.js';
|
|
15
|
-
import '../shortcuts/core.js';
|
|
16
|
-
import 'combokeys';
|
|
17
|
-
import '../global/sniffer.js';
|
|
18
|
-
import 'sniffr';
|
|
19
|
-
import '../global/data-tests.js';
|
|
20
|
-
import '../loader/loader__core.js';
|
|
21
|
-
import '../global/dom.js';
|
|
22
|
-
import '@jetbrains/icons/chevron-right';
|
|
23
|
-
import '@jetbrains/icons/chevron-down';
|
|
24
|
-
import '../link/link.js';
|
|
25
|
-
import 'focus-visible';
|
|
26
|
-
import '../global/memoize.js';
|
|
27
|
-
import '../link/clickableLink.js';
|
|
28
|
-
import '../text/text.js';
|
|
29
|
-
import '../loader-inline/loader-inline.js';
|
|
30
|
-
import '../global/theme.js';
|
|
31
|
-
import '../_helpers/inject-styles.js';
|
|
32
|
-
import '../global/conic-gradient.js';
|
|
33
|
-
import 'conic-gradient';
|
|
34
|
-
import '../global/supports-css.js';
|
|
35
|
-
import '../global/inject-styles.js';
|
|
36
|
-
import '../global/radial-gradient-mask.js';
|
|
37
|
-
import '../button/button.js';
|
|
38
|
-
import '@jetbrains/icons/chevron-10px';
|
|
39
|
-
import '../icon/icon.js';
|
|
40
|
-
import 'util-deprecate';
|
|
41
|
-
import '../icon/icon__constants.js';
|
|
42
|
-
import '../_helpers/icon__svg.js';
|
|
43
|
-
import '../_helpers/button__classes.js';
|
|
44
|
-
import '../checkbox/checkbox.js';
|
|
45
|
-
import '@jetbrains/icons/checkmark';
|
|
46
|
-
import '@jetbrains/icons/remove-10px';
|
|
47
|
-
|
|
48
|
-
class DataList extends PureComponent {
|
|
49
|
-
constructor() {
|
|
50
|
-
super(...arguments);
|
|
51
|
-
|
|
52
|
-
_defineProperty(this, "shortcutsScope", getUID('ring-data-list-'));
|
|
53
|
-
|
|
54
|
-
_defineProperty(this, "onItemFocus", item => {
|
|
55
|
-
const {
|
|
56
|
-
selection,
|
|
57
|
-
onSelect
|
|
58
|
-
} = this.props;
|
|
59
|
-
onSelect(selection.focus(item));
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
_defineProperty(this, "onItemSelect", (item, selected) => {
|
|
63
|
-
const {
|
|
64
|
-
selection,
|
|
65
|
-
onSelect
|
|
66
|
-
} = this.props;
|
|
67
|
-
|
|
68
|
-
if (selected) {
|
|
69
|
-
onSelect(selection.select(item));
|
|
70
|
-
} else {
|
|
71
|
-
onSelect(selection.deselect(item));
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
_defineProperty(this, "onEqualPress", () => {
|
|
76
|
-
const {
|
|
77
|
-
selection,
|
|
78
|
-
itemFormatter
|
|
79
|
-
} = this.props;
|
|
80
|
-
const item = itemFormatter(selection.getFocused());
|
|
81
|
-
|
|
82
|
-
if (item.collapsed) {
|
|
83
|
-
item.onExpand();
|
|
84
|
-
} else {
|
|
85
|
-
item.onCollapse();
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
_defineProperty(this, "shortcutsMap", {
|
|
90
|
-
'=': this.onEqualPress
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
componentDidUpdate(prevProps) {
|
|
95
|
-
const {
|
|
96
|
-
data,
|
|
97
|
-
selection,
|
|
98
|
-
onSelect,
|
|
99
|
-
selectable
|
|
100
|
-
} = this.props;
|
|
101
|
-
|
|
102
|
-
if (data !== prevProps.data && !prevProps.remoteSelection) {
|
|
103
|
-
onSelect(selection.cloneWith({
|
|
104
|
-
data
|
|
105
|
-
}));
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (!selectable && prevProps.selectable) {
|
|
109
|
-
onSelect(selection.resetSelection());
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
render() {
|
|
114
|
-
const {
|
|
115
|
-
data,
|
|
116
|
-
className,
|
|
117
|
-
loading,
|
|
118
|
-
selection,
|
|
119
|
-
disabledHover,
|
|
120
|
-
itemFormatter,
|
|
121
|
-
focused,
|
|
122
|
-
innerRef
|
|
123
|
-
} = this.props;
|
|
124
|
-
|
|
125
|
-
const shortcutsMap = _objectSpread2(_objectSpread2({}, this.shortcutsMap), this.props.shortcutsMap);
|
|
126
|
-
|
|
127
|
-
const classes = classNames(className, {
|
|
128
|
-
[modules_09d014b4.dataList]: true,
|
|
129
|
-
[modules_09d014b4.disabledHover]: disabledHover,
|
|
130
|
-
[modules_09d014b4.multiSelection]: selection.getSelected().size > 0
|
|
131
|
-
});
|
|
132
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
133
|
-
className: modules_09d014b4.dataListWrapper,
|
|
134
|
-
"data-test": "ring-data-list",
|
|
135
|
-
ref: innerRef
|
|
136
|
-
}, focused && /*#__PURE__*/React.createElement(Shortcuts, {
|
|
137
|
-
map: shortcutsMap,
|
|
138
|
-
scope: this.shortcutsScope
|
|
139
|
-
}), /*#__PURE__*/React.createElement("ul", {
|
|
140
|
-
className: classes
|
|
141
|
-
}, data.map(model => {
|
|
142
|
-
const item = itemFormatter(model);
|
|
143
|
-
const {
|
|
144
|
-
id,
|
|
145
|
-
key,
|
|
146
|
-
title,
|
|
147
|
-
items
|
|
148
|
-
} = item;
|
|
149
|
-
const showMoreLessButton = this.props.itemMoreLessState(item);
|
|
150
|
-
return /*#__PURE__*/React.createElement(Item, {
|
|
151
|
-
key: key || id,
|
|
152
|
-
item: model,
|
|
153
|
-
title: title,
|
|
154
|
-
items: items,
|
|
155
|
-
itemFormatter: itemFormatter,
|
|
156
|
-
collapsible: item.collapsible,
|
|
157
|
-
collapsed: item.collapsed,
|
|
158
|
-
onCollapse: item.onCollapse,
|
|
159
|
-
onExpand: item.onExpand,
|
|
160
|
-
focused: selection.isFocused(model),
|
|
161
|
-
showFocus: selection.isFocused(model),
|
|
162
|
-
onFocus: this.onItemFocus,
|
|
163
|
-
selection: selection,
|
|
164
|
-
selectable: item.selectable,
|
|
165
|
-
selected: selection.isSelected(model),
|
|
166
|
-
onSelect: this.onItemSelect,
|
|
167
|
-
showMoreLessButton: showMoreLessButton,
|
|
168
|
-
onItemMoreLess: this.props.onItemMoreLess
|
|
169
|
-
});
|
|
170
|
-
})), loading && /*#__PURE__*/React.createElement("div", {
|
|
171
|
-
className: data.length > 0 ? modules_09d014b4.loadingOverlay : null
|
|
172
|
-
}, /*#__PURE__*/React.createElement(Loader, null)));
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
_defineProperty(DataList, "propTypes", {
|
|
178
|
-
className: PropTypes.string,
|
|
179
|
-
data: PropTypes.array.isRequired,
|
|
180
|
-
loading: PropTypes.bool,
|
|
181
|
-
focused: PropTypes.bool,
|
|
182
|
-
disabledHover: PropTypes.bool,
|
|
183
|
-
selection: PropTypes.object,
|
|
184
|
-
selectable: PropTypes.bool,
|
|
185
|
-
shortcutsMap: PropTypes.object,
|
|
186
|
-
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func]),
|
|
187
|
-
itemFormatter: PropTypes.func.isRequired,
|
|
188
|
-
onItemMoreLess: PropTypes.func,
|
|
189
|
-
itemMoreLessState: PropTypes.func,
|
|
190
|
-
onSelect: PropTypes.func,
|
|
191
|
-
remoteSelection: PropTypes.bool
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
_defineProperty(DataList, "defaultProps", {
|
|
195
|
-
loading: false,
|
|
196
|
-
onItemMoreLess: () => {},
|
|
197
|
-
itemMoreLessState: () => moreLessButtonStates.UNUSED,
|
|
198
|
-
remoteSelection: false
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
var dataList = disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(DataList)));
|
|
202
|
-
|
|
203
|
-
export default dataList;
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Link from '../link/link.js';
|
|
3
|
-
import Badge from '../badge/badge.js';
|
|
4
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
5
|
-
import 'focus-visible';
|
|
6
|
-
import 'prop-types';
|
|
7
|
-
import 'classnames';
|
|
8
|
-
import '../global/memoize.js';
|
|
9
|
-
import '../global/data-tests.js';
|
|
10
|
-
import '../link/clickableLink.js';
|
|
11
|
-
import '../_helpers/badge.js';
|
|
12
|
-
|
|
13
|
-
var dataList_mock = [{
|
|
14
|
-
id: 1,
|
|
15
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("strong", null, "Assigner"), " in 60 projects"),
|
|
16
|
-
collapsible: true,
|
|
17
|
-
selectable: true,
|
|
18
|
-
items: [{
|
|
19
|
-
id: 11,
|
|
20
|
-
title: '6 projects: as a member of jetbrains-team',
|
|
21
|
-
collapsible: true,
|
|
22
|
-
selectable: true,
|
|
23
|
-
items: [{
|
|
24
|
-
id: 111,
|
|
25
|
-
selectable: true,
|
|
26
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
27
|
-
href: "#"
|
|
28
|
-
}, "TeamCity")
|
|
29
|
-
}, {
|
|
30
|
-
id: 112,
|
|
31
|
-
selectable: true,
|
|
32
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
33
|
-
href: "#"
|
|
34
|
-
}, "YouTrack")
|
|
35
|
-
}, {
|
|
36
|
-
id: 113,
|
|
37
|
-
selectable: true,
|
|
38
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
39
|
-
href: "#"
|
|
40
|
-
}, "Sandbox")
|
|
41
|
-
}, {
|
|
42
|
-
id: 114,
|
|
43
|
-
selectable: true,
|
|
44
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
45
|
-
href: "#"
|
|
46
|
-
}, "Exception Analyzer")
|
|
47
|
-
}, {
|
|
48
|
-
id: 115,
|
|
49
|
-
selectable: true,
|
|
50
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
51
|
-
href: "#"
|
|
52
|
-
}, "MPS")
|
|
53
|
-
}]
|
|
54
|
-
}]
|
|
55
|
-
}, {
|
|
56
|
-
id: 2,
|
|
57
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("strong", null, "Code Reviewer"), " in 5 projects"),
|
|
58
|
-
selectable: true,
|
|
59
|
-
collapsible: true,
|
|
60
|
-
items: [{
|
|
61
|
-
id: 21,
|
|
62
|
-
selectable: true,
|
|
63
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Link, {
|
|
64
|
-
href: "#"
|
|
65
|
-
}, "JetProfile"), /*#__PURE__*/React.createElement("span", null, " "), /*#__PURE__*/React.createElement(Badge, {
|
|
66
|
-
gray: true
|
|
67
|
-
}, "duplicate"))
|
|
68
|
-
}, {
|
|
69
|
-
id: 22,
|
|
70
|
-
title: '6 projects: as a member of jetbrains-team',
|
|
71
|
-
collapsible: true,
|
|
72
|
-
items: [{
|
|
73
|
-
id: 221,
|
|
74
|
-
collapsible: true,
|
|
75
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
76
|
-
href: "#"
|
|
77
|
-
}, "TeamCity")
|
|
78
|
-
}, {
|
|
79
|
-
id: 222,
|
|
80
|
-
collapsible: true,
|
|
81
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
82
|
-
href: "#"
|
|
83
|
-
}, "YouTrack")
|
|
84
|
-
}, {
|
|
85
|
-
id: 223,
|
|
86
|
-
collapsible: true,
|
|
87
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
88
|
-
href: "#"
|
|
89
|
-
}, "Sandbox")
|
|
90
|
-
}, {
|
|
91
|
-
id: 224,
|
|
92
|
-
collapsible: true,
|
|
93
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
94
|
-
href: "#"
|
|
95
|
-
}, "Exception Analyzer")
|
|
96
|
-
}, {
|
|
97
|
-
id: 225,
|
|
98
|
-
collapsible: true,
|
|
99
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
100
|
-
href: "#"
|
|
101
|
-
}, "MPS")
|
|
102
|
-
}]
|
|
103
|
-
}, {
|
|
104
|
-
id: 23,
|
|
105
|
-
collapsible: true,
|
|
106
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Link, {
|
|
107
|
-
href: "#"
|
|
108
|
-
}, "CustomJDK"), /*#__PURE__*/React.createElement("span", null, ": as a member of ide-developers"))
|
|
109
|
-
}]
|
|
110
|
-
}, {
|
|
111
|
-
id: 3,
|
|
112
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("strong", null, "Code Viewer"), " in 5 projects"),
|
|
113
|
-
selectable: true,
|
|
114
|
-
collapsible: true,
|
|
115
|
-
items: [{
|
|
116
|
-
id: 31,
|
|
117
|
-
collapsible: true,
|
|
118
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Link, {
|
|
119
|
-
href: "#"
|
|
120
|
-
}, "ide-frontend"), /*#__PURE__*/React.createElement("span", null, ": as a member of ide-developers"))
|
|
121
|
-
}, {
|
|
122
|
-
id: 32,
|
|
123
|
-
collapsible: true,
|
|
124
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Link, {
|
|
125
|
-
href: "#"
|
|
126
|
-
}, "ide-frontend"), /*#__PURE__*/React.createElement("span", null, ": as a member of ide-frontend Code Viewers"))
|
|
127
|
-
}]
|
|
128
|
-
}, {
|
|
129
|
-
id: 4,
|
|
130
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("strong", null, "Commenter"), " in 12 projects"),
|
|
131
|
-
collapsible: true,
|
|
132
|
-
items: [{
|
|
133
|
-
id: 41,
|
|
134
|
-
collapsible: true,
|
|
135
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Link, {
|
|
136
|
-
href: "#"
|
|
137
|
-
}, "Intellij IDEA"), /*#__PURE__*/React.createElement("span", null, ": as a member of Registered Users"))
|
|
138
|
-
}, {
|
|
139
|
-
id: 42,
|
|
140
|
-
collapsible: true,
|
|
141
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Link, {
|
|
142
|
-
href: "#"
|
|
143
|
-
}, "YouTrack Backlog"), /*#__PURE__*/React.createElement("span", null, ": as a member of jetbrains-team"))
|
|
144
|
-
}]
|
|
145
|
-
}, {
|
|
146
|
-
id: 5,
|
|
147
|
-
collapsible: true,
|
|
148
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("strong", null, "Developer"), /*#__PURE__*/React.createElement("span", null, " in 57 projects "), /*#__PURE__*/React.createElement(Badge, null, "team role")),
|
|
149
|
-
items: [{
|
|
150
|
-
id: 51,
|
|
151
|
-
selectable: true,
|
|
152
|
-
collapsible: true,
|
|
153
|
-
title: /*#__PURE__*/React.createElement(Link, {
|
|
154
|
-
href: "#"
|
|
155
|
-
}, "Wasabi")
|
|
156
|
-
}]
|
|
157
|
-
}, {
|
|
158
|
-
id: 6,
|
|
159
|
-
collapsible: true,
|
|
160
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("strong", null, "Git Hosting Admin"), /*#__PURE__*/React.createElement("span", null, " in project "), /*#__PURE__*/React.createElement(Link, {
|
|
161
|
-
href: "#"
|
|
162
|
-
}, "Hackathon 2016"), /*#__PURE__*/React.createElement("span", null, ": as a member of jetbrains-team"))
|
|
163
|
-
}, {
|
|
164
|
-
id: 7,
|
|
165
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("strong", null, "Git Hosting Checkout"), " in 7 projects"),
|
|
166
|
-
selectable: true,
|
|
167
|
-
collapsible: true
|
|
168
|
-
}];
|
|
169
|
-
const moreItems = [{
|
|
170
|
-
id: 91,
|
|
171
|
-
selectable: true,
|
|
172
|
-
collapsible: true,
|
|
173
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Link, {
|
|
174
|
-
href: "#"
|
|
175
|
-
}, "More item 1"), /*#__PURE__*/React.createElement("span", null, " "), /*#__PURE__*/React.createElement(Badge, {
|
|
176
|
-
gray: true
|
|
177
|
-
}, "duplicate"))
|
|
178
|
-
}, {
|
|
179
|
-
id: 92,
|
|
180
|
-
selectable: true,
|
|
181
|
-
collapsible: true,
|
|
182
|
-
title: /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Link, {
|
|
183
|
-
href: "#"
|
|
184
|
-
}, "More item 2"), /*#__PURE__*/React.createElement("span", null, " "), /*#__PURE__*/React.createElement(Badge, {
|
|
185
|
-
gray: true
|
|
186
|
-
}, "duplicate"))
|
|
187
|
-
}];
|
|
188
|
-
|
|
189
|
-
export default dataList_mock;
|
|
190
|
-
export { moreItems };
|
package/dist/data-list/item.js
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { PureComponent } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import chevronRightIcon from '@jetbrains/icons/chevron-right';
|
|
5
|
-
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
|
6
|
-
import Link from '../link/link.js';
|
|
7
|
-
import Text from '../text/text.js';
|
|
8
|
-
import LoaderInline from '../loader-inline/loader-inline.js';
|
|
9
|
-
import Button from '../button/button.js';
|
|
10
|
-
import { m as modules_09d014b4, T as Title } from '../_helpers/title.js';
|
|
11
|
-
import 'focus-visible';
|
|
12
|
-
import 'classnames';
|
|
13
|
-
import '../global/memoize.js';
|
|
14
|
-
import '../global/data-tests.js';
|
|
15
|
-
import '../link/clickableLink.js';
|
|
16
|
-
import '../global/theme.js';
|
|
17
|
-
import '../_helpers/inject-styles.js';
|
|
18
|
-
import '../global/conic-gradient.js';
|
|
19
|
-
import 'conic-gradient';
|
|
20
|
-
import '../global/supports-css.js';
|
|
21
|
-
import '../global/inject-styles.js';
|
|
22
|
-
import '../global/radial-gradient-mask.js';
|
|
23
|
-
import '../global/get-uid.js';
|
|
24
|
-
import '@jetbrains/icons/chevron-10px';
|
|
25
|
-
import '../icon/icon.js';
|
|
26
|
-
import 'util-deprecate';
|
|
27
|
-
import '../icon/icon__constants.js';
|
|
28
|
-
import '../_helpers/icon__svg.js';
|
|
29
|
-
import '../_helpers/button__classes.js';
|
|
30
|
-
import '../global/focus-sensor-hoc.js';
|
|
31
|
-
import '../global/composeRefs.js';
|
|
32
|
-
import '../checkbox/checkbox.js';
|
|
33
|
-
import '@jetbrains/icons/checkmark';
|
|
34
|
-
import '@jetbrains/icons/remove-10px';
|
|
35
|
-
|
|
36
|
-
const moreLessButtonStates = {
|
|
37
|
-
UNUSED: 0,
|
|
38
|
-
MORE: 1,
|
|
39
|
-
MORE_LOADING: 2,
|
|
40
|
-
LESS: 3
|
|
41
|
-
};
|
|
42
|
-
const ITEM_LEFT_OFFSET = 32;
|
|
43
|
-
const LIST_LEFT_OFFSET = 24;
|
|
44
|
-
class Item extends PureComponent {
|
|
45
|
-
constructor() {
|
|
46
|
-
super(...arguments);
|
|
47
|
-
|
|
48
|
-
_defineProperty(this, "onShowMore", () => {
|
|
49
|
-
const {
|
|
50
|
-
onItemMoreLess,
|
|
51
|
-
item
|
|
52
|
-
} = this.props;
|
|
53
|
-
onItemMoreLess(item, true);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
_defineProperty(this, "onShowLess", () => {
|
|
57
|
-
const {
|
|
58
|
-
onItemMoreLess,
|
|
59
|
-
item
|
|
60
|
-
} = this.props;
|
|
61
|
-
onItemMoreLess(item, false);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
_defineProperty(this, "onFocus", () => {
|
|
65
|
-
const {
|
|
66
|
-
onFocus,
|
|
67
|
-
item
|
|
68
|
-
} = this.props;
|
|
69
|
-
onFocus(item);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
_defineProperty(this, "onSelect", selected => {
|
|
73
|
-
const {
|
|
74
|
-
onSelect,
|
|
75
|
-
item
|
|
76
|
-
} = this.props;
|
|
77
|
-
onSelect(item, selected);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
_defineProperty(this, "renderItem", (model, parentShift) => {
|
|
81
|
-
const {
|
|
82
|
-
onFocus,
|
|
83
|
-
onSelect,
|
|
84
|
-
selection,
|
|
85
|
-
level,
|
|
86
|
-
itemFormatter
|
|
87
|
-
} = this.props;
|
|
88
|
-
const item = itemFormatter(model);
|
|
89
|
-
return /*#__PURE__*/React.createElement(Item, {
|
|
90
|
-
key: item.key || item.id,
|
|
91
|
-
item: model,
|
|
92
|
-
title: item.title,
|
|
93
|
-
items: item.items,
|
|
94
|
-
level: level + 1,
|
|
95
|
-
parentShift: parentShift,
|
|
96
|
-
itemFormatter: itemFormatter,
|
|
97
|
-
collapsible: item.collapsible,
|
|
98
|
-
collapsed: item.collapsed,
|
|
99
|
-
onCollapse: item.onCollapse,
|
|
100
|
-
onExpand: item.onExpand,
|
|
101
|
-
focused: selection.isFocused(model),
|
|
102
|
-
showFocus: selection.isFocused(model),
|
|
103
|
-
onFocus: onFocus,
|
|
104
|
-
selection: selection,
|
|
105
|
-
selectable: item.selectable,
|
|
106
|
-
selected: selection.isSelected(model),
|
|
107
|
-
onSelect: onSelect
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
render() {
|
|
113
|
-
const {
|
|
114
|
-
title,
|
|
115
|
-
items,
|
|
116
|
-
showMoreLessButton,
|
|
117
|
-
level,
|
|
118
|
-
parentShift,
|
|
119
|
-
showFocus,
|
|
120
|
-
selectable,
|
|
121
|
-
selected,
|
|
122
|
-
collapsible,
|
|
123
|
-
collapsed,
|
|
124
|
-
onCollapse,
|
|
125
|
-
onExpand
|
|
126
|
-
} = this.props;
|
|
127
|
-
let moreLessButton;
|
|
128
|
-
|
|
129
|
-
if (showMoreLessButton === moreLessButtonStates.MORE || showMoreLessButton === moreLessButtonStates.MORE_LOADING) {
|
|
130
|
-
moreLessButton = /*#__PURE__*/React.createElement(Text, {
|
|
131
|
-
info: true
|
|
132
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
|
133
|
-
inherit: true,
|
|
134
|
-
pseudo: true,
|
|
135
|
-
onClick: this.onShowMore
|
|
136
|
-
}, 'Show more'), showMoreLessButton === moreLessButtonStates.MORE_LOADING && /*#__PURE__*/React.createElement(LoaderInline, {
|
|
137
|
-
className: modules_09d014b4.showMoreLoader
|
|
138
|
-
}));
|
|
139
|
-
} else if (showMoreLessButton === moreLessButtonStates.LESS) {
|
|
140
|
-
moreLessButton = /*#__PURE__*/React.createElement(Text, {
|
|
141
|
-
info: true
|
|
142
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
|
143
|
-
inherit: true,
|
|
144
|
-
pseudo: true,
|
|
145
|
-
onClick: this.onShowLess
|
|
146
|
-
}, 'Show less'));
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
let collapserExpander = null;
|
|
150
|
-
|
|
151
|
-
if (collapsible) {
|
|
152
|
-
if (collapsed) {
|
|
153
|
-
collapserExpander = /*#__PURE__*/React.createElement(Button, {
|
|
154
|
-
title: "Expand",
|
|
155
|
-
onClick: onExpand,
|
|
156
|
-
icon: chevronRightIcon,
|
|
157
|
-
className: modules_09d014b4.collapseButton,
|
|
158
|
-
iconClassName: modules_09d014b4.collapseIcon,
|
|
159
|
-
"data-test": "ring-data-list-expand"
|
|
160
|
-
});
|
|
161
|
-
} else {
|
|
162
|
-
collapserExpander = /*#__PURE__*/React.createElement(Button, {
|
|
163
|
-
title: "Collapse",
|
|
164
|
-
onClick: onCollapse,
|
|
165
|
-
icon: chevronDownIcon,
|
|
166
|
-
className: modules_09d014b4.collapseButton,
|
|
167
|
-
iconClassName: modules_09d014b4.collapseIcon,
|
|
168
|
-
"data-test": "ring-data-list-collapse"
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
const itemIsEmpty = !items.length || collapsible && collapsed;
|
|
174
|
-
const offset = level * LIST_LEFT_OFFSET + ITEM_LEFT_OFFSET + parentShift;
|
|
175
|
-
return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Title, {
|
|
176
|
-
title: title,
|
|
177
|
-
focused: showFocus,
|
|
178
|
-
showFocus: showFocus,
|
|
179
|
-
selectable: selectable,
|
|
180
|
-
selected: selected,
|
|
181
|
-
collapserExpander: collapserExpander,
|
|
182
|
-
onFocus: this.onFocus,
|
|
183
|
-
onSelect: this.onSelect,
|
|
184
|
-
offset: offset
|
|
185
|
-
}), !itemIsEmpty ? /*#__PURE__*/React.createElement("ul", {
|
|
186
|
-
className: modules_09d014b4.itemContent
|
|
187
|
-
}, items.map(model => this.renderItem(model, parentShift)), showMoreLessButton !== moreLessButtonStates.UNUSED ? /*#__PURE__*/React.createElement("li", {
|
|
188
|
-
className: modules_09d014b4.showMore
|
|
189
|
-
}, moreLessButton) : null) : null);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
_defineProperty(Item, "propTypes", {
|
|
195
|
-
item: PropTypes.object,
|
|
196
|
-
title: PropTypes.node,
|
|
197
|
-
items: PropTypes.array,
|
|
198
|
-
className: PropTypes.string,
|
|
199
|
-
level: PropTypes.number,
|
|
200
|
-
parentShift: PropTypes.number,
|
|
201
|
-
itemFormatter: PropTypes.func,
|
|
202
|
-
collapsible: PropTypes.bool,
|
|
203
|
-
collapsed: PropTypes.bool,
|
|
204
|
-
onCollapse: PropTypes.func,
|
|
205
|
-
onExpand: PropTypes.func,
|
|
206
|
-
showFocus: PropTypes.bool,
|
|
207
|
-
onFocus: PropTypes.func,
|
|
208
|
-
selection: PropTypes.object,
|
|
209
|
-
selectable: PropTypes.bool,
|
|
210
|
-
selected: PropTypes.bool,
|
|
211
|
-
onSelect: PropTypes.func,
|
|
212
|
-
showMoreLessButton: PropTypes.number,
|
|
213
|
-
onItemMoreLess: PropTypes.func
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
_defineProperty(Item, "defaultProps", {
|
|
217
|
-
items: [],
|
|
218
|
-
level: 0,
|
|
219
|
-
parentShift: 0,
|
|
220
|
-
showMoreLessButton: moreLessButtonStates.UNUSED,
|
|
221
|
-
onItemMoreLess: () => {}
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
export default Item;
|
|
225
|
-
export { moreLessButtonStates };
|