@jetbrains/ring-ui 4.1.0-beta.3 → 4.1.1

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 (234) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +17 -15
  3. package/babel.config.js +3 -2
  4. package/components/alert/alert.js +9 -3
  5. package/components/alert/alert.test.js +21 -48
  6. package/components/alert/container.css +1 -1
  7. package/components/alert/container.test.js +3 -13
  8. package/components/alert-service/alert-service.examples.css +18 -0
  9. package/components/alert-service/alert-service.examples.js +21 -0
  10. package/components/alert-service/alert-service.js +10 -3
  11. package/components/analytics/analytics__fus-plugin.js +3 -3
  12. package/components/analytics/analytics__ga-plugin.js +2 -2
  13. package/components/auth/auth.test.js +14 -7
  14. package/components/auth/auth__core.js +64 -33
  15. package/components/auth-dialog/auth-dialog.css +2 -3
  16. package/components/auth-dialog/auth-dialog.js +4 -1
  17. package/components/auth-dialog/auth-dialog.test.js +3 -19
  18. package/components/avatar/avatar.css +4 -1
  19. package/components/avatar/avatar.examples.js +3 -2
  20. package/components/avatar/avatar.js +34 -6
  21. package/components/avatar/avatar.test.js +20 -17
  22. package/components/avatar/fallback-avatar.js +136 -0
  23. package/components/avatar-editor-ng/avatar-editor-ng.css +2 -2
  24. package/components/avatar-editor-ng/avatar-editor-ng.js +2 -1
  25. package/components/avatar-editor-ng/{avatar-editor-ng.html → avatar-editor-ng__template.js} +2 -2
  26. package/components/badge/badge.test.js +13 -20
  27. package/components/button/button.css +2 -2
  28. package/components/button/button.js +4 -1
  29. package/components/button/button.test.js +32 -33
  30. package/components/button-group/button-group.js +1 -1
  31. package/components/button-group/caption.js +1 -1
  32. package/components/button-ng/button-ng.js +1 -1
  33. package/components/button-set-ng/button-set-ng.js +3 -1
  34. package/components/checkbox/checkbox.css +1 -1
  35. package/components/code/code.js +2 -5
  36. package/components/confirm/confirm.js +1 -0
  37. package/components/confirm-service/confirm-service.js +5 -5
  38. package/components/content-layout/content-layout.css +1 -1
  39. package/components/data-list/data-list.css +1 -1
  40. package/components/date-picker/date-input.js +5 -4
  41. package/components/date-picker/date-picker.css +34 -22
  42. package/components/date-picker/date-picker.js +16 -14
  43. package/components/date-picker/date-popup.js +22 -7
  44. package/components/date-picker/month-names.js +8 -5
  45. package/components/date-picker/month.js +6 -2
  46. package/components/date-picker/weekdays.js +10 -2
  47. package/components/dialog/dialog.examples.js +3 -1
  48. package/components/dialog/dialog.js +10 -5
  49. package/components/dialog/dialog.test.js +1 -1
  50. package/components/dialog/dialog__body-scroll-preventer.js +51 -31
  51. package/components/dialog-ng/dialog-ng.js +10 -10
  52. package/components/dialog-ng/{dialog-ng.html → dialog-ng__template.js} +2 -2
  53. package/components/dropdown/dropdown.examples.js +36 -1
  54. package/components/dropdown/dropdown.test.js +2 -2
  55. package/components/dropdown-menu/dropdown-menu.examples.js +47 -0
  56. package/components/dropdown-menu/dropdown-menu.js +117 -0
  57. package/components/dropdown-menu/dropdown-menu.test.js +76 -0
  58. package/components/error-bubble/error-bubble-legacy.css +1 -1
  59. package/components/error-bubble/error-bubble.css +1 -1
  60. package/components/error-bubble/error-bubble.examples.js +1 -1
  61. package/components/error-page/error-page.css +2 -2
  62. package/components/footer-ng/footer-ng.js +13 -3
  63. package/components/form/form.css +2 -2
  64. package/components/form-ng/form-ng.js +3 -1
  65. package/components/global/global.css +1 -1
  66. package/components/global/theme.js +1 -1
  67. package/components/global/variables.css +8 -1
  68. package/components/grid/grid.css +10 -9
  69. package/components/header/header.css +1 -1
  70. package/components/header/header.examples.js +7 -8
  71. package/components/header/profile.js +10 -11
  72. package/components/http/http.js +1 -1
  73. package/components/icon/icon.css +5 -4
  74. package/components/input/input-legacy.css +7 -7
  75. package/components/island/header.js +2 -2
  76. package/components/island/island.css +8 -3
  77. package/components/island-legacy/island-legacy.css +3 -1
  78. package/components/list/list.js +6 -1
  79. package/components/list/list__custom.js +9 -3
  80. package/components/list/list__item.js +8 -2
  81. package/components/list/list__link.js +2 -1
  82. package/components/loader-inline/loader-inline.css +1 -1
  83. package/components/loader-screen/loader-screen.css +1 -1
  84. package/components/message/message.css +1 -1
  85. package/components/message/message.examples.js +8 -7
  86. package/components/pager/pager.js +5 -3
  87. package/components/permissions/permissions.js +1 -1
  88. package/components/popup/popup.js +1 -1
  89. package/components/popup/popup.test.js +15 -13
  90. package/components/progress-bar/progress-bar.css +1 -1
  91. package/components/progress-bar/progress-bar.examples.js +3 -3
  92. package/components/progress-bar/progress-bar.js +5 -2
  93. package/components/progress-bar/progress-bar.test.js +12 -13
  94. package/components/progress-bar-ng/progress-bar-ng.examples.js +3 -3
  95. package/components/query-assist/query-assist.css +13 -3
  96. package/components/query-assist/query-assist.examples.js +3 -4
  97. package/components/query-assist/query-assist.js +56 -12
  98. package/components/query-assist/query-assist.test.js +37 -5
  99. package/components/save-field-ng/save-field-ng.css +0 -3
  100. package/components/save-field-ng/save-field-ng.js +3 -1
  101. package/components/save-field-ng/{save-field-ng.html → save-field-ng__template.js} +2 -2
  102. package/components/select/select.css +12 -7
  103. package/components/select/select.examples.js +13 -0
  104. package/components/select/select.js +30 -43
  105. package/components/select/select.test.js +4 -5
  106. package/components/select/select__popup.js +1 -0
  107. package/components/shortcuts-hint-ng/shortcuts-hint-ng.css +1 -1
  108. package/components/shortcuts-hint-ng/shortcuts-hint-ng.js +1 -1
  109. package/components/shortcuts-hint-ng/{shortcuts-hint-ng.html → shortcuts-hint-ng__template.js} +2 -2
  110. package/components/sidebar/sidebar.css +1 -0
  111. package/components/sidebar-ng/sidebar-ng.js +6 -2
  112. package/components/sidebar-ng/{sidebar-ng__button.html → sidebar-ng__button-template.js} +2 -2
  113. package/components/sidebar-ng/{sidebar-ng.html → sidebar-ng__template.js} +2 -2
  114. package/components/table/header.js +9 -1
  115. package/components/table/row.js +2 -1
  116. package/components/table/table.css +2 -1
  117. package/components/table-legacy/table-legacy.css +2 -2
  118. package/components/table-legacy/table-legacy__toolbar.css +2 -2
  119. package/components/table-legacy-ng/table-legacy-ng.js +38 -5
  120. package/components/table-legacy-ng/table-legacy-ng__pager.js +7 -1
  121. package/components/tabs/collapsible-tab.js +2 -2
  122. package/components/tabs/collapsible-tabs.js +5 -9
  123. package/components/tabs/tab-link.js +4 -2
  124. package/components/tabs/tabs.css +32 -5
  125. package/components/tabs-ng/tabs-ng.js +4 -2
  126. package/components/tabs-ng/{tabs-ng.html → tabs-ng__template.js} +6 -2
  127. package/components/tag/tag.css +5 -2
  128. package/components/tag/tag.examples.js +3 -0
  129. package/components/tag/tag.js +19 -16
  130. package/components/tags-input/tag-input.examples.js +1 -1
  131. package/components/tags-input/tags-input.js +5 -2
  132. package/components/template-ng/template-ng.js +1 -1
  133. package/components/tooltip/tooltip.js +7 -2
  134. package/components/user-agreement/user-agreement.css +1 -5
  135. package/components/user-agreement/user-agreement.examples.js +7 -6
  136. package/components/user-agreement/user-agreement.js +11 -3
  137. package/package.json +85 -83
  138. package/webpack.config.js +14 -10
  139. package/components/button-set-ng/button-set-ng.html +0 -1
  140. package/components/footer-ng/footer-ng.html +0 -13
  141. package/components/form-ng/form-ng__error-bubble.html +0 -3
  142. package/components/table-legacy-ng/table-legacy-ng.html +0 -4
  143. package/components/table-legacy-ng/table-legacy-ng__column.html +0 -12
  144. package/components/table-legacy-ng/table-legacy-ng__header.html +0 -4
  145. package/components/table-legacy-ng/table-legacy-ng__pager.html +0 -7
  146. package/components/table-legacy-ng/table-legacy-ng__row.html +0 -12
  147. package/components/table-legacy-ng/table-legacy-ng__title.html +0 -9
  148. package/dist/_helpers/_rollupPluginBabelHelpers.js +0 -123
  149. package/dist/_helpers/background-flow.js +0 -232
  150. package/dist/_helpers/badge.js +0 -3
  151. package/dist/_helpers/button.js +0 -145
  152. package/dist/_helpers/clickableLink.js +0 -65
  153. package/dist/_helpers/data-tests.js +0 -15
  154. package/dist/_helpers/disable-hover-hoc.js +0 -407
  155. package/dist/_helpers/dom.js +0 -101
  156. package/dist/_helpers/get-uid.js +0 -15
  157. package/dist/_helpers/linear-function.js +0 -17
  158. package/dist/_helpers/list.js +0 -1327
  159. package/dist/_helpers/logo.js +0 -36
  160. package/dist/_helpers/memoize.js +0 -17
  161. package/dist/_helpers/popup.js +0 -691
  162. package/dist/_helpers/popup.target.js +0 -27
  163. package/dist/_helpers/rerender-hoc.js +0 -49
  164. package/dist/_helpers/schedule-raf.js +0 -31
  165. package/dist/_helpers/sniffer.js +0 -6
  166. package/dist/_helpers/theme.js +0 -40
  167. package/dist/_helpers/url.js +0 -125
  168. package/dist/alert-service.js +0 -149
  169. package/dist/alert.js +0 -284
  170. package/dist/analytics.js +0 -116
  171. package/dist/auth-dialog-service.js +0 -56
  172. package/dist/auth-dialog.js +0 -122
  173. package/dist/auth.js +0 -1744
  174. package/dist/avatar.js +0 -152
  175. package/dist/badge.js +0 -52
  176. package/dist/button-group.js +0 -48
  177. package/dist/button-set.js +0 -27
  178. package/dist/button-toolbar.js +0 -30
  179. package/dist/button.js +0 -12
  180. package/dist/caret.js +0 -262
  181. package/dist/checkbox.js +0 -108
  182. package/dist/confirm-service.js +0 -102
  183. package/dist/confirm.js +0 -113
  184. package/dist/content-layout.js +0 -184
  185. package/dist/contenteditable.js +0 -81
  186. package/dist/data-list.js +0 -466
  187. package/dist/date-picker.js +0 -1398
  188. package/dist/dialog.js +0 -223
  189. package/dist/dropdown.js +0 -250
  190. package/dist/error-bubble.js +0 -56
  191. package/dist/error-message.js +0 -53
  192. package/dist/footer.js +0 -124
  193. package/dist/grid.js +0 -148
  194. package/dist/group.js +0 -34
  195. package/dist/header.js +0 -658
  196. package/dist/heading.js +0 -76
  197. package/dist/http.js +0 -207
  198. package/dist/hub-source.js +0 -130
  199. package/dist/icon.js +0 -211
  200. package/dist/input.js +0 -228
  201. package/dist/island.js +0 -314
  202. package/dist/link.js +0 -117
  203. package/dist/list.js +0 -29
  204. package/dist/loader-inline.js +0 -165
  205. package/dist/loader-screen.js +0 -45
  206. package/dist/loader.js +0 -338
  207. package/dist/login-dialog.js +0 -173
  208. package/dist/logo.js +0 -8
  209. package/dist/message.js +0 -226
  210. package/dist/old-browsers-message.js +0 -129
  211. package/dist/pager.js +0 -325
  212. package/dist/panel.js +0 -34
  213. package/dist/permissions.js +0 -466
  214. package/dist/popup-menu.js +0 -93
  215. package/dist/popup.js +0 -16
  216. package/dist/progress-bar.js +0 -111
  217. package/dist/proxy-attrs.js +0 -19
  218. package/dist/query-assist.js +0 -1081
  219. package/dist/radio.js +0 -112
  220. package/dist/select.js +0 -1920
  221. package/dist/selection.js +0 -213
  222. package/dist/shortcuts.js +0 -307
  223. package/dist/storage.js +0 -373
  224. package/dist/style.css +0 -1
  225. package/dist/tab-trap.js +0 -174
  226. package/dist/table.js +0 -903
  227. package/dist/tabs.js +0 -721
  228. package/dist/tag.js +0 -187
  229. package/dist/tags-input.js +0 -440
  230. package/dist/tags-list.js +0 -91
  231. package/dist/text.js +0 -38
  232. package/dist/toggle.js +0 -80
  233. package/dist/tooltip.js +0 -202
  234. package/dist/user-card.js +0 -218
@@ -1,407 +0,0 @@
1
- import { b as _defineProperty, c as _objectSpread2, _ as _objectWithoutProperties, a as _extends } from './_rollupPluginBabelHelpers.js';
2
- import React, { Component, PureComponent } from 'react';
3
- import PropTypes from 'prop-types';
4
- import Selection from '../selection.js';
5
-
6
- var composeRefs = ((...refs) => value => refs.forEach(ref => {
7
- if (typeof ref === 'function') {
8
- ref(value);
9
- } else if (ref != null) {
10
- ref.current = value;
11
- }
12
- }));
13
-
14
- function focusSensorHOC(ComposedComponent) {
15
- var _class, _temp;
16
-
17
- return _temp = _class = class FocusSensor extends Component {
18
- constructor(...args) {
19
- super(...args);
20
-
21
- _defineProperty(this, "state", {
22
- focused: this.props.focused
23
- });
24
-
25
- _defineProperty(this, "_skipNextCapture", false);
26
-
27
- _defineProperty(this, "onRefUpdate", node => {
28
- if (node) {
29
- this.node = node;
30
- }
31
- });
32
-
33
- _defineProperty(this, "onFocusCapture", ({
34
- target
35
- }) => {
36
- if (this._skipNextCapture) {
37
- this._skipNextCapture = false;
38
- return;
39
- }
40
-
41
- const focused = this.node.contains(target);
42
-
43
- if (focused && !this.state.focused) {
44
- this.setState({
45
- focused: true
46
- });
47
- this.props.onFocus();
48
- }
49
- });
50
-
51
- _defineProperty(this, "onBlurCapture", ({
52
- target
53
- }) => {
54
- const {
55
- state: {
56
- focused
57
- },
58
- node
59
- } = this;
60
-
61
- if (focused) {
62
- setTimeout(() => {
63
- const blurred = node.contains(target) && !node.contains(document.activeElement);
64
-
65
- if (blurred) {
66
- this.setState({
67
- focused: false
68
- });
69
- this.props.onBlur();
70
- }
71
- }, 1);
72
- }
73
- });
74
-
75
- _defineProperty(this, "onFocusRestore", () => {
76
- this._skipNextCapture = true;
77
- this.node.focus();
78
- });
79
-
80
- _defineProperty(this, "onFocusReset", () => {
81
- this.node.blur();
82
- });
83
- }
84
-
85
- componentDidMount() {
86
- const {
87
- props: {
88
- autofocus
89
- },
90
- node
91
- } = this;
92
- node.setAttribute('tabindex', '0');
93
- node.style.outline = 'none';
94
- document.addEventListener('focus', this.onFocusCapture, true);
95
- document.addEventListener('blur', this.onBlurCapture, true);
96
-
97
- if (autofocus) {
98
- node.focus();
99
- }
100
- }
101
-
102
- componentDidUpdate(prevProps) {
103
- const {
104
- focused
105
- } = this.props;
106
-
107
- if (focused && !prevProps.focused) {
108
- this.onFocusRestore();
109
- } else if (!focused && prevProps.focused) {
110
- this.onFocusReset();
111
- }
112
- }
113
-
114
- componentWillUnmount() {
115
- document.removeEventListener('focus', this.onFocusCapture, true);
116
- document.removeEventListener('blur', this.onBlurCapture, true);
117
- }
118
-
119
- render() {
120
- const _this$props = this.props,
121
- {
122
- autofocus,
123
- focused,
124
- onFocus,
125
- onBlur,
126
- innerRef
127
- } = _this$props,
128
- rest = _objectWithoutProperties(_this$props, ["autofocus", "focused", "onFocus", "onBlur", "innerRef"]);
129
-
130
- return /*#__PURE__*/React.createElement(ComposedComponent, _extends({}, rest, {
131
- innerRef: composeRefs(innerRef, this.onRefUpdate),
132
- focused: this.state.focused,
133
- onFocusReset: this.onFocusReset,
134
- onFocusRestore: this.onFocusRestore
135
- }));
136
- }
137
-
138
- }, _defineProperty(_class, "propTypes", _objectSpread2(_objectSpread2({}, ComposedComponent.propTypes), {}, {
139
- focused: PropTypes.bool,
140
- autofocus: PropTypes.bool,
141
- onFocus: PropTypes.func,
142
- onBlur: PropTypes.func,
143
- innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
144
- })), _defineProperty(_class, "defaultProps", _objectSpread2(_objectSpread2({}, ComposedComponent.defaultProps), {}, {
145
- focused: false,
146
- autofocus: false,
147
- onFocus: () => {},
148
- onBlur: () => {}
149
- })), _temp;
150
- }
151
-
152
- function selectionShortcutsHOC(ComposedComponent) {
153
- var _class, _temp;
154
-
155
- return _temp = _class = class SelectionShortcuts extends PureComponent {
156
- constructor(...args) {
157
- super(...args);
158
-
159
- _defineProperty(this, "onUpPress", () => {
160
- const {
161
- selection,
162
- onSelect
163
- } = this.props;
164
- const newSelection = selection.moveUp();
165
-
166
- if (newSelection) {
167
- onSelect(newSelection);
168
- }
169
-
170
- return false;
171
- });
172
-
173
- _defineProperty(this, "onDownPress", () => {
174
- const {
175
- selection,
176
- onSelect
177
- } = this.props;
178
- const newSelection = selection.moveDown();
179
-
180
- if (newSelection) {
181
- onSelect(newSelection);
182
- }
183
-
184
- return false;
185
- });
186
-
187
- _defineProperty(this, "onShiftKeyDown", () => {
188
- const {
189
- selection
190
- } = this.props;
191
-
192
- if (selection.isSelected(selection.getFocused())) {
193
- this.shiftSelectionMode = 'deletion';
194
- } else {
195
- this.shiftSelectionMode = 'addition';
196
- }
197
- });
198
-
199
- _defineProperty(this, "shiftSelect", selection => {
200
- if (this.shiftSelectionMode === 'addition') {
201
- return selection.select();
202
- } else {
203
- return selection.deselect();
204
- }
205
- });
206
-
207
- _defineProperty(this, "onShiftUpPress", e => {
208
- e.preventDefault();
209
- const {
210
- selectable,
211
- selection,
212
- onSelect
213
- } = this.props;
214
-
215
- if (!selectable) {
216
- return;
217
- }
218
-
219
- const newSelection = this.shiftSelect(selection);
220
- const newMovedSelection = newSelection.moveUp();
221
-
222
- if (newMovedSelection) {
223
- onSelect(newMovedSelection);
224
- } else {
225
- onSelect(newSelection);
226
- }
227
- });
228
-
229
- _defineProperty(this, "onShiftDownPress", e => {
230
- e.preventDefault();
231
- const {
232
- selectable,
233
- selection,
234
- onSelect
235
- } = this.props;
236
-
237
- if (!selectable) {
238
- return;
239
- }
240
-
241
- const newSelection = this.shiftSelect(selection);
242
- const newMovedSelection = newSelection.moveDown();
243
-
244
- if (newMovedSelection) {
245
- onSelect(newMovedSelection);
246
- } else {
247
- onSelect(newSelection);
248
- }
249
- });
250
-
251
- _defineProperty(this, "onHomePress", () => {
252
- const {
253
- selection,
254
- onSelect
255
- } = this.props;
256
- const newSelection = selection.moveStart();
257
-
258
- if (newSelection) {
259
- onSelect(newSelection);
260
- }
261
-
262
- return false;
263
- });
264
-
265
- _defineProperty(this, "onEndPress", () => {
266
- const {
267
- selection,
268
- onSelect
269
- } = this.props;
270
- const newSelection = selection.moveEnd();
271
-
272
- if (newSelection) {
273
- onSelect(newSelection);
274
- }
275
-
276
- return false;
277
- });
278
-
279
- _defineProperty(this, "onSpacePress", () => {
280
- const {
281
- selectable,
282
- selection,
283
- onSelect
284
- } = this.props;
285
-
286
- if (!selectable) {
287
- return true;
288
- }
289
-
290
- onSelect(selection.toggleSelection());
291
- return false;
292
- });
293
-
294
- _defineProperty(this, "onEscPress", () => {
295
- const {
296
- selection,
297
- onSelect
298
- } = this.props;
299
- onSelect(selection.reset()); //this.restoreFocusWithoutScroll();
300
- });
301
-
302
- _defineProperty(this, "onCmdAPress", () => {
303
- const {
304
- selectable,
305
- selection,
306
- onSelect
307
- } = this.props;
308
-
309
- if (!selectable) {
310
- return true;
311
- }
312
-
313
- onSelect(selection.selectAll());
314
- return false;
315
- });
316
-
317
- _defineProperty(this, "shortcutsMap", {
318
- up: this.onUpPress,
319
- down: this.onDownPress,
320
- shift: this.onShiftKeyDown,
321
- 'shift+up': this.onShiftUpPress,
322
- 'shift+down': this.onShiftDownPress,
323
- home: this.onHomePress,
324
- end: this.onEndPress,
325
- space: this.onSpacePress,
326
- esc: this.onEscPress,
327
- 'command+a': this.onCmdAPress,
328
- 'ctrl+a': this.onCmdAPress
329
- });
330
- }
331
-
332
- render() {
333
- const {
334
- selection,
335
- selectable,
336
- onSelect
337
- } = this.props;
338
- return /*#__PURE__*/React.createElement(ComposedComponent, _extends({}, this.props, {
339
- selection: selection,
340
- selectable: selectable,
341
- onSelect: onSelect,
342
- shortcutsMap: _objectSpread2(_objectSpread2({}, this.shortcutsMap), this.props.shortcuts)
343
- }));
344
- }
345
-
346
- }, _defineProperty(_class, "propTypes", _objectSpread2(_objectSpread2({}, ComposedComponent.propTypes), {}, {
347
- selection: PropTypes.instanceOf(Selection).isRequired,
348
- selectable: PropTypes.bool,
349
- onSelect: PropTypes.func,
350
- shortcuts: PropTypes.object
351
- })), _defineProperty(_class, "defaultProps", _objectSpread2(_objectSpread2({}, ComposedComponent.defaultProps), {}, {
352
- selectable: true,
353
- onSelect: () => {},
354
- shortcuts: {}
355
- })), _temp;
356
- }
357
-
358
- function disableHoverHOC(ComposedComponent) {
359
- var _class, _temp;
360
-
361
- return _temp = _class = class DisableHover extends PureComponent {
362
- constructor(...args) {
363
- super(...args);
364
-
365
- _defineProperty(this, "state", {
366
- disabledHover: false
367
- });
368
-
369
- _defineProperty(this, "onMouseMove", () => {
370
- if (this.state.disabledHover) {
371
- this.setState({
372
- disabledHover: false
373
- });
374
- }
375
- });
376
-
377
- _defineProperty(this, "onKeyDown", e => {
378
- const metaKeys = [16, 17, 18, 19, 20, 91]; // eslint-disable-line no-magic-numbers
379
-
380
- if (!this.state.disabledHover && !metaKeys.includes(e.keyCode)) {
381
- this.setState({
382
- disabledHover: true
383
- });
384
- }
385
- });
386
- }
387
-
388
- componentDidMount() {
389
- document.addEventListener('mousemove', this.onMouseMove);
390
- document.addEventListener('keydown', this.onKeyDown, true);
391
- }
392
-
393
- componentWillUnmount() {
394
- document.removeEventListener('mousemove', this.onMouseMove);
395
- document.removeEventListener('keydown', this.onKeyDown, true);
396
- }
397
-
398
- render() {
399
- return /*#__PURE__*/React.createElement(ComposedComponent, _extends({}, this.props, {
400
- disabledHover: this.state.disabledHover
401
- }));
402
- }
403
-
404
- }, _defineProperty(_class, "propTypes", ComposedComponent.propTypes), _defineProperty(_class, "defaultProps", ComposedComponent.defaultProps), _temp;
405
- }
406
-
407
- export { composeRefs as c, disableHoverHOC as d, focusSensorHOC as f, selectionShortcutsHOC as s };
@@ -1,101 +0,0 @@
1
- import { b as _defineProperty } from './_rollupPluginBabelHelpers.js';
2
-
3
- /**
4
- * @name DOM
5
- */
6
- const getStyles = window.getComputedStyle.bind(window);
7
- function isMounted(node) {
8
- if (node === document) {
9
- return true;
10
- }
11
-
12
- return node instanceof Node && document.documentElement.contains(node.parentNode);
13
- }
14
- const rectStub = {
15
- top: 0,
16
- right: 0,
17
- bottom: 0,
18
- left: 0,
19
- width: 0,
20
- height: 0
21
- };
22
- function getRect(node) {
23
- if (node instanceof Range || isMounted(node)) {
24
- const {
25
- top,
26
- right,
27
- bottom,
28
- left,
29
- width,
30
- height
31
- } = node.getBoundingClientRect();
32
- return {
33
- top,
34
- right,
35
- bottom,
36
- left,
37
- width,
38
- height
39
- };
40
- } else {
41
- return Object.assign({}, rectStub);
42
- }
43
- }
44
- function getPixelRatio() {
45
- return 'devicePixelRatio' in window ? window.devicePixelRatio : 1;
46
- }
47
- function getWindowHeight() {
48
- return window.innerHeight;
49
- }
50
- function getWindowWidth() {
51
- return window.innerWidth;
52
- }
53
- function isNodeInVisiblePartOfPage(node) {
54
- const {
55
- top,
56
- bottom,
57
- left,
58
- right
59
- } = getRect(node);
60
- return !(bottom < 0 || right < 0 || getWindowHeight() - top < 0 || getWindowWidth() - left < 0);
61
- }
62
- function getDocumentScrollTop() {
63
- return document.documentElement && document.documentElement.scrollTop || document.body.scrollTop;
64
- }
65
- function getDocumentScrollLeft() {
66
- return document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft;
67
- }
68
- class Listeners {
69
- constructor() {
70
- _defineProperty(this, "_all", new Set());
71
- }
72
-
73
- add(el, event, handler, useCapture) {
74
- el.addEventListener(event, handler, useCapture);
75
-
76
- const dispatchFn = () => el.removeEventListener(event, handler, useCapture);
77
-
78
- this._all.add(dispatchFn);
79
-
80
- return dispatchFn;
81
- }
82
-
83
- remove(fn) {
84
- fn();
85
-
86
- this._all.delete(fn);
87
- }
88
-
89
- removeAll() {
90
- this._all.forEach(fn => this.remove(fn));
91
- }
92
-
93
- } // Synthetic events from Combokeys#trigger are plain objects
94
-
95
- function preventDefault(e) {
96
- if (e.preventDefault) {
97
- e.preventDefault();
98
- }
99
- }
100
-
101
- export { Listeners as L, getPixelRatio as a, isMounted as b, getDocumentScrollTop as c, getDocumentScrollLeft as d, getWindowHeight as e, getStyles as f, getRect as g, isNodeInVisiblePartOfPage as i, preventDefault as p };
@@ -1,15 +0,0 @@
1
- const idCounters = {};
2
- function getUID(name) {
3
- if (!name) {
4
- throw Error('Argument "name" is required in getUID()');
5
- }
6
-
7
- if (!idCounters[name]) {
8
- idCounters[name] = 0;
9
- }
10
-
11
- const id = String(idCounters[name]++);
12
- return name + id;
13
- }
14
-
15
- export { getUID as g };
@@ -1,17 +0,0 @@
1
- function linearFunction(x0, y0, a) {
2
- return {
3
- y(x) {
4
- return +y0 + (x - x0) * a;
5
- },
6
-
7
- x(y) {
8
- return +x0 + (y - y0) / a;
9
- }
10
-
11
- };
12
- }
13
- function interpolateLinear(x0, x1, phase) {
14
- return linearFunction(x0, x0, phase).y(x1);
15
- }
16
-
17
- export { interpolateLinear as i, linearFunction as l };