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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/components/_helpers/_rollupPluginBabelHelpers.js +1 -504
  2. package/components/_helpers/anchor.js +7 -5
  3. package/components/_helpers/button__classes.js +15 -13
  4. package/components/_helpers/caption.js +11 -17
  5. package/components/_helpers/card.js +92 -96
  6. package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
  7. package/components/_helpers/icon__svg.js +27 -23
  8. package/components/_helpers/input.js +150 -171
  9. package/components/_helpers/query-assist__suggestions.js +78 -93
  10. package/components/_helpers/select__filter.js +56 -67
  11. package/components/_helpers/services-link.js +23 -29
  12. package/components/_helpers/sidebar.js +91 -93
  13. package/components/_helpers/tab-link.js +8 -6
  14. package/components/_helpers/theme.js +41 -50
  15. package/components/_helpers/title.js +59 -69
  16. package/components/alert/alert.js +112 -156
  17. package/components/alert/container.js +32 -39
  18. package/components/alert-service/alert-service.js +104 -161
  19. package/components/analytics/analytics.js +12 -20
  20. package/components/analytics/analytics__custom-plugin.js +52 -68
  21. package/components/auth/auth.js +2 -27
  22. package/components/auth/auth__core.d.ts +1 -1
  23. package/components/auth/auth__core.js +742 -1428
  24. package/components/auth/background-flow.js +84 -121
  25. package/components/auth/down-notification.js +31 -69
  26. package/components/auth/iframe-flow.js +70 -123
  27. package/components/auth/request-builder.js +46 -77
  28. package/components/auth/response-parser.js +84 -112
  29. package/components/auth/storage.js +160 -318
  30. package/components/auth/token-validator.js +132 -227
  31. package/components/auth/window-flow.js +84 -121
  32. package/components/auth-dialog/auth-dialog.js +99 -150
  33. package/components/auth-dialog-service/auth-dialog-service.js +6 -26
  34. package/components/avatar/avatar-example-datauri.js +1 -1
  35. package/components/avatar/avatar.js +94 -123
  36. package/components/avatar/fallback-avatar.js +20 -34
  37. package/components/badge/badge.js +32 -38
  38. package/components/breadcrumbs/breadcrumbs.js +13 -17
  39. package/components/button/button.js +67 -80
  40. package/components/button-group/button-group.js +27 -36
  41. package/components/button-set/button-set.js +19 -27
  42. package/components/button-toolbar/button-toolbar.js +17 -25
  43. package/components/caret/caret.js +184 -211
  44. package/components/checkbox/checkbox.js +69 -86
  45. package/components/clipboard/clipboard-fallback.js +7 -7
  46. package/components/clipboard/clipboard.js +36 -128
  47. package/components/code/code.js +83 -151
  48. package/components/collapse/collapse-content.js +42 -60
  49. package/components/collapse/collapse-context.js +2 -2
  50. package/components/collapse/collapse-control.js +12 -12
  51. package/components/collapse/collapse.js +12 -17
  52. package/components/collapse/consts.js +4 -4
  53. package/components/collapse/utils.js +1 -3
  54. package/components/confirm/confirm.js +57 -87
  55. package/components/confirm-service/confirm-service.js +23 -44
  56. package/components/content-layout/content-layout.js +41 -56
  57. package/components/content-layout/sidebar.js +1 -1
  58. package/components/contenteditable/contenteditable.js +38 -46
  59. package/components/control-help/control-help.js +5 -3
  60. package/components/control-label/control-label.js +9 -8
  61. package/components/data-list/data-list.js +113 -156
  62. package/components/data-list/data-list.mock.js +3 -5
  63. package/components/data-list/item.js +120 -140
  64. package/components/data-list/selection.js +77 -135
  65. package/components/data-list/title.js +2 -10
  66. package/components/date-picker/consts.js +16 -22
  67. package/components/date-picker/date-input.js +99 -124
  68. package/components/date-picker/date-picker.js +140 -184
  69. package/components/date-picker/date-popup.js +280 -327
  70. package/components/date-picker/day.js +71 -94
  71. package/components/date-picker/month-names.js +41 -59
  72. package/components/date-picker/month-slider.js +42 -61
  73. package/components/date-picker/month.js +17 -24
  74. package/components/date-picker/months.js +44 -49
  75. package/components/date-picker/weekdays.js +12 -21
  76. package/components/date-picker/years.js +77 -98
  77. package/components/dialog/dialog.js +151 -187
  78. package/components/dialog/dialog__body-scroll-preventer.js +0 -3
  79. package/components/dropdown/anchor.js +0 -6
  80. package/components/dropdown/dropdown.js +134 -154
  81. package/components/dropdown-menu/dropdown-menu.js +59 -87
  82. package/components/editable-heading/editable-heading.js +69 -116
  83. package/components/error-bubble/error-bubble.js +29 -54
  84. package/components/error-message/error-message.js +34 -49
  85. package/components/footer/footer.js +27 -28
  86. package/components/global/compose.js +1 -8
  87. package/components/global/composeRefs.d.ts +0 -3
  88. package/components/global/composeRefs.js +8 -15
  89. package/components/global/controls-height.js +2 -2
  90. package/components/global/create-stateful-context.js +14 -13
  91. package/components/global/data-tests.js +7 -12
  92. package/components/global/dom.js +49 -82
  93. package/components/global/focus-sensor-hoc.js +99 -106
  94. package/components/global/fuzzy-highlight.js +23 -34
  95. package/components/global/get-event-key.js +8 -8
  96. package/components/global/get-uid.js +3 -7
  97. package/components/global/inject-styles.js +7 -14
  98. package/components/global/listeners.js +28 -47
  99. package/components/global/memoize.js +6 -10
  100. package/components/global/normalize-indent.js +19 -46
  101. package/components/global/promise-with-timeout.js +6 -8
  102. package/components/global/prop-types.js +3 -5
  103. package/components/global/react-dom-renderer.js +29 -40
  104. package/components/global/rerender-hoc.js +16 -32
  105. package/components/global/schedule-raf.js +4 -4
  106. package/components/global/sniffer.js +1 -1
  107. package/components/global/theme.js +1 -18
  108. package/components/global/trivial-template-tag.js +4 -9
  109. package/components/global/typescript-utils.js +2 -6
  110. package/components/global/url.js +20 -23
  111. package/components/global/use-event-callback.js +7 -4
  112. package/components/grid/col.js +27 -39
  113. package/components/grid/grid.js +18 -27
  114. package/components/grid/row.js +23 -30
  115. package/components/group/group.js +16 -22
  116. package/components/header/header-icon.js +19 -31
  117. package/components/header/header.d.ts +0 -1
  118. package/components/header/header.js +30 -64
  119. package/components/header/links.js +6 -3
  120. package/components/header/logo.js +15 -26
  121. package/components/header/profile.js +124 -150
  122. package/components/header/services-link.js +1 -3
  123. package/components/header/services.js +64 -97
  124. package/components/header/smart-profile.js +101 -178
  125. package/components/header/smart-services.js +55 -90
  126. package/components/header/tray.js +21 -30
  127. package/components/heading/heading.js +21 -20
  128. package/components/http/http.js +162 -319
  129. package/components/http/http.mock.js +50 -98
  130. package/components/hub-source/hub-source.js +77 -182
  131. package/components/hub-source/hub-source__user.js +9 -37
  132. package/components/hub-source/hub-source__users-groups.js +34 -60
  133. package/components/i18n/i18n-context.js +7 -8
  134. package/components/i18n/i18n.js +3 -6
  135. package/components/icon/icon.js +60 -74
  136. package/components/icon/icon__svg.js +0 -5
  137. package/components/icon/index.js +0 -5
  138. package/components/input/input.js +1 -11
  139. package/components/island/adaptive-island-hoc.js +29 -37
  140. package/components/island/content.js +100 -110
  141. package/components/island/header.js +56 -66
  142. package/components/island/island.js +25 -33
  143. package/components/island-legacy/content-legacy.js +16 -22
  144. package/components/island-legacy/header-legacy.js +19 -25
  145. package/components/island-legacy/island-legacy.js +16 -22
  146. package/components/link/clickableLink.js +33 -42
  147. package/components/link/link.js +47 -55
  148. package/components/list/consts.js +2 -2
  149. package/components/list/list.js +399 -486
  150. package/components/list/list__custom.js +51 -61
  151. package/components/list/list__hint.js +9 -17
  152. package/components/list/list__item.js +147 -178
  153. package/components/list/list__link.js +38 -47
  154. package/components/list/list__separator.js +15 -24
  155. package/components/list/list__title.js +25 -34
  156. package/components/list/list__users-groups-source.js +55 -121
  157. package/components/loader/loader.js +38 -60
  158. package/components/loader/loader__core.js +123 -184
  159. package/components/loader-inline/loader-inline.js +24 -32
  160. package/components/loader-screen/loader-screen.js +24 -40
  161. package/components/login-dialog/login-dialog.js +81 -121
  162. package/components/login-dialog/service.js +6 -29
  163. package/components/markdown/markdown.js +16 -24
  164. package/components/message/message.js +170 -201
  165. package/components/old-browsers-message/old-browsers-message.js +11 -14
  166. package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
  167. package/components/old-browsers-message/white-list.js +8 -13
  168. package/components/pager/pager.js +212 -257
  169. package/components/panel/panel.js +16 -22
  170. package/components/permissions/permissions.js +118 -161
  171. package/components/permissions/permissions__cache.js +191 -218
  172. package/components/popup/popup.consts.js +1 -1
  173. package/components/popup/popup.js +237 -288
  174. package/components/popup/popup.target.js +9 -7
  175. package/components/popup/position.js +94 -101
  176. package/components/popup-menu/popup-menu.js +33 -67
  177. package/components/progress-bar/progress-bar.js +57 -68
  178. package/components/query-assist/query-assist.js +583 -652
  179. package/components/query-assist/query-assist__suggestions.js +2 -26
  180. package/components/radio/radio.js +15 -27
  181. package/components/radio/radio__item.js +52 -62
  182. package/components/scrollable-section/scrollable-section.js +22 -32
  183. package/components/select/select.js +693 -793
  184. package/components/select/select__filter.js +1 -26
  185. package/components/select/select__popup.js +316 -413
  186. package/components/shortcuts/core.js +147 -195
  187. package/components/shortcuts/shortcut-title.js +6 -10
  188. package/components/shortcuts/shortcuts-hoc.js +23 -41
  189. package/components/shortcuts/shortcuts.js +41 -64
  190. package/components/slider/slider.js +93 -112
  191. package/components/slider/slider.utils.js +16 -23
  192. package/components/storage/storage.js +3 -27
  193. package/components/storage/storage__fallback.js +137 -210
  194. package/components/storage/storage__local.js +89 -147
  195. package/components/style.css +1 -1
  196. package/components/tab-trap/tab-trap.js +35 -53
  197. package/components/table/cell.js +11 -21
  198. package/components/table/disable-hover-hoc.js +27 -42
  199. package/components/table/header-cell.js +59 -75
  200. package/components/table/header.js +89 -110
  201. package/components/table/multitable.js +83 -89
  202. package/components/table/row-with-focus-sensor.js +25 -57
  203. package/components/table/row.js +169 -200
  204. package/components/table/selection-adapter.js +2 -2
  205. package/components/table/selection-shortcuts-hoc.js +108 -113
  206. package/components/table/selection.js +150 -217
  207. package/components/table/simple-table.js +19 -55
  208. package/components/table/smart-table.js +42 -76
  209. package/components/table/table.js +267 -327
  210. package/components/tabs/collapsible-more.js +47 -73
  211. package/components/tabs/collapsible-tab.js +32 -36
  212. package/components/tabs/collapsible-tabs.js +89 -148
  213. package/components/tabs/custom-item.js +4 -2
  214. package/components/tabs/dumb-tabs.js +60 -92
  215. package/components/tabs/smart-tabs.js +29 -61
  216. package/components/tabs/tab-link.js +1 -3
  217. package/components/tabs/tab.js +15 -24
  218. package/components/tabs/tabs.js +1 -26
  219. package/components/tag/tag.d.ts +0 -2
  220. package/components/tag/tag.js +120 -162
  221. package/components/tags-input/tags-input.js +222 -304
  222. package/components/tags-list/tags-list.js +45 -61
  223. package/components/text/text.js +28 -37
  224. package/components/toggle/toggle.js +51 -61
  225. package/components/tooltip/tooltip.js +109 -141
  226. package/components/user-agreement/service.js +259 -400
  227. package/components/user-agreement/user-agreement.js +80 -108
  228. package/components/user-card/card.js +1 -25
  229. package/components/user-card/smart-user-card-tooltip.js +52 -103
  230. package/components/user-card/tooltip.js +35 -65
  231. package/components/user-card/user-card.js +1 -25
  232. package/package.json +1 -1
  233. package/components/global/react-render-adapter.d.ts +0 -1
  234. package/components/global/react-render-adapter.js +0 -6
  235. package/components/header/tray-icon.d.ts +0 -1
  236. package/components/header/tray-icon.js +0 -26
@@ -1,8 +1,5 @@
1
- import { _ as _defineProperty, a as _inherits, b as _createClass, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.concat.js';
3
- import 'core-js/modules/es.array.includes.js';
4
- import 'core-js/modules/es.object.to-string.js';
5
- import 'core-js/modules/es.string.includes.js';
1
+ import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
6
3
  import { Component } from 'react';
7
4
  import PropTypes from 'prop-types';
8
5
  import classNames from 'classnames';
@@ -18,111 +15,91 @@ import { startOfDay } from 'date-fns/startOfDay';
18
15
  import { dateType, getDayNumInWeek, weekdays } from './consts.js';
19
16
  import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
20
17
  import { jsx } from 'react/jsx-runtime';
21
- import 'core-js/modules/es.array.index-of.js';
22
- import 'core-js/modules/es.array.slice.js';
23
- import 'core-js/modules/es.object.values.js';
24
18
  import 'core-js/modules/es.regexp.exec.js';
25
19
  import 'date-fns/add';
26
20
 
27
- var hoverTO;
28
- var Day = /*#__PURE__*/function (_Component) {
29
- function Day() {
30
- var _this;
31
- _classCallCheck(this, Day);
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, Day, [].concat(args));
36
- _defineProperty(_this, "handleClick", function () {
37
- return _this.props.onSelect(_this.props.day);
38
- });
39
- _defineProperty(_this, "handleMouseOver", function () {
21
+ let hoverTO;
22
+ class Day extends Component {
23
+ constructor() {
24
+ super(...arguments);
25
+ _defineProperty(this, "handleClick", () => this.props.onSelect(this.props.day));
26
+ _defineProperty(this, "handleMouseOver", () => {
40
27
  if (hoverTO) {
41
28
  window.clearTimeout(hoverTO);
42
29
  hoverTO = null;
43
30
  }
44
- _this.props.onHover(_this.props.day);
45
- });
46
- _defineProperty(_this, "handleMouseOut", function () {
47
- hoverTO = window.setTimeout(_this.props.onHover, 0);
48
- });
49
- _defineProperty(_this, "isDay", function (date) {
50
- return isSameDay(_this.props.day, date);
31
+ this.props.onHover(this.props.day);
51
32
  });
52
- _defineProperty(_this, "is", function (name) {
53
- var value = _this.props[name];
54
- return value != null && _this.isDay(value);
33
+ _defineProperty(this, "handleMouseOut", () => {
34
+ hoverTO = window.setTimeout(this.props.onHover, 0);
55
35
  });
56
- _defineProperty(_this, "inRange", function (range) {
57
- return range && isAfter(startOfDay(_this.props.day), startOfDay(range[0])) && isBefore(startOfDay(_this.props.day), startOfDay(range[1]));
36
+ _defineProperty(this, "isDay", date => isSameDay(this.props.day, date));
37
+ _defineProperty(this, "is", name => {
38
+ const value = this.props[name];
39
+ return value != null && this.isDay(value);
58
40
  });
59
- _defineProperty(_this, "isDisabled", function (date) {
60
- var min = _this.parse(_this.props.minDate);
61
- var max = _this.parse(_this.props.maxDate);
41
+ _defineProperty(this, "inRange", range => range && isAfter(startOfDay(this.props.day), startOfDay(range[0])) && isBefore(startOfDay(this.props.day), startOfDay(range[1])));
42
+ _defineProperty(this, "isDisabled", date => {
43
+ const min = this.parse(this.props.minDate);
44
+ const max = this.parse(this.props.maxDate);
62
45
  return min != null && isBefore(startOfDay(date), startOfDay(min)) || max != null && isAfter(startOfDay(date), startOfDay(max));
63
46
  });
64
- return _this;
65
47
  }
66
- _inherits(Day, _Component);
67
- return _createClass(Day, [{
68
- key: "parse",
69
- value: function parse(text) {
70
- return this.props.parseDateInput(text);
48
+ parse(text) {
49
+ return this.props.parseDateInput(text);
50
+ }
51
+ render() {
52
+ const {
53
+ day,
54
+ from,
55
+ currentRange,
56
+ activeRange,
57
+ empty,
58
+ locale
59
+ } = this.props;
60
+ const reverse = activeRange && activeRange[1] === from;
61
+ const dayInWeek = getDayNumInWeek(locale, getDay(day)) + 1;
62
+ function makeSpreadRange(range) {
63
+ return range && [range[0], addDays(range[1], 1)];
71
64
  }
72
- }, {
73
- key: "render",
74
- value: function render() {
75
- var _this$props = this.props,
76
- day = _this$props.day,
77
- from = _this$props.from,
78
- currentRange = _this$props.currentRange,
79
- activeRange = _this$props.activeRange,
80
- empty = _this$props.empty,
81
- locale = _this$props.locale;
82
- var reverse = activeRange && activeRange[1] === from;
83
- var dayInWeek = getDayNumInWeek(locale, getDay(day)) + 1;
84
- function makeSpreadRange(range) {
85
- return range && [range[0], addDays(range[1], 1)];
86
- }
87
- var spreadRange = makeSpreadRange(currentRange);
88
- var disabled = this.isDisabled(day);
89
- var activeSpreadRange = makeSpreadRange(activeRange);
90
- return (
91
- /*#__PURE__*/
92
- // TODO make keyboard navigation actually work
93
- jsx("button", {
94
- type: "button",
95
- className: classNames(modules_0c7b7d96.day, modules_0c7b7d96["Day".concat(dayInWeek)], {
96
- [modules_0c7b7d96.current]: ['date', 'from', 'to'].some(this.is),
97
- [modules_0c7b7d96.active]: !disabled && this.is('activeDate'),
98
- [modules_0c7b7d96.weekend]: [weekdays.SA, weekdays.SU].includes(getDay(day)),
99
- [modules_0c7b7d96.empty]: empty,
100
- [modules_0c7b7d96.from]: currentRange && this.isDay(currentRange[0]) && !reverse || activeRange && this.isDay(activeRange[0]),
101
- [modules_0c7b7d96.to]: currentRange && this.isDay(currentRange[1]) || activeRange && this.isDay(activeRange[1]),
102
- [modules_0c7b7d96.between]: this.inRange(currentRange),
103
- [modules_0c7b7d96.activeBetween]: !disabled && this.inRange(activeRange),
104
- [modules_0c7b7d96.first]: getDate(day) === 1,
105
- [modules_0c7b7d96.spread]: this.inRange(spreadRange),
106
- [modules_0c7b7d96.activeSpread]: !disabled && this.inRange(activeSpreadRange),
107
- [modules_0c7b7d96.disabled]: disabled
65
+ const spreadRange = makeSpreadRange(currentRange);
66
+ const disabled = this.isDisabled(day);
67
+ const activeSpreadRange = makeSpreadRange(activeRange);
68
+ return (
69
+ /*#__PURE__*/
70
+ // TODO make keyboard navigation actually work
71
+ jsx("button", {
72
+ type: "button",
73
+ className: classNames(modules_0c7b7d96.day, modules_0c7b7d96["Day".concat(dayInWeek)], {
74
+ [modules_0c7b7d96.current]: ['date', 'from', 'to'].some(this.is),
75
+ [modules_0c7b7d96.active]: !disabled && this.is('activeDate'),
76
+ [modules_0c7b7d96.weekend]: [weekdays.SA, weekdays.SU].includes(getDay(day)),
77
+ [modules_0c7b7d96.empty]: empty,
78
+ [modules_0c7b7d96.from]: currentRange && this.isDay(currentRange[0]) && !reverse || activeRange && this.isDay(activeRange[0]),
79
+ [modules_0c7b7d96.to]: currentRange && this.isDay(currentRange[1]) || activeRange && this.isDay(activeRange[1]),
80
+ [modules_0c7b7d96.between]: this.inRange(currentRange),
81
+ [modules_0c7b7d96.activeBetween]: !disabled && this.inRange(activeRange),
82
+ [modules_0c7b7d96.first]: getDate(day) === 1,
83
+ [modules_0c7b7d96.spread]: this.inRange(spreadRange),
84
+ [modules_0c7b7d96.activeSpread]: !disabled && this.inRange(activeSpreadRange),
85
+ [modules_0c7b7d96.disabled]: disabled
86
+ }),
87
+ onClick: this.handleClick,
88
+ onMouseOver: this.handleMouseOver,
89
+ onFocus: this.handleMouseOver,
90
+ onMouseOut: this.handleMouseOut,
91
+ onBlur: this.handleMouseOut,
92
+ disabled: disabled,
93
+ children: empty || /*#__PURE__*/jsx("span", {
94
+ className: classNames({
95
+ [modules_0c7b7d96.today]: isToday(day)
108
96
  }),
109
- onClick: this.handleClick,
110
- onMouseOver: this.handleMouseOver,
111
- onFocus: this.handleMouseOver,
112
- onMouseOut: this.handleMouseOut,
113
- onBlur: this.handleMouseOut,
114
- disabled: disabled,
115
- children: empty || /*#__PURE__*/jsx("span", {
116
- className: classNames({
117
- [modules_0c7b7d96.today]: isToday(day)
118
- }),
119
- children: format(day, 'd')
120
- })
97
+ children: format(day, 'd')
121
98
  })
122
- );
123
- }
124
- }]);
125
- }(Component);
99
+ })
100
+ );
101
+ }
102
+ }
126
103
  _defineProperty(Day, "propTypes", {
127
104
  day: dateType,
128
105
  from: dateType,
@@ -1,6 +1,5 @@
1
- import { _ as _defineProperty, i as _slicedToArray, d as _objectSpread2, a as _inherits, b as _createClass, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.concat.js';
3
- import 'core-js/modules/es.array.map.js';
1
+ import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
4
3
  import { PureComponent } from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import classNames from 'classnames';
@@ -17,82 +16,65 @@ import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
17
16
  import { jsxs, jsx } from 'react/jsx-runtime';
18
17
  import 'date-fns/addYears';
19
18
  import 'date-fns/subYears';
20
- import 'core-js/modules/es.array.index-of.js';
21
- import 'core-js/modules/es.array.slice.js';
22
- import 'core-js/modules/es.object.values.js';
23
19
  import 'core-js/modules/es.regexp.exec.js';
24
20
  import 'date-fns/add';
25
21
 
26
- var MonthName = /*#__PURE__*/function (_PureComponent) {
27
- function MonthName() {
28
- var _this;
29
- _classCallCheck(this, MonthName);
30
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
31
- args[_key] = arguments[_key];
32
- }
33
- _this = _callSuper(this, MonthName, [].concat(args));
34
- _defineProperty(_this, "handleClick", function () {
35
- var end = endOfMonth(_this.props.month);
36
- _this.props.onScrollChange(end.getTime());
22
+ class MonthName extends PureComponent {
23
+ constructor() {
24
+ super(...arguments);
25
+ _defineProperty(this, "handleClick", () => {
26
+ const end = endOfMonth(this.props.month);
27
+ this.props.onScrollChange(end.getTime());
37
28
  });
38
- return _this;
39
29
  }
40
- _inherits(MonthName, _PureComponent);
41
- return _createClass(MonthName, [{
42
- key: "render",
43
- value: function render() {
44
- var _this$props = this.props,
45
- month = _this$props.month,
46
- locale = _this$props.locale;
47
- return /*#__PURE__*/jsx("button", {
48
- type: "button",
49
- className: classNames(modules_0c7b7d96.monthName, {
50
- [modules_0c7b7d96.today]: isThisMonth(month)
51
- }),
52
- onClick: this.handleClick,
53
- children: format(month, 'LLL', {
54
- locale
55
- })
56
- });
57
- }
58
- }]);
59
- }(PureComponent);
30
+ render() {
31
+ const {
32
+ month,
33
+ locale
34
+ } = this.props;
35
+ return /*#__PURE__*/jsx("button", {
36
+ type: "button",
37
+ className: classNames(modules_0c7b7d96.monthName, {
38
+ [modules_0c7b7d96.today]: isThisMonth(month)
39
+ }),
40
+ onClick: this.handleClick,
41
+ children: format(month, 'LLL', {
42
+ locale
43
+ })
44
+ });
45
+ }
46
+ }
60
47
  _defineProperty(MonthName, "propTypes", {
61
48
  month: dateType,
62
49
  onScrollChange: PropTypes.func,
63
50
  locale: PropTypes.object
64
51
  });
65
52
  function MonthNames(props) {
66
- var scrollDate = props.scrollDate,
67
- locale = props.locale;
68
- var months = [];
69
- for (var i = 0; i < YEAR; i++) {
70
- var middleDay = set(scrollDate, {
53
+ const {
54
+ scrollDate,
55
+ locale
56
+ } = props;
57
+ const months = [];
58
+ for (let i = 0; i < YEAR; i++) {
59
+ const middleDay = set(scrollDate, {
71
60
  month: i,
72
61
  date: MIDDLE_DAY
73
62
  });
74
63
  months.push(startOfDay(middleDay));
75
64
  }
76
- var pxToDate = linearFunction(0, Number(startOfYear(scrollDate)), yearScrollSpeed);
77
- var top = 0;
78
- var bottom = 0;
65
+ const pxToDate = linearFunction(0, Number(startOfYear(scrollDate)), yearScrollSpeed);
66
+ let top = 0;
67
+ let bottom = 0;
79
68
  if (props.currentRange) {
80
- var _props$currentRange$m = props.currentRange.map(function (date) {
81
- return Math.floor(pxToDate.x(Number(date)));
82
- });
83
- var _props$currentRange$m2 = _slicedToArray(_props$currentRange$m, 2);
84
- top = _props$currentRange$m2[0];
85
- bottom = _props$currentRange$m2[1];
69
+ [top, bottom] = props.currentRange.map(date => Math.floor(pxToDate.x(Number(date))));
86
70
  }
87
71
  return /*#__PURE__*/jsxs("div", {
88
72
  className: modules_0c7b7d96.monthNames,
89
- children: [months.map(function (month) {
90
- return /*#__PURE__*/jsx(MonthName, {
91
- month: month,
92
- onScrollChange: props.onScrollChange,
93
- locale: locale
94
- }, +month);
95
- }), props.currentRange && /*#__PURE__*/jsx("div", {
73
+ children: [months.map(month => /*#__PURE__*/jsx(MonthName, {
74
+ month: month,
75
+ onScrollChange: props.onScrollChange,
76
+ locale: locale
77
+ }, +month)), props.currentRange && /*#__PURE__*/jsx("div", {
96
78
  className: modules_0c7b7d96.range,
97
79
  style: {
98
80
  top: top - 1,
@@ -1,6 +1,5 @@
1
- import { _ as _defineProperty, a as _inherits, b as _createClass, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.concat.js';
3
- import 'core-js/modules/es.array.map.js';
1
+ import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
4
3
  import { PureComponent } from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import classNames from 'classnames';
@@ -11,79 +10,61 @@ import linearFunction from '../global/linear-function.js';
11
10
  import units, { dateType, yearScrollSpeed } from './consts.js';
12
11
  import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
13
12
  import { jsx } from 'react/jsx-runtime';
14
- import 'core-js/modules/es.array.index-of.js';
15
- import 'core-js/modules/es.array.slice.js';
16
- import 'core-js/modules/es.object.values.js';
17
13
  import 'core-js/modules/es.regexp.exec.js';
18
14
  import 'date-fns/add';
19
15
 
20
- var COVERYEARS = 3;
21
- var MonthSlider = /*#__PURE__*/function (_PureComponent) {
22
- function MonthSlider() {
23
- var _this;
24
- _classCallCheck(this, MonthSlider);
25
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
26
- args[_key] = arguments[_key];
27
- }
28
- _this = _callSuper(this, MonthSlider, [].concat(args));
29
- _defineProperty(_this, "state", {
16
+ const COVERYEARS = 3;
17
+ class MonthSlider extends PureComponent {
18
+ constructor() {
19
+ super(...arguments);
20
+ _defineProperty(this, "state", {
30
21
  dragging: false
31
22
  });
32
- _defineProperty(_this, "onMouseDown", function () {
33
- _this.setState({
23
+ _defineProperty(this, "onMouseDown", () => {
24
+ this.setState({
34
25
  dragging: true
35
26
  });
36
27
  });
37
- _defineProperty(_this, "onMouseUp", function () {
38
- _this.setState({
28
+ _defineProperty(this, "onMouseUp", () => {
29
+ this.setState({
39
30
  dragging: false
40
31
  });
41
32
  });
42
- _defineProperty(_this, "onMouseMove", function (e) {
43
- _this.props.onScroll(linearFunction(0, Number(_this.props.scrollDate), yearScrollSpeed).y(e.movementY));
33
+ _defineProperty(this, "onMouseMove", e => {
34
+ this.props.onScroll(linearFunction(0, Number(this.props.scrollDate), yearScrollSpeed).y(e.movementY));
44
35
  });
45
- return _this;
46
36
  }
47
- _inherits(MonthSlider, _PureComponent);
48
- return _createClass(MonthSlider, [{
49
- key: "componentDidUpdate",
50
- value: function componentDidUpdate(prevProps, prevState) {
51
- if (this.state.dragging && !prevState.dragging) {
52
- window.addEventListener('mousemove', this.onMouseMove);
53
- window.addEventListener('mouseup', this.onMouseUp);
54
- } else if (!this.state.dragging && prevState.dragging) {
55
- window.removeEventListener('mousemove', this.onMouseMove);
56
- window.removeEventListener('mouseup', this.onMouseUp);
57
- }
37
+ componentDidUpdate(prevProps, prevState) {
38
+ if (this.state.dragging && !prevState.dragging) {
39
+ window.addEventListener('mousemove', this.onMouseMove);
40
+ window.addEventListener('mouseup', this.onMouseUp);
41
+ } else if (!this.state.dragging && prevState.dragging) {
42
+ window.removeEventListener('mousemove', this.onMouseMove);
43
+ window.removeEventListener('mouseup', this.onMouseUp);
58
44
  }
59
- }, {
60
- key: "render",
61
- value: function render() {
62
- var _this2 = this;
63
- var year = subYears(startOfDay(this.props.scrollDate), 1);
64
- var years = [year];
65
- for (var i = 0; i <= COVERYEARS; i++) {
66
- year = addYears(year, 1);
67
- years.push(year);
68
- }
69
- var classes = classNames(modules_0c7b7d96.monthSlider, {
70
- [modules_0c7b7d96.dragging]: this.state.dragging
71
- });
72
- return /*#__PURE__*/jsx("div", {
73
- children: years.map(function (date) {
74
- return /*#__PURE__*/jsx("button", {
75
- type: "button",
76
- className: classes,
77
- style: {
78
- top: Math.floor(_this2.props.pxToDate.x(Number(date)) - units.cellSize)
79
- },
80
- onMouseDown: _this2.onMouseDown
81
- }, +date);
82
- })
83
- });
45
+ }
46
+ render() {
47
+ let year = subYears(startOfDay(this.props.scrollDate), 1);
48
+ const years = [year];
49
+ for (let i = 0; i <= COVERYEARS; i++) {
50
+ year = addYears(year, 1);
51
+ years.push(year);
84
52
  }
85
- }]);
86
- }(PureComponent);
53
+ const classes = classNames(modules_0c7b7d96.monthSlider, {
54
+ [modules_0c7b7d96.dragging]: this.state.dragging
55
+ });
56
+ return /*#__PURE__*/jsx("div", {
57
+ children: years.map(date => /*#__PURE__*/jsx("button", {
58
+ type: "button",
59
+ className: classes,
60
+ style: {
61
+ top: Math.floor(this.props.pxToDate.x(Number(date)) - units.cellSize)
62
+ },
63
+ onMouseDown: this.onMouseDown
64
+ }, +date))
65
+ });
66
+ }
67
+ }
87
68
  _defineProperty(MonthSlider, "propTypes", {
88
69
  scrollDate: dateType,
89
70
  onScroll: PropTypes.func,
@@ -1,6 +1,4 @@
1
- import { d as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.map.js';
3
- import 'core-js/modules/es.object.values.js';
1
+ import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
4
2
  import { addDays } from 'date-fns/addDays';
5
3
  import { endOfMonth } from 'date-fns/endOfMonth';
6
4
  import { format } from 'date-fns/format';
@@ -12,10 +10,7 @@ import { dateType, shiftWeekArray, getWeekStartsOn, weekdays, FIFTH_DAY, WEEK }
12
10
  import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
13
11
  import { jsxs, jsx } from 'react/jsx-runtime';
14
12
  import { createElement } from 'react';
15
- import 'core-js/modules/es.array.concat.js';
16
- import 'core-js/modules/es.array.includes.js';
17
- import 'core-js/modules/es.object.to-string.js';
18
- import 'core-js/modules/es.string.includes.js';
13
+ import 'core-js/modules/web.dom-collections.iterator.js';
19
14
  import 'classnames';
20
15
  import 'date-fns/getDate';
21
16
  import 'date-fns/isAfter';
@@ -23,21 +18,21 @@ import 'date-fns/isBefore';
23
18
  import 'date-fns/isSameDay';
24
19
  import 'date-fns/isToday';
25
20
  import 'date-fns/startOfDay';
26
- import 'core-js/modules/es.array.index-of.js';
27
- import 'core-js/modules/es.array.slice.js';
28
21
  import 'core-js/modules/es.regexp.exec.js';
29
22
  import 'date-fns/add';
30
23
 
31
24
  function Month(props) {
32
- var start = props.month;
33
- var end = endOfMonth(start);
34
- var locale = props.locale;
25
+ const start = props.month;
26
+ const end = endOfMonth(start);
27
+ const {
28
+ locale
29
+ } = props;
35
30
  // pad with empty cells starting from last friday
36
- var weekday = getDay(start);
37
- var weekDays = shiftWeekArray(Object.values(weekdays), getWeekStartsOn(props.locale));
38
- var fifthDayOfWeek = weekDays[FIFTH_DAY];
39
- var day = setDay(start, weekday >= fifthDayOfWeek ? fifthDayOfWeek : fifthDayOfWeek - WEEK);
40
- var days = [];
31
+ const weekday = getDay(start);
32
+ const weekDays = shiftWeekArray(Object.values(weekdays), getWeekStartsOn(props.locale));
33
+ const fifthDayOfWeek = weekDays[FIFTH_DAY];
34
+ let day = setDay(start, weekday >= fifthDayOfWeek ? fifthDayOfWeek : fifthDayOfWeek - WEEK);
35
+ const days = [];
41
36
  while (day < end) {
42
37
  days.push(day);
43
38
  day = addDays(day, 1);
@@ -49,13 +44,11 @@ function Month(props) {
49
44
  children: format(props.month, 'LLLL', {
50
45
  locale
51
46
  })
52
- }), days.map(function (date) {
53
- return /*#__PURE__*/createElement(Day, _objectSpread2(_objectSpread2({}, props), {}, {
54
- day: date,
55
- empty: date < start,
56
- key: +date
57
- }));
58
- })]
47
+ }), days.map(date => /*#__PURE__*/createElement(Day, _objectSpread2(_objectSpread2({}, props), {}, {
48
+ day: date,
49
+ empty: date < start,
50
+ key: +date
51
+ })))]
59
52
  });
60
53
  }
61
54
  Month.propTypes = {