@jetbrains/ring-ui-built 7.0.0-beta.1 → 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 (241) 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/header.js +1 -1
  8. package/components/_helpers/icon__svg.js +27 -23
  9. package/components/_helpers/input.js +150 -171
  10. package/components/_helpers/query-assist__suggestions.js +78 -93
  11. package/components/_helpers/select__filter.js +56 -67
  12. package/components/_helpers/services-link.js +23 -29
  13. package/components/_helpers/sidebar.js +91 -93
  14. package/components/_helpers/tab-link.js +8 -6
  15. package/components/_helpers/theme.js +55 -51
  16. package/components/_helpers/title.js +59 -69
  17. package/components/alert/alert.js +112 -156
  18. package/components/alert/container.js +32 -39
  19. package/components/alert-service/alert-service.js +104 -161
  20. package/components/analytics/analytics.js +12 -20
  21. package/components/analytics/analytics__custom-plugin.js +52 -68
  22. package/components/auth/auth.js +2 -27
  23. package/components/auth/auth__core.d.ts +1 -1
  24. package/components/auth/auth__core.js +742 -1428
  25. package/components/auth/background-flow.js +84 -121
  26. package/components/auth/down-notification.js +31 -69
  27. package/components/auth/iframe-flow.js +70 -123
  28. package/components/auth/request-builder.js +46 -77
  29. package/components/auth/response-parser.js +84 -112
  30. package/components/auth/storage.js +160 -318
  31. package/components/auth/token-validator.js +132 -227
  32. package/components/auth/window-flow.js +84 -121
  33. package/components/auth-dialog/auth-dialog.js +99 -150
  34. package/components/auth-dialog-service/auth-dialog-service.js +6 -26
  35. package/components/avatar/avatar-example-datauri.js +1 -1
  36. package/components/avatar/avatar.js +94 -123
  37. package/components/avatar/fallback-avatar.js +20 -34
  38. package/components/badge/badge.js +32 -38
  39. package/components/breadcrumbs/breadcrumbs.js +13 -17
  40. package/components/button/button.js +67 -80
  41. package/components/button-group/button-group.js +27 -36
  42. package/components/button-set/button-set.js +19 -27
  43. package/components/button-toolbar/button-toolbar.js +17 -25
  44. package/components/caret/caret.js +184 -211
  45. package/components/checkbox/checkbox.js +69 -86
  46. package/components/clipboard/clipboard-fallback.js +7 -7
  47. package/components/clipboard/clipboard.js +36 -128
  48. package/components/code/code.js +83 -151
  49. package/components/collapse/collapse-content.js +42 -60
  50. package/components/collapse/collapse-context.js +2 -2
  51. package/components/collapse/collapse-control.js +12 -12
  52. package/components/collapse/collapse.js +12 -17
  53. package/components/collapse/consts.js +4 -4
  54. package/components/collapse/utils.js +1 -3
  55. package/components/confirm/confirm.js +57 -87
  56. package/components/confirm-service/confirm-service.js +23 -44
  57. package/components/content-layout/content-layout.js +41 -56
  58. package/components/content-layout/sidebar.js +1 -1
  59. package/components/contenteditable/contenteditable.js +38 -46
  60. package/components/control-help/control-help.js +5 -3
  61. package/components/control-label/control-label.js +9 -8
  62. package/components/data-list/data-list.js +113 -156
  63. package/components/data-list/data-list.mock.js +3 -5
  64. package/components/data-list/item.js +120 -140
  65. package/components/data-list/selection.js +77 -135
  66. package/components/data-list/title.js +2 -10
  67. package/components/date-picker/consts.js +16 -22
  68. package/components/date-picker/date-input.js +99 -124
  69. package/components/date-picker/date-picker.js +140 -184
  70. package/components/date-picker/date-popup.js +280 -327
  71. package/components/date-picker/day.js +71 -94
  72. package/components/date-picker/month-names.js +41 -59
  73. package/components/date-picker/month-slider.js +42 -61
  74. package/components/date-picker/month.js +17 -24
  75. package/components/date-picker/months.js +44 -49
  76. package/components/date-picker/weekdays.js +12 -21
  77. package/components/date-picker/years.js +77 -98
  78. package/components/dialog/dialog.js +151 -187
  79. package/components/dialog/dialog__body-scroll-preventer.js +0 -3
  80. package/components/dropdown/anchor.js +0 -6
  81. package/components/dropdown/dropdown.js +134 -154
  82. package/components/dropdown-menu/dropdown-menu.js +59 -87
  83. package/components/editable-heading/editable-heading.js +69 -116
  84. package/components/error-bubble/error-bubble.js +29 -54
  85. package/components/error-message/error-message.js +34 -49
  86. package/components/footer/footer.js +27 -28
  87. package/components/global/compose.js +1 -8
  88. package/components/global/composeRefs.d.ts +0 -3
  89. package/components/global/composeRefs.js +8 -15
  90. package/components/global/controls-height.js +2 -2
  91. package/components/global/create-stateful-context.js +14 -13
  92. package/components/global/data-tests.js +7 -12
  93. package/components/global/dom.js +49 -82
  94. package/components/global/focus-sensor-hoc.js +99 -106
  95. package/components/global/fuzzy-highlight.js +23 -34
  96. package/components/global/get-event-key.js +8 -8
  97. package/components/global/get-uid.js +3 -7
  98. package/components/global/inject-styles.js +7 -14
  99. package/components/global/listeners.js +28 -47
  100. package/components/global/memoize.js +6 -10
  101. package/components/global/normalize-indent.js +19 -46
  102. package/components/global/promise-with-timeout.js +6 -8
  103. package/components/global/prop-types.js +3 -5
  104. package/components/global/react-dom-renderer.js +29 -40
  105. package/components/global/rerender-hoc.js +16 -32
  106. package/components/global/schedule-raf.js +4 -4
  107. package/components/global/sniffer.js +1 -1
  108. package/components/global/theme.d.ts +3 -0
  109. package/components/global/theme.js +2 -19
  110. package/components/global/trivial-template-tag.js +4 -9
  111. package/components/global/typescript-utils.js +2 -6
  112. package/components/global/url.js +20 -23
  113. package/components/global/use-event-callback.js +7 -4
  114. package/components/grid/col.js +27 -39
  115. package/components/grid/grid.js +18 -27
  116. package/components/grid/row.js +23 -30
  117. package/components/group/group.js +16 -22
  118. package/components/header/header-icon.js +19 -31
  119. package/components/header/header.d.ts +0 -1
  120. package/components/header/header.js +30 -64
  121. package/components/header/links.d.ts +2 -0
  122. package/components/header/links.js +20 -0
  123. package/components/header/logo.js +15 -26
  124. package/components/header/profile.js +124 -150
  125. package/components/header/services-link.js +1 -3
  126. package/components/header/services.js +64 -97
  127. package/components/header/smart-profile.js +101 -178
  128. package/components/header/smart-services.js +55 -90
  129. package/components/header/tray.js +21 -30
  130. package/components/heading/heading.js +21 -20
  131. package/components/http/http.js +162 -319
  132. package/components/http/http.mock.js +50 -98
  133. package/components/hub-source/hub-source.js +77 -182
  134. package/components/hub-source/hub-source__user.js +9 -37
  135. package/components/hub-source/hub-source__users-groups.js +34 -60
  136. package/components/i18n/i18n-context.js +7 -8
  137. package/components/i18n/i18n.js +3 -6
  138. package/components/icon/icon.js +60 -74
  139. package/components/icon/icon__svg.js +0 -5
  140. package/components/icon/index.js +0 -5
  141. package/components/input/input.js +1 -11
  142. package/components/island/adaptive-island-hoc.js +29 -37
  143. package/components/island/content.js +100 -110
  144. package/components/island/header.js +56 -66
  145. package/components/island/island.js +25 -33
  146. package/components/island-legacy/content-legacy.js +16 -22
  147. package/components/island-legacy/header-legacy.js +19 -25
  148. package/components/island-legacy/island-legacy.js +16 -22
  149. package/components/link/clickableLink.js +33 -42
  150. package/components/link/link.js +47 -55
  151. package/components/list/consts.js +2 -2
  152. package/components/list/list.js +399 -486
  153. package/components/list/list__custom.js +51 -61
  154. package/components/list/list__hint.js +9 -17
  155. package/components/list/list__item.js +147 -178
  156. package/components/list/list__link.js +38 -47
  157. package/components/list/list__separator.js +15 -24
  158. package/components/list/list__title.js +25 -34
  159. package/components/list/list__users-groups-source.js +55 -121
  160. package/components/loader/loader.js +38 -60
  161. package/components/loader/loader__core.js +123 -184
  162. package/components/loader-inline/loader-inline.js +24 -32
  163. package/components/loader-screen/loader-screen.js +24 -40
  164. package/components/login-dialog/login-dialog.js +81 -121
  165. package/components/login-dialog/service.js +6 -29
  166. package/components/markdown/markdown.js +16 -24
  167. package/components/message/message.js +170 -201
  168. package/components/old-browsers-message/old-browsers-message.js +11 -14
  169. package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
  170. package/components/old-browsers-message/white-list.js +8 -13
  171. package/components/pager/pager.js +212 -257
  172. package/components/panel/panel.js +16 -22
  173. package/components/permissions/permissions.js +118 -161
  174. package/components/permissions/permissions__cache.js +191 -218
  175. package/components/popup/popup.consts.js +1 -1
  176. package/components/popup/popup.js +237 -288
  177. package/components/popup/popup.target.js +9 -7
  178. package/components/popup/position.js +94 -101
  179. package/components/popup-menu/popup-menu.js +33 -67
  180. package/components/progress-bar/progress-bar.js +57 -68
  181. package/components/query-assist/query-assist.js +583 -652
  182. package/components/query-assist/query-assist__suggestions.js +2 -26
  183. package/components/radio/radio.js +15 -27
  184. package/components/radio/radio__item.js +52 -62
  185. package/components/scrollable-section/scrollable-section.js +53 -0
  186. package/components/select/select.js +701 -796
  187. package/components/select/select__filter.js +1 -26
  188. package/components/select/select__popup.js +316 -413
  189. package/components/shortcuts/core.js +147 -195
  190. package/components/shortcuts/shortcut-title.js +6 -10
  191. package/components/shortcuts/shortcuts-hoc.js +23 -41
  192. package/components/shortcuts/shortcuts.js +41 -64
  193. package/components/slider/slider.js +93 -112
  194. package/components/slider/slider.utils.js +16 -23
  195. package/components/storage/storage.js +3 -27
  196. package/components/storage/storage__fallback.js +137 -210
  197. package/components/storage/storage__local.js +89 -147
  198. package/components/style.css +1 -1
  199. package/components/tab-trap/tab-trap.js +35 -53
  200. package/components/table/cell.js +11 -21
  201. package/components/table/disable-hover-hoc.js +27 -42
  202. package/components/table/header-cell.js +59 -75
  203. package/components/table/header.js +89 -110
  204. package/components/table/multitable.js +83 -89
  205. package/components/table/row-with-focus-sensor.js +25 -57
  206. package/components/table/row.js +169 -200
  207. package/components/table/selection-adapter.js +2 -2
  208. package/components/table/selection-shortcuts-hoc.js +108 -113
  209. package/components/table/selection.js +150 -217
  210. package/components/table/simple-table.js +19 -55
  211. package/components/table/smart-table.js +42 -76
  212. package/components/table/table.js +267 -327
  213. package/components/tabs/collapsible-more.js +47 -73
  214. package/components/tabs/collapsible-tab.js +32 -36
  215. package/components/tabs/collapsible-tabs.js +89 -148
  216. package/components/tabs/custom-item.js +4 -2
  217. package/components/tabs/dumb-tabs.js +60 -92
  218. package/components/tabs/smart-tabs.js +29 -61
  219. package/components/tabs/tab-link.js +1 -3
  220. package/components/tabs/tab.js +15 -24
  221. package/components/tabs/tabs.js +1 -26
  222. package/components/tag/tag.d.ts +0 -2
  223. package/components/tag/tag.js +120 -162
  224. package/components/tags-input/tags-input.js +222 -304
  225. package/components/tags-list/tags-list.js +45 -61
  226. package/components/text/text.js +28 -37
  227. package/components/toggle/toggle.js +51 -61
  228. package/components/tooltip/tooltip.js +109 -141
  229. package/components/user-agreement/service.js +259 -400
  230. package/components/user-agreement/user-agreement.js +80 -108
  231. package/components/user-card/card.js +1 -25
  232. package/components/user-card/smart-user-card-tooltip.js +52 -103
  233. package/components/user-card/tooltip.js +35 -65
  234. package/components/user-card/user-card.js +1 -25
  235. package/package.json +1 -1
  236. package/components/global/react-render-adapter.d.ts +0 -1
  237. package/components/global/react-render-adapter.js +0 -6
  238. package/components/header/scrollable-section.js +0 -47
  239. package/components/header/tray-icon.d.ts +0 -1
  240. package/components/header/tray-icon.js +0 -26
  241. /package/components/{header → scrollable-section}/scrollable-section.d.ts +0 -0
@@ -1,26 +1,19 @@
1
- import 'core-js/modules/es.object.to-string.js';
2
- import 'core-js/modules/web.dom-collections.for-each.js';
3
1
  import memoizeOne from 'memoize-one';
4
- import deprecate from 'util-deprecate';
5
2
 
6
3
  function composeRefs() {
7
4
  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
8
5
  refs[_key] = arguments[_key];
9
6
  }
10
- return function (value) {
11
- return refs.forEach(function (ref) {
12
- if (typeof ref === 'function') {
13
- ref(value);
14
- } else if (ref != null) {
15
- ref.current = value;
16
- }
17
- });
18
- };
7
+ return value => refs.forEach(ref => {
8
+ if (typeof ref === 'function') {
9
+ ref(value);
10
+ } else if (ref != null) {
11
+ ref.current = value;
12
+ }
13
+ });
19
14
  }
20
- // TODO remove export in 7.0, composeRefs should be used only in createComposedRef and in useComposedRefs in the future
21
- var composeRefs$1 = deprecate(composeRefs, 'composeRefs is deprecated and will be removed in 7.0. Use createComposedRef instead.');
22
15
  function createComposedRef() {
23
16
  return memoizeOne(composeRefs);
24
17
  }
25
18
 
26
- export { createComposedRef, composeRefs$1 as default };
19
+ export { createComposedRef };
@@ -6,8 +6,8 @@ var ControlsHeight;
6
6
  ControlsHeight["M"] = "M";
7
7
  ControlsHeight["L"] = "L";
8
8
  })(ControlsHeight || (ControlsHeight = {}));
9
- var ControlsHeightContext = /*#__PURE__*/createContext(ControlsHeight.M);
10
- var globalControlsHeight = ControlsHeight.M;
9
+ const ControlsHeightContext = /*#__PURE__*/createContext(ControlsHeight.M);
10
+ let globalControlsHeight = ControlsHeight.M;
11
11
  // This can be used if React Context is not applicable, for example for alertService or Auth dialog
12
12
  function configureGlobalControlsHeight(value) {
13
13
  globalControlsHeight = value;
@@ -1,18 +1,17 @@
1
- import { i as _slicedToArray } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
2
  import { memo, createContext, useState, useContext, useEffect } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
6
  function createStatefulContext(initialValue) {
7
- var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
8
- var ValueContext = /*#__PURE__*/createContext(initialValue);
9
- var UpdateContext = /*#__PURE__*/createContext(function () {});
7
+ let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
8
+ const ValueContext = /*#__PURE__*/createContext(initialValue);
9
+ const UpdateContext = /*#__PURE__*/createContext(() => {});
10
10
  function Provider(_ref) {
11
- var children = _ref.children;
12
- var _useState = useState(initialValue),
13
- _useState2 = _slicedToArray(_useState, 2),
14
- value = _useState2[0],
15
- update = _useState2[1];
11
+ let {
12
+ children
13
+ } = _ref;
14
+ const [value, update] = useState(initialValue);
16
15
  return /*#__PURE__*/jsx(ValueContext.Provider, {
17
16
  value: value,
18
17
  children: /*#__PURE__*/jsx(UpdateContext.Provider, {
@@ -26,16 +25,18 @@ function createStatefulContext(initialValue) {
26
25
  };
27
26
  Provider.displayName = "".concat(name, "Provider");
28
27
  function useUpdate(value, skipUpdate) {
29
- var update = useContext(UpdateContext);
30
- useEffect(function () {
28
+ const update = useContext(UpdateContext);
29
+ useEffect(() => {
31
30
  if (!skipUpdate) {
32
31
  update(value);
33
32
  }
34
33
  }, [update, value, skipUpdate]);
35
34
  }
36
35
  function Updater(_ref2) {
37
- var value = _ref2.value,
38
- skipUpdate = _ref2.skipUpdate;
36
+ let {
37
+ value,
38
+ skipUpdate
39
+ } = _ref2;
39
40
  useUpdate(value, skipUpdate);
40
41
  return null;
41
42
  }
@@ -1,29 +1,24 @@
1
- import { j as _toConsumableArray, i as _slicedToArray } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.concat.js';
3
1
  import 'core-js/modules/es.array.reduce.js';
4
- import 'core-js/modules/es.object.entries.js';
5
- import 'core-js/modules/es.object.to-string.js';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
6
3
 
7
4
  function expandMap(attrsMap) {
8
- return Object.entries(attrsMap).reduce(function (result, _ref) {
9
- var _ref2 = _slicedToArray(_ref, 2),
10
- key = _ref2[0],
11
- value = _ref2[1];
12
- return value ? [].concat(_toConsumableArray(result), [key]) : result;
5
+ return Object.entries(attrsMap).reduce((result, _ref) => {
6
+ let [key, value] = _ref;
7
+ return value ? [...result, key] : result;
13
8
  }, []);
14
9
  }
15
10
  function joinDataTestAttributes() {
16
11
  for (var _len = arguments.length, attrs = new Array(_len), _key = 0; _key < _len; _key++) {
17
12
  attrs[_key] = arguments[_key];
18
13
  }
19
- return attrs.reduce(function (result, attr) {
14
+ return attrs.reduce((result, attr) => {
20
15
  if (!attr) {
21
16
  return result;
22
17
  }
23
18
  if (typeof attr === 'object') {
24
- return [].concat(_toConsumableArray(result), _toConsumableArray(expandMap(attr)));
19
+ return [...result, ...expandMap(attr)];
25
20
  }
26
- return [].concat(_toConsumableArray(result), [attr]);
21
+ return [...result, attr];
27
22
  }, []).join(' ');
28
23
  }
29
24
 
@@ -1,26 +1,18 @@
1
- import { i as _slicedToArray, b as _createClass, e as _classCallCheck, _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.filter.js';
3
- import 'core-js/modules/es.array.iterator.js';
4
- import 'core-js/modules/es.object.assign.js';
5
- import 'core-js/modules/es.object.entries.js';
6
- import 'core-js/modules/es.object.to-string.js';
1
+ import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
7
2
  import 'core-js/modules/es.regexp.exec.js';
8
- import 'core-js/modules/es.set.js';
9
- import 'core-js/modules/es.string.split.js';
10
- import 'core-js/modules/web.dom-collections.for-each.js';
11
3
  import 'core-js/modules/web.dom-collections.iterator.js';
12
4
 
13
5
  /**
14
6
  * @name DOM
15
7
  */
16
- var getStyles = window.getComputedStyle.bind(window);
8
+ const getStyles = window.getComputedStyle.bind(window);
17
9
  function isMounted(node) {
18
10
  if (node === document) {
19
11
  return true;
20
12
  }
21
13
  return node instanceof Node && document.documentElement.contains(node.parentNode);
22
14
  }
23
- var rectStub = {
15
+ const rectStub = {
24
16
  top: 0,
25
17
  right: 0,
26
18
  bottom: 0,
@@ -30,13 +22,14 @@ var rectStub = {
30
22
  };
31
23
  function getRect(node) {
32
24
  if (node instanceof Range || node != null && isMounted(node)) {
33
- var _node$getBoundingClie = node.getBoundingClientRect(),
34
- top = _node$getBoundingClie.top,
35
- right = _node$getBoundingClie.right,
36
- bottom = _node$getBoundingClie.bottom,
37
- left = _node$getBoundingClie.left,
38
- width = _node$getBoundingClie.width,
39
- height = _node$getBoundingClie.height;
25
+ const {
26
+ top,
27
+ right,
28
+ bottom,
29
+ left,
30
+ width,
31
+ height
32
+ } = node.getBoundingClientRect();
40
33
  return {
41
34
  top,
42
35
  right,
@@ -59,11 +52,12 @@ function getWindowWidth() {
59
52
  return window.innerWidth;
60
53
  }
61
54
  function isNodeInVisiblePartOfPage(node) {
62
- var _getRect = getRect(node),
63
- top = _getRect.top,
64
- bottom = _getRect.bottom,
65
- left = _getRect.left,
66
- right = _getRect.right;
55
+ const {
56
+ top,
57
+ bottom,
58
+ left,
59
+ right
60
+ } = getRect(node);
67
61
  return !(bottom < 0 || right < 0 || getWindowHeight() - top < 0 || getWindowWidth() - left < 0);
68
62
  }
69
63
  function getDocumentScrollTop() {
@@ -72,74 +66,47 @@ function getDocumentScrollTop() {
72
66
  function getDocumentScrollLeft() {
73
67
  return document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft;
74
68
  }
75
- var applyMethodToClasses = function applyMethodToClasses(method) {
76
- return function (classList) {
77
- var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
78
- classes.split(/\s+/g).filter(function (className) {
79
- return !!className;
80
- }).forEach(function (className) {
81
- return classList[method](className);
82
- });
83
- };
84
- };
85
- var addClasses = applyMethodToClasses('add');
86
- var removeClasses = applyMethodToClasses('remove');
87
- var toggleClasses = function toggleClasses(classList, classes) {
88
- return Object.entries(classes).forEach(function (_ref) {
89
- var _ref2 = _slicedToArray(_ref, 2),
90
- className = _ref2[0],
91
- on = _ref2[1];
92
- return classList.toggle(className, on);
93
- });
69
+ const applyMethodToClasses = method => function (classList) {
70
+ let classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
71
+ classes.split(/\s+/g).filter(className => !!className).forEach(className => classList[method](className));
94
72
  };
73
+ const addClasses = applyMethodToClasses('add');
74
+ const removeClasses = applyMethodToClasses('remove');
75
+ const toggleClasses = (classList, classes) => Object.entries(classes).forEach(_ref => {
76
+ let [className, on] = _ref;
77
+ return classList.toggle(className, on);
78
+ });
95
79
  function setRootStyleProperties() {
96
- var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
97
- var rootStyle = document.documentElement.style;
98
- Object.entries(properties).forEach(function (_ref3) {
99
- var _ref4 = _slicedToArray(_ref3, 2),
100
- key = _ref4[0],
101
- value = _ref4[1];
80
+ let properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
81
+ const rootStyle = document.documentElement.style;
82
+ Object.entries(properties).forEach(_ref2 => {
83
+ let [key, value] = _ref2;
102
84
  rootStyle.setProperty(key, value);
103
85
  });
104
86
  }
105
87
  function resetRootStyleProperties() {
106
- var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
107
- var rootStyle = document.documentElement.style;
108
- Object.keys(properties).forEach(function (key) {
109
- return rootStyle.removeProperty(key);
110
- });
88
+ let properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
89
+ const rootStyle = document.documentElement.style;
90
+ Object.keys(properties).forEach(key => rootStyle.removeProperty(key));
111
91
  }
112
- var Listeners = /*#__PURE__*/function () {
113
- function Listeners() {
114
- _classCallCheck(this, Listeners);
92
+ class Listeners {
93
+ constructor() {
115
94
  _defineProperty(this, "_all", new Set());
116
95
  }
117
- return _createClass(Listeners, [{
118
- key: "add",
119
- value: function add(el, event, handler, options) {
120
- el.addEventListener(event, handler, options);
121
- var dispatchFn = function dispatchFn() {
122
- return el.removeEventListener(event, handler, options);
123
- };
124
- this._all.add(dispatchFn);
125
- return dispatchFn;
126
- }
127
- }, {
128
- key: "remove",
129
- value: function remove(fn) {
130
- fn();
131
- this._all.delete(fn);
132
- }
133
- }, {
134
- key: "removeAll",
135
- value: function removeAll() {
136
- var _this = this;
137
- this._all.forEach(function (fn) {
138
- return _this.remove(fn);
139
- });
140
- }
141
- }]);
142
- }();
96
+ add(el, event, handler, options) {
97
+ el.addEventListener(event, handler, options);
98
+ const dispatchFn = () => el.removeEventListener(event, handler, options);
99
+ this._all.add(dispatchFn);
100
+ return dispatchFn;
101
+ }
102
+ remove(fn) {
103
+ fn();
104
+ this._all.delete(fn);
105
+ }
106
+ removeAll() {
107
+ this._all.forEach(fn => this.remove(fn));
108
+ }
109
+ }
143
110
  // Synthetic events from Combokeys#trigger are plain objects
144
111
  function preventDefault(e) {
145
112
  if (e.preventDefault) {
@@ -1,152 +1,145 @@
1
- import { d as _objectSpread2, c as _objectWithoutProperties, a as _inherits, b as _createClass, e as _classCallCheck, f as _callSuper, _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.concat.js';
1
+ import { b as _objectSpread2, a as _objectWithoutProperties, _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
3
  import { Component } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { refObject } from './prop-types.js';
6
6
  import { createComposedRef } from './composeRefs.js';
7
7
  import { jsx } from 'react/jsx-runtime';
8
- import 'core-js/modules/es.object.to-string.js';
9
- import 'core-js/modules/web.dom-collections.for-each.js';
10
8
  import 'memoize-one';
11
- import 'util-deprecate';
12
9
 
13
- var _excluded = ["innerRef", "focused", "onFocusReset", "onFocusRestore"],
10
+ const _excluded = ["innerRef", "focused", "onFocusReset", "onFocusRestore"],
14
11
  _excluded2 = ["autofocus", "focused", "onFocus", "onBlur", "innerRef", "scrollOnTableFocus"];
15
12
  function extractPropTypes(_ref) {
16
- var propTypes = _ref.propTypes;
13
+ let {
14
+ propTypes
15
+ } = _ref;
17
16
  if (propTypes == null) {
18
17
  return propTypes;
19
18
  }
20
- propTypes.innerRef;
21
- propTypes.focused;
22
- propTypes.onFocusReset;
23
- propTypes.onFocusRestore;
24
- var restPropTypes = _objectWithoutProperties(propTypes, _excluded);
19
+ const restPropTypes = _objectWithoutProperties(propTypes, _excluded);
25
20
  return restPropTypes;
26
21
  }
27
22
  function focusSensorHOC(ComposedComponent) {
28
- var FocusSensor = /*#__PURE__*/function (_Component) {
29
- function FocusSensor() {
30
- var _this;
31
- _classCallCheck(this, FocusSensor);
32
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
33
- args[_key] = arguments[_key];
34
- }
35
- _this = _callSuper(this, FocusSensor, [].concat(args));
36
- _defineProperty(_this, "state", {
37
- focused: _this.props.focused
23
+ class FocusSensor extends Component {
24
+ constructor() {
25
+ super(...arguments);
26
+ _defineProperty(this, "state", {
27
+ focused: this.props.focused
38
28
  });
39
- _defineProperty(_this, "node", void 0);
40
- _defineProperty(_this, "_skipNextCapture", false);
41
- _defineProperty(_this, "onRefUpdate", function (node) {
29
+ _defineProperty(this, "node", void 0);
30
+ _defineProperty(this, "_skipNextCapture", false);
31
+ _defineProperty(this, "onRefUpdate", node => {
42
32
  if (node) {
43
- _this.node = node;
33
+ this.node = node;
44
34
  }
45
35
  });
46
- _defineProperty(_this, "composedRef", createComposedRef());
47
- _defineProperty(_this, "onFocusCapture", function (_ref2) {
36
+ _defineProperty(this, "composedRef", createComposedRef());
37
+ _defineProperty(this, "onFocusCapture", _ref2 => {
48
38
  var _this$node;
49
- var target = _ref2.target;
50
- if (_this._skipNextCapture) {
51
- _this._skipNextCapture = false;
39
+ let {
40
+ target
41
+ } = _ref2;
42
+ if (this._skipNextCapture) {
43
+ this._skipNextCapture = false;
52
44
  return;
53
45
  }
54
- var focused = target instanceof Node && ((_this$node = _this.node) === null || _this$node === void 0 ? void 0 : _this$node.contains(target));
55
- if (focused && !_this.state.focused) {
46
+ const focused = target instanceof Node && ((_this$node = this.node) === null || _this$node === void 0 ? void 0 : _this$node.contains(target));
47
+ if (focused && !this.state.focused) {
56
48
  var _this$props$onFocus, _this$props;
57
- _this.setState({
49
+ this.setState({
58
50
  focused: true
59
51
  });
60
- (_this$props$onFocus = (_this$props = _this.props).onFocus) === null || _this$props$onFocus === void 0 || _this$props$onFocus.call(_this$props);
52
+ (_this$props$onFocus = (_this$props = this.props).onFocus) === null || _this$props$onFocus === void 0 || _this$props$onFocus.call(_this$props);
61
53
  }
62
54
  });
63
- _defineProperty(_this, "onBlurCapture", function (_ref3) {
64
- var target = _ref3.target;
65
- var _this2 = _this,
66
- focused = _this2.state.focused,
67
- node = _this2.node;
55
+ _defineProperty(this, "onBlurCapture", _ref3 => {
56
+ let {
57
+ target
58
+ } = _ref3;
59
+ const {
60
+ state: {
61
+ focused
62
+ },
63
+ node
64
+ } = this;
68
65
  if (focused) {
69
- setTimeout(function () {
70
- var blurred = target instanceof Node && (node === null || node === void 0 ? void 0 : node.contains(target)) && !node.contains(document.activeElement);
66
+ setTimeout(() => {
67
+ const blurred = target instanceof Node && (node === null || node === void 0 ? void 0 : node.contains(target)) && !node.contains(document.activeElement);
71
68
  if (blurred) {
72
69
  var _this$props$onBlur, _this$props2;
73
- _this.setState({
70
+ this.setState({
74
71
  focused: false
75
72
  });
76
- (_this$props$onBlur = (_this$props2 = _this.props).onBlur) === null || _this$props$onBlur === void 0 || _this$props$onBlur.call(_this$props2);
73
+ (_this$props$onBlur = (_this$props2 = this.props).onBlur) === null || _this$props$onBlur === void 0 || _this$props$onBlur.call(_this$props2);
77
74
  }
78
75
  }, 1);
79
76
  }
80
77
  });
81
- _defineProperty(_this, "onFocusRestore", function () {
78
+ _defineProperty(this, "onFocusRestore", () => {
82
79
  var _this$node2;
83
- _this._skipNextCapture = true;
84
- (_this$node2 = _this.node) === null || _this$node2 === void 0 || _this$node2.focus({
85
- preventScroll: !_this.props.scrollOnTableFocus
80
+ this._skipNextCapture = true;
81
+ (_this$node2 = this.node) === null || _this$node2 === void 0 || _this$node2.focus({
82
+ preventScroll: !this.props.scrollOnTableFocus
86
83
  });
87
84
  });
88
- _defineProperty(_this, "onFocusReset", function () {
85
+ _defineProperty(this, "onFocusReset", () => {
89
86
  var _this$node3;
90
- (_this$node3 = _this.node) === null || _this$node3 === void 0 || _this$node3.blur();
87
+ (_this$node3 = this.node) === null || _this$node3 === void 0 || _this$node3.blur();
91
88
  });
92
- return _this;
93
89
  }
94
- _inherits(FocusSensor, _Component);
95
- return _createClass(FocusSensor, [{
96
- key: "componentDidMount",
97
- value: function componentDidMount() {
98
- var _this$props3 = this.props,
99
- autofocus = _this$props3.autofocus,
100
- scrollOnTableFocus = _this$props3.scrollOnTableFocus,
101
- node = this.node;
102
- node === null || node === void 0 || node.setAttribute('tabindex', '0');
103
- if (node != null) {
104
- node.style.outline = 'none';
105
- }
106
- document.addEventListener('focus', this.onFocusCapture, true);
107
- document.addEventListener('blur', this.onBlurCapture, true);
108
- if (autofocus) {
109
- node === null || node === void 0 || node.focus({
110
- preventScroll: !scrollOnTableFocus
111
- });
112
- }
113
- }
114
- }, {
115
- key: "componentDidUpdate",
116
- value: function componentDidUpdate(prevProps) {
117
- var focused = this.props.focused;
118
- if (focused && !prevProps.focused) {
119
- this.onFocusRestore();
120
- } else if (!focused && prevProps.focused) {
121
- this.onFocusReset();
122
- }
90
+ componentDidMount() {
91
+ const {
92
+ props: {
93
+ autofocus,
94
+ scrollOnTableFocus
95
+ },
96
+ node
97
+ } = this;
98
+ node === null || node === void 0 || node.setAttribute('tabindex', '0');
99
+ if (node != null) {
100
+ node.style.outline = 'none';
123
101
  }
124
- }, {
125
- key: "componentWillUnmount",
126
- value: function componentWillUnmount() {
127
- document.removeEventListener('focus', this.onFocusCapture, true);
128
- document.removeEventListener('blur', this.onBlurCapture, true);
102
+ document.addEventListener('focus', this.onFocusCapture, true);
103
+ document.addEventListener('blur', this.onBlurCapture, true);
104
+ if (autofocus) {
105
+ node === null || node === void 0 || node.focus({
106
+ preventScroll: !scrollOnTableFocus
107
+ });
129
108
  }
130
- }, {
131
- key: "render",
132
- value: function render() {
133
- var _this$props4 = this.props;
134
- _this$props4.autofocus;
135
- _this$props4.focused;
136
- _this$props4.onFocus;
137
- _this$props4.onBlur;
138
- var innerRef = _this$props4.innerRef;
139
- _this$props4.scrollOnTableFocus;
140
- var rest = _objectWithoutProperties(_this$props4, _excluded2);
141
- return /*#__PURE__*/jsx(ComposedComponent, _objectSpread2(_objectSpread2({}, rest), {}, {
142
- innerRef: this.composedRef(innerRef, this.onRefUpdate),
143
- focused: this.state.focused,
144
- onFocusReset: this.onFocusReset,
145
- onFocusRestore: this.onFocusRestore
146
- }));
109
+ }
110
+ componentDidUpdate(prevProps) {
111
+ const {
112
+ focused
113
+ } = this.props;
114
+ if (focused && !prevProps.focused) {
115
+ this.onFocusRestore();
116
+ } else if (!focused && prevProps.focused) {
117
+ this.onFocusReset();
147
118
  }
148
- }]);
149
- }(Component);
119
+ }
120
+ componentWillUnmount() {
121
+ document.removeEventListener('focus', this.onFocusCapture, true);
122
+ document.removeEventListener('blur', this.onBlurCapture, true);
123
+ }
124
+ render() {
125
+ const _this$props3 = this.props,
126
+ {
127
+ autofocus,
128
+ focused,
129
+ onFocus,
130
+ onBlur,
131
+ innerRef,
132
+ scrollOnTableFocus
133
+ } = _this$props3,
134
+ rest = _objectWithoutProperties(_this$props3, _excluded2);
135
+ return /*#__PURE__*/jsx(ComposedComponent, _objectSpread2(_objectSpread2({}, rest), {}, {
136
+ innerRef: this.composedRef(innerRef, this.onRefUpdate),
137
+ focused: this.state.focused,
138
+ onFocusReset: this.onFocusReset,
139
+ onFocusRestore: this.onFocusRestore
140
+ }));
141
+ }
142
+ }
150
143
  FocusSensor.propTypes = _objectSpread2(_objectSpread2({}, extractPropTypes(ComposedComponent)), {}, {
151
144
  focused: PropTypes.bool,
152
145
  autofocus: PropTypes.bool,
@@ -158,8 +151,8 @@ function focusSensorHOC(ComposedComponent) {
158
151
  focused: false,
159
152
  autofocus: false,
160
153
  scrollOnTableFocus: true,
161
- onFocus: function onFocus() {},
162
- onBlur: function onBlur() {}
154
+ onFocus: () => {},
155
+ onBlur: () => {}
163
156
  });
164
157
  return FocusSensor;
165
158
  }
@@ -1,33 +1,22 @@
1
- import { k as _createForOfIteratorHelper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.concat.js';
3
- import 'core-js/modules/es.array.slice.js';
4
1
  import 'core-js/modules/es.regexp.exec.js';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
5
3
 
6
4
  /** https://github.com/bevacqua/fuzzysearch + highlighting with Markdown */
7
5
  function fuzzyHighlight(needle, haystack) {
8
- var caseSensitive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
9
- var ndl = caseSensitive ? needle : needle.toLowerCase();
10
- var hstck = caseSensitive ? haystack : haystack.toLowerCase();
11
- var result = function result(matched) {
12
- var matches = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
13
- var highlight = haystack;
6
+ let caseSensitive = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7
+ const ndl = caseSensitive ? needle : needle.toLowerCase();
8
+ const hstck = caseSensitive ? haystack : haystack.toLowerCase();
9
+ const result = function (matched) {
10
+ let matches = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
11
+ let highlight = haystack;
14
12
  if (matches.length > 0) {
15
13
  highlight = '';
16
- var prevMatch = {
14
+ let prevMatch = {
17
15
  to: 0
18
16
  };
19
- var _iterator = _createForOfIteratorHelper(matches),
20
- _step;
21
- try {
22
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
23
- var match = _step.value;
24
- highlight += "".concat(haystack.slice(prevMatch.to, match.from), "**").concat(haystack.slice(match.from, match.to), "**");
25
- prevMatch = match;
26
- }
27
- } catch (err) {
28
- _iterator.e(err);
29
- } finally {
30
- _iterator.f();
17
+ for (const match of matches) {
18
+ highlight += "".concat(haystack.slice(prevMatch.to, match.from), "**").concat(haystack.slice(match.from, match.to), "**");
19
+ prevMatch = match;
31
20
  }
32
21
  highlight += haystack.slice(prevMatch.to);
33
22
  }
@@ -37,30 +26,30 @@ function fuzzyHighlight(needle, haystack) {
37
26
  highlight
38
27
  };
39
28
  };
40
- var hlen = hstck.length;
41
- var nlen = ndl.length;
29
+ const hlen = hstck.length;
30
+ const nlen = ndl.length;
42
31
  if (nlen > hlen) {
43
32
  return result(false);
44
33
  }
45
34
  if (nlen === hlen) {
46
- var matched = ndl === hstck;
35
+ const matched = ndl === hstck;
47
36
  return result(matched, matched ? [{
48
37
  from: 0,
49
38
  to: haystack.length
50
39
  }] : []);
51
40
  }
52
- var on = false;
53
- var j = 0;
54
- var matches = [];
55
- var from = 0;
41
+ let on = false;
42
+ let j = 0;
43
+ const matches = [];
44
+ let from = 0;
56
45
  /* eslint-disable no-labels */
57
- outer: for (var i = 0; i < nlen; i++) {
58
- var nch = ndl[i];
46
+ outer: for (let i = 0; i < nlen; i++) {
47
+ const nch = ndl[i];
59
48
  while (j < hlen) {
60
- var hch = hstck[j];
61
- var match = hch === nch;
49
+ const hch = hstck[j];
50
+ const match = hch === nch;
62
51
  // Don't turn highlight on for space characters
63
- var nextOn = match && /\S/.test(hch);
52
+ const nextOn = match && /\S/.test(hch);
64
53
  if (nextOn && !on) {
65
54
  from = j;
66
55
  } else if (!nextOn && on) {