@jetbrains/ring-ui 5.0.126 → 5.0.128

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 (305) hide show
  1. package/components/alert/alert.js +2 -1
  2. package/components/alert/container.js +2 -1
  3. package/components/auth/auth__core.js +2 -1
  4. package/components/auth/request-builder.js +2 -1
  5. package/components/auth/response-parser.js +2 -1
  6. package/components/auth/token-validator.js +2 -1
  7. package/components/auth-dialog/auth-dialog.js +2 -1
  8. package/components/avatar/avatar.js +2 -1
  9. package/components/badge/badge.js +2 -1
  10. package/components/button/button.js +2 -1
  11. package/components/button-group/button-group.js +2 -1
  12. package/components/button-group/caption.js +2 -1
  13. package/components/button-set/button-set.js +2 -1
  14. package/components/button-toolbar/button-toolbar.js +2 -1
  15. package/components/caret/caret.js +2 -1
  16. package/components/checkbox/checkbox.js +2 -1
  17. package/components/code/code.js +2 -1
  18. package/components/confirm/confirm.js +2 -1
  19. package/components/content-layout/content-layout.js +2 -1
  20. package/components/content-layout/sidebar.js +2 -1
  21. package/components/data-list/data-list.js +2 -1
  22. package/components/data-list/item.js +2 -1
  23. package/components/date-picker/date-input.js +2 -1
  24. package/components/date-picker/date-picker.js +2 -1
  25. package/components/date-picker/date-popup.js +2 -1
  26. package/components/date-picker/day.js +2 -1
  27. package/components/date-picker/month-slider.js +2 -1
  28. package/components/date-picker/years.js +2 -1
  29. package/components/dialog/dialog.d.ts +4 -16
  30. package/components/dialog/dialog.js +6 -3
  31. package/components/dropdown/dropdown.js +2 -1
  32. package/components/editable-heading/editable-heading.css +2 -0
  33. package/components/error-bubble/error-bubble.js +2 -1
  34. package/components/error-message/error-message.js +2 -1
  35. package/components/footer/footer.js +1 -0
  36. package/components/global/react-dom-renderer.js +2 -1
  37. package/components/grid/col.js +2 -1
  38. package/components/grid/grid.js +2 -1
  39. package/components/grid/row.js +2 -1
  40. package/components/group/group.js +2 -1
  41. package/components/header/logo.js +2 -1
  42. package/components/header/profile.js +2 -1
  43. package/components/header/services-link.js +2 -1
  44. package/components/header/services.js +2 -1
  45. package/components/header/smart-profile.js +2 -1
  46. package/components/header/smart-services.js +2 -1
  47. package/components/header/tray-icon.js +2 -1
  48. package/components/header/tray.js +2 -1
  49. package/components/hub-source/hub-source.js +2 -1
  50. package/components/icon/icon.js +2 -1
  51. package/components/input/input.js +2 -1
  52. package/components/island/island.js +2 -1
  53. package/components/island-legacy/content-legacy.js +2 -1
  54. package/components/island-legacy/header-legacy.js +2 -1
  55. package/components/island-legacy/island-legacy.js +2 -1
  56. package/components/link/clickableLink.js +2 -1
  57. package/components/list/list.js +2 -1
  58. package/components/list/list__hint.js +2 -1
  59. package/components/list/list__users-groups-source.js +2 -1
  60. package/components/loader/loader.js +2 -1
  61. package/components/loader/loader__core.js +2 -1
  62. package/components/loader-screen/loader-screen.js +2 -1
  63. package/components/login-dialog/login-dialog.js +2 -1
  64. package/components/message/message.js +2 -1
  65. package/components/pager/pager.js +2 -1
  66. package/components/panel/panel.js +2 -1
  67. package/components/permissions/permissions.js +2 -1
  68. package/components/permissions/permissions__cache.js +2 -1
  69. package/components/popup/popup.js +2 -1
  70. package/components/popup-menu/popup-menu.js +2 -1
  71. package/components/progress-bar/progress-bar.js +2 -1
  72. package/components/query-assist/query-assist.js +4 -3
  73. package/components/radio/radio.js +2 -1
  74. package/components/radio/radio__item.js +2 -1
  75. package/components/select/select.js +3 -2
  76. package/components/select/select__filter.js +2 -1
  77. package/components/select/select__popup.js +4 -2
  78. package/components/shortcuts/shortcuts.js +2 -1
  79. package/components/storage/storage__fallback.js +2 -1
  80. package/components/tab-trap/tab-trap.js +2 -1
  81. package/components/table/cell.js +2 -1
  82. package/components/table/header-cell.js +2 -1
  83. package/components/table/header.js +2 -1
  84. package/components/table/multitable.js +2 -1
  85. package/components/table/row.js +3 -2
  86. package/components/table/table.js +4 -2
  87. package/components/tabs/smart-tabs.js +2 -1
  88. package/components/tabs/tab.js +2 -1
  89. package/components/tag/tag.js +2 -1
  90. package/components/tags-input/tags-input.d.ts +1 -1
  91. package/components/tags-input/tags-input.js +3 -2
  92. package/components/tags-list/tags-list.js +2 -1
  93. package/components/text/text.js +2 -1
  94. package/components/tooltip/tooltip.js +2 -1
  95. package/components/user-agreement/user-agreement.js +2 -1
  96. package/components/user-card/card.js +2 -1
  97. package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
  98. package/components/user-card/smart-user-card-tooltip.js +2 -1
  99. package/components/user-card/tooltip.js +2 -1
  100. package/dist/_helpers/_rollupPluginBabelHelpers.js +1 -29
  101. package/dist/_helpers/anchor.js +1 -1
  102. package/dist/_helpers/card.js +44 -47
  103. package/dist/_helpers/footer.js +1 -0
  104. package/dist/_helpers/select__filter.js +10 -13
  105. package/dist/_helpers/services-link.js +10 -10
  106. package/dist/_helpers/sidebar.js +34 -37
  107. package/dist/_helpers/theme.js +1 -1
  108. package/dist/_helpers/title.js +12 -16
  109. package/dist/alert/alert.js +63 -66
  110. package/dist/alert/container.js +5 -5
  111. package/dist/alert-service/alert-service.js +5 -7
  112. package/dist/analytics/analytics.js +1 -2
  113. package/dist/analytics/analytics__custom-plugin.js +6 -8
  114. package/dist/auth/auth.js +1 -1
  115. package/dist/auth/auth__core.js +26 -26
  116. package/dist/auth/background-flow.js +4 -5
  117. package/dist/auth/iframe-flow.js +12 -12
  118. package/dist/auth/landing.js +1 -1
  119. package/dist/auth/request-builder.js +3 -5
  120. package/dist/auth/response-parser.js +5 -6
  121. package/dist/auth/storage.js +12 -12
  122. package/dist/auth/token-validator.js +13 -16
  123. package/dist/auth/window-flow.js +18 -19
  124. package/dist/auth-dialog/auth-dialog.js +54 -57
  125. package/dist/auth-dialog-service/auth-dialog-service.js +1 -1
  126. package/dist/auth-ng/auth-ng.js +1 -1
  127. package/dist/avatar/avatar.js +30 -33
  128. package/dist/avatar-ng/avatar-ng.js +1 -1
  129. package/dist/badge/badge.js +10 -10
  130. package/dist/badge-ng/badge-ng.js +1 -1
  131. package/dist/breadcrumb-ng/breadcrumb-ng.js +0 -1
  132. package/dist/button/button.js +24 -27
  133. package/dist/button-group/button-group.js +5 -5
  134. package/dist/button-group/caption.js +4 -4
  135. package/dist/button-ng/button-ng.js +68 -69
  136. package/dist/button-set/button-set.js +6 -6
  137. package/dist/button-toolbar/button-toolbar.js +6 -6
  138. package/dist/caret/caret.js +2 -4
  139. package/dist/checkbox/checkbox.js +27 -30
  140. package/dist/checkbox-ng/checkbox-ng.js +0 -1
  141. package/dist/code/code.js +17 -21
  142. package/dist/confirm/confirm.js +31 -34
  143. package/dist/confirm-ng/confirm-ng.js +1 -1
  144. package/dist/confirm-service/confirm-service.js +1 -1
  145. package/dist/content-layout/content-layout.js +17 -20
  146. package/dist/contenteditable/contenteditable.js +11 -11
  147. package/dist/data-list/data-list.js +49 -55
  148. package/dist/data-list/item.js +64 -67
  149. package/dist/data-list/selection.js +0 -1
  150. package/dist/data-list/title.js +1 -1
  151. package/dist/data-list-ng/data-list-ng.js +1 -1
  152. package/dist/date-picker/date-input.js +39 -42
  153. package/dist/date-picker/date-picker.js +162 -165
  154. package/dist/date-picker/date-popup.js +119 -119
  155. package/dist/date-picker/day.js +34 -38
  156. package/dist/date-picker/month-names.js +11 -14
  157. package/dist/date-picker/month-slider.js +24 -28
  158. package/dist/date-picker/month.js +1 -1
  159. package/dist/date-picker/months.js +1 -1
  160. package/dist/date-picker/years.js +9 -13
  161. package/dist/dialog/dialog.d.ts +4 -16
  162. package/dist/dialog/dialog.js +68 -65
  163. package/dist/dialog-ng/dialog-ng.js +21 -22
  164. package/dist/docked-panel-ng/docked-panel-ng.js +0 -1
  165. package/dist/dropdown/dropdown.js +101 -104
  166. package/dist/dropdown-menu/dropdown-menu.js +1 -1
  167. package/dist/editable-heading/editable-heading.js +1 -1
  168. package/dist/error-bubble/error-bubble.js +6 -6
  169. package/dist/error-message/error-message.js +10 -10
  170. package/dist/error-message-ng/error-message-ng.js +0 -1
  171. package/dist/footer-ng/footer-ng.js +19 -21
  172. package/dist/global/angular-component-factory.js +2 -3
  173. package/dist/global/dom.js +1 -5
  174. package/dist/global/focus-sensor-hoc.js +58 -61
  175. package/dist/global/listeners.js +1 -5
  176. package/dist/global/react-dom-renderer.js +8 -12
  177. package/dist/global/rerender-hoc.js +1 -5
  178. package/dist/global/ring-angular-component.js +1 -3
  179. package/dist/grid/col.js +13 -14
  180. package/dist/grid/grid.js +5 -5
  181. package/dist/grid/row.js +16 -17
  182. package/dist/group/group.js +5 -5
  183. package/dist/header/header.js +10 -10
  184. package/dist/header/logo.js +9 -9
  185. package/dist/header/profile.js +58 -58
  186. package/dist/header/services.js +19 -22
  187. package/dist/header/smart-profile.js +40 -43
  188. package/dist/header/smart-services.js +28 -31
  189. package/dist/header/tray-icon.js +6 -6
  190. package/dist/header/tray.js +5 -5
  191. package/dist/heading/heading.js +1 -1
  192. package/dist/heading-ng/heading-ng.js +1 -1
  193. package/dist/http/http.js +111 -107
  194. package/dist/http/http.mock.js +3 -4
  195. package/dist/hub-source/hub-source.js +7 -9
  196. package/dist/hub-source/hub-source__user.js +0 -1
  197. package/dist/hub-source/hub-source__users-groups.js +4 -5
  198. package/dist/icon/icon.js +18 -18
  199. package/dist/icon/icon__svg.js +1 -1
  200. package/dist/icon-ng/icon-ng.js +0 -1
  201. package/dist/input/input.js +35 -38
  202. package/dist/input-ng/input-ng.js +25 -26
  203. package/dist/island/adaptive-island-hoc.js +21 -25
  204. package/dist/island/content.js +62 -65
  205. package/dist/island/header.js +11 -11
  206. package/dist/island/island.js +8 -8
  207. package/dist/island-legacy/content-legacy.js +5 -5
  208. package/dist/island-legacy/header-legacy.js +5 -5
  209. package/dist/island-legacy/island-legacy.js +5 -5
  210. package/dist/link/clickableLink.js +27 -30
  211. package/dist/link/link.js +16 -16
  212. package/dist/list/list.js +389 -391
  213. package/dist/list/list__custom.js +6 -10
  214. package/dist/list/list__hint.js +3 -4
  215. package/dist/list/list__item.js +4 -7
  216. package/dist/list/list__link.js +1 -1
  217. package/dist/list/list__users-groups-source.js +3 -3
  218. package/dist/loader/loader.js +16 -19
  219. package/dist/loader/loader__core.js +62 -62
  220. package/dist/loader-inline/loader-inline.js +6 -6
  221. package/dist/loader-ng/loader-ng.js +3 -4
  222. package/dist/loader-screen/loader-screen.js +6 -6
  223. package/dist/loader-screen-ng/loader-screen-ng.js +0 -1
  224. package/dist/login-dialog/login-dialog.js +55 -58
  225. package/dist/login-dialog/service.js +1 -1
  226. package/dist/markdown/code.js +0 -1
  227. package/dist/markdown/markdown.js +1 -1
  228. package/dist/message/message.js +22 -25
  229. package/dist/old-browsers-message/white-list.js +2 -2
  230. package/dist/pager/pager.js +55 -58
  231. package/dist/pager-ng/pager-ng.js +1 -1
  232. package/dist/panel/panel.js +5 -5
  233. package/dist/panel-ng/panel-ng.js +0 -1
  234. package/dist/permissions/permissions.js +14 -16
  235. package/dist/permissions/permissions__cache.js +4 -6
  236. package/dist/permissions-ng/permissions-ng.js +1 -1
  237. package/dist/place-under-ng/place-under-ng.js +0 -1
  238. package/dist/popup/popup.js +118 -121
  239. package/dist/popup/popup.target.js +1 -1
  240. package/dist/popup/position.js +0 -1
  241. package/dist/popup-menu/popup-menu.js +19 -22
  242. package/dist/progress-bar/progress-bar.js +41 -44
  243. package/dist/progress-bar-ng/progress-bar-ng.js +1 -1
  244. package/dist/promised-click-ng/promised-click-ng.js +0 -1
  245. package/dist/query-assist/query-assist.js +507 -501
  246. package/dist/query-assist/query-assist__suggestions.js +1 -1
  247. package/dist/query-assist-ng/query-assist-ng.js +1 -1
  248. package/dist/radio/radio.js +10 -13
  249. package/dist/radio/radio__item.js +19 -22
  250. package/dist/select/select.js +351 -350
  251. package/dist/select/select__popup.js +148 -152
  252. package/dist/select-ng/select-ng.js +1 -1
  253. package/dist/select-ng/select-ng__lazy.js +4 -4
  254. package/dist/select-ng/select-ng__options.js +14 -15
  255. package/dist/shortcuts/core.js +35 -36
  256. package/dist/shortcuts/shortcuts-hoc.js +7 -11
  257. package/dist/shortcuts/shortcuts.js +10 -11
  258. package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -1
  259. package/dist/shortcuts-ng/shortcuts-ng.js +0 -1
  260. package/dist/sidebar-ng/sidebar-ng.js +0 -1
  261. package/dist/storage/storage.js +1 -1
  262. package/dist/storage/storage__fallback.js +8 -10
  263. package/dist/storage/storage__local.js +2 -2
  264. package/dist/style.css +1 -1
  265. package/dist/tab-trap/tab-trap.js +84 -86
  266. package/dist/table/cell.js +6 -6
  267. package/dist/table/disable-hover-hoc.js +23 -25
  268. package/dist/table/header-cell.js +28 -31
  269. package/dist/table/header.js +58 -61
  270. package/dist/table/multitable.js +91 -95
  271. package/dist/table/row-with-focus-sensor.js +15 -18
  272. package/dist/table/row.js +51 -54
  273. package/dist/table/selection-shortcuts-hoc.js +145 -147
  274. package/dist/table/selection.js +7 -9
  275. package/dist/table/smart-table.js +21 -24
  276. package/dist/table/table.js +103 -109
  277. package/dist/table-legacy-ng/table-legacy-ng.js +1 -1
  278. package/dist/table-legacy-ng/table-legacy-ng__pager.js +1 -1
  279. package/dist/table-legacy-ng/table-legacy-ng__selection.js +1 -3
  280. package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +0 -1
  281. package/dist/table-ng/smart-table-ng.js +1 -1
  282. package/dist/table-ng/table-ng.js +1 -1
  283. package/dist/tabs/collapsible-more.js +1 -1
  284. package/dist/tabs/collapsible-tab.js +1 -1
  285. package/dist/tabs/dumb-tabs.js +46 -49
  286. package/dist/tabs/smart-tabs.js +10 -10
  287. package/dist/tabs/tab.js +7 -8
  288. package/dist/tag/tag.js +42 -45
  289. package/dist/tags-input/tags-input.d.ts +1 -1
  290. package/dist/tags-input/tags-input.js +214 -213
  291. package/dist/tags-input-ng/tags-input-ng.js +1 -1
  292. package/dist/tags-list/tags-list.js +20 -20
  293. package/dist/template-ng/template-ng.js +25 -26
  294. package/dist/text/text.js +6 -6
  295. package/dist/toggle/toggle.js +19 -19
  296. package/dist/toggle-ng/toggle-ng.js +1 -1
  297. package/dist/tooltip/tooltip.js +86 -89
  298. package/dist/tooltip-ng/tooltip-ng.js +1 -1
  299. package/dist/user-agreement/service.js +207 -205
  300. package/dist/user-agreement/user-agreement.js +39 -42
  301. package/dist/user-card/smart-user-card-tooltip.d.ts +1 -1
  302. package/dist/user-card/smart-user-card-tooltip.js +32 -35
  303. package/dist/user-card/tooltip.js +26 -26
  304. package/dist/user-card-ng/user-card-ng.js +1 -1
  305. package/package.json +15 -15
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { Component } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { isNodeInVisiblePartOfPage } from '../global/dom.js';
@@ -10,30 +10,55 @@ const FOCUSABLE_ELEMENTS = 'input, button, select, textarea, a[href], *[tabindex
10
10
  * @name TabTrap
11
11
  */
12
12
  class TabTrap extends Component {
13
- constructor() {
14
- var _this;
15
- super(...arguments);
16
- _this = this;
17
- _defineProperty(this, "previousFocusedNode", void 0);
18
- _defineProperty(this, "trapWithoutFocus", void 0);
19
- _defineProperty(this, "restoreFocus", () => {
20
- const {
21
- previousFocusedNode
22
- } = this;
23
- if (previousFocusedNode instanceof HTMLElement && previousFocusedNode.focus && isNodeInVisiblePartOfPage(previousFocusedNode)) {
24
- previousFocusedNode.focus({
25
- preventScroll: true
26
- });
27
- }
28
- });
29
- _defineProperty(this, "node", void 0);
30
- _defineProperty(this, "containerRef", node => {
31
- if (!node) {
32
- return;
33
- }
34
- this.node = node;
35
- });
36
- _defineProperty(this, "focusElement", function () {
13
+ static propTypes = {
14
+ children: PropTypes.node.isRequired,
15
+ trapDisabled: PropTypes.bool,
16
+ autoFocusFirst: PropTypes.bool,
17
+ focusBackOnClose: PropTypes.bool,
18
+ focusBackOnExit: PropTypes.bool
19
+ };
20
+ static defaultProps = {
21
+ trapDisabled: false,
22
+ autoFocusFirst: true,
23
+ focusBackOnClose: true,
24
+ focusBackOnExit: false
25
+ };
26
+ componentDidMount() {
27
+ this.previousFocusedNode = document.activeElement;
28
+ if (this.props.autoFocusFirst) {
29
+ this.focusFirst();
30
+ } else if (!this.props.trapDisabled && (!this.node || !this.node.contains(this.previousFocusedNode))) {
31
+ this.trapWithoutFocus = true;
32
+ this.trapButtonNode?.focus();
33
+ }
34
+ }
35
+ componentWillUnmount() {
36
+ if (this.props.focusBackOnClose) {
37
+ this.restoreFocus();
38
+ }
39
+ }
40
+ previousFocusedNode;
41
+ trapWithoutFocus;
42
+ restoreFocus = () => {
43
+ const {
44
+ previousFocusedNode
45
+ } = this;
46
+ if (previousFocusedNode instanceof HTMLElement && previousFocusedNode.focus && isNodeInVisiblePartOfPage(previousFocusedNode)) {
47
+ previousFocusedNode.focus({
48
+ preventScroll: true
49
+ });
50
+ }
51
+ };
52
+ node;
53
+ containerRef = node => {
54
+ if (!node) {
55
+ return;
56
+ }
57
+ this.node = node;
58
+ };
59
+ focusElement = (() => {
60
+ var _this = this;
61
+ return function () {
37
62
  let first = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
38
63
  const {
39
64
  node
@@ -46,58 +71,44 @@ class TabTrap extends Component {
46
71
  if (toBeFocused) {
47
72
  toBeFocused.focus();
48
73
  }
49
- });
50
- _defineProperty(this, "focusFirst", () => this.focusElement(true));
51
- _defineProperty(this, "focusLast", () => this.focusElement(false));
52
- _defineProperty(this, "focusLastIfEnabled", event => {
53
- if (this.trapWithoutFocus) {
54
- return;
55
- }
56
- if (this.props.focusBackOnExit) {
57
- const prevFocused = event.nativeEvent.relatedTarget;
58
- if (prevFocused != null && this.node != null && prevFocused instanceof Element && this.node.contains(prevFocused)) {
59
- this.restoreFocus();
60
- }
61
- } else {
62
- this.focusLast();
63
- }
64
- });
65
- _defineProperty(this, "handleBlurIfWithoutFocus", event => {
66
- if (!this.trapWithoutFocus) {
67
- return;
68
- }
69
- this.trapWithoutFocus = false;
70
- const newFocused = event.nativeEvent.relatedTarget;
71
- if (!newFocused) {
72
- return;
73
- }
74
- if (newFocused instanceof Element && this.node?.contains(newFocused)) {
75
- return;
74
+ };
75
+ })();
76
+ focusFirst = () => this.focusElement(true);
77
+ focusLast = () => this.focusElement(false);
78
+ focusLastIfEnabled = event => {
79
+ if (this.trapWithoutFocus) {
80
+ return;
81
+ }
82
+ if (this.props.focusBackOnExit) {
83
+ const prevFocused = event.nativeEvent.relatedTarget;
84
+ if (prevFocused != null && this.node != null && prevFocused instanceof Element && this.node.contains(prevFocused)) {
85
+ this.restoreFocus();
76
86
  }
87
+ } else {
77
88
  this.focusLast();
78
- });
79
- _defineProperty(this, "trapButtonNode", void 0);
80
- _defineProperty(this, "trapButtonRef", node => {
81
- if (!node) {
82
- return;
83
- }
84
- this.trapButtonNode = node;
85
- });
86
- }
87
- componentDidMount() {
88
- this.previousFocusedNode = document.activeElement;
89
- if (this.props.autoFocusFirst) {
90
- this.focusFirst();
91
- } else if (!this.props.trapDisabled && (!this.node || !this.node.contains(this.previousFocusedNode))) {
92
- this.trapWithoutFocus = true;
93
- this.trapButtonNode?.focus();
94
89
  }
95
- }
96
- componentWillUnmount() {
97
- if (this.props.focusBackOnClose) {
98
- this.restoreFocus();
90
+ };
91
+ handleBlurIfWithoutFocus = event => {
92
+ if (!this.trapWithoutFocus) {
93
+ return;
99
94
  }
100
- }
95
+ this.trapWithoutFocus = false;
96
+ const newFocused = event.nativeEvent.relatedTarget;
97
+ if (!newFocused) {
98
+ return;
99
+ }
100
+ if (newFocused instanceof Element && this.node?.contains(newFocused)) {
101
+ return;
102
+ }
103
+ this.focusLast();
104
+ };
105
+ trapButtonNode;
106
+ trapButtonRef = node => {
107
+ if (!node) {
108
+ return;
109
+ }
110
+ this.trapButtonNode = node;
111
+ };
101
112
  render() {
102
113
  const {
103
114
  children,
@@ -132,18 +143,5 @@ class TabTrap extends Component {
132
143
  }));
133
144
  }
134
145
  }
135
- _defineProperty(TabTrap, "propTypes", {
136
- children: PropTypes.node.isRequired,
137
- trapDisabled: PropTypes.bool,
138
- autoFocusFirst: PropTypes.bool,
139
- focusBackOnClose: PropTypes.bool,
140
- focusBackOnExit: PropTypes.bool
141
- });
142
- _defineProperty(TabTrap, "defaultProps", {
143
- trapDisabled: false,
144
- autoFocusFirst: true,
145
- focusBackOnClose: true,
146
- focusBackOnExit: false
147
- });
148
146
 
149
147
  export { FOCUSABLE_ELEMENTS, TabTrap as default };
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -6,6 +6,11 @@ import joinDataTestAttributes from '../global/data-tests.js';
6
6
  import { m as modules_1db4bbca } from '../_helpers/table.js';
7
7
 
8
8
  class Cell extends PureComponent {
9
+ static propTypes = {
10
+ children: PropTypes.any,
11
+ className: PropTypes.string,
12
+ 'data-test': PropTypes.string
13
+ };
9
14
  render() {
10
15
  const classes = classNames(modules_1db4bbca.cell, this.props.className);
11
16
  return /*#__PURE__*/React.createElement("td", _extends({}, this.props, {
@@ -14,10 +19,5 @@ class Cell extends PureComponent {
14
19
  }), this.props.children);
15
20
  }
16
21
  }
17
- _defineProperty(Cell, "propTypes", {
18
- children: PropTypes.any,
19
- className: PropTypes.string,
20
- 'data-test': PropTypes.string
21
- });
22
22
 
23
23
  export { Cell as default };
@@ -1,30 +1,13 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
 
4
4
  function disableHoverHOC(ComposedComponent) {
5
- var _class;
6
- return _class = class DisableHover extends PureComponent {
7
- constructor() {
8
- super(...arguments);
9
- _defineProperty(this, "state", {
10
- disabledHover: false
11
- });
12
- _defineProperty(this, "onMouseMove", () => {
13
- if (this.state.disabledHover) {
14
- this.setState({
15
- disabledHover: false
16
- });
17
- }
18
- });
19
- _defineProperty(this, "onKeyDown", e => {
20
- const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line @typescript-eslint/no-magic-numbers
21
- if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
22
- this.setState({
23
- disabledHover: true
24
- });
25
- }
26
- });
27
- }
5
+ return class DisableHover extends PureComponent {
6
+ static propTypes = ComposedComponent.propTypes;
7
+ static defaultProps = ComposedComponent.defaultProps;
8
+ state = {
9
+ disabledHover: false
10
+ };
28
11
  componentDidMount() {
29
12
  document.addEventListener('mousemove', this.onMouseMove);
30
13
  document.addEventListener('keydown', this.onKeyDown, true);
@@ -33,12 +16,27 @@ function disableHoverHOC(ComposedComponent) {
33
16
  document.removeEventListener('mousemove', this.onMouseMove);
34
17
  document.removeEventListener('keydown', this.onKeyDown, true);
35
18
  }
19
+ onMouseMove = () => {
20
+ if (this.state.disabledHover) {
21
+ this.setState({
22
+ disabledHover: false
23
+ });
24
+ }
25
+ };
26
+ onKeyDown = e => {
27
+ const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line @typescript-eslint/no-magic-numbers
28
+ if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
29
+ this.setState({
30
+ disabledHover: true
31
+ });
32
+ }
33
+ };
36
34
  render() {
37
35
  return /*#__PURE__*/React.createElement(ComposedComponent, _extends({}, this.props, {
38
36
  disabledHover: this.state.disabledHover
39
37
  }));
40
38
  }
41
- }, _defineProperty(_class, "propTypes", ComposedComponent.propTypes), _defineProperty(_class, "defaultProps", ComposedComponent.defaultProps), _class;
39
+ };
42
40
  }
43
41
 
44
42
  export { disableHoverHOC as default };
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -14,24 +14,33 @@ import '../icon/icon__svg.js';
14
14
  import '../global/memoize.js';
15
15
 
16
16
  class HeaderCell extends PureComponent {
17
- constructor() {
18
- super(...arguments);
19
- _defineProperty(this, "sortable", void 0);
20
- _defineProperty(this, "sorted", void 0);
21
- _defineProperty(this, "onClick", () => {
22
- if (this.sortable) {
23
- const {
24
- column,
25
- onSort,
26
- sortOrder
27
- } = this.props;
28
- onSort({
29
- column,
30
- order: !(this.sorted && sortOrder)
31
- });
32
- }
33
- });
34
- }
17
+ static propTypes = {
18
+ children: PropTypes.any,
19
+ className: PropTypes.string,
20
+ column: PropTypes.object.isRequired,
21
+ onSort: PropTypes.func,
22
+ sortKey: PropTypes.string,
23
+ sortOrder: PropTypes.bool,
24
+ 'data-test': PropTypes.string
25
+ };
26
+ static defaultProps = {
27
+ onSort: () => {}
28
+ };
29
+ sortable;
30
+ sorted;
31
+ onClick = () => {
32
+ if (this.sortable) {
33
+ const {
34
+ column,
35
+ onSort,
36
+ sortOrder
37
+ } = this.props;
38
+ onSort({
39
+ column,
40
+ order: !(this.sorted && sortOrder)
41
+ });
42
+ }
43
+ };
35
44
  onChildrenClick(e) {
36
45
  e.stopPropagation();
37
46
  }
@@ -70,17 +79,5 @@ class HeaderCell extends PureComponent {
70
79
  })));
71
80
  }
72
81
  }
73
- _defineProperty(HeaderCell, "propTypes", {
74
- children: PropTypes.any,
75
- className: PropTypes.string,
76
- column: PropTypes.object.isRequired,
77
- onSort: PropTypes.func,
78
- sortKey: PropTypes.string,
79
- sortOrder: PropTypes.bool,
80
- 'data-test': PropTypes.string
81
- });
82
- _defineProperty(HeaderCell, "defaultProps", {
83
- onSort: () => {}
84
- });
85
82
 
86
83
  export { HeaderCell as default };
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -23,43 +23,65 @@ import '@jetbrains/icons/chevron-10px';
23
23
  import '../global/data-tests.js';
24
24
 
25
25
  class Header extends PureComponent {
26
- constructor() {
27
- super(...arguments);
28
- _defineProperty(this, "state", {
29
- fixed: false,
30
- headerWidth: undefined,
31
- widths: []
32
- });
33
- _defineProperty(this, "id", getUID('table-header-'));
34
- _defineProperty(this, "onCheckboxFocus", event => {
35
- event.currentTarget.blur();
36
- });
37
- _defineProperty(this, "_columnsRowNode", void 0);
38
- _defineProperty(this, "storeColumnsRowNode", node => {
39
- if (node) {
40
- this._columnsRowNode = node;
41
- this.calculateColumnsWidths(node);
42
- }
43
- });
44
- _defineProperty(this, "onScrollIn", () => {
45
- this.calculateColumnsWidths(this._columnsRowNode);
46
- this.setState({
47
- fixed: false
48
- });
26
+ static propTypes = {
27
+ caption: PropTypes.string,
28
+ selectable: PropTypes.bool,
29
+ draggable: PropTypes.bool,
30
+ checked: PropTypes.bool,
31
+ checkboxDisabled: PropTypes.bool,
32
+ sticky: PropTypes.bool,
33
+ topStickOffset: PropTypes.string,
34
+ onCheckboxChange: PropTypes.func,
35
+ columns: PropTypes.array.isRequired,
36
+ onSort: PropTypes.func,
37
+ sortKey: PropTypes.string,
38
+ sortOrder: PropTypes.bool
39
+ };
40
+ static defaultProps = {
41
+ selectable: true,
42
+ draggable: false,
43
+ checked: true,
44
+ sticky: true,
45
+ topStickOffset: '0px',
46
+ onSort: () => {},
47
+ onCheckboxChange: () => {},
48
+ sortKey: 'id',
49
+ sortOrder: true
50
+ };
51
+ state = {
52
+ fixed: false,
53
+ headerWidth: undefined,
54
+ widths: []
55
+ };
56
+ id = getUID('table-header-');
57
+ onCheckboxFocus = event => {
58
+ event.currentTarget.blur();
59
+ };
60
+ _columnsRowNode;
61
+ storeColumnsRowNode = node => {
62
+ if (node) {
63
+ this._columnsRowNode = node;
64
+ this.calculateColumnsWidths(node);
65
+ }
66
+ };
67
+ onScrollIn = () => {
68
+ this.calculateColumnsWidths(this._columnsRowNode);
69
+ this.setState({
70
+ fixed: false
49
71
  });
50
- _defineProperty(this, "onScrollOut", _ref => {
51
- let {
52
- currentPosition
53
- } = _ref;
54
- if (currentPosition !== 'above') {
55
- return;
56
- }
57
- this.calculateColumnsWidths(this._columnsRowNode);
58
- this.setState({
59
- fixed: true
60
- });
72
+ };
73
+ onScrollOut = _ref => {
74
+ let {
75
+ currentPosition
76
+ } = _ref;
77
+ if (currentPosition !== 'above') {
78
+ return;
79
+ }
80
+ this.calculateColumnsWidths(this._columnsRowNode);
81
+ this.setState({
82
+ fixed: true
61
83
  });
62
- }
84
+ };
63
85
  calculateColumnsWidths(columnsRowNode) {
64
86
  var _columnsRowNode$child;
65
87
  this.setState({
@@ -152,30 +174,5 @@ class Header extends PureComponent {
152
174
  }, this.createCells(widths)));
153
175
  }
154
176
  }
155
- _defineProperty(Header, "propTypes", {
156
- caption: PropTypes.string,
157
- selectable: PropTypes.bool,
158
- draggable: PropTypes.bool,
159
- checked: PropTypes.bool,
160
- checkboxDisabled: PropTypes.bool,
161
- sticky: PropTypes.bool,
162
- topStickOffset: PropTypes.string,
163
- onCheckboxChange: PropTypes.func,
164
- columns: PropTypes.array.isRequired,
165
- onSort: PropTypes.func,
166
- sortKey: PropTypes.string,
167
- sortOrder: PropTypes.bool
168
- });
169
- _defineProperty(Header, "defaultProps", {
170
- selectable: true,
171
- draggable: false,
172
- checked: true,
173
- sticky: true,
174
- topStickOffset: '0px',
175
- onSort: () => {},
176
- onCheckboxChange: () => {},
177
- sortKey: 'id',
178
- sortOrder: true
179
- });
180
177
 
181
178
  export { Header as default };