@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, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import Selection$1 from './selection.js';
@@ -21,152 +21,150 @@ function extractPropTypes(_ref) {
21
21
  }
22
22
  function selectionShortcutsHOC(ComposedComponent) {
23
23
  class SelectionShortcuts extends PureComponent {
24
- constructor() {
25
- super(...arguments);
26
- _defineProperty(this, "onUpPress", () => {
27
- const {
28
- selection,
29
- onSelect
30
- } = this.props;
31
- const newSelection = selection.moveUp();
32
- if (newSelection) {
33
- onSelect?.(newSelection);
34
- }
35
- return false;
36
- });
37
- _defineProperty(this, "onDownPress", () => {
38
- const {
39
- selection,
40
- onSelect
41
- } = this.props;
42
- const newSelection = selection.moveDown();
43
- if (newSelection) {
44
- onSelect?.(newSelection);
45
- }
46
- return false;
47
- });
48
- _defineProperty(this, "shiftSelectionMode", void 0);
49
- _defineProperty(this, "onShiftKeyDown", () => {
50
- const {
51
- selection
52
- } = this.props;
53
- if (selection.isSelected(selection.getFocused())) {
54
- this.shiftSelectionMode = 'deletion';
55
- } else {
56
- this.shiftSelectionMode = 'addition';
57
- }
58
- });
59
- _defineProperty(this, "shiftSelect", selection => {
60
- if (this.shiftSelectionMode === 'addition') {
61
- return selection.select();
62
- } else {
63
- return selection.deselect();
64
- }
65
- });
66
- _defineProperty(this, "onShiftUpPress", e => {
67
- e.preventDefault();
68
- const {
69
- selectable,
70
- selection,
71
- onSelect
72
- } = this.props;
73
- if (!selectable) {
74
- return;
75
- }
76
- const newSelection = this.shiftSelect(selection);
77
- const newMovedSelection = newSelection.moveUp();
78
- if (newMovedSelection) {
79
- onSelect?.(newMovedSelection);
80
- } else {
81
- onSelect?.(newSelection);
82
- }
83
- });
84
- _defineProperty(this, "onShiftDownPress", e => {
85
- e.preventDefault();
86
- const {
87
- selectable,
88
- selection,
89
- onSelect
90
- } = this.props;
91
- if (!selectable) {
92
- return;
93
- }
94
- const newSelection = this.shiftSelect(selection);
95
- const newMovedSelection = newSelection.moveDown();
96
- if (newMovedSelection) {
97
- onSelect?.(newMovedSelection);
98
- } else {
99
- onSelect?.(newSelection);
100
- }
101
- });
102
- _defineProperty(this, "onHomePress", () => {
103
- const {
104
- selection,
105
- onSelect
106
- } = this.props;
107
- const newSelection = selection.moveStart();
108
- if (newSelection) {
109
- onSelect?.(newSelection);
110
- }
111
- return false;
112
- });
113
- _defineProperty(this, "onEndPress", () => {
114
- const {
115
- selection,
116
- onSelect
117
- } = this.props;
118
- const newSelection = selection.moveEnd();
119
- if (newSelection) {
120
- onSelect?.(newSelection);
121
- }
122
- return false;
123
- });
124
- _defineProperty(this, "onSpacePress", () => {
125
- const {
126
- selectable,
127
- selection,
128
- onSelect
129
- } = this.props;
130
- if (!selectable) {
131
- return true;
132
- }
133
- onSelect?.(selection.toggleSelection());
134
- return false;
135
- });
136
- _defineProperty(this, "onEscPress", () => {
137
- const {
138
- selection,
139
- onSelect
140
- } = this.props;
141
- onSelect?.(selection.reset());
142
- //this.restoreFocusWithoutScroll();
143
- });
144
- _defineProperty(this, "onCmdAPress", () => {
145
- const {
146
- selectable,
147
- selection,
148
- onSelect
149
- } = this.props;
150
- if (!selectable) {
151
- return true;
152
- }
153
- onSelect?.(selection.selectAll());
154
- return false;
155
- });
156
- _defineProperty(this, "shortcutsMap", {
157
- up: this.onUpPress,
158
- down: this.onDownPress,
159
- shift: this.onShiftKeyDown,
160
- 'shift+up': this.onShiftUpPress,
161
- 'shift+down': this.onShiftDownPress,
162
- home: this.onHomePress,
163
- end: this.onEndPress,
164
- space: this.onSpacePress,
165
- esc: this.onEscPress,
166
- 'command+a': this.onCmdAPress,
167
- 'ctrl+a': this.onCmdAPress
168
- });
169
- }
24
+ onUpPress = () => {
25
+ const {
26
+ selection,
27
+ onSelect
28
+ } = this.props;
29
+ const newSelection = selection.moveUp();
30
+ if (newSelection) {
31
+ onSelect?.(newSelection);
32
+ }
33
+ return false;
34
+ };
35
+ onDownPress = () => {
36
+ const {
37
+ selection,
38
+ onSelect
39
+ } = this.props;
40
+ const newSelection = selection.moveDown();
41
+ if (newSelection) {
42
+ onSelect?.(newSelection);
43
+ }
44
+ return false;
45
+ };
46
+ shiftSelectionMode;
47
+ onShiftKeyDown = () => {
48
+ const {
49
+ selection
50
+ } = this.props;
51
+ if (selection.isSelected(selection.getFocused())) {
52
+ this.shiftSelectionMode = 'deletion';
53
+ } else {
54
+ this.shiftSelectionMode = 'addition';
55
+ }
56
+ };
57
+ shiftSelect = selection => {
58
+ if (this.shiftSelectionMode === 'addition') {
59
+ return selection.select();
60
+ } else {
61
+ return selection.deselect();
62
+ }
63
+ };
64
+ onShiftUpPress = e => {
65
+ e.preventDefault();
66
+ const {
67
+ selectable,
68
+ selection,
69
+ onSelect
70
+ } = this.props;
71
+ if (!selectable) {
72
+ return;
73
+ }
74
+ const newSelection = this.shiftSelect(selection);
75
+ const newMovedSelection = newSelection.moveUp();
76
+ if (newMovedSelection) {
77
+ onSelect?.(newMovedSelection);
78
+ } else {
79
+ onSelect?.(newSelection);
80
+ }
81
+ };
82
+ onShiftDownPress = e => {
83
+ e.preventDefault();
84
+ const {
85
+ selectable,
86
+ selection,
87
+ onSelect
88
+ } = this.props;
89
+ if (!selectable) {
90
+ return;
91
+ }
92
+ const newSelection = this.shiftSelect(selection);
93
+ const newMovedSelection = newSelection.moveDown();
94
+ if (newMovedSelection) {
95
+ onSelect?.(newMovedSelection);
96
+ } else {
97
+ onSelect?.(newSelection);
98
+ }
99
+ };
100
+ onHomePress = () => {
101
+ const {
102
+ selection,
103
+ onSelect
104
+ } = this.props;
105
+ const newSelection = selection.moveStart();
106
+ if (newSelection) {
107
+ onSelect?.(newSelection);
108
+ }
109
+ return false;
110
+ };
111
+ onEndPress = () => {
112
+ const {
113
+ selection,
114
+ onSelect
115
+ } = this.props;
116
+ const newSelection = selection.moveEnd();
117
+ if (newSelection) {
118
+ onSelect?.(newSelection);
119
+ }
120
+ return false;
121
+ };
122
+ onSpacePress = () => {
123
+ const {
124
+ selectable,
125
+ selection,
126
+ onSelect
127
+ } = this.props;
128
+ if (!selectable) {
129
+ return true;
130
+ }
131
+ onSelect?.(selection.toggleSelection());
132
+ return false;
133
+ };
134
+ onEscPress = () => {
135
+ const {
136
+ selection,
137
+ onSelect
138
+ } = this.props;
139
+ onSelect?.(selection.reset());
140
+ //this.restoreFocusWithoutScroll();
141
+ };
142
+
143
+ onCmdAPress = () => {
144
+ const {
145
+ selectable,
146
+ selection,
147
+ onSelect
148
+ } = this.props;
149
+ if (!selectable) {
150
+ return true;
151
+ }
152
+ onSelect?.(selection.selectAll());
153
+ return false;
154
+ };
155
+ shortcutsMap = {
156
+ up: this.onUpPress,
157
+ down: this.onDownPress,
158
+ shift: this.onShiftKeyDown,
159
+ 'shift+up': this.onShiftUpPress,
160
+ 'shift+down': this.onShiftDownPress,
161
+ home: this.onHomePress,
162
+ end: this.onEndPress,
163
+ space: this.onSpacePress,
164
+ esc: this.onEscPress,
165
+ 'command+a': this.onCmdAPress,
166
+ 'ctrl+a': this.onCmdAPress
167
+ };
170
168
  render() {
171
169
  const {
172
170
  selection,
@@ -1,6 +1,11 @@
1
- import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
-
3
1
  let Selection$1 = class Selection {
2
+ _rawData;
3
+ _getChildren;
4
+ _data;
5
+ _selected;
6
+ _focused;
7
+ _getKey;
8
+ _isItemSelectable;
4
9
  constructor() {
5
10
  let {
6
11
  data = [],
@@ -10,13 +15,6 @@ let Selection$1 = class Selection {
10
15
  getChildren = () => [],
11
16
  isItemSelectable = () => true
12
17
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13
- _defineProperty(this, "_rawData", void 0);
14
- _defineProperty(this, "_getChildren", void 0);
15
- _defineProperty(this, "_data", void 0);
16
- _defineProperty(this, "_selected", void 0);
17
- _defineProperty(this, "_focused", void 0);
18
- _defineProperty(this, "_getKey", void 0);
19
- _defineProperty(this, "_isItemSelectable", void 0);
20
18
  this._rawData = data;
21
19
  this._getChildren = getChildren;
22
20
  this._data = this._buildData(data);
@@ -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 TableContainer from './table.js';
@@ -63,21 +63,20 @@ const {
63
63
  ...restPropTypes
64
64
  } = (_Table$propTypes = TableContainer.propTypes) !== null && _Table$propTypes !== void 0 ? _Table$propTypes : {};
65
65
  class SmartTable extends PureComponent {
66
- constructor() {
67
- super(...arguments);
68
- _defineProperty(this, "state", {
69
- selection: new Selection$1({
70
- data: this.props.data,
71
- isItemSelectable: this.props.isItemSelectable
72
- })
73
- });
74
- _defineProperty(this, "onSelect", selection => {
75
- this.setState({
76
- selection
77
- });
78
- this.props.onSelectionChange(selection);
79
- });
80
- }
66
+ static propTypes = {
67
+ onSelectionChange: PropTypes.func,
68
+ isItemSelectable: PropTypes.func,
69
+ ...restPropTypes
70
+ };
71
+ static defaultProps = {
72
+ onSelectionChange: () => {}
73
+ };
74
+ state = {
75
+ selection: new Selection$1({
76
+ data: this.props.data,
77
+ isItemSelectable: this.props.isItemSelectable
78
+ })
79
+ };
81
80
  UNSAFE_componentWillReceiveProps(nextProps) {
82
81
  const {
83
82
  data,
@@ -97,6 +96,12 @@ class SmartTable extends PureComponent {
97
96
  });
98
97
  }
99
98
  }
99
+ onSelect = selection => {
100
+ this.setState({
101
+ selection
102
+ });
103
+ this.props.onSelectionChange(selection);
104
+ };
100
105
  render() {
101
106
  return /*#__PURE__*/React.createElement(TableContainer, _extends({}, this.props, {
102
107
  selection: this.state.selection,
@@ -104,13 +109,5 @@ class SmartTable extends PureComponent {
104
109
  }));
105
110
  }
106
111
  }
107
- _defineProperty(SmartTable, "propTypes", {
108
- onSelectionChange: PropTypes.func,
109
- isItemSelectable: PropTypes.func,
110
- ...restPropTypes
111
- });
112
- _defineProperty(SmartTable, "defaultProps", {
113
- onSelectionChange: () => {}
114
- });
115
112
 
116
113
  export { SmartTable as default };
@@ -1,5 +1,5 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import React, { PureComponent, Component } from 'react';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import React, { Component, PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
  import { arrayMove, List } from 'react-movable';
@@ -59,91 +59,46 @@ import './cell.js';
59
59
  * Interactive table with selection and keyboard navigation support.
60
60
  */
61
61
  class Table extends PureComponent {
62
- constructor() {
63
- super(...arguments);
64
- _defineProperty(this, "state", {
65
- shortcutsScope: getUID('ring-table-'),
66
- userSelectNone: false
67
- });
68
- _defineProperty(this, "onMouseDown", e => {
69
- if (e.shiftKey) {
70
- this.setState({
71
- userSelectNone: true
72
- });
73
- }
74
- });
75
- _defineProperty(this, "onMouseUp", () => {
76
- if (this.state.userSelectNone) {
77
- this.setState({
78
- userSelectNone: false
79
- });
80
- }
81
- });
82
- _defineProperty(this, "onRowFocus", row => {
83
- const {
84
- selection,
85
- onSelect
86
- } = this.props;
87
- onSelect(selection.focus(row));
88
- });
89
- _defineProperty(this, "onRowSelect", (row, selected) => {
90
- const {
91
- selection,
92
- onSelect
93
- } = this.props;
94
- if (selected) {
95
- onSelect(selection.select(row));
96
- } else {
97
- onSelect(selection.deselect(row));
98
- }
99
- });
100
- _defineProperty(this, "onSortEnd", _ref => {
101
- let {
102
- oldIndex,
103
- newIndex
104
- } = _ref;
105
- const data = arrayMove(this.props.data, oldIndex, newIndex);
106
- this.props.onReorder({
107
- data,
108
- oldIndex,
109
- newIndex
110
- });
111
- });
112
- _defineProperty(this, "onCheckboxChange", e => {
113
- const {
114
- checked
115
- } = e.currentTarget;
116
- const {
117
- selection,
118
- onSelect
119
- } = this.props;
120
- if (checked) {
121
- onSelect(selection.selectAll());
122
- } else {
123
- onSelect(selection.reset());
124
- }
125
- this.restoreFocusWithoutScroll();
126
- });
127
- _defineProperty(this, "restoreFocusWithoutScroll", () => {
128
- const {
129
- scrollX,
130
- scrollY
131
- } = window;
132
- this.props.onFocusRestore();
133
- window.scrollTo(scrollX, scrollY);
134
- });
135
- }
62
+ static defaultProps = {
63
+ isItemSelectable: () => true,
64
+ loading: false,
65
+ onSort: () => {},
66
+ onReorder: () => {},
67
+ getItemKey: item => item.id,
68
+ sortKey: 'id',
69
+ sortOrder: true,
70
+ draggable: false,
71
+ alwaysShowDragHandle: false,
72
+ stickyHeader: true,
73
+ getItemLevel: () => 0,
74
+ getItemClassName: () => null,
75
+ getItemDataTest: () => null,
76
+ isItemCollapsible: () => false,
77
+ isParentCollapsible: () => false,
78
+ isItemCollapsed: () => false,
79
+ onItemCollapse: () => {},
80
+ onItemExpand: () => {},
81
+ onItemDoubleClick: () => {},
82
+ onItemClick: () => {},
83
+ remoteSelection: false,
84
+ isDisabledSelectionVisible: () => false,
85
+ getCheckboxTooltip: () => undefined
86
+ };
87
+ state = {
88
+ shortcutsScope: getUID('ring-table-'),
89
+ userSelectNone: false
90
+ };
136
91
  componentDidMount() {
137
92
  document.addEventListener('mouseup', this.onMouseUp);
138
93
  }
139
- componentDidUpdate(_ref2) {
94
+ componentDidUpdate(_ref) {
140
95
  let {
141
96
  data,
142
97
  selection,
143
98
  onSelect,
144
99
  selectable,
145
100
  remoteSelection
146
- } = _ref2;
101
+ } = _ref;
147
102
  if (data !== this.props.data && remoteSelection) {
148
103
  onSelect(selection.cloneWith({
149
104
  data: this.props.data
@@ -156,6 +111,73 @@ class Table extends PureComponent {
156
111
  componentWillUnmount() {
157
112
  document.removeEventListener('mouseup', this.onMouseUp);
158
113
  }
114
+ onMouseDown = e => {
115
+ if (e.shiftKey) {
116
+ this.setState({
117
+ userSelectNone: true
118
+ });
119
+ }
120
+ };
121
+ onMouseUp = () => {
122
+ if (this.state.userSelectNone) {
123
+ this.setState({
124
+ userSelectNone: false
125
+ });
126
+ }
127
+ };
128
+ onRowFocus = row => {
129
+ const {
130
+ selection,
131
+ onSelect
132
+ } = this.props;
133
+ onSelect(selection.focus(row));
134
+ };
135
+ onRowSelect = (row, selected) => {
136
+ const {
137
+ selection,
138
+ onSelect
139
+ } = this.props;
140
+ if (selected) {
141
+ onSelect(selection.select(row));
142
+ } else {
143
+ onSelect(selection.deselect(row));
144
+ }
145
+ };
146
+ onSortEnd = _ref2 => {
147
+ let {
148
+ oldIndex,
149
+ newIndex
150
+ } = _ref2;
151
+ const data = arrayMove(this.props.data, oldIndex, newIndex);
152
+ this.props.onReorder({
153
+ data,
154
+ oldIndex,
155
+ newIndex
156
+ });
157
+ };
158
+ onCheckboxChange = e => {
159
+ const {
160
+ checked
161
+ } = e.currentTarget;
162
+ const {
163
+ selection,
164
+ onSelect
165
+ } = this.props;
166
+ if (checked) {
167
+ onSelect(selection.selectAll());
168
+ } else {
169
+ onSelect(selection.reset());
170
+ }
171
+ this.restoreFocusWithoutScroll();
172
+ };
173
+ restoreFocusWithoutScroll = () => {
174
+ const {
175
+ scrollX,
176
+ scrollY
177
+ } = window;
178
+ this.props.onFocusRestore();
179
+ window.scrollTo(scrollX, scrollY);
180
+ };
159
181
  render() {
160
182
  const {
161
183
  data,
@@ -311,31 +333,6 @@ class Table extends PureComponent {
311
333
  })));
312
334
  }
313
335
  }
314
- _defineProperty(Table, "defaultProps", {
315
- isItemSelectable: () => true,
316
- loading: false,
317
- onSort: () => {},
318
- onReorder: () => {},
319
- getItemKey: item => item.id,
320
- sortKey: 'id',
321
- sortOrder: true,
322
- draggable: false,
323
- alwaysShowDragHandle: false,
324
- stickyHeader: true,
325
- getItemLevel: () => 0,
326
- getItemClassName: () => null,
327
- getItemDataTest: () => null,
328
- isItemCollapsible: () => false,
329
- isParentCollapsible: () => false,
330
- isItemCollapsed: () => false,
331
- onItemCollapse: () => {},
332
- onItemExpand: () => {},
333
- onItemDoubleClick: () => {},
334
- onItemClick: () => {},
335
- remoteSelection: false,
336
- isDisabledSelectionVisible: () => false,
337
- getCheckboxTooltip: () => undefined
338
- });
339
336
  Table.propTypes = {
340
337
  className: PropTypes.string,
341
338
  loaderClassName: PropTypes.string,
@@ -382,15 +379,12 @@ Table.propTypes = {
382
379
  const getContainer = () => disableHoverHOC(selectionShortcutsHOC(focusSensorHOC(Table)));
383
380
  // eslint-disable-next-line react/no-multi-comp
384
381
  class TableContainer extends Component {
385
- constructor() {
386
- super(...arguments);
387
- _defineProperty(this, "Table", getContainer());
388
- }
382
+ // https://stackoverflow.com/a/53882322/6304152
383
+ static propTypes = getContainer().propTypes;
384
+ Table = getContainer();
389
385
  render() {
390
386
  return /*#__PURE__*/React.createElement(this.Table, this.props);
391
387
  }
392
388
  }
393
- // https://stackoverflow.com/a/53882322/6304152
394
- _defineProperty(TableContainer, "propTypes", getContainer().propTypes);
395
389
 
396
390
  export { Table, TableContainer as default };
@@ -7,7 +7,6 @@ import Selection from './table-legacy-ng__selection.js';
7
7
  import SelectionNavigateActions from './table-legacy-ng__selection-navigate-actions.js';
8
8
  import TableToolbar from './table-legacy-ng__toolbar.js';
9
9
  import TablePager from './table-legacy-ng__pager.js';
10
- import '../_helpers/_rollupPluginBabelHelpers.js';
11
10
  import 'element-resize-detector';
12
11
  import '@jetbrains/icons/checkmark-14px';
13
12
  import '../icon-ng/icon-ng.js';
@@ -26,6 +25,7 @@ import 'react-dom';
26
25
  import '../global/react-dom-renderer.js';
27
26
  import 'prop-types';
28
27
  import '../pager/pager.js';
28
+ import '../_helpers/_rollupPluginBabelHelpers.js';
29
29
  import 'classnames';
30
30
  import '@jetbrains/icons/chevron-left';
31
31
  import '@jetbrains/icons/chevron-right';