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