@jetbrains/ring-ui-built 6.0.31 → 6.0.32

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 (225) hide show
  1. package/components/_helpers/_rollupPluginBabelHelpers.js +1 -567
  2. package/components/_helpers/anchor.js +7 -6
  3. package/components/_helpers/button__classes.js +16 -14
  4. package/components/_helpers/caption.js +14 -20
  5. package/components/_helpers/card.js +95 -105
  6. package/components/_helpers/dialog__body-scroll-preventer.js +11 -19
  7. package/components/_helpers/icon__svg.js +22 -25
  8. package/components/_helpers/input.js +146 -177
  9. package/components/_helpers/query-assist__suggestions.js +74 -90
  10. package/components/_helpers/select__filter.js +48 -69
  11. package/components/_helpers/services-link.js +29 -37
  12. package/components/_helpers/sidebar.js +99 -107
  13. package/components/_helpers/tab-link.js +7 -7
  14. package/components/_helpers/theme.js +31 -40
  15. package/components/_helpers/title.js +57 -72
  16. package/components/alert/alert.js +150 -202
  17. package/components/alert/container.js +32 -41
  18. package/components/alert-service/alert-service.js +105 -170
  19. package/components/analytics/analytics.js +12 -22
  20. package/components/analytics/analytics__custom-plugin.js +54 -75
  21. package/components/auth/auth.js +4 -36
  22. package/components/auth/auth__core.js +746 -1471
  23. package/components/auth/background-flow.js +87 -127
  24. package/components/auth/down-notification.js +30 -73
  25. package/components/auth/iframe-flow.js +75 -133
  26. package/components/auth/request-builder.js +46 -82
  27. package/components/auth/response-parser.js +86 -116
  28. package/components/auth/storage.js +171 -334
  29. package/components/auth/token-validator.js +137 -242
  30. package/components/auth/window-flow.js +92 -134
  31. package/components/auth-dialog/auth-dialog.js +114 -172
  32. package/components/auth-dialog-service/auth-dialog-service.js +8 -31
  33. package/components/avatar/avatar-example-datauri.js +23 -1
  34. package/components/avatar/avatar.js +119 -152
  35. package/components/avatar/fallback-avatar.js +22 -38
  36. package/components/badge/badge.js +35 -45
  37. package/components/button/button.js +86 -107
  38. package/components/button-group/button-group.js +19 -33
  39. package/components/button-set/button-set.js +20 -32
  40. package/components/button-toolbar/button-toolbar.js +19 -31
  41. package/components/caret/caret.js +186 -220
  42. package/components/checkbox/checkbox.js +76 -101
  43. package/components/clipboard/clipboard-fallback.js +10 -10
  44. package/components/clipboard/clipboard.js +35 -132
  45. package/components/code/code.js +92 -166
  46. package/components/collapse/collapse-content.js +42 -64
  47. package/components/collapse/collapse-context.js +2 -2
  48. package/components/collapse/collapse-control.js +12 -14
  49. package/components/collapse/collapse.js +11 -17
  50. package/components/collapse/consts.js +4 -4
  51. package/components/collapse/utils.js +1 -3
  52. package/components/confirm/confirm.js +66 -104
  53. package/components/confirm-service/confirm-service.js +37 -59
  54. package/components/content-layout/content-layout.js +43 -64
  55. package/components/content-layout/sidebar.js +0 -1
  56. package/components/contenteditable/contenteditable.js +50 -59
  57. package/components/control-label/control-label.js +9 -9
  58. package/components/data-list/data-list.js +129 -182
  59. package/components/data-list/data-list.mock.js +2 -6
  60. package/components/data-list/item.js +143 -170
  61. package/components/data-list/selection.js +76 -136
  62. package/components/data-list/title.js +1 -12
  63. package/components/date-picker/consts.js +19 -26
  64. package/components/date-picker/date-input.js +113 -144
  65. package/components/date-picker/date-picker.js +227 -282
  66. package/components/date-picker/date-popup.js +350 -395
  67. package/components/date-picker/day.js +87 -116
  68. package/components/date-picker/month-names.js +43 -66
  69. package/components/date-picker/month-slider.js +51 -76
  70. package/components/date-picker/month.js +16 -25
  71. package/components/date-picker/months.js +43 -50
  72. package/components/date-picker/weekdays.js +12 -22
  73. package/components/date-picker/years.js +83 -110
  74. package/components/dialog/dialog.js +142 -190
  75. package/components/dialog/dialog__body-scroll-preventer.js +0 -4
  76. package/components/dropdown/anchor.js +0 -9
  77. package/components/dropdown/dropdown.js +182 -213
  78. package/components/dropdown-menu/dropdown-menu.js +71 -97
  79. package/components/editable-heading/editable-heading.js +75 -127
  80. package/components/error-bubble/error-bubble.js +31 -60
  81. package/components/error-message/error-message.js +39 -59
  82. package/components/footer/footer.js +27 -30
  83. package/components/global/compose.js +1 -10
  84. package/components/global/composeRefs.js +7 -12
  85. package/components/global/controls-height.js +2 -2
  86. package/components/global/create-stateful-context.js +15 -15
  87. package/components/global/data-tests.js +6 -14
  88. package/components/global/dom.js +47 -86
  89. package/components/global/focus-sensor-hoc.js +122 -132
  90. package/components/global/fuzzy-highlight.js +22 -36
  91. package/components/global/get-event-key.js +8 -8
  92. package/components/global/get-uid.js +4 -8
  93. package/components/global/inject-styles.js +10 -15
  94. package/components/global/listeners.js +27 -51
  95. package/components/global/memoize.js +6 -12
  96. package/components/global/normalize-indent.js +19 -50
  97. package/components/global/promise-with-timeout.js +6 -8
  98. package/components/global/prop-types.js +3 -5
  99. package/components/global/react-dom-renderer.js +28 -44
  100. package/components/global/react-render-adapter.js +1 -1
  101. package/components/global/rerender-hoc.js +12 -30
  102. package/components/global/schedule-raf.js +5 -6
  103. package/components/global/sniffer.js +1 -1
  104. package/components/global/theme.js +0 -22
  105. package/components/global/trivial-template-tag.js +3 -10
  106. package/components/global/typescript-utils.js +2 -6
  107. package/components/global/url.js +20 -26
  108. package/components/global/use-event-callback.js +6 -4
  109. package/components/grid/col.js +35 -52
  110. package/components/grid/grid.js +17 -31
  111. package/components/grid/row.js +35 -47
  112. package/components/group/group.js +17 -25
  113. package/components/header/header.js +33 -78
  114. package/components/header/logo.js +20 -36
  115. package/components/header/profile.js +166 -199
  116. package/components/header/services-link.js +0 -4
  117. package/components/header/services.js +73 -116
  118. package/components/header/smart-profile.js +111 -203
  119. package/components/header/smart-services.js +62 -113
  120. package/components/header/tray-icon.js +21 -37
  121. package/components/header/tray.js +21 -32
  122. package/components/heading/heading.js +24 -25
  123. package/components/http/http.d.ts +1 -3
  124. package/components/http/http.js +203 -353
  125. package/components/http/http.mock.js +49 -101
  126. package/components/hub-source/hub-source.js +83 -190
  127. package/components/hub-source/hub-source__user.js +11 -44
  128. package/components/hub-source/hub-source__users-groups.js +37 -65
  129. package/components/i18n/i18n-context.js +7 -10
  130. package/components/i18n/i18n.js +7 -10
  131. package/components/icon/icon.js +76 -93
  132. package/components/icon/icon__svg.js +0 -8
  133. package/components/icon/index.js +0 -8
  134. package/components/input/input.js +0 -13
  135. package/components/island/adaptive-island-hoc.js +30 -43
  136. package/components/island/content.js +115 -132
  137. package/components/island/header.js +57 -70
  138. package/components/island/island.js +28 -40
  139. package/components/island-legacy/content-legacy.js +17 -25
  140. package/components/island-legacy/header-legacy.js +19 -27
  141. package/components/island-legacy/island-legacy.js +17 -25
  142. package/components/link/clickableLink.js +44 -59
  143. package/components/link/link.js +57 -68
  144. package/components/list/consts.js +2 -2
  145. package/components/list/list.js +611 -698
  146. package/components/list/list__custom.js +44 -62
  147. package/components/list/list__hint.js +10 -19
  148. package/components/list/list__item.js +133 -174
  149. package/components/list/list__link.js +37 -50
  150. package/components/list/list__separator.js +14 -24
  151. package/components/list/list__title.js +22 -32
  152. package/components/list/list__users-groups-source.js +54 -126
  153. package/components/loader/loader.js +43 -74
  154. package/components/loader/loader__core.js +198 -263
  155. package/components/loader-inline/loader-inline.js +23 -35
  156. package/components/loader-screen/loader-screen.js +25 -46
  157. package/components/login-dialog/login-dialog.js +111 -158
  158. package/components/login-dialog/service.js +8 -34
  159. package/components/markdown/markdown.js +15 -23
  160. package/components/message/message.js +161 -203
  161. package/components/old-browsers-message/old-browsers-message.js +11 -18
  162. package/components/old-browsers-message/old-browsers-message__stop.js +0 -7
  163. package/components/old-browsers-message/white-list.js +8 -16
  164. package/components/pager/pager.js +212 -271
  165. package/components/panel/panel.js +17 -25
  166. package/components/permissions/permissions.js +127 -172
  167. package/components/permissions/permissions__cache.js +194 -224
  168. package/components/popup/popup.consts.js +1 -1
  169. package/components/popup/popup.js +284 -343
  170. package/components/popup/popup.target.js +9 -8
  171. package/components/popup/position.js +96 -106
  172. package/components/popup-menu/popup-menu.js +44 -80
  173. package/components/progress-bar/progress-bar.js +87 -104
  174. package/components/query-assist/query-assist.js +838 -916
  175. package/components/query-assist/query-assist__suggestions.js +1 -30
  176. package/components/radio/radio.js +19 -34
  177. package/components/radio/radio__item.js +52 -69
  178. package/components/select/select.js +852 -957
  179. package/components/select/select__filter.js +0 -30
  180. package/components/select/select__popup.js +373 -487
  181. package/components/shortcuts/core.js +166 -217
  182. package/components/shortcuts/shortcut-title.js +6 -11
  183. package/components/shortcuts/shortcuts-hoc.js +19 -45
  184. package/components/shortcuts/shortcuts.js +50 -75
  185. package/components/slider/slider.js +99 -122
  186. package/components/slider/slider.utils.js +14 -24
  187. package/components/storage/storage.js +4 -33
  188. package/components/storage/storage__fallback.js +149 -224
  189. package/components/storage/storage__local.js +90 -153
  190. package/components/tab-trap/tab-trap.js +122 -153
  191. package/components/table/cell.js +14 -26
  192. package/components/table/disable-hover-hoc.js +33 -51
  193. package/components/table/header-cell.js +64 -89
  194. package/components/table/header.js +104 -132
  195. package/components/table/multitable.js +107 -125
  196. package/components/table/row-with-focus-sensor.js +25 -69
  197. package/components/table/row.js +175 -216
  198. package/components/table/selection-adapter.js +1 -3
  199. package/components/table/selection-shortcuts-hoc.js +180 -181
  200. package/components/table/selection.js +156 -226
  201. package/components/table/smart-table.js +50 -88
  202. package/components/table/table.js +289 -358
  203. package/components/tabs/collapsible-more.js +46 -79
  204. package/components/tabs/collapsible-tab.js +31 -38
  205. package/components/tabs/collapsible-tabs.js +88 -153
  206. package/components/tabs/custom-item.js +4 -2
  207. package/components/tabs/dumb-tabs.js +74 -117
  208. package/components/tabs/smart-tabs.js +29 -69
  209. package/components/tabs/tab-link.js +1 -5
  210. package/components/tabs/tab.js +19 -31
  211. package/components/tabs/tabs.js +0 -31
  212. package/components/tag/tag.js +133 -173
  213. package/components/tags-input/tags-input.js +329 -427
  214. package/components/tags-list/tags-list.js +57 -78
  215. package/components/text/text.js +28 -39
  216. package/components/toggle/toggle.js +56 -70
  217. package/components/tooltip/tooltip.js +146 -190
  218. package/components/user-agreement/service.js +228 -371
  219. package/components/user-agreement/toolbox.eula.js +160 -1
  220. package/components/user-agreement/user-agreement.js +85 -120
  221. package/components/user-card/card.js +0 -29
  222. package/components/user-card/smart-user-card-tooltip.js +51 -111
  223. package/components/user-card/tooltip.js +47 -84
  224. package/components/user-card/user-card.js +0 -29
  225. package/package.json +1 -1
@@ -1,90 +1,65 @@
1
- import { _ as _defineProperty, a as _inherits, b as _createClass, f as _classCallCheck, g as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.map.js';
3
1
  import { PureComponent } from 'react';
4
2
  import PropTypes from 'prop-types';
5
3
  import shortcuts from './core.js';
6
- import 'core-js/modules/es.array.concat.js';
7
- import 'core-js/modules/es.array.find-index.js';
8
- import 'core-js/modules/es.array.includes.js';
9
- import 'core-js/modules/es.array.slice.js';
10
- import 'core-js/modules/es.array.splice.js';
11
- import 'core-js/modules/es.object.assign.js';
12
- import 'core-js/modules/es.regexp.exec.js';
13
- import 'core-js/modules/es.string.includes.js';
14
- import 'core-js/modules/es.string.match.js';
15
4
  import 'combokeys';
16
5
  import '../global/sniffer.js';
17
6
  import 'sniffr';
18
7
 
19
- var Shortcuts = /*#__PURE__*/function (_PureComponent) {
20
- function Shortcuts() {
21
- _classCallCheck(this, Shortcuts);
22
- return _callSuper(this, Shortcuts, arguments);
23
- }
24
- _inherits(Shortcuts, _PureComponent);
25
- return _createClass(Shortcuts, [{
26
- key: "componentDidMount",
27
- value: function componentDidMount() {
28
- if (!this.props.disabled) {
29
- this.turnShorcutsOn();
30
- }
8
+ class Shortcuts extends PureComponent {
9
+ static propTypes = {
10
+ map: PropTypes.object.isRequired,
11
+ scope: PropTypes.string.isRequired,
12
+ options: PropTypes.object,
13
+ disabled: PropTypes.bool,
14
+ children: PropTypes.node
15
+ };
16
+ static defaultProps = {
17
+ options: {}
18
+ };
19
+ componentDidMount() {
20
+ if (!this.props.disabled) {
21
+ this.turnShorcutsOn();
31
22
  }
32
- }, {
33
- key: "componentDidUpdate",
34
- value: function componentDidUpdate(prevProps) {
35
- var _this$props = this.props,
36
- disabled = _this$props.disabled,
37
- map = _this$props.map;
38
- if (!prevProps.disabled && disabled) {
39
- this.turnShorcutsOff();
40
- }
41
- if (prevProps.disabled && !disabled) {
42
- this.turnShorcutsOn();
43
- }
44
- if (prevProps.map !== map) {
45
- shortcuts.bindMap(map, this.props);
46
- }
23
+ }
24
+ componentDidUpdate(prevProps) {
25
+ const {
26
+ disabled,
27
+ map
28
+ } = this.props;
29
+ if (!prevProps.disabled && disabled) {
30
+ this.turnShorcutsOff();
47
31
  }
48
- }, {
49
- key: "componentWillUnmount",
50
- value: function componentWillUnmount() {
51
- if (!this.props.disabled) {
52
- this.turnShorcutsOff();
53
- }
32
+ if (prevProps.disabled && !disabled) {
33
+ this.turnShorcutsOn();
54
34
  }
55
- }, {
56
- key: "turnShorcutsOn",
57
- value: function turnShorcutsOn() {
58
- var _this$props2 = this.props,
59
- map = _this$props2.map,
60
- scope = _this$props2.scope,
61
- options = _this$props2.options;
35
+ if (prevProps.map !== map) {
62
36
  shortcuts.bindMap(map, this.props);
63
- shortcuts.pushScope(scope, options);
64
37
  }
65
- }, {
66
- key: "turnShorcutsOff",
67
- value: function turnShorcutsOff() {
68
- var scope = this.props.scope;
69
- shortcuts.unbindScope(scope);
70
- shortcuts.spliceScope(scope);
71
- }
72
- }, {
73
- key: "render",
74
- value: function render() {
75
- return this.props.children || null;
38
+ }
39
+ componentWillUnmount() {
40
+ if (!this.props.disabled) {
41
+ this.turnShorcutsOff();
76
42
  }
77
- }]);
78
- }(PureComponent);
79
- _defineProperty(Shortcuts, "propTypes", {
80
- map: PropTypes.object.isRequired,
81
- scope: PropTypes.string.isRequired,
82
- options: PropTypes.object,
83
- disabled: PropTypes.bool,
84
- children: PropTypes.node
85
- });
86
- _defineProperty(Shortcuts, "defaultProps", {
87
- options: {}
88
- });
43
+ }
44
+ turnShorcutsOn() {
45
+ const {
46
+ map,
47
+ scope,
48
+ options
49
+ } = this.props;
50
+ shortcuts.bindMap(map, this.props);
51
+ shortcuts.pushScope(scope, options);
52
+ }
53
+ turnShorcutsOff() {
54
+ const {
55
+ scope
56
+ } = this.props;
57
+ shortcuts.unbindScope(scope);
58
+ shortcuts.spliceScope(scope);
59
+ }
60
+ render() {
61
+ return this.props.children || null;
62
+ }
63
+ }
89
64
 
90
65
  export { Shortcuts as default };
@@ -1,6 +1,3 @@
1
- import { j as _slicedToArray, d as _objectSpread2, k as _toConsumableArray } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.index-of.js';
3
- import 'core-js/modules/es.array.map.js';
4
1
  import React, { useRef, useState, useMemo, useCallback, useEffect, Fragment } from 'react';
5
2
  import classNames from 'classnames';
6
3
  import { isArray } from '../global/typescript-utils.js';
@@ -9,140 +6,114 @@ import getUID from '../global/get-uid.js';
9
6
  import { toRange, validateValue, calculateMarks, toPercent, calculateValue, adjustValues, HUNDRED } from './slider.utils.js';
10
7
  import 'prop-types';
11
8
  import '../shortcuts/core.js';
12
- import 'core-js/modules/es.array.concat.js';
13
- import 'core-js/modules/es.array.find-index.js';
14
- import 'core-js/modules/es.array.includes.js';
15
- import 'core-js/modules/es.array.slice.js';
16
- import 'core-js/modules/es.array.splice.js';
17
- import 'core-js/modules/es.object.assign.js';
18
- import 'core-js/modules/es.regexp.exec.js';
19
- import 'core-js/modules/es.string.includes.js';
20
- import 'core-js/modules/es.string.match.js';
21
9
  import 'combokeys';
22
10
  import '../global/sniffer.js';
23
11
  import 'sniffr';
24
- import 'core-js/modules/es.object.to-string.js';
25
- import 'core-js/modules/es.regexp.to-string.js';
26
- import 'core-js/modules/es.array.from.js';
27
12
 
28
13
  var modules_b653e84a = {"dark":"dark_rui_f090","slider":"slider_rui_35ea","disabled":"disabled_rui_35ea","marked":"marked_rui_35ea","rail":"rail_rui_35ea","rounded":"rounded_rui_35ea","track":"track_rui_35ea","thumb":"thumb_rui_35ea resetButton_rui_f295","dragged":"dragged_rui_35ea","tick":"tick_rui_35ea","active":"active_rui_35ea","markValue":"markValue_rui_35ea","tag":"tag_rui_35ea"};
29
14
 
30
- var Slider = function Slider(_ref) {
31
- var defaultValue = _ref.defaultValue,
32
- value = _ref.value,
33
- _ref$min = _ref.min,
34
- min = _ref$min === void 0 ? 0 : _ref$min,
35
- _ref$max = _ref.max,
36
- max = _ref$max === void 0 ? HUNDRED : _ref$max,
37
- _ref$step = _ref.step,
38
- step = _ref$step === void 0 ? 1 : _ref$step,
39
- disabled = _ref.disabled,
40
- marks = _ref.marks,
41
- showTicks = _ref.showTicks,
42
- showTag = _ref.showTag,
43
- className = _ref.className,
44
- renderTag = _ref.renderTag,
45
- onChange = _ref.onChange;
46
- var ref = useRef(null);
47
- var previouslyDragged = useRef(false);
48
- var _useState = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : min),
49
- _useState2 = _slicedToArray(_useState, 2),
50
- values = _useState2[0],
51
- setValues = _useState2[1];
52
- var validValues = useMemo(function () {
53
- return toRange(value !== null && value !== void 0 ? value : values, min, max);
54
- }, [max, min, value, values]);
55
- var validStep = step < 0 ? 0 : step;
56
- var isRange = isArray(defaultValue !== null && defaultValue !== void 0 ? defaultValue : value);
57
- var _useState3 = useState(false),
58
- _useState4 = _slicedToArray(_useState3, 2),
59
- isDragging = _useState4[0],
60
- setIsDragging = _useState4[1];
61
- var _useState5 = useState(-1),
62
- _useState6 = _slicedToArray(_useState5, 2),
63
- draggedIndex = _useState6[0],
64
- setDraggedIndex = _useState6[1];
65
- var _useState7 = useState(getUID('ring-slider-')),
66
- _useState8 = _slicedToArray(_useState7, 1),
67
- shortcutsScope = _useState8[0];
68
- var markValues = useMemo(function () {
15
+ const Slider = _ref => {
16
+ let {
17
+ defaultValue,
18
+ value,
19
+ min = 0,
20
+ max = HUNDRED,
21
+ step = 1,
22
+ disabled,
23
+ marks,
24
+ showTicks,
25
+ showTag,
26
+ className,
27
+ renderTag,
28
+ onChange
29
+ } = _ref;
30
+ const ref = useRef(null);
31
+ const previouslyDragged = useRef(false);
32
+ const [values, setValues] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : min);
33
+ const validValues = useMemo(() => toRange(value !== null && value !== void 0 ? value : values, min, max), [max, min, value, values]);
34
+ const validStep = step < 0 ? 0 : step;
35
+ const isRange = isArray(defaultValue !== null && defaultValue !== void 0 ? defaultValue : value);
36
+ const [isDragging, setIsDragging] = useState(false);
37
+ const [draggedIndex, setDraggedIndex] = useState(-1);
38
+ const [shortcutsScope] = useState(getUID('ring-slider-'));
39
+ const markValues = useMemo(() => {
69
40
  if (isArray(marks)) {
70
- return marks.map(function (mark) {
71
- return _objectSpread2(_objectSpread2({}, mark), {}, {
72
- value: validateValue(mark.value, min, max)
73
- });
74
- });
41
+ return marks.map(mark => ({
42
+ ...mark,
43
+ value: validateValue(mark.value, min, max)
44
+ }));
75
45
  } else if (marks) {
76
46
  return calculateMarks(min, max, validStep);
77
47
  }
78
48
  return [];
79
49
  }, [marks, max, min, validStep]);
80
- var tickMarks = useMemo(function () {
50
+ const tickMarks = useMemo(() => {
81
51
  if (showTicks) {
82
52
  return markValues.length ? markValues : calculateMarks(min, max, validStep);
83
53
  }
84
54
  return [];
85
55
  }, [max, min, markValues, showTicks, validStep]);
86
- var trackStart = useMemo(function () {
87
- return toPercent(isRange ? Math.min.apply(Math, _toConsumableArray(validValues)) : min, min, max);
88
- }, [isRange, max, min, validValues]);
89
- var trackLength = useMemo(function () {
90
- return toPercent(Math.max.apply(Math, _toConsumableArray(validValues)), min, max) - trackStart;
91
- }, [max, min, trackStart, validValues]);
92
- var handleValueChange = useCallback(function (nextValues) {
56
+ const trackStart = useMemo(() => toPercent(isRange ? Math.min(...validValues) : min, min, max), [isRange, max, min, validValues]);
57
+ const trackLength = useMemo(() => toPercent(Math.max(...validValues), min, max) - trackStart, [max, min, trackStart, validValues]);
58
+ const handleValueChange = useCallback(nextValues => {
93
59
  setValues(nextValues);
94
- onChange === null || onChange === void 0 || onChange(isRange ? nextValues : nextValues[0]);
60
+ onChange?.(isRange ? nextValues : nextValues[0]);
95
61
  }, [isRange, onChange]);
96
- var shortcutsMap = useMemo(function () {
97
- var setValueAndSwap = function setValueAndSwap(nextValue, index) {
98
- var nextValues = _toConsumableArray(validValues);
62
+ const shortcutsMap = useMemo(() => {
63
+ const setValueAndSwap = (nextValue, index) => {
64
+ const nextValues = [...validValues];
99
65
  nextValues[index] = nextValue;
100
66
  if (nextValues[0] > nextValues[1]) {
101
- var _ref$current;
102
- var previousValue = nextValues[index];
67
+ const previousValue = nextValues[index];
103
68
  nextValues.reverse();
104
- var thumb = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector("[role=\"slider\"][data-index=\"".concat(nextValues.indexOf(previousValue), "\"]"));
105
- thumb === null || thumb === void 0 || thumb.focus();
69
+ const thumb = ref.current?.querySelector(`[role="slider"][data-index="${nextValues.indexOf(previousValue)}"]`);
70
+ thumb?.focus();
106
71
  }
107
72
  handleValueChange(nextValues);
108
73
  };
109
- var getIndex = function getIndex(target) {
110
- return Number(target === null || target === void 0 ? void 0 : target.getAttribute('data-index'));
111
- };
112
- var map = {};
74
+ const getIndex = target => Number(target?.getAttribute('data-index'));
75
+ const map = {};
113
76
  if (!disabled) {
114
- map.left = map.down = function (_ref2) {
115
- var target = _ref2.target;
116
- var index = getIndex(target);
77
+ map.left = map.down = _ref2 => {
78
+ let {
79
+ target
80
+ } = _ref2;
81
+ const index = getIndex(target);
117
82
  setValueAndSwap(Math.max(min, validValues[index] - validStep), index);
118
83
  };
119
- map.right = map.up = function (_ref3) {
120
- var target = _ref3.target;
121
- var index = getIndex(target);
84
+ map.right = map.up = _ref3 => {
85
+ let {
86
+ target
87
+ } = _ref3;
88
+ const index = getIndex(target);
122
89
  setValueAndSwap(Math.min(max, validValues[index] + validStep), index);
123
90
  };
124
- map.home = function (_ref4) {
125
- var target = _ref4.target;
126
- var index = getIndex(target);
91
+ map.home = _ref4 => {
92
+ let {
93
+ target
94
+ } = _ref4;
95
+ const index = getIndex(target);
127
96
  setValueAndSwap(min, index);
128
97
  };
129
- map.end = function (_ref5) {
130
- var target = _ref5.target;
131
- var index = getIndex(target);
98
+ map.end = _ref5 => {
99
+ let {
100
+ target
101
+ } = _ref5;
102
+ const index = getIndex(target);
132
103
  setValueAndSwap(max, index);
133
104
  };
134
105
  }
135
106
  return map;
136
107
  }, [disabled, handleValueChange, max, min, validStep, validValues]);
137
- var handleMouseDown = useCallback(function (e) {
108
+ const handleMouseDown = useCallback(e => {
138
109
  e.stopPropagation();
139
110
  if (disabled) {
140
111
  return;
141
112
  }
142
- var index = e.currentTarget.getAttribute('data-index');
143
- var nextValue = calculateValue(ref, e.pageX, min, max, validStep);
113
+ const index = e.currentTarget.getAttribute('data-index');
114
+ const nextValue = calculateValue(ref, e.pageX, min, max, validStep);
144
115
  if (nextValue !== null && !isNaN(nextValue) && !index) {
145
- var rangeIndex = Number(Math.abs(validValues[0] - nextValue) > Math.abs(validValues[1] - nextValue));
116
+ const rangeIndex = Number(Math.abs(validValues[0] - nextValue) > Math.abs(validValues[1] - nextValue));
146
117
  setDraggedIndex(isRange ? rangeIndex : 0);
147
118
  } else {
148
119
  setDraggedIndex(Number(index));
@@ -150,9 +121,11 @@ var Slider = function Slider(_ref) {
150
121
  setIsDragging(true);
151
122
  previouslyDragged.current = false;
152
123
  }, [disabled, isRange, max, min, validStep, validValues]);
153
- var handleMouseUp = useCallback(function (_ref6) {
154
- var pageX = _ref6.pageX;
155
- var nextValues = adjustValues(validValues, ref, draggedIndex, pageX, max, min, validStep);
124
+ const handleMouseUp = useCallback(_ref6 => {
125
+ let {
126
+ pageX
127
+ } = _ref6;
128
+ const nextValues = adjustValues(validValues, ref, draggedIndex, pageX, max, min, validStep);
156
129
  if (nextValues[0] > nextValues[1]) {
157
130
  nextValues.reverse();
158
131
  }
@@ -161,18 +134,18 @@ var Slider = function Slider(_ref) {
161
134
  setIsDragging(false);
162
135
  previouslyDragged.current = true;
163
136
  }, [validValues, draggedIndex, handleValueChange, max, min, validStep]);
164
- var handleMouseMove = useCallback(function (_ref7) {
165
- var pageX = _ref7.pageX;
166
- var nextValues = adjustValues(validValues, ref, draggedIndex, pageX, max, min, validStep);
137
+ const handleMouseMove = useCallback(_ref7 => {
138
+ let {
139
+ pageX
140
+ } = _ref7;
141
+ const nextValues = adjustValues(validValues, ref, draggedIndex, pageX, max, min, validStep);
167
142
  if (nextValues[0] > nextValues[1]) {
168
143
  nextValues.reverse();
169
- setDraggedIndex(function (prevState) {
170
- return prevState === 0 ? 1 : 0;
171
- });
144
+ setDraggedIndex(prevState => prevState === 0 ? 1 : 0);
172
145
  }
173
146
  handleValueChange(nextValues);
174
147
  }, [validValues, draggedIndex, max, min, validStep, handleValueChange]);
175
- useEffect(function () {
148
+ useEffect(() => {
176
149
  if (disabled) {
177
150
  return undefined;
178
151
  }
@@ -183,7 +156,7 @@ var Slider = function Slider(_ref) {
183
156
  window.removeEventListener('mousemove', handleMouseMove);
184
157
  window.removeEventListener('mouseup', handleMouseUp);
185
158
  }
186
- return function () {
159
+ return () => {
187
160
  window.removeEventListener('mousemove', handleMouseMove);
188
161
  window.removeEventListener('mouseup', handleMouseUp);
189
162
  };
@@ -208,15 +181,15 @@ var Slider = function Slider(_ref) {
208
181
  })
209
182
  }), /*#__PURE__*/React.createElement("div", {
210
183
  style: {
211
- left: "".concat(trackStart, "%"),
212
- width: "".concat(trackLength, "%")
184
+ left: `${trackStart}%`,
185
+ width: `${trackLength}%`
213
186
  },
214
187
  className: classNames(modules_b653e84a.track, {
215
188
  [modules_b653e84a.rounded]: !showTicks,
216
189
  [modules_b653e84a.disabled]: disabled
217
190
  })
218
- }), validValues.map(function (numValue, index) {
219
- var percent = toPercent(numValue, min, max);
191
+ }), validValues.map((numValue, index) => {
192
+ const percent = toPercent(numValue, min, max);
220
193
  return (
221
194
  /*#__PURE__*/
222
195
  // eslint-disable-next-line react/no-array-index-key
@@ -231,7 +204,7 @@ var Slider = function Slider(_ref) {
231
204
  "aria-valuenow": numValue,
232
205
  "data-index": index,
233
206
  style: {
234
- left: "".concat(percent, "%")
207
+ left: `${percent}%`
235
208
  },
236
209
  className: classNames(modules_b653e84a.thumb, {
237
210
  [modules_b653e84a.disabled]: disabled,
@@ -240,7 +213,7 @@ var Slider = function Slider(_ref) {
240
213
  onMouseDown: handleMouseDown
241
214
  }), showTag && /*#__PURE__*/React.createElement("div", {
242
215
  style: {
243
- left: "".concat(percent, "%")
216
+ left: `${percent}%`
244
217
  },
245
218
  className: classNames(modules_b653e84a.tag, {
246
219
  [modules_b653e84a.disabled]: disabled
@@ -248,24 +221,28 @@ var Slider = function Slider(_ref) {
248
221
  role: "tooltip"
249
222
  }, renderTag ? renderTag(numValue) : numValue))
250
223
  );
251
- }), markValues.map(function (_ref8, index) {
252
- var markValue = _ref8.value,
253
- label = _ref8.label;
254
- var percent = toPercent(markValue, min, max);
224
+ }), markValues.map((_ref8, index) => {
225
+ let {
226
+ value: markValue,
227
+ label
228
+ } = _ref8;
229
+ const percent = toPercent(markValue, min, max);
255
230
  return /*#__PURE__*/React.createElement("div", {
256
231
  // eslint-disable-next-line react/no-array-index-key
257
232
  key: index,
258
233
  style: {
259
- left: "".concat(percent, "%")
234
+ left: `${percent}%`
260
235
  },
261
236
  className: classNames(modules_b653e84a.markValue, {
262
237
  [modules_b653e84a.disabled]: disabled
263
238
  })
264
239
  }, label !== null && label !== void 0 ? label : markValue);
265
- }), tickMarks.map(function (_ref9, index) {
266
- var tickValue = _ref9.value;
267
- var percent = toPercent(tickValue, min, max);
268
- var isActive = isRange ? tickValue >= validValues[0] && tickValue <= validValues[validValues.length - 1] : tickValue <= validValues[0];
240
+ }), tickMarks.map((_ref9, index) => {
241
+ let {
242
+ value: tickValue
243
+ } = _ref9;
244
+ const percent = toPercent(tickValue, min, max);
245
+ const isActive = isRange ? tickValue >= validValues[0] && tickValue <= validValues[validValues.length - 1] : tickValue <= validValues[0];
269
246
  return /*#__PURE__*/React.createElement("div", {
270
247
  // eslint-disable-next-line react/no-array-index-key
271
248
  key: index,
@@ -274,7 +251,7 @@ var Slider = function Slider(_ref) {
274
251
  [modules_b653e84a.disabled]: disabled
275
252
  }),
276
253
  style: {
277
- left: "".concat(percent, "%")
254
+ left: `${percent}%`
278
255
  }
279
256
  });
280
257
  }));
@@ -1,12 +1,6 @@
1
- import { k as _toConsumableArray } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.from.js';
3
- import 'core-js/modules/es.array.map.js';
4
- import 'core-js/modules/es.array.slice.js';
5
- import 'core-js/modules/es.object.to-string.js';
6
- import 'core-js/modules/es.regexp.to-string.js';
7
1
  import { isArray } from '../global/typescript-utils.js';
8
2
 
9
- var HUNDRED = 100;
3
+ const HUNDRED = 100;
10
4
  function toPercent(value, min, max) {
11
5
  return (value - min) * HUNDRED / (max - min);
12
6
  }
@@ -17,15 +11,15 @@ function roundToStep(value, step, min) {
17
11
  return Math.round((value - min) / step) * step + min;
18
12
  }
19
13
  function calculateValue(ref, x, min, max, step) {
20
- var _step$toString$split;
21
14
  if (!ref.current) {
22
15
  return null;
23
16
  }
24
- var _ref$current$getBound = ref.current.getBoundingClientRect(),
25
- width = _ref$current$getBound.width,
26
- left = _ref$current$getBound.left;
27
- var value = toValue((x - left) / width, min, max);
28
- var precision = (_step$toString$split = step.toString().split('.')) === null || _step$toString$split === void 0 || (_step$toString$split = _step$toString$split[1]) === null || _step$toString$split === void 0 ? void 0 : _step$toString$split.length;
17
+ const {
18
+ width,
19
+ left
20
+ } = ref.current.getBoundingClientRect();
21
+ const value = toValue((x - left) / width, min, max);
22
+ const precision = step.toString().split('.')?.[1]?.length;
29
23
  return Number(roundToStep(value, step, min).toFixed(precision));
30
24
  }
31
25
  function validateValue(value, min, max) {
@@ -39,9 +33,7 @@ function validateValue(value, min, max) {
39
33
  }
40
34
  function toRange(value, min, max) {
41
35
  if (isArray(value)) {
42
- var nextValues = value.slice(0, 2).map(function (val) {
43
- return validateValue(val, min, max);
44
- });
36
+ const nextValues = value.slice(0, 2).map(val => validateValue(val, min, max));
45
37
  if (nextValues[0] > nextValues[1]) {
46
38
  nextValues.reverse();
47
39
  }
@@ -51,22 +43,20 @@ function toRange(value, min, max) {
51
43
  }
52
44
  }
53
45
  function adjustValues(values, ref, index, x, max, min, step) {
54
- var nextValue = calculateValue(ref, x, min, max, step);
55
- var nextValues = _toConsumableArray(values);
46
+ const nextValue = calculateValue(ref, x, min, max, step);
47
+ const nextValues = [...values];
56
48
  if (nextValue !== null && !isNaN(nextValue)) {
57
49
  nextValues[index] = validateValue(nextValue, min, max);
58
50
  }
59
51
  return nextValues;
60
52
  }
61
53
  function calculateMarks(min, max, step) {
62
- var numMarks = Math.floor((max - min) / step) + 1;
54
+ const numMarks = Math.floor((max - min) / step) + 1;
63
55
  return Array.from({
64
56
  length: numMarks
65
- }, function (_, index) {
66
- return {
67
- value: validateValue(min + step * index, min, max)
68
- };
69
- });
57
+ }, (_, index) => ({
58
+ value: validateValue(min + step * index, min, max)
59
+ }));
70
60
  }
71
61
 
72
62
  export { HUNDRED, adjustValues, calculateMarks, calculateValue, toPercent, toRange, validateValue };
@@ -1,20 +1,11 @@
1
1
  import LocalStorage from './storage__local.js';
2
2
  import FallbackStorage from './storage__fallback.js';
3
- import '../_helpers/_rollupPluginBabelHelpers.js';
4
- import 'core-js/modules/es.array.iterator.js';
5
- import 'core-js/modules/es.object.to-string.js';
6
- import 'core-js/modules/es.promise.js';
7
- import 'core-js/modules/web.dom-collections.iterator.js';
8
3
  import '../alert-service/alert-service.js';
9
- import 'core-js/modules/es.array.concat.js';
10
- import 'core-js/modules/es.array.filter.js';
11
- import 'core-js/modules/es.array.map.js';
4
+ import '../_helpers/_rollupPluginBabelHelpers.js';
12
5
  import 'react';
13
6
  import 'react-dom/client';
14
7
  import '../global/get-uid.js';
15
- import 'core-js/modules/es.regexp.to-string.js';
16
8
  import '../alert/alert.js';
17
- import 'core-js/modules/es.object.values.js';
18
9
  import 'classnames';
19
10
  import 'prop-types';
20
11
  import '@jetbrains/icons/exception';
@@ -25,21 +16,10 @@ import '../icon/icon.js';
25
16
  import 'util-deprecate';
26
17
  import '../icon/icon__constants.js';
27
18
  import '../_helpers/icon__svg.js';
28
- import 'core-js/modules/es.regexp.exec.js';
29
- import 'core-js/modules/es.string.replace.js';
30
- import 'core-js/modules/es.string.starts-with.js';
31
19
  import '../global/memoize.js';
32
- import 'core-js/modules/es.map.js';
33
- import 'core-js/modules/es.weak-map.js';
34
20
  import '../loader-inline/loader-inline.js';
35
21
  import '../global/data-tests.js';
36
- import 'core-js/modules/es.array.reduce.js';
37
- import 'core-js/modules/es.object.entries.js';
38
22
  import '../global/dom.js';
39
- import 'core-js/modules/es.object.assign.js';
40
- import 'core-js/modules/es.set.js';
41
- import 'core-js/modules/es.string.split.js';
42
- import 'core-js/modules/web.dom-collections.for-each.js';
43
23
  import '../button/button.js';
44
24
  import '@jetbrains/icons/chevron-10px';
45
25
  import '../link/clickableLink.js';
@@ -52,22 +32,13 @@ import '../popup/popup.js';
52
32
  import '../global/schedule-raf.js';
53
33
  import '../shortcuts/shortcuts.js';
54
34
  import '../shortcuts/core.js';
55
- import 'core-js/modules/es.array.find-index.js';
56
- import 'core-js/modules/es.array.includes.js';
57
- import 'core-js/modules/es.array.slice.js';
58
- import 'core-js/modules/es.array.splice.js';
59
- import 'core-js/modules/es.string.includes.js';
60
- import 'core-js/modules/es.string.match.js';
61
35
  import 'combokeys';
62
36
  import '../global/sniffer.js';
63
37
  import 'sniffr';
64
38
  import '../tab-trap/tab-trap.js';
65
39
  import '../popup/position.js';
66
- import 'core-js/modules/es.array.sort.js';
67
40
  import '../popup/popup.consts.js';
68
41
  import '../alert/container.js';
69
- import 'core-js/modules/es.array.index-of.js';
70
- import 'core-js/modules/es.reflect.delete-property.js';
71
42
  import 'deep-equal';
72
43
 
73
44
  /**
@@ -77,16 +48,16 @@ import 'deep-equal';
77
48
  * @constructor
78
49
  * @extends {LocalStorage}
79
50
  */
80
- var Storage = LocalStorage;
51
+ let Storage = LocalStorage;
81
52
  // Using try/catch here because of IE10+ protected mode and other browsers' quirks
82
53
  // See https://github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js
83
54
  try {
84
- var temp = 'testStorage';
55
+ const temp = 'testStorage';
85
56
  localStorage.setItem(temp, temp);
86
57
  localStorage.removeItem(temp);
87
58
  } catch (e) {
88
59
  Storage = FallbackStorage;
89
60
  }
90
- var ActualStorage = Storage;
61
+ const ActualStorage = Storage;
91
62
 
92
63
  export { ActualStorage as default };