@jetbrains/ring-ui-built 7.0.0-beta.2 → 7.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/components/_helpers/_rollupPluginBabelHelpers.js +1 -504
  2. package/components/_helpers/anchor.js +7 -5
  3. package/components/_helpers/button__classes.js +15 -13
  4. package/components/_helpers/caption.js +11 -17
  5. package/components/_helpers/card.js +92 -96
  6. package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
  7. package/components/_helpers/icon__svg.js +27 -23
  8. package/components/_helpers/input.js +150 -171
  9. package/components/_helpers/query-assist__suggestions.js +78 -93
  10. package/components/_helpers/select__filter.js +56 -67
  11. package/components/_helpers/services-link.js +23 -29
  12. package/components/_helpers/sidebar.js +91 -93
  13. package/components/_helpers/tab-link.js +8 -6
  14. package/components/_helpers/theme.js +41 -50
  15. package/components/_helpers/title.js +59 -69
  16. package/components/alert/alert.js +112 -156
  17. package/components/alert/container.js +32 -39
  18. package/components/alert-service/alert-service.js +104 -161
  19. package/components/analytics/analytics.js +12 -20
  20. package/components/analytics/analytics__custom-plugin.js +52 -68
  21. package/components/auth/auth.js +2 -27
  22. package/components/auth/auth__core.d.ts +1 -1
  23. package/components/auth/auth__core.js +742 -1428
  24. package/components/auth/background-flow.js +84 -121
  25. package/components/auth/down-notification.js +31 -69
  26. package/components/auth/iframe-flow.js +70 -123
  27. package/components/auth/request-builder.js +46 -77
  28. package/components/auth/response-parser.js +84 -112
  29. package/components/auth/storage.js +160 -318
  30. package/components/auth/token-validator.js +132 -227
  31. package/components/auth/window-flow.js +84 -121
  32. package/components/auth-dialog/auth-dialog.js +99 -150
  33. package/components/auth-dialog-service/auth-dialog-service.js +6 -26
  34. package/components/avatar/avatar-example-datauri.js +1 -1
  35. package/components/avatar/avatar.js +94 -123
  36. package/components/avatar/fallback-avatar.js +20 -34
  37. package/components/badge/badge.js +32 -38
  38. package/components/breadcrumbs/breadcrumbs.js +13 -17
  39. package/components/button/button.js +67 -80
  40. package/components/button-group/button-group.js +27 -36
  41. package/components/button-set/button-set.js +19 -27
  42. package/components/button-toolbar/button-toolbar.js +17 -25
  43. package/components/caret/caret.js +184 -211
  44. package/components/checkbox/checkbox.js +69 -86
  45. package/components/clipboard/clipboard-fallback.js +7 -7
  46. package/components/clipboard/clipboard.js +36 -128
  47. package/components/code/code.js +83 -151
  48. package/components/collapse/collapse-content.js +42 -60
  49. package/components/collapse/collapse-context.js +2 -2
  50. package/components/collapse/collapse-control.js +12 -12
  51. package/components/collapse/collapse.js +12 -17
  52. package/components/collapse/consts.js +4 -4
  53. package/components/collapse/utils.js +1 -3
  54. package/components/confirm/confirm.js +57 -87
  55. package/components/confirm-service/confirm-service.js +23 -44
  56. package/components/content-layout/content-layout.js +41 -56
  57. package/components/content-layout/sidebar.js +1 -1
  58. package/components/contenteditable/contenteditable.js +38 -46
  59. package/components/control-help/control-help.js +5 -3
  60. package/components/control-label/control-label.js +9 -8
  61. package/components/data-list/data-list.js +113 -156
  62. package/components/data-list/data-list.mock.js +3 -5
  63. package/components/data-list/item.js +120 -140
  64. package/components/data-list/selection.js +77 -135
  65. package/components/data-list/title.js +2 -10
  66. package/components/date-picker/consts.js +16 -22
  67. package/components/date-picker/date-input.js +99 -124
  68. package/components/date-picker/date-picker.js +140 -184
  69. package/components/date-picker/date-popup.js +280 -327
  70. package/components/date-picker/day.js +71 -94
  71. package/components/date-picker/month-names.js +41 -59
  72. package/components/date-picker/month-slider.js +42 -61
  73. package/components/date-picker/month.js +17 -24
  74. package/components/date-picker/months.js +44 -49
  75. package/components/date-picker/weekdays.js +12 -21
  76. package/components/date-picker/years.js +77 -98
  77. package/components/dialog/dialog.js +151 -187
  78. package/components/dialog/dialog__body-scroll-preventer.js +0 -3
  79. package/components/dropdown/anchor.js +0 -6
  80. package/components/dropdown/dropdown.js +134 -154
  81. package/components/dropdown-menu/dropdown-menu.js +59 -87
  82. package/components/editable-heading/editable-heading.js +69 -116
  83. package/components/error-bubble/error-bubble.js +29 -54
  84. package/components/error-message/error-message.js +34 -49
  85. package/components/footer/footer.js +27 -28
  86. package/components/global/compose.js +1 -8
  87. package/components/global/composeRefs.d.ts +0 -3
  88. package/components/global/composeRefs.js +8 -15
  89. package/components/global/controls-height.js +2 -2
  90. package/components/global/create-stateful-context.js +14 -13
  91. package/components/global/data-tests.js +7 -12
  92. package/components/global/dom.js +49 -82
  93. package/components/global/focus-sensor-hoc.js +99 -106
  94. package/components/global/fuzzy-highlight.js +23 -34
  95. package/components/global/get-event-key.js +8 -8
  96. package/components/global/get-uid.js +3 -7
  97. package/components/global/inject-styles.js +7 -14
  98. package/components/global/listeners.js +28 -47
  99. package/components/global/memoize.js +6 -10
  100. package/components/global/normalize-indent.js +19 -46
  101. package/components/global/promise-with-timeout.js +6 -8
  102. package/components/global/prop-types.js +3 -5
  103. package/components/global/react-dom-renderer.js +29 -40
  104. package/components/global/rerender-hoc.js +16 -32
  105. package/components/global/schedule-raf.js +4 -4
  106. package/components/global/sniffer.js +1 -1
  107. package/components/global/theme.js +1 -18
  108. package/components/global/trivial-template-tag.js +4 -9
  109. package/components/global/typescript-utils.js +2 -6
  110. package/components/global/url.js +20 -23
  111. package/components/global/use-event-callback.js +7 -4
  112. package/components/grid/col.js +27 -39
  113. package/components/grid/grid.js +18 -27
  114. package/components/grid/row.js +23 -30
  115. package/components/group/group.js +16 -22
  116. package/components/header/header-icon.js +19 -31
  117. package/components/header/header.d.ts +0 -1
  118. package/components/header/header.js +30 -64
  119. package/components/header/links.js +6 -3
  120. package/components/header/logo.js +15 -26
  121. package/components/header/profile.js +124 -150
  122. package/components/header/services-link.js +1 -3
  123. package/components/header/services.js +64 -97
  124. package/components/header/smart-profile.js +101 -178
  125. package/components/header/smart-services.js +55 -90
  126. package/components/header/tray.js +21 -30
  127. package/components/heading/heading.js +21 -20
  128. package/components/http/http.js +162 -319
  129. package/components/http/http.mock.js +50 -98
  130. package/components/hub-source/hub-source.js +77 -182
  131. package/components/hub-source/hub-source__user.js +9 -37
  132. package/components/hub-source/hub-source__users-groups.js +34 -60
  133. package/components/i18n/i18n-context.js +7 -8
  134. package/components/i18n/i18n.js +3 -6
  135. package/components/icon/icon.js +60 -74
  136. package/components/icon/icon__svg.js +0 -5
  137. package/components/icon/index.js +0 -5
  138. package/components/input/input.js +1 -11
  139. package/components/island/adaptive-island-hoc.js +29 -37
  140. package/components/island/content.js +100 -110
  141. package/components/island/header.js +56 -66
  142. package/components/island/island.js +25 -33
  143. package/components/island-legacy/content-legacy.js +16 -22
  144. package/components/island-legacy/header-legacy.js +19 -25
  145. package/components/island-legacy/island-legacy.js +16 -22
  146. package/components/link/clickableLink.js +33 -42
  147. package/components/link/link.js +47 -55
  148. package/components/list/consts.js +2 -2
  149. package/components/list/list.js +399 -486
  150. package/components/list/list__custom.js +51 -61
  151. package/components/list/list__hint.js +9 -17
  152. package/components/list/list__item.js +147 -178
  153. package/components/list/list__link.js +38 -47
  154. package/components/list/list__separator.js +15 -24
  155. package/components/list/list__title.js +25 -34
  156. package/components/list/list__users-groups-source.js +55 -121
  157. package/components/loader/loader.js +38 -60
  158. package/components/loader/loader__core.js +123 -184
  159. package/components/loader-inline/loader-inline.js +24 -32
  160. package/components/loader-screen/loader-screen.js +24 -40
  161. package/components/login-dialog/login-dialog.js +81 -121
  162. package/components/login-dialog/service.js +6 -29
  163. package/components/markdown/markdown.js +16 -24
  164. package/components/message/message.js +170 -201
  165. package/components/old-browsers-message/old-browsers-message.js +11 -14
  166. package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
  167. package/components/old-browsers-message/white-list.js +8 -13
  168. package/components/pager/pager.js +212 -257
  169. package/components/panel/panel.js +16 -22
  170. package/components/permissions/permissions.js +118 -161
  171. package/components/permissions/permissions__cache.js +191 -218
  172. package/components/popup/popup.consts.js +1 -1
  173. package/components/popup/popup.js +237 -288
  174. package/components/popup/popup.target.js +9 -7
  175. package/components/popup/position.js +94 -101
  176. package/components/popup-menu/popup-menu.js +33 -67
  177. package/components/progress-bar/progress-bar.js +57 -68
  178. package/components/query-assist/query-assist.js +583 -652
  179. package/components/query-assist/query-assist__suggestions.js +2 -26
  180. package/components/radio/radio.js +15 -27
  181. package/components/radio/radio__item.js +52 -62
  182. package/components/scrollable-section/scrollable-section.js +22 -32
  183. package/components/select/select.js +693 -793
  184. package/components/select/select__filter.js +1 -26
  185. package/components/select/select__popup.js +316 -413
  186. package/components/shortcuts/core.js +147 -195
  187. package/components/shortcuts/shortcut-title.js +6 -10
  188. package/components/shortcuts/shortcuts-hoc.js +23 -41
  189. package/components/shortcuts/shortcuts.js +41 -64
  190. package/components/slider/slider.js +93 -112
  191. package/components/slider/slider.utils.js +16 -23
  192. package/components/storage/storage.js +3 -27
  193. package/components/storage/storage__fallback.js +137 -210
  194. package/components/storage/storage__local.js +89 -147
  195. package/components/style.css +1 -1
  196. package/components/tab-trap/tab-trap.js +35 -53
  197. package/components/table/cell.js +11 -21
  198. package/components/table/disable-hover-hoc.js +27 -42
  199. package/components/table/header-cell.js +59 -75
  200. package/components/table/header.js +89 -110
  201. package/components/table/multitable.js +83 -89
  202. package/components/table/row-with-focus-sensor.js +25 -57
  203. package/components/table/row.js +169 -200
  204. package/components/table/selection-adapter.js +2 -2
  205. package/components/table/selection-shortcuts-hoc.js +108 -113
  206. package/components/table/selection.js +150 -217
  207. package/components/table/simple-table.js +19 -55
  208. package/components/table/smart-table.js +42 -76
  209. package/components/table/table.js +267 -327
  210. package/components/tabs/collapsible-more.js +47 -73
  211. package/components/tabs/collapsible-tab.js +32 -36
  212. package/components/tabs/collapsible-tabs.js +89 -148
  213. package/components/tabs/custom-item.js +4 -2
  214. package/components/tabs/dumb-tabs.js +60 -92
  215. package/components/tabs/smart-tabs.js +29 -61
  216. package/components/tabs/tab-link.js +1 -3
  217. package/components/tabs/tab.js +15 -24
  218. package/components/tabs/tabs.js +1 -26
  219. package/components/tag/tag.d.ts +0 -2
  220. package/components/tag/tag.js +120 -162
  221. package/components/tags-input/tags-input.js +222 -304
  222. package/components/tags-list/tags-list.js +45 -61
  223. package/components/text/text.js +28 -37
  224. package/components/toggle/toggle.js +51 -61
  225. package/components/tooltip/tooltip.js +109 -141
  226. package/components/user-agreement/service.js +259 -400
  227. package/components/user-agreement/user-agreement.js +80 -108
  228. package/components/user-card/card.js +1 -25
  229. package/components/user-card/smart-user-card-tooltip.js +52 -103
  230. package/components/user-card/tooltip.js +35 -65
  231. package/components/user-card/user-card.js +1 -25
  232. package/package.json +1 -1
  233. package/components/global/react-render-adapter.d.ts +0 -1
  234. package/components/global/react-render-adapter.js +0 -6
  235. package/components/header/tray-icon.d.ts +0 -1
  236. package/components/header/tray-icon.js +0 -26
@@ -1,15 +1,14 @@
1
- import { _ as _defineProperty, a as _inherits, b as _createClass, d as _objectSpread2, e as _classCallCheck, f as _callSuper, c as _objectWithoutProperties } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.concat.js';
3
- import 'core-js/modules/es.array.map.js';
1
+ import { _ as _defineProperty, b as _objectSpread2, a as _objectWithoutProperties } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
4
3
  import { PureComponent, Component, createElement } from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import classNames from 'classnames';
7
- import { List, arrayMove } from 'react-movable';
6
+ import { arrayMove, List } from 'react-movable';
8
7
  import focusSensorHOC from '../global/focus-sensor-hoc.js';
9
8
  import getUID from '../global/get-uid.js';
10
9
  import Shortcuts from '../shortcuts/shortcuts.js';
11
10
  import Loader from '../loader/loader.js';
12
- import Selection from './selection.js';
11
+ import Selection$1 from './selection.js';
13
12
  import Header from './header.js';
14
13
  import { m as modules_1db4bbca } from '../_helpers/table.js';
15
14
  import selectionShortcutsHOC from './selection-shortcuts-hoc.js';
@@ -18,46 +17,25 @@ import RowWithFocusSensorCallbacks from './row-with-focus-sensor.js';
18
17
  import { jsxs, jsx } from 'react/jsx-runtime';
19
18
  import '../global/prop-types.js';
20
19
  import '../global/composeRefs.js';
21
- import 'core-js/modules/es.object.to-string.js';
22
- import 'core-js/modules/web.dom-collections.for-each.js';
23
20
  import 'memoize-one';
24
- import 'util-deprecate';
25
- import 'core-js/modules/es.regexp.to-string.js';
26
21
  import '../shortcuts/core.js';
27
- import 'core-js/modules/es.array.find-index.js';
28
- import 'core-js/modules/es.array.includes.js';
29
- import 'core-js/modules/es.array.slice.js';
30
- import 'core-js/modules/es.array.splice.js';
31
- import 'core-js/modules/es.object.assign.js';
32
22
  import 'core-js/modules/es.regexp.exec.js';
33
- import 'core-js/modules/es.string.includes.js';
34
- import 'core-js/modules/es.string.match.js';
35
23
  import 'combokeys';
36
24
  import '../global/sniffer.js';
37
25
  import 'sniffr';
38
26
  import '../global/data-tests.js';
39
27
  import 'core-js/modules/es.array.reduce.js';
40
- import 'core-js/modules/es.object.entries.js';
41
28
  import '../loader/loader__core.js';
42
- import 'core-js/modules/es.array.fill.js';
43
- import 'core-js/modules/es.array.filter.js';
44
29
  import '../global/dom.js';
45
- import 'core-js/modules/es.array.iterator.js';
46
- import 'core-js/modules/es.set.js';
47
- import 'core-js/modules/es.string.split.js';
48
- import 'core-js/modules/web.dom-collections.iterator.js';
49
- import 'core-js/modules/es.array.index-of.js';
50
30
  import '../checkbox/checkbox.js';
51
31
  import '@jetbrains/icons/checkmark-12px';
52
32
  import '@jetbrains/icons/remove-12px';
53
33
  import '../icon/icon.js';
34
+ import 'util-deprecate';
54
35
  import '../icon/icon__constants.js';
55
36
  import '../_helpers/icon__svg.js';
56
37
  import 'core-js/modules/es.string.replace.js';
57
- import 'core-js/modules/es.string.starts-with.js';
58
38
  import '../global/memoize.js';
59
- import 'core-js/modules/es.map.js';
60
- import 'core-js/modules/es.weak-map.js';
61
39
  import '../control-help/control-help.js';
62
40
  import './header-cell.js';
63
41
  import '@jetbrains/icons/unsorted-10px';
@@ -81,331 +59,305 @@ import '../popup/popup.consts.js';
81
59
  import '../popup/popup.target.js';
82
60
  import './cell.js';
83
61
 
84
- var _excluded = ["ref"];
85
- var Table = /*#__PURE__*/function (_PureComponent) {
86
- function Table() {
87
- var _this;
88
- _classCallCheck(this, Table);
89
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
90
- args[_key] = arguments[_key];
91
- }
92
- _this = _callSuper(this, Table, [].concat(args));
93
- _defineProperty(_this, "state", {
62
+ const _excluded = ["ref"];
63
+ class Table extends PureComponent {
64
+ constructor() {
65
+ super(...arguments);
66
+ _defineProperty(this, "state", {
94
67
  shortcutsScope: getUID('ring-table-'),
95
68
  userSelectNone: false
96
69
  });
97
- _defineProperty(_this, "onMouseDown", function (e) {
70
+ _defineProperty(this, "onMouseDown", e => {
98
71
  if (e.shiftKey) {
99
- _this.setState({
72
+ this.setState({
100
73
  userSelectNone: true
101
74
  });
102
75
  }
103
76
  });
104
- _defineProperty(_this, "onMouseUp", function () {
105
- if (_this.state.userSelectNone) {
106
- _this.setState({
77
+ _defineProperty(this, "onMouseUp", () => {
78
+ if (this.state.userSelectNone) {
79
+ this.setState({
107
80
  userSelectNone: false
108
81
  });
109
82
  }
110
83
  });
111
- _defineProperty(_this, "onRowFocus", function (row) {
112
- var _this$props = _this.props,
113
- selection = _this$props.selection,
114
- onSelect = _this$props.onSelect;
84
+ _defineProperty(this, "onRowFocus", row => {
85
+ const {
86
+ selection,
87
+ onSelect
88
+ } = this.props;
115
89
  onSelect(selection.focus(row));
116
90
  });
117
- _defineProperty(_this, "onRowSelect", function (row, selected) {
118
- var _this$props2 = _this.props,
119
- selection = _this$props2.selection,
120
- onSelect = _this$props2.onSelect;
91
+ _defineProperty(this, "onRowSelect", (row, selected) => {
92
+ const {
93
+ selection,
94
+ onSelect
95
+ } = this.props;
121
96
  if (selected) {
122
97
  onSelect(selection.select(row));
123
98
  } else {
124
99
  onSelect(selection.deselect(row));
125
100
  }
126
101
  });
127
- _defineProperty(_this, "onSortEnd", function (_ref) {
128
- var oldIndex = _ref.oldIndex,
129
- newIndex = _ref.newIndex;
130
- var data = arrayMove(_this.props.data, oldIndex, newIndex);
131
- _this.props.onReorder({
102
+ _defineProperty(this, "onSortEnd", _ref => {
103
+ let {
104
+ oldIndex,
105
+ newIndex
106
+ } = _ref;
107
+ const data = arrayMove(this.props.data, oldIndex, newIndex);
108
+ this.props.onReorder({
132
109
  data,
133
110
  oldIndex,
134
111
  newIndex
135
112
  });
136
113
  });
137
- _defineProperty(_this, "onCheckboxChange", function (e) {
138
- var checked = e.currentTarget.checked;
139
- var _this$props3 = _this.props,
140
- selection = _this$props3.selection,
141
- onSelect = _this$props3.onSelect;
114
+ _defineProperty(this, "onCheckboxChange", e => {
115
+ const {
116
+ checked
117
+ } = e.currentTarget;
118
+ const {
119
+ selection,
120
+ onSelect
121
+ } = this.props;
142
122
  if (checked) {
143
123
  onSelect(selection.selectAll());
144
124
  } else {
145
125
  onSelect(selection.reset());
146
126
  }
147
- _this.restoreFocusWithoutScroll();
127
+ this.restoreFocusWithoutScroll();
148
128
  });
149
- _defineProperty(_this, "restoreFocusWithoutScroll", function () {
150
- var _window = window,
151
- scrollX = _window.scrollX,
152
- scrollY = _window.scrollY;
153
- _this.props.onFocusRestore();
129
+ _defineProperty(this, "restoreFocusWithoutScroll", () => {
130
+ const {
131
+ scrollX,
132
+ scrollY
133
+ } = window;
134
+ this.props.onFocusRestore();
154
135
  window.scrollTo(scrollX, scrollY);
155
136
  });
156
- return _this;
157
137
  }
158
- _inherits(Table, _PureComponent);
159
- return _createClass(Table, [{
160
- key: "componentDidMount",
161
- value: function componentDidMount() {
162
- document.addEventListener('mouseup', this.onMouseUp);
163
- }
164
- }, {
165
- key: "componentDidUpdate",
166
- value: function componentDidUpdate(_ref2) {
167
- var data = _ref2.data,
168
- selection = _ref2.selection,
169
- onSelect = _ref2.onSelect,
170
- selectable = _ref2.selectable,
171
- remoteSelection = _ref2.remoteSelection;
172
- if (data !== this.props.data && remoteSelection) {
173
- onSelect(selection.cloneWith({
174
- data: this.props.data
175
- }));
176
- }
177
- if (!this.props.selectable && this.props.selectable !== selectable) {
178
- onSelect(selection.resetSelection());
179
- }
138
+ componentDidMount() {
139
+ document.addEventListener('mouseup', this.onMouseUp);
140
+ }
141
+ componentDidUpdate(_ref2) {
142
+ let {
143
+ data,
144
+ selection,
145
+ onSelect,
146
+ selectable,
147
+ remoteSelection
148
+ } = _ref2;
149
+ if (data !== this.props.data && remoteSelection) {
150
+ onSelect(selection.cloneWith({
151
+ data: this.props.data
152
+ }));
180
153
  }
181
- }, {
182
- key: "componentWillUnmount",
183
- value: function componentWillUnmount() {
184
- document.removeEventListener('mouseup', this.onMouseUp);
154
+ if (!this.props.selectable && this.props.selectable !== selectable) {
155
+ onSelect(selection.resetSelection());
185
156
  }
186
- }, {
187
- key: "render",
188
- value: function render() {
189
- var _this2 = this;
190
- var _this$props4 = this.props,
191
- data = _this$props4.data,
192
- selection = _this$props4.selection,
193
- columns = _this$props4.columns,
194
- caption = _this$props4.caption,
195
- getItemKey = _this$props4.getItemKey,
196
- selectable = _this$props4.selectable,
197
- focused = _this$props4.focused,
198
- isItemSelectable = _this$props4.isItemSelectable,
199
- getItemLevel = _this$props4.getItemLevel,
200
- getItemClassName = _this$props4.getItemClassName,
201
- getMetaColumnClassName = _this$props4.getMetaColumnClassName,
202
- getItemDataTest = _this$props4.getItemDataTest,
203
- draggable = _this$props4.draggable,
204
- alwaysShowDragHandle = _this$props4.alwaysShowDragHandle,
205
- dragHandleTitle = _this$props4.dragHandleTitle,
206
- loading = _this$props4.loading,
207
- onSort = _this$props4.onSort,
208
- sortKey = _this$props4.sortKey,
209
- sortOrder = _this$props4.sortOrder,
210
- loaderClassName = _this$props4.loaderClassName,
211
- stickyHeader = _this$props4.stickyHeader,
212
- stickyHeaderOffset = _this$props4.stickyHeaderOffset,
213
- isItemCollapsible = _this$props4.isItemCollapsible,
214
- isParentCollapsible = _this$props4.isParentCollapsible,
215
- isItemCollapsed = _this$props4.isItemCollapsed,
216
- onItemCollapse = _this$props4.onItemCollapse,
217
- onItemExpand = _this$props4.onItemExpand,
218
- isDisabledSelectionVisible = _this$props4.isDisabledSelectionVisible,
219
- getCheckboxTooltip = _this$props4.getCheckboxTooltip,
220
- onItemDoubleClick = _this$props4.onItemDoubleClick,
221
- onItemClick = _this$props4.onItemClick,
222
- renderEmpty = _this$props4.renderEmpty,
223
- maxColSpan = _this$props4.maxColSpan,
224
- RowComponent = _this$props4.RowComponent;
225
- // NOTE: Do not construct new object per render because it causes all rows rerendering
226
- var headerProps = {
227
- caption,
228
- selectable,
229
- draggable,
230
- columns: typeof columns === 'function' ? columns(null) : columns,
231
- onSort,
232
- sortKey,
233
- sortOrder,
234
- sticky: stickyHeader,
235
- topStickOffset: stickyHeaderOffset,
236
- maxColSpan: this.props.maxColSpan
237
- };
238
- var selectedSize = selection.getSelected().size;
239
- var allSelectedSize = selection.selectAll().getSelected().size;
240
- headerProps.checked = selectedSize > 0 && selectedSize === allSelectedSize;
241
- headerProps.onCheckboxChange = this.onCheckboxChange;
242
- headerProps.checkboxDisabled = this.props.data.length === 0;
243
- var wrapperClasses = classNames({
244
- [modules_1db4bbca.tableWrapper]: true,
245
- [modules_1db4bbca.loading]: loading
246
- });
247
- var classes = classNames(this.props.className, {
248
- [modules_1db4bbca.table]: true,
249
- [modules_1db4bbca.wideFirstColumn]: this.props.wideFirstColumn,
250
- [modules_1db4bbca.multiSelection]: selection.getSelected().size > 0,
251
- [modules_1db4bbca.userSelectNone]: this.state.userSelectNone,
252
- [modules_1db4bbca.disabledHover]: this.props.disabledHover
157
+ }
158
+ componentWillUnmount() {
159
+ document.removeEventListener('mouseup', this.onMouseUp);
160
+ }
161
+ render() {
162
+ const {
163
+ data,
164
+ selection,
165
+ columns,
166
+ caption,
167
+ getItemKey,
168
+ selectable,
169
+ focused,
170
+ isItemSelectable,
171
+ getItemLevel,
172
+ getItemClassName,
173
+ getMetaColumnClassName,
174
+ getItemDataTest,
175
+ draggable,
176
+ alwaysShowDragHandle,
177
+ dragHandleTitle,
178
+ loading,
179
+ onSort,
180
+ sortKey,
181
+ sortOrder,
182
+ loaderClassName,
183
+ stickyHeader,
184
+ stickyHeaderOffset,
185
+ isItemCollapsible,
186
+ isParentCollapsible,
187
+ isItemCollapsed,
188
+ onItemCollapse,
189
+ onItemExpand,
190
+ isDisabledSelectionVisible,
191
+ getCheckboxTooltip,
192
+ onItemDoubleClick,
193
+ onItemClick,
194
+ renderEmpty,
195
+ maxColSpan,
196
+ RowComponent
197
+ } = this.props;
198
+ // NOTE: Do not construct new object per render because it causes all rows rerendering
199
+ const headerProps = {
200
+ caption,
201
+ selectable,
202
+ draggable,
203
+ columns: typeof columns === 'function' ? columns(null) : columns,
204
+ onSort,
205
+ sortKey,
206
+ sortOrder,
207
+ sticky: stickyHeader,
208
+ topStickOffset: stickyHeaderOffset,
209
+ maxColSpan: this.props.maxColSpan
210
+ };
211
+ const selectedSize = selection.getSelected().size;
212
+ const allSelectedSize = selection.selectAll().getSelected().size;
213
+ headerProps.checked = selectedSize > 0 && selectedSize === allSelectedSize;
214
+ headerProps.onCheckboxChange = this.onCheckboxChange;
215
+ headerProps.checkboxDisabled = this.props.data.length === 0;
216
+ const wrapperClasses = classNames({
217
+ [modules_1db4bbca.tableWrapper]: true,
218
+ [modules_1db4bbca.loading]: loading
219
+ });
220
+ const classes = classNames(this.props.className, {
221
+ [modules_1db4bbca.table]: true,
222
+ [modules_1db4bbca.wideFirstColumn]: this.props.wideFirstColumn,
223
+ [modules_1db4bbca.multiSelection]: selection.getSelected().size > 0,
224
+ [modules_1db4bbca.userSelectNone]: this.state.userSelectNone,
225
+ [modules_1db4bbca.disabledHover]: this.props.disabledHover
226
+ });
227
+ const renderList = _ref3 => {
228
+ let {
229
+ children,
230
+ props
231
+ } = _ref3;
232
+ const empty = /*#__PURE__*/jsx("tr", {
233
+ children: /*#__PURE__*/jsx("td", {
234
+ colSpan: this.props.columns.length || 1,
235
+ className: modules_1db4bbca.tableMessage,
236
+ children: renderEmpty ? renderEmpty() : null
237
+ })
253
238
  });
254
- var renderList = function renderList(_ref3) {
255
- var children = _ref3.children,
256
- props = _ref3.props;
257
- var empty = /*#__PURE__*/jsx("tr", {
258
- children: /*#__PURE__*/jsx("td", {
259
- colSpan: _this2.props.columns.length || 1,
260
- className: modules_1db4bbca.tableMessage,
261
- children: renderEmpty ? renderEmpty() : null
262
- })
263
- });
264
- var tbody = Array.isArray(children) && children.length > 0 ? children : empty;
265
- return /*#__PURE__*/jsxs("table", {
266
- className: classes,
267
- "data-test": "ring-table",
268
- children: [/*#__PURE__*/jsx(Header, _objectSpread2({}, headerProps)), /*#__PURE__*/jsx("tbody", _objectSpread2(_objectSpread2({}, props), {}, {
269
- "data-test": "ring-table-body",
270
- children: tbody
271
- }))]
272
- });
273
- };
274
- var renderItem = function renderItem(_ref4) {
275
- var _restProps$key;
276
- var value = _ref4.value,
277
- _ref4$props = _ref4.props,
278
- props = _ref4$props === void 0 ? {} : _ref4$props,
279
- isDragged = _ref4.isDragged;
280
- if (value == null) {
281
- return null;
282
- }
283
- var ref = props.ref,
284
- restProps = _objectWithoutProperties(props, _excluded);
285
- var row = /*#__PURE__*/createElement(RowComponent, _objectSpread2(_objectSpread2({
286
- innerRef: ref,
287
- level: getItemLevel(value),
288
- item: value,
289
- showFocus: selection.isFocused(value),
290
- autofocus: selection.isFocused(value),
291
- focused: focused && selection.isFocused(value),
292
- selectable: selectable && isItemSelectable(value),
293
- selected: selectable && selection.isSelected(value),
294
- onFocus: _this2.onRowFocus,
295
- onSelect: _this2.onRowSelect,
296
- onDoubleClick: onItemDoubleClick,
297
- onClick: onItemClick,
298
- collapsible: isItemCollapsible(value),
299
- parentCollapsible: isParentCollapsible(value),
300
- collapsed: isItemCollapsed(value),
301
- onCollapse: onItemCollapse,
302
- onExpand: onItemExpand,
303
- showDisabledSelection: isDisabledSelectionVisible(value),
304
- checkboxTooltip: getCheckboxTooltip(value),
305
- className: classNames(getItemClassName(value), {
306
- [modules_1db4bbca.draggingRow]: isDragged
307
- }),
308
- metaColumnClassName: getMetaColumnClassName(value),
309
- draggable: draggable,
310
- alwaysShowDragHandle: alwaysShowDragHandle,
311
- dragHandleTitle: dragHandleTitle,
312
- columns: columns,
313
- "data-test": getItemDataTest(value),
314
- maxColSpan: maxColSpan
315
- }, restProps), {}, {
316
- key: (_restProps$key = restProps.key) !== null && _restProps$key !== void 0 ? _restProps$key : getItemKey(value)
317
- }));
318
- return isDragged ? /*#__PURE__*/jsx("table", {
319
- style: _objectSpread2({}, props.style),
320
- className: modules_1db4bbca.draggingTable,
321
- children: /*#__PURE__*/jsx("tbody", {
322
- children: row
323
- })
324
- }) : row;
325
- };
326
- return /*#__PURE__*/jsxs("div", {
327
- className: wrapperClasses,
328
- "data-test": "ring-table-wrapper",
329
- ref: this.props.innerRef,
330
- children: [focused && /*#__PURE__*/jsx(Shortcuts, {
331
- map: this.props.shortcutsMap,
332
- scope: this.state.shortcutsScope
333
- }), /*#__PURE__*/jsx("div", {
334
- role: "presentation",
335
- onMouseDown: this.onMouseDown,
336
- children: draggable ? /*#__PURE__*/jsx(List, {
337
- values: data,
338
- renderList: renderList,
339
- renderItem: renderItem,
340
- onChange: this.onSortEnd
341
- }) : renderList({
342
- children: data.map(function (value, index) {
343
- return renderItem({
344
- value,
345
- index
346
- });
347
- })
348
- })
349
- }), loading && /*#__PURE__*/jsx("div", {
350
- className: modules_1db4bbca.loadingOverlay,
351
- children: /*#__PURE__*/jsx(Loader, {
352
- className: loaderClassName
353
- })
354
- })]
239
+ const tbody = Array.isArray(children) && children.length > 0 ? children : empty;
240
+ return /*#__PURE__*/jsxs("table", {
241
+ className: classes,
242
+ "data-test": "ring-table",
243
+ children: [/*#__PURE__*/jsx(Header, _objectSpread2({}, headerProps)), /*#__PURE__*/jsx("tbody", _objectSpread2(_objectSpread2({}, props), {}, {
244
+ "data-test": "ring-table-body",
245
+ children: tbody
246
+ }))]
355
247
  });
356
- }
357
- }]);
358
- }(PureComponent);
248
+ };
249
+ const renderItem = _ref4 => {
250
+ var _restProps$key;
251
+ let {
252
+ value,
253
+ props = {},
254
+ isDragged
255
+ } = _ref4;
256
+ if (value == null) {
257
+ return null;
258
+ }
259
+ const {
260
+ ref
261
+ } = props,
262
+ restProps = _objectWithoutProperties(props, _excluded);
263
+ const row = /*#__PURE__*/createElement(RowComponent, _objectSpread2(_objectSpread2({
264
+ innerRef: ref,
265
+ level: getItemLevel(value),
266
+ item: value,
267
+ showFocus: selection.isFocused(value),
268
+ autofocus: selection.isFocused(value),
269
+ focused: focused && selection.isFocused(value),
270
+ selectable: selectable && isItemSelectable(value),
271
+ selected: selectable && selection.isSelected(value),
272
+ onFocus: this.onRowFocus,
273
+ onSelect: this.onRowSelect,
274
+ onDoubleClick: onItemDoubleClick,
275
+ onClick: onItemClick,
276
+ collapsible: isItemCollapsible(value),
277
+ parentCollapsible: isParentCollapsible(value),
278
+ collapsed: isItemCollapsed(value),
279
+ onCollapse: onItemCollapse,
280
+ onExpand: onItemExpand,
281
+ showDisabledSelection: isDisabledSelectionVisible(value),
282
+ checkboxTooltip: getCheckboxTooltip(value),
283
+ className: classNames(getItemClassName(value), {
284
+ [modules_1db4bbca.draggingRow]: isDragged
285
+ }),
286
+ metaColumnClassName: getMetaColumnClassName(value),
287
+ draggable: draggable,
288
+ alwaysShowDragHandle: alwaysShowDragHandle,
289
+ dragHandleTitle: dragHandleTitle,
290
+ columns: columns,
291
+ "data-test": getItemDataTest(value),
292
+ maxColSpan: maxColSpan
293
+ }, restProps), {}, {
294
+ key: (_restProps$key = restProps.key) !== null && _restProps$key !== void 0 ? _restProps$key : getItemKey(value)
295
+ }));
296
+ return isDragged ? /*#__PURE__*/jsx("table", {
297
+ style: _objectSpread2({}, props.style),
298
+ className: modules_1db4bbca.draggingTable,
299
+ children: /*#__PURE__*/jsx("tbody", {
300
+ children: row
301
+ })
302
+ }) : row;
303
+ };
304
+ return /*#__PURE__*/jsxs("div", {
305
+ className: wrapperClasses,
306
+ "data-test": "ring-table-wrapper",
307
+ ref: this.props.innerRef,
308
+ children: [focused && /*#__PURE__*/jsx(Shortcuts, {
309
+ map: this.props.shortcutsMap,
310
+ scope: this.state.shortcutsScope
311
+ }), /*#__PURE__*/jsx("div", {
312
+ role: "presentation",
313
+ onMouseDown: this.onMouseDown,
314
+ children: draggable ? /*#__PURE__*/jsx(List, {
315
+ values: data,
316
+ renderList: renderList,
317
+ renderItem: renderItem,
318
+ onChange: this.onSortEnd
319
+ }) : renderList({
320
+ children: data.map((value, index) => renderItem({
321
+ value,
322
+ index
323
+ }))
324
+ })
325
+ }), loading && /*#__PURE__*/jsx("div", {
326
+ className: modules_1db4bbca.loadingOverlay,
327
+ children: /*#__PURE__*/jsx(Loader, {
328
+ className: loaderClassName
329
+ })
330
+ })]
331
+ });
332
+ }
333
+ }
359
334
  _defineProperty(Table, "defaultProps", {
360
- isItemSelectable: function isItemSelectable() {
361
- return true;
362
- },
335
+ isItemSelectable: () => true,
363
336
  loading: false,
364
- onSort: function onSort() {},
365
- onReorder: function onReorder() {},
366
- getItemKey: function getItemKey(item) {
367
- return item.id;
368
- },
337
+ onSort: () => {},
338
+ onReorder: () => {},
339
+ getItemKey: item => item.id,
369
340
  sortKey: 'id',
370
341
  sortOrder: true,
371
342
  draggable: false,
372
343
  alwaysShowDragHandle: false,
373
344
  stickyHeader: true,
374
- getItemLevel: function getItemLevel() {
375
- return 0;
376
- },
377
- getItemClassName: function getItemClassName() {
378
- return null;
379
- },
380
- getMetaColumnClassName: function getMetaColumnClassName() {
381
- return null;
382
- },
383
- getItemDataTest: function getItemDataTest() {
384
- return null;
385
- },
386
- isItemCollapsible: function isItemCollapsible() {
387
- return false;
388
- },
389
- isParentCollapsible: function isParentCollapsible() {
390
- return false;
391
- },
392
- isItemCollapsed: function isItemCollapsed() {
393
- return false;
394
- },
395
- onItemCollapse: function onItemCollapse() {},
396
- onItemExpand: function onItemExpand() {},
397
- onItemDoubleClick: function onItemDoubleClick() {},
398
- onItemClick: function onItemClick() {},
345
+ getItemLevel: () => 0,
346
+ getItemClassName: () => null,
347
+ getMetaColumnClassName: () => null,
348
+ getItemDataTest: () => null,
349
+ isItemCollapsible: () => false,
350
+ isParentCollapsible: () => false,
351
+ isItemCollapsed: () => false,
352
+ onItemCollapse: () => {},
353
+ onItemExpand: () => {},
354
+ onItemDoubleClick: () => {},
355
+ onItemClick: () => {},
399
356
  remoteSelection: false,
400
- isDisabledSelectionVisible: function isDisabledSelectionVisible() {
401
- return false;
402
- },
403
- getCheckboxTooltip: function getCheckboxTooltip() {
404
- return undefined;
405
- },
357
+ isDisabledSelectionVisible: () => false,
358
+ getCheckboxTooltip: () => undefined,
406
359
  RowComponent: RowWithFocusSensorCallbacks,
407
- //TODO: change to false in 7.0
408
- wideFirstColumn: true
360
+ wideFirstColumn: false
409
361
  });
410
362
  Table.propTypes = {
411
363
  className: PropTypes.string,
@@ -443,7 +395,7 @@ Table.propTypes = {
443
395
  onFocusRestore: PropTypes.func,
444
396
  innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func]),
445
397
  // selectionShortcutsHOC
446
- selection: PropTypes.instanceOf(Selection).isRequired,
398
+ selection: PropTypes.instanceOf(Selection$1).isRequired,
447
399
  selectable: PropTypes.bool,
448
400
  onSelect: PropTypes.func,
449
401
  shortcutsMap: PropTypes.object,
@@ -452,29 +404,17 @@ Table.propTypes = {
452
404
  remoteSelection: PropTypes.bool,
453
405
  renderEmpty: PropTypes.func
454
406
  };
455
- var getContainer = function getContainer() {
456
- return disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(Table)));
457
- };
407
+ const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(Table)));
458
408
  // eslint-disable-next-line react/no-multi-comp
459
- var TableContainer = /*#__PURE__*/function (_Component) {
460
- function TableContainer() {
461
- var _this3;
462
- _classCallCheck(this, TableContainer);
463
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
464
- args[_key2] = arguments[_key2];
465
- }
466
- _this3 = _callSuper(this, TableContainer, [].concat(args));
467
- _defineProperty(_this3, "Table", getContainer());
468
- return _this3;
409
+ class TableContainer extends Component {
410
+ constructor() {
411
+ super(...arguments);
412
+ _defineProperty(this, "Table", getContainer());
469
413
  }
470
- _inherits(TableContainer, _Component);
471
- return _createClass(TableContainer, [{
472
- key: "render",
473
- value: function render() {
474
- return /*#__PURE__*/jsx(this.Table, _objectSpread2({}, this.props));
475
- }
476
- }]);
477
- }(Component);
414
+ render() {
415
+ return /*#__PURE__*/jsx(this.Table, _objectSpread2({}, this.props));
416
+ }
417
+ }
478
418
  // https://stackoverflow.com/a/53882322/6304152
479
419
  _defineProperty(TableContainer, "propTypes", getContainer().propTypes);
480
420