@jetbrains/ring-ui-built 7.0.66 → 7.0.71

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 (231) hide show
  1. package/components/_helpers/anchor.js +12 -17
  2. package/components/_helpers/avatar-info.js +4 -5
  3. package/components/_helpers/button.classes.js +20 -21
  4. package/components/_helpers/caption.js +3 -3
  5. package/components/_helpers/card.js +26 -32
  6. package/components/_helpers/dialog-body-scroll-preventer.js +1 -2
  7. package/components/_helpers/icon-svg.js +9 -12
  8. package/components/_helpers/input.js +78 -86
  9. package/components/_helpers/loader-core.js +260 -0
  10. package/components/_helpers/query-assist-suggestions.js +0 -1
  11. package/components/_helpers/select-filter.js +19 -26
  12. package/components/_helpers/services-link.js +9 -12
  13. package/components/_helpers/sidebar.js +36 -44
  14. package/components/_helpers/tab-link.js +9 -11
  15. package/components/_helpers/theme.js +20 -24
  16. package/components/_helpers/title.js +12 -17
  17. package/components/alert/alert.js +41 -49
  18. package/components/alert/container.js +9 -12
  19. package/components/alert-service/alert-service.js +23 -32
  20. package/components/analytics/analytics-custom-plugin.js +12 -17
  21. package/components/analytics/analytics.js +1 -3
  22. package/components/auth/auth-core.js +128 -170
  23. package/components/auth/auth.js +3 -10
  24. package/components/auth/background-flow.js +5 -8
  25. package/components/auth/down-notification.js +9 -17
  26. package/components/auth/iframe-flow.js +13 -19
  27. package/components/auth/request-builder.js +4 -9
  28. package/components/auth/response-parser.js +9 -12
  29. package/components/auth/storage.js +12 -18
  30. package/components/auth/token-validator.js +19 -30
  31. package/components/auth/window-flow.js +22 -27
  32. package/components/auth-dialog/auth-dialog.js +40 -48
  33. package/components/auth-dialog-service/auth-dialog-service.js +10 -13
  34. package/components/avatar/avatar.figma.js +6 -6
  35. package/components/avatar/avatar.js +58 -59
  36. package/components/avatar/fallback-avatar.js +8 -11
  37. package/components/avatar-stack/avatar-stack.figma.js +10 -11
  38. package/components/avatar-stack/avatar-stack.js +25 -31
  39. package/components/banner/banner.js +0 -6
  40. package/components/breadcrumbs/breadcrumbs.figma.js +8 -6
  41. package/components/breadcrumbs/breadcrumbs.js +4 -5
  42. package/components/button/button.figma.js +15 -10
  43. package/components/button/button.js +59 -64
  44. package/components/button-group/button-group.js +11 -15
  45. package/components/button-group/caption.js +0 -1
  46. package/components/button-set/button-set.js +9 -12
  47. package/components/button-toolbar/button-toolbar.js +8 -11
  48. package/components/caret/caret.js +20 -28
  49. package/components/checkbox/checkbox-group.figma.js +8 -10
  50. package/components/checkbox/checkbox.figma.js +5 -5
  51. package/components/checkbox/checkbox.js +27 -35
  52. package/components/clipboard/clipboard-fallback.js +3 -3
  53. package/components/clipboard/clipboard.js +3 -16
  54. package/components/code/code.js +8 -14
  55. package/components/collapse/collapse-content.js +10 -15
  56. package/components/collapse/collapse-control.js +5 -7
  57. package/components/collapse/collapse.js +9 -11
  58. package/components/collapse/utils.js +1 -1
  59. package/components/confirm/confirm.js +17 -26
  60. package/components/confirm-service/confirm-service.js +30 -31
  61. package/components/content-layout/content-layout.js +21 -28
  62. package/components/content-layout/sidebar.js +0 -2
  63. package/components/contenteditable/contenteditable.js +23 -28
  64. package/components/control-help/control-help.js +8 -10
  65. package/components/control-label/control-label.js +12 -17
  66. package/components/data-list/data-list.js +57 -65
  67. package/components/data-list/data-list.mock.js +0 -4
  68. package/components/data-list/item.js +65 -72
  69. package/components/data-list/selection.js +11 -19
  70. package/components/data-list/title.js +0 -4
  71. package/components/date-picker/consts.js +3 -4
  72. package/components/date-picker/date-input.js +25 -33
  73. package/components/date-picker/date-picker.js +179 -193
  74. package/components/date-picker/date-popup.js +135 -127
  75. package/components/date-picker/day.d.ts +1 -1
  76. package/components/date-picker/day.js +24 -30
  77. package/components/date-picker/month-names.js +7 -12
  78. package/components/date-picker/month-slider.js +16 -22
  79. package/components/date-picker/month.js +3 -5
  80. package/components/date-picker/months.js +6 -6
  81. package/components/date-picker/weekdays.js +0 -1
  82. package/components/date-picker/years.js +20 -26
  83. package/components/dialog/dialog-body-scroll-preventer.js +0 -1
  84. package/components/dialog/dialog.js +73 -83
  85. package/components/dropdown/anchor.js +0 -4
  86. package/components/dropdown/dropdown.js +98 -114
  87. package/components/dropdown-menu/dropdown-menu.js +80 -79
  88. package/components/editable-heading/editable-heading.js +48 -54
  89. package/components/error-bubble/error-bubble.figma.js +4 -4
  90. package/components/error-bubble/error-bubble.js +9 -13
  91. package/components/error-message/error-message.js +1 -6
  92. package/components/footer/footer.js +11 -15
  93. package/components/global/compose-refs.js +1 -4
  94. package/components/global/compose.js +1 -4
  95. package/components/global/configuration.js +3 -3
  96. package/components/global/controls-height.js +0 -1
  97. package/components/global/create-stateful-context.js +10 -14
  98. package/components/global/data-tests.js +2 -10
  99. package/components/global/dom.js +6 -19
  100. package/components/global/focus-sensor-hoc.js +74 -87
  101. package/components/global/fuzzy-highlight.js +3 -8
  102. package/components/global/get-uid.js +1 -1
  103. package/components/global/inject-styles.js +5 -6
  104. package/components/global/listeners.js +2 -11
  105. package/components/global/memoize.js +0 -2
  106. package/components/global/normalize-indent.js +2 -6
  107. package/components/global/promise-with-timeout.js +4 -5
  108. package/components/global/react-dom-renderer.js +4 -9
  109. package/components/global/rerender-hoc.js +8 -11
  110. package/components/global/schedule-raf.js +1 -2
  111. package/components/global/theme.js +0 -5
  112. package/components/global/trivial-template-tag.js +1 -6
  113. package/components/global/url.js +2 -6
  114. package/components/global/use-event-callback.js +2 -3
  115. package/components/grid/col.js +7 -18
  116. package/components/grid/grid.js +9 -14
  117. package/components/grid/row.js +7 -11
  118. package/components/group/group.js +9 -12
  119. package/components/header/header-icon.js +8 -13
  120. package/components/header/header.js +16 -27
  121. package/components/header/links.js +7 -10
  122. package/components/header/logo.js +12 -16
  123. package/components/header/profile.js +73 -83
  124. package/components/header/services-link.js +0 -2
  125. package/components/header/services.js +32 -43
  126. package/components/header/smart-profile.js +44 -59
  127. package/components/header/smart-services.js +33 -45
  128. package/components/header/tray.js +8 -10
  129. package/components/heading/heading.js +27 -27
  130. package/components/http/http.js +120 -125
  131. package/components/http/http.mock.js +6 -10
  132. package/components/hub-source/hub-source-user.js +6 -13
  133. package/components/hub-source/hub-source-users-groups.js +8 -12
  134. package/components/hub-source/hub-source.js +8 -10
  135. package/components/i18n/i18n-context.js +4 -7
  136. package/components/i18n/i18n.js +5 -5
  137. package/components/icon/icon-svg.js +0 -4
  138. package/components/icon/icon.js +28 -32
  139. package/components/icon/index.js +0 -4
  140. package/components/input/input.figma.js +8 -8
  141. package/components/input/input.js +0 -4
  142. package/components/island/adaptive-island-hoc.js +19 -23
  143. package/components/island/content.js +70 -75
  144. package/components/island/header.js +21 -21
  145. package/components/island/island.js +11 -14
  146. package/components/link/clickable-link.js +30 -37
  147. package/components/link/link.js +27 -29
  148. package/components/list/list-custom.js +6 -11
  149. package/components/list/list-item.js +49 -56
  150. package/components/list/list-separator.js +0 -1
  151. package/components/list/list-title.js +0 -1
  152. package/components/list/list-users-groups-source.js +14 -22
  153. package/components/list/list.classes.js +8 -9
  154. package/components/list/list.js +387 -404
  155. package/components/loader/loader-core.js +2 -265
  156. package/components/loader/loader.d.ts +8 -0
  157. package/components/loader/loader.js +43 -29
  158. package/components/loader-inline/loader-inline.js +9 -12
  159. package/components/loader-screen/loader-screen.js +10 -14
  160. package/components/login-dialog/login-dialog.js +46 -54
  161. package/components/login-dialog/service.js +13 -15
  162. package/components/message/message.js +65 -79
  163. package/components/old-browsers-message/old-browsers-message-stop.js +0 -3
  164. package/components/old-browsers-message/old-browsers-message.js +1 -4
  165. package/components/old-browsers-message/white-list.js +5 -7
  166. package/components/pager/pager.js +73 -88
  167. package/components/panel/panel.js +9 -12
  168. package/components/permissions/permissions-cache.js +6 -8
  169. package/components/permissions/permissions.js +19 -21
  170. package/components/popup/popup.js +136 -145
  171. package/components/popup/popup.target.js +8 -10
  172. package/components/popup/position-css.js +19 -27
  173. package/components/popup/position.js +22 -28
  174. package/components/popup-menu/popup-menu.js +27 -37
  175. package/components/progress-bar/progress-bar.js +26 -32
  176. package/components/query-assist/query-assist-suggestions.js +0 -6
  177. package/components/query-assist/query-assist.js +432 -468
  178. package/components/radio/radio-item.js +30 -40
  179. package/components/radio/radio.js +6 -10
  180. package/components/scrollable-section/scrollable-section.js +7 -10
  181. package/components/select/select-filter.js +0 -6
  182. package/components/select/select-popup.js +155 -174
  183. package/components/select/select.js +464 -479
  184. package/components/shortcuts/core.js +40 -45
  185. package/components/shortcuts/shortcut-title.js +0 -1
  186. package/components/shortcuts/shortcuts-hoc.js +9 -15
  187. package/components/shortcuts/shortcuts.js +3 -5
  188. package/components/slider/slider.js +53 -66
  189. package/components/slider/slider.utils.js +1 -4
  190. package/components/storage/storage-local.js +2 -8
  191. package/components/storage/storage.js +0 -5
  192. package/components/style.css +1 -1
  193. package/components/tab-trap/tab-trap.js +21 -30
  194. package/components/table/cell.js +3 -4
  195. package/components/table/disable-hover-hoc.js +24 -28
  196. package/components/table/header-cell.js +30 -38
  197. package/components/table/header.js +20 -28
  198. package/components/table/multitable.js +81 -101
  199. package/components/table/row-with-focus-sensor.js +17 -28
  200. package/components/table/row.js +89 -99
  201. package/components/table/selection-adapter.js +0 -2
  202. package/components/table/selection-shortcuts-hoc.js +159 -161
  203. package/components/table/selection.js +23 -31
  204. package/components/table/simple-table.js +16 -22
  205. package/components/table/smart-table.js +19 -26
  206. package/components/table/table.js +137 -146
  207. package/components/tabs/collapsible-more.js +34 -47
  208. package/components/tabs/collapsible-tab.js +28 -33
  209. package/components/tabs/collapsible-tabs.js +16 -24
  210. package/components/tabs/custom-item.js +3 -6
  211. package/components/tabs/dumb-tabs.js +48 -64
  212. package/components/tabs/smart-tabs.js +14 -23
  213. package/components/tabs/tab-link.js +0 -2
  214. package/components/tabs/tab.js +0 -1
  215. package/components/tabs/tabs.js +0 -7
  216. package/components/tag/tag.js +30 -35
  217. package/components/tags-input/tags-input.js +192 -218
  218. package/components/tags-list/tags-list.js +26 -31
  219. package/components/text/text.js +16 -19
  220. package/components/toggle/toggle.js +19 -23
  221. package/components/tooltip/tooltip.js +110 -121
  222. package/components/upload/upload.js +19 -28
  223. package/components/user-agreement/service.js +247 -252
  224. package/components/user-agreement/toolbox.eula.js +160 -1
  225. package/components/user-agreement/user-agreement.js +23 -32
  226. package/components/user-card/card.js +0 -5
  227. package/components/user-card/smart-user-card-tooltip.js +41 -50
  228. package/components/user-card/tooltip.js +32 -38
  229. package/components/user-card/user-card.js +0 -5
  230. package/package.json +9 -3
  231. package/components/_helpers/_rollupPluginBabelHelpers.js +0 -72
@@ -1,5 +1,3 @@
1
- import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/web.dom-collections.iterator.js';
3
1
  import { jsx } from 'react/jsx-runtime';
4
2
  import { PureComponent, createRef } from 'react';
5
3
  import classNames from 'classnames';
@@ -14,7 +12,6 @@ import { subYears } from 'date-fns/subYears';
14
12
  import linearFunction from '../global/linear-function.js';
15
13
  import { s as styles } from '../_helpers/date-picker.js';
16
14
  import units, { yearDuration, DOUBLE, HALF } from './consts.js';
17
- import 'core-js/modules/es.regexp.exec.js';
18
15
  import 'date-fns/add';
19
16
 
20
17
  const {
@@ -25,29 +22,9 @@ let scrollTO;
25
22
  const YEARSBACK = 5;
26
23
  const scrollDelay = 100;
27
24
  class Years extends PureComponent {
28
- constructor() {
29
- super(...arguments);
30
- _defineProperty(this, "state", {
31
- scrollDate: null
32
- });
33
- _defineProperty(this, "stoppedScrolling", void 0);
34
- _defineProperty(this, "componentRef", /*#__PURE__*/createRef());
35
- _defineProperty(this, "handleWheel", e => {
36
- const {
37
- scrollDate
38
- } = this.props;
39
- const date = this.state.scrollDate || scrollDate;
40
- e.preventDefault();
41
- const newScrollDate = linearFunction(0, Number(date), yearDuration / yearHeight).y(e.deltaY);
42
- this.setState({
43
- scrollDate: newScrollDate
44
- });
45
- if (scrollTO) {
46
- window.clearTimeout(scrollTO);
47
- }
48
- scrollTO = window.setTimeout(() => this.setYear(newScrollDate), scrollDelay);
49
- });
50
- }
25
+ state = {
26
+ scrollDate: null
27
+ };
51
28
  componentDidMount() {
52
29
  if (this.componentRef.current) {
53
30
  this.componentRef.current.addEventListener('wheel', this.handleWheel);
@@ -61,6 +38,7 @@ class Years extends PureComponent {
61
38
  this.componentRef.current.removeEventListener('wheel', this.handleWheel);
62
39
  }
63
40
  }
41
+ stoppedScrolling;
64
42
  setYear(date) {
65
43
  if (scrollTO) {
66
44
  window.clearTimeout(scrollTO);
@@ -71,6 +49,22 @@ class Years extends PureComponent {
71
49
  });
72
50
  this.props.onScroll(Number(setYear(this.props.scrollDate, getYear(date))));
73
51
  }
52
+ componentRef = /*#__PURE__*/createRef();
53
+ handleWheel = e => {
54
+ const {
55
+ scrollDate
56
+ } = this.props;
57
+ const date = this.state.scrollDate || scrollDate;
58
+ e.preventDefault();
59
+ const newScrollDate = linearFunction(0, Number(date), yearDuration / yearHeight).y(e.deltaY);
60
+ this.setState({
61
+ scrollDate: newScrollDate
62
+ });
63
+ if (scrollTO) {
64
+ window.clearTimeout(scrollTO);
65
+ }
66
+ scrollTO = window.setTimeout(() => this.setYear(newScrollDate), scrollDelay);
67
+ };
74
68
  render() {
75
69
  const {
76
70
  onScrollChange,
@@ -1,3 +1,2 @@
1
- import 'core-js/modules/web.dom-collections.iterator.js';
2
1
  import 'scrollbar-width';
3
2
  export { d as default, p as preventerFactory } from '../_helpers/dialog-body-scroll-preventer.js';
@@ -1,5 +1,3 @@
1
- import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/web.dom-collections.iterator.js';
3
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
4
2
  import { PureComponent, createRef } from 'react';
5
3
  import { createPortal } from 'react-dom';
@@ -22,7 +20,6 @@ import '../island/content.js';
22
20
  import 'element-resize-detector';
23
21
  import '../global/schedule-raf.js';
24
22
  import '../shortcuts/core.js';
25
- import 'core-js/modules/es.regexp.exec.js';
26
23
  import 'combokeys';
27
24
  import '../global/sniffer.js';
28
25
  import 'sniffr';
@@ -33,56 +30,40 @@ import 'util-deprecate';
33
30
  import '../icon/icon.js';
34
31
  import '../icon/icon.constants.js';
35
32
  import '../_helpers/icon-svg.js';
36
- import 'core-js/modules/es.string.replace.js';
37
33
  import '../global/memoize.js';
38
34
  import '../link/clickable-link.js';
39
35
  import '../global/controls-height.js';
40
36
  import '../global/configuration.js';
41
37
  import '../_helpers/button.classes.js';
42
38
  import '../popup/position.js';
43
- import 'core-js/modules/es.array.sort.js';
44
39
  import '../popup/popup.consts.js';
45
40
  import '../popup/position-css.js';
46
41
  import 'scrollbar-width';
47
42
 
48
- const _excluded = ["show", "showCloseButton", "onOverlayClick", "onCloseAttempt", "onEscPress", "onCloseClick", "children", "className", "contentClassName", "trapFocus", "data-test", "closeButtonInside", "portalTarget", "label", "closeButtonTitle", "dense", "shortcutOptions", "native", "modal", "preventBodyScroll"];
49
43
  /**
50
44
  * @name Dialog
51
45
  */
52
46
  function noop() {}
53
47
  class Dialog extends PureComponent {
54
- constructor() {
55
- super(...arguments);
56
- _defineProperty(this, "state", {
57
- shortcutsScope: getUID('ring-dialog-')
58
- });
59
- _defineProperty(this, "scrollPreventer", preventerFactory(getUID('preventer-')));
60
- _defineProperty(this, "uid", getUID('dialog-'));
61
- _defineProperty(this, "handleClick", event => {
62
- this.props.onOverlayClick(event);
63
- this.props.onCloseAttempt(event);
64
- });
65
- _defineProperty(this, "onCloseClick", event => {
66
- this.props.onCloseClick(event);
67
- this.props.onCloseAttempt(event);
68
- });
69
- _defineProperty(this, "getShortcutsMap", () => {
70
- const onEscape = event => {
71
- if (this.props.show) {
72
- this.props.onEscPress(event);
73
- this.props.onCloseAttempt(event);
74
- }
75
- };
76
- return {
77
- esc: onEscape
78
- };
79
- });
80
- _defineProperty(this, "dialog", void 0);
81
- _defineProperty(this, "dialogRef", tabTrap => {
82
- this.dialog = tabTrap && tabTrap.node;
83
- });
84
- _defineProperty(this, "nativeDialog", /*#__PURE__*/createRef());
85
- }
48
+ static defaultProps = {
49
+ label: 'Dialog',
50
+ onOverlayClick: noop,
51
+ onEscPress: noop,
52
+ onCloseClick: noop,
53
+ onCloseAttempt: noop,
54
+ showCloseButton: false,
55
+ closeButtonInside: false,
56
+ shortcutOptions: {
57
+ modal: false
58
+ },
59
+ trapFocus: false,
60
+ autoFocusFirst: true,
61
+ modal: true,
62
+ preventBodyScroll: true
63
+ };
64
+ state = {
65
+ shortcutsScope: getUID('ring-dialog-')
66
+ };
86
67
  componentDidMount() {
87
68
  const {
88
69
  show,
@@ -108,6 +89,8 @@ class Dialog extends PureComponent {
108
89
  componentWillUnmount() {
109
90
  this.scrollPreventer.reset();
110
91
  }
92
+ scrollPreventer = preventerFactory(getUID('preventer-'));
93
+ uid = getUID('dialog-');
111
94
  toggleNativeDialog() {
112
95
  const {
113
96
  show,
@@ -136,31 +119,54 @@ class Dialog extends PureComponent {
136
119
  this.scrollPreventer.reset();
137
120
  }
138
121
  }
122
+ handleClick = event => {
123
+ this.props.onOverlayClick(event);
124
+ this.props.onCloseAttempt(event);
125
+ };
126
+ onCloseClick = event => {
127
+ this.props.onCloseClick(event);
128
+ this.props.onCloseAttempt(event);
129
+ };
130
+ getShortcutsMap = () => {
131
+ const onEscape = event => {
132
+ if (this.props.show) {
133
+ this.props.onEscPress(event);
134
+ this.props.onCloseAttempt(event);
135
+ }
136
+ };
137
+ return {
138
+ esc: onEscape
139
+ };
140
+ };
141
+ dialog;
142
+ dialogRef = tabTrap => {
143
+ this.dialog = tabTrap && tabTrap.node;
144
+ };
145
+ nativeDialog = /*#__PURE__*/createRef();
139
146
  render() {
140
- const _this$props = this.props,
141
- {
142
- show,
143
- showCloseButton,
144
- onOverlayClick,
145
- onCloseAttempt,
146
- onEscPress,
147
- onCloseClick,
148
- children,
149
- className,
150
- contentClassName,
151
- trapFocus,
152
- 'data-test': dataTest,
153
- closeButtonInside,
154
- portalTarget,
155
- label,
156
- closeButtonTitle,
157
- dense,
158
- shortcutOptions,
159
- native,
160
- modal,
161
- preventBodyScroll
162
- } = _this$props,
163
- restProps = _objectWithoutProperties(_this$props, _excluded);
147
+ const {
148
+ show,
149
+ showCloseButton,
150
+ onOverlayClick,
151
+ onCloseAttempt,
152
+ onEscPress,
153
+ onCloseClick,
154
+ children,
155
+ className,
156
+ contentClassName,
157
+ trapFocus,
158
+ 'data-test': dataTest,
159
+ closeButtonInside,
160
+ portalTarget,
161
+ label,
162
+ closeButtonTitle,
163
+ dense,
164
+ shortcutOptions,
165
+ native,
166
+ modal,
167
+ preventBodyScroll,
168
+ ...restProps
169
+ } = this.props;
164
170
  const classes = classNames(styles.container, className);
165
171
  const shortcutsMap = this.getShortcutsMap();
166
172
  const content = jsxs(Fragment, {
@@ -220,7 +226,7 @@ class Dialog extends PureComponent {
220
226
  let targetElement = document.body;
221
227
  if (portalTarget instanceof HTMLElement) {
222
228
  targetElement = portalTarget;
223
- } else if (contextTarget) {
229
+ } else if (contextTarget !== undefined) {
224
230
  const container = getPopupContainer(contextTarget);
225
231
  if (container) {
226
232
  targetElement = container;
@@ -229,36 +235,20 @@ class Dialog extends PureComponent {
229
235
  return /*#__PURE__*/createPortal(jsx(PopupTarget, {
230
236
  id: this.uid,
231
237
  className: styles.popupTarget,
232
- children: target => jsxs(TabTrap, _objectSpread2(_objectSpread2({
238
+ children: target => jsxs(TabTrap, {
233
239
  trapDisabled: !trapFocus,
234
240
  "data-test": joinDataTestAttributes('ring-dialog-container', dataTest),
235
241
  "data-rg-modal-dialog-container": '',
236
242
  ref: this.dialogRef,
237
243
  className: classes,
238
- role: 'presentation'
239
- }, restProps), {}, {
244
+ role: 'presentation',
245
+ ...restProps,
240
246
  children: [content, target]
241
- }))
247
+ })
242
248
  }), targetElement);
243
249
  }
244
250
  });
245
251
  }
246
252
  }
247
- _defineProperty(Dialog, "defaultProps", {
248
- label: 'Dialog',
249
- onOverlayClick: noop,
250
- onEscPress: noop,
251
- onCloseClick: noop,
252
- onCloseAttempt: noop,
253
- showCloseButton: false,
254
- closeButtonInside: false,
255
- shortcutOptions: {
256
- modal: false
257
- },
258
- trapFocus: false,
259
- autoFocusFirst: true,
260
- modal: true,
261
- preventBodyScroll: true
262
- });
263
253
 
264
254
  export { Dialog as default };
@@ -1,18 +1,14 @@
1
- import '../_helpers/_rollupPluginBabelHelpers.js';
2
1
  import 'react/jsx-runtime';
3
2
  import 'react';
4
3
  import 'classnames';
5
4
  import '../button/button.js';
6
5
  export { A as default } from '../_helpers/anchor.js';
7
- import 'core-js/modules/web.dom-collections.iterator.js';
8
6
  import '@jetbrains/icons/chevron-down';
9
7
  import '@jetbrains/icons/chevron-12px-down';
10
8
  import 'util-deprecate';
11
9
  import '../icon/icon.js';
12
10
  import '../icon/icon.constants.js';
13
11
  import '../_helpers/icon-svg.js';
14
- import 'core-js/modules/es.regexp.exec.js';
15
- import 'core-js/modules/es.string.replace.js';
16
12
  import '../global/memoize.js';
17
13
  import '../link/clickable-link.js';
18
14
  import '../global/controls-height.js';
@@ -1,5 +1,3 @@
1
- import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/web.dom-collections.iterator.js';
3
1
  import { jsx, jsxs } from 'react/jsx-runtime';
4
2
  import { Component, cloneElement } from 'react';
5
3
  import classNames from 'classnames';
@@ -13,103 +11,102 @@ import 'util-deprecate';
13
11
  import '../icon/icon.js';
14
12
  import '../icon/icon.constants.js';
15
13
  import '../_helpers/icon-svg.js';
16
- import 'core-js/modules/es.regexp.exec.js';
17
- import 'core-js/modules/es.string.replace.js';
18
14
  import '../global/memoize.js';
19
15
  import '../link/clickable-link.js';
20
16
  import '../global/controls-height.js';
21
17
  import '../global/configuration.js';
22
18
  import '../_helpers/button.classes.js';
23
19
 
24
- const _excluded = ["initShown", "onShow", "onHide", "hoverShowTimeOut", "hoverHideTimeOut", "children", "anchor", "className", "activeClassName", "hoverMode", "clickMode", "data-test", "disabled"];
25
20
  /**
26
21
  * @name Dropdown
27
22
  */
28
23
  class Dropdown extends Component {
29
- constructor() {
30
- super(...arguments);
31
- _defineProperty(this, "state", {
32
- show: this.props.initShown,
33
- pinned: false
34
- });
35
- _defineProperty(this, "onClick", () => {
36
- if (this.props.disabled) {
37
- return;
38
- }
39
- const {
40
- show,
41
- pinned
42
- } = this.state;
43
- let nextPinned = pinned;
44
- if (this.props.hoverMode) {
45
- if (!pinned) {
46
- nextPinned = true;
47
- if (show) {
48
- this.setState({
49
- pinned: true
50
- });
51
- return;
52
- }
53
- } else {
54
- nextPinned = false;
24
+ static defaultProps = {
25
+ initShown: false,
26
+ clickMode: true,
27
+ hoverMode: false,
28
+ hoverShowTimeOut: 300,
29
+ hoverHideTimeOut: 600,
30
+ disabled: false,
31
+ onShow: () => {},
32
+ onHide: () => {},
33
+ onMouseEnter: () => {},
34
+ onMouseLeave: () => {}
35
+ };
36
+ state = {
37
+ show: this.props.initShown,
38
+ pinned: false
39
+ };
40
+ onClick = () => {
41
+ if (this.props.disabled) {
42
+ return;
43
+ }
44
+ const {
45
+ show,
46
+ pinned
47
+ } = this.state;
48
+ let nextPinned = pinned;
49
+ if (this.props.hoverMode) {
50
+ if (!pinned) {
51
+ nextPinned = true;
52
+ if (show) {
53
+ this.setState({
54
+ pinned: true
55
+ });
56
+ return;
55
57
  }
56
- }
57
- this._toggle(!show, nextPinned);
58
- });
59
- _defineProperty(this, "onChildCloseAttempt", () => {
60
- let nextPinned = this.state.pinned;
61
- if (this.props.hoverMode) {
58
+ } else {
62
59
  nextPinned = false;
63
60
  }
64
- this._toggle(false, nextPinned);
65
- });
66
- _defineProperty(this, "hoverTimer", void 0);
67
- _defineProperty(this, "onMouseEnter", event => {
68
- var _this$props$onMouseEn, _this$props;
69
- if (this.props.disabled) {
70
- return;
71
- }
72
- this._clearTimer();
73
- (_this$props$onMouseEn = (_this$props = this.props).onMouseEnter) === null || _this$props$onMouseEn === void 0 || _this$props$onMouseEn.call(_this$props, event);
74
- this.hoverTimer = window.setTimeout(() => {
75
- if (!this.state.show) {
76
- this._toggle(true);
77
- }
78
- }, this.props.hoverShowTimeOut);
79
- });
80
- _defineProperty(this, "onMouseLeave", event => {
81
- var _this$props$onMouseLe, _this$props2;
82
- if (this.props.disabled) {
83
- return;
61
+ }
62
+ this._toggle(!show, nextPinned);
63
+ };
64
+ onChildCloseAttempt = () => {
65
+ let nextPinned = this.state.pinned;
66
+ if (this.props.hoverMode) {
67
+ nextPinned = false;
68
+ }
69
+ this._toggle(false, nextPinned);
70
+ };
71
+ hoverTimer;
72
+ onMouseEnter = event => {
73
+ if (this.props.disabled) {
74
+ return;
75
+ }
76
+ this._clearTimer();
77
+ this.props.onMouseEnter?.(event);
78
+ this.hoverTimer = window.setTimeout(() => {
79
+ if (!this.state.show) {
80
+ this._toggle(true);
84
81
  }
85
- (_this$props$onMouseLe = (_this$props2 = this.props).onMouseLeave) === null || _this$props$onMouseLe === void 0 || _this$props$onMouseLe.call(_this$props2, event);
86
- if (this.state.pinned) {
87
- return;
82
+ }, this.props.hoverShowTimeOut);
83
+ };
84
+ onMouseLeave = event => {
85
+ if (this.props.disabled) {
86
+ return;
87
+ }
88
+ this.props.onMouseLeave?.(event);
89
+ if (this.state.pinned) {
90
+ return;
91
+ }
92
+ this._clearTimer();
93
+ this.hoverTimer = window.setTimeout(() => {
94
+ if (this.state.show) {
95
+ this._toggle(false);
88
96
  }
89
- this._clearTimer();
90
- this.hoverTimer = window.setTimeout(() => {
91
- if (this.state.show) {
92
- this._toggle(false);
93
- }
94
- }, this.props.hoverHideTimeOut);
95
- });
96
- _defineProperty(this, "handlePopupInteraction", () => {
97
- this.setState(_ref => {
98
- let {
99
- pinned
100
- } = _ref;
101
- return pinned ? null : {
102
- pinned: true
103
- };
104
- });
97
+ }, this.props.hoverHideTimeOut);
98
+ };
99
+ handlePopupInteraction = () => {
100
+ this.setState(({
101
+ pinned
102
+ }) => pinned ? null : {
103
+ pinned: true
105
104
  });
106
- }
107
- toggle() {
108
- let show = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.state.show;
105
+ };
106
+ toggle(show = !this.state.show) {
109
107
  this._toggle(show);
110
108
  }
111
- _toggle(show) {
112
- let pinned = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state.pinned;
109
+ _toggle(show, pinned = this.state.pinned) {
113
110
  this.setState({
114
111
  show,
115
112
  pinned
@@ -126,23 +123,22 @@ class Dropdown extends Component {
126
123
  show,
127
124
  pinned
128
125
  } = this.state;
129
- const _this$props3 = this.props,
130
- {
131
- initShown,
132
- onShow,
133
- onHide,
134
- hoverShowTimeOut,
135
- hoverHideTimeOut,
136
- children,
137
- anchor,
138
- className,
139
- activeClassName,
140
- hoverMode,
141
- clickMode,
142
- 'data-test': dataTest,
143
- disabled
144
- } = _this$props3,
145
- restProps = _objectWithoutProperties(_this$props3, _excluded);
126
+ const {
127
+ initShown,
128
+ onShow,
129
+ onHide,
130
+ hoverShowTimeOut,
131
+ hoverHideTimeOut,
132
+ children,
133
+ anchor,
134
+ className,
135
+ activeClassName,
136
+ hoverMode,
137
+ clickMode,
138
+ 'data-test': dataTest,
139
+ disabled,
140
+ ...restProps
141
+ } = this.props;
146
142
  const classes = classNames(styles.dropdown, className, {
147
143
  [activeClassName !== null && activeClassName !== void 0 ? activeClassName : '']: activeClassName && show
148
144
  });
@@ -177,9 +173,9 @@ class Dropdown extends Component {
177
173
  onContextMenu: hoverMode ? this.handlePopupInteraction : undefined,
178
174
  dontCloseOnAnchorClick: true
179
175
  };
180
- return jsxs("div", _objectSpread2(_objectSpread2({
181
- "data-test": joinDataTestAttributes('ring-dropdown', dataTest)
182
- }, restProps), {}, {
176
+ return jsxs("div", {
177
+ "data-test": joinDataTestAttributes('ring-dropdown', dataTest),
178
+ ...restProps,
183
179
  onClick: clickMode ? this.onClick : undefined,
184
180
  // anchorElement should be a `button` or an `a`
185
181
  role: 'presentation',
@@ -187,20 +183,8 @@ class Dropdown extends Component {
187
183
  onMouseLeave: hoverMode ? this.onMouseLeave : undefined,
188
184
  className: classes,
189
185
  children: [anchorElement, typeof children === 'function' ? children(childProps) : /*#__PURE__*/cloneElement(children, childProps)]
190
- }));
186
+ });
191
187
  }
192
188
  }
193
- _defineProperty(Dropdown, "defaultProps", {
194
- initShown: false,
195
- clickMode: true,
196
- hoverMode: false,
197
- hoverShowTimeOut: 300,
198
- hoverHideTimeOut: 600,
199
- disabled: false,
200
- onShow: () => {},
201
- onHide: () => {},
202
- onMouseEnter: () => {},
203
- onMouseLeave: () => {}
204
- });
205
189
 
206
190
  export { Anchor, Dropdown as default };