@jetbrains/ring-ui 5.0.126 → 5.0.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/components/alert/alert.js +2 -1
  2. package/components/alert/container.js +2 -1
  3. package/components/auth/auth__core.js +2 -1
  4. package/components/auth/request-builder.js +2 -1
  5. package/components/auth/response-parser.js +2 -1
  6. package/components/auth/token-validator.js +2 -1
  7. package/components/auth-dialog/auth-dialog.js +2 -1
  8. package/components/avatar/avatar.js +2 -1
  9. package/components/badge/badge.js +2 -1
  10. package/components/button/button.js +2 -1
  11. package/components/button-group/button-group.js +2 -1
  12. package/components/button-group/caption.js +2 -1
  13. package/components/button-set/button-set.js +2 -1
  14. package/components/button-toolbar/button-toolbar.js +2 -1
  15. package/components/caret/caret.js +2 -1
  16. package/components/checkbox/checkbox.js +2 -1
  17. package/components/code/code.js +2 -1
  18. package/components/confirm/confirm.js +2 -1
  19. package/components/content-layout/content-layout.js +2 -1
  20. package/components/content-layout/sidebar.js +2 -1
  21. package/components/data-list/data-list.js +2 -1
  22. package/components/data-list/item.js +2 -1
  23. package/components/date-picker/date-input.js +2 -1
  24. package/components/date-picker/date-picker.js +2 -1
  25. package/components/date-picker/date-popup.js +2 -1
  26. package/components/date-picker/day.js +2 -1
  27. package/components/date-picker/month-slider.js +2 -1
  28. package/components/date-picker/years.js +2 -1
  29. package/components/dialog/dialog.d.ts +4 -16
  30. package/components/dialog/dialog.js +6 -3
  31. package/components/dropdown/dropdown.js +2 -1
  32. package/components/editable-heading/editable-heading.css +2 -0
  33. package/components/error-bubble/error-bubble.js +2 -1
  34. package/components/error-message/error-message.js +2 -1
  35. package/components/footer/footer.js +1 -0
  36. package/components/global/react-dom-renderer.js +2 -1
  37. package/components/grid/col.js +2 -1
  38. package/components/grid/grid.js +2 -1
  39. package/components/grid/row.js +2 -1
  40. package/components/group/group.js +2 -1
  41. package/components/header/logo.js +2 -1
  42. package/components/header/profile.js +2 -1
  43. package/components/header/services-link.js +2 -1
  44. package/components/header/services.js +2 -1
  45. package/components/header/smart-profile.js +2 -1
  46. package/components/header/smart-services.js +2 -1
  47. package/components/header/tray-icon.js +2 -1
  48. package/components/header/tray.js +2 -1
  49. package/components/hub-source/hub-source.js +2 -1
  50. package/components/icon/icon.js +2 -1
  51. package/components/input/input.js +2 -1
  52. package/components/island/island.js +2 -1
  53. package/components/island-legacy/content-legacy.js +2 -1
  54. package/components/island-legacy/header-legacy.js +2 -1
  55. package/components/island-legacy/island-legacy.js +2 -1
  56. package/components/link/clickableLink.js +2 -1
  57. package/components/list/list.js +2 -1
  58. package/components/list/list__hint.js +2 -1
  59. package/components/list/list__users-groups-source.js +2 -1
  60. package/components/loader/loader.js +2 -1
  61. package/components/loader/loader__core.js +2 -1
  62. package/components/loader-screen/loader-screen.js +2 -1
  63. package/components/login-dialog/login-dialog.js +2 -1
  64. package/components/message/message.js +2 -1
  65. package/components/pager/pager.js +2 -1
  66. package/components/panel/panel.js +2 -1
  67. package/components/permissions/permissions.js +2 -1
  68. package/components/permissions/permissions__cache.js +2 -1
  69. package/components/popup/popup.js +2 -1
  70. package/components/popup-menu/popup-menu.js +2 -1
  71. package/components/progress-bar/progress-bar.js +2 -1
  72. package/components/query-assist/query-assist.js +4 -3
  73. package/components/radio/radio.js +2 -1
  74. package/components/radio/radio__item.js +2 -1
  75. package/components/select/select.js +3 -2
  76. package/components/select/select__filter.js +2 -1
  77. package/components/select/select__popup.js +4 -2
  78. package/components/shortcuts/shortcuts.js +2 -1
  79. package/components/storage/storage__fallback.js +2 -1
  80. package/components/tab-trap/tab-trap.js +2 -1
  81. package/components/table/cell.js +2 -1
  82. package/components/table/header-cell.js +2 -1
  83. package/components/table/header.js +2 -1
  84. package/components/table/multitable.js +2 -1
  85. package/components/table/row.js +3 -2
  86. package/components/table/table.js +4 -2
  87. package/components/tabs/smart-tabs.js +2 -1
  88. package/components/tabs/tab.js +2 -1
  89. package/components/tag/tag.js +2 -1
  90. package/components/tags-input/tags-input.d.ts +1 -1
  91. package/components/tags-input/tags-input.js +3 -2
  92. package/components/tags-list/tags-list.js +2 -1
  93. package/components/text/text.js +2 -1
  94. package/components/tooltip/tooltip.js +2 -1
  95. package/components/user-agreement/user-agreement.js +2 -1
  96. package/components/user-card/card.js +2 -1
  97. package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
  98. package/components/user-card/smart-user-card-tooltip.js +2 -1
  99. package/components/user-card/tooltip.js +2 -1
  100. package/dist/_helpers/_rollupPluginBabelHelpers.js +1 -29
  101. package/dist/_helpers/anchor.js +1 -1
  102. package/dist/_helpers/card.js +44 -47
  103. package/dist/_helpers/footer.js +1 -0
  104. package/dist/_helpers/select__filter.js +10 -13
  105. package/dist/_helpers/services-link.js +10 -10
  106. package/dist/_helpers/sidebar.js +34 -37
  107. package/dist/_helpers/theme.js +1 -1
  108. package/dist/_helpers/title.js +12 -16
  109. package/dist/alert/alert.js +63 -66
  110. package/dist/alert/container.js +5 -5
  111. package/dist/alert-service/alert-service.js +5 -7
  112. package/dist/analytics/analytics.js +1 -2
  113. package/dist/analytics/analytics__custom-plugin.js +6 -8
  114. package/dist/auth/auth.js +1 -1
  115. package/dist/auth/auth__core.js +26 -26
  116. package/dist/auth/background-flow.js +4 -5
  117. package/dist/auth/iframe-flow.js +12 -12
  118. package/dist/auth/landing.js +1 -1
  119. package/dist/auth/request-builder.js +3 -5
  120. package/dist/auth/response-parser.js +5 -6
  121. package/dist/auth/storage.js +12 -12
  122. package/dist/auth/token-validator.js +13 -16
  123. package/dist/auth/window-flow.js +18 -19
  124. package/dist/auth-dialog/auth-dialog.js +54 -57
  125. package/dist/auth-dialog-service/auth-dialog-service.js +1 -1
  126. package/dist/auth-ng/auth-ng.js +1 -1
  127. package/dist/avatar/avatar.js +30 -33
  128. package/dist/avatar-ng/avatar-ng.js +1 -1
  129. package/dist/badge/badge.js +10 -10
  130. package/dist/badge-ng/badge-ng.js +1 -1
  131. package/dist/breadcrumb-ng/breadcrumb-ng.js +0 -1
  132. package/dist/button/button.js +24 -27
  133. package/dist/button-group/button-group.js +5 -5
  134. package/dist/button-group/caption.js +4 -4
  135. package/dist/button-ng/button-ng.js +68 -69
  136. package/dist/button-set/button-set.js +6 -6
  137. package/dist/button-toolbar/button-toolbar.js +6 -6
  138. package/dist/caret/caret.js +2 -4
  139. package/dist/checkbox/checkbox.js +27 -30
  140. package/dist/checkbox-ng/checkbox-ng.js +0 -1
  141. package/dist/code/code.js +17 -21
  142. package/dist/confirm/confirm.js +31 -34
  143. package/dist/confirm-ng/confirm-ng.js +1 -1
  144. package/dist/confirm-service/confirm-service.js +1 -1
  145. package/dist/content-layout/content-layout.js +17 -20
  146. package/dist/contenteditable/contenteditable.js +11 -11
  147. package/dist/data-list/data-list.js +49 -55
  148. package/dist/data-list/item.js +64 -67
  149. package/dist/data-list/selection.js +0 -1
  150. package/dist/data-list/title.js +1 -1
  151. package/dist/data-list-ng/data-list-ng.js +1 -1
  152. package/dist/date-picker/date-input.js +39 -42
  153. package/dist/date-picker/date-picker.js +162 -165
  154. package/dist/date-picker/date-popup.js +119 -119
  155. package/dist/date-picker/day.js +34 -38
  156. package/dist/date-picker/month-names.js +11 -14
  157. package/dist/date-picker/month-slider.js +24 -28
  158. package/dist/date-picker/month.js +1 -1
  159. package/dist/date-picker/months.js +1 -1
  160. package/dist/date-picker/years.js +9 -13
  161. package/dist/dialog/dialog.d.ts +4 -16
  162. package/dist/dialog/dialog.js +68 -65
  163. package/dist/dialog-ng/dialog-ng.js +21 -22
  164. package/dist/docked-panel-ng/docked-panel-ng.js +0 -1
  165. package/dist/dropdown/dropdown.js +101 -104
  166. package/dist/dropdown-menu/dropdown-menu.js +1 -1
  167. package/dist/editable-heading/editable-heading.js +1 -1
  168. package/dist/error-bubble/error-bubble.js +6 -6
  169. package/dist/error-message/error-message.js +10 -10
  170. package/dist/error-message-ng/error-message-ng.js +0 -1
  171. package/dist/footer-ng/footer-ng.js +19 -21
  172. package/dist/global/angular-component-factory.js +2 -3
  173. package/dist/global/dom.js +1 -5
  174. package/dist/global/focus-sensor-hoc.js +58 -61
  175. package/dist/global/listeners.js +1 -5
  176. package/dist/global/react-dom-renderer.js +8 -12
  177. package/dist/global/rerender-hoc.js +1 -5
  178. package/dist/global/ring-angular-component.js +1 -3
  179. package/dist/grid/col.js +13 -14
  180. package/dist/grid/grid.js +5 -5
  181. package/dist/grid/row.js +16 -17
  182. package/dist/group/group.js +5 -5
  183. package/dist/header/header.js +10 -10
  184. package/dist/header/logo.js +9 -9
  185. package/dist/header/profile.js +58 -58
  186. package/dist/header/services.js +19 -22
  187. package/dist/header/smart-profile.js +40 -43
  188. package/dist/header/smart-services.js +28 -31
  189. package/dist/header/tray-icon.js +6 -6
  190. package/dist/header/tray.js +5 -5
  191. package/dist/heading/heading.js +1 -1
  192. package/dist/heading-ng/heading-ng.js +1 -1
  193. package/dist/http/http.js +111 -107
  194. package/dist/http/http.mock.js +3 -4
  195. package/dist/hub-source/hub-source.js +7 -9
  196. package/dist/hub-source/hub-source__user.js +0 -1
  197. package/dist/hub-source/hub-source__users-groups.js +4 -5
  198. package/dist/icon/icon.js +18 -18
  199. package/dist/icon/icon__svg.js +1 -1
  200. package/dist/icon-ng/icon-ng.js +0 -1
  201. package/dist/input/input.js +35 -38
  202. package/dist/input-ng/input-ng.js +25 -26
  203. package/dist/island/adaptive-island-hoc.js +21 -25
  204. package/dist/island/content.js +62 -65
  205. package/dist/island/header.js +11 -11
  206. package/dist/island/island.js +8 -8
  207. package/dist/island-legacy/content-legacy.js +5 -5
  208. package/dist/island-legacy/header-legacy.js +5 -5
  209. package/dist/island-legacy/island-legacy.js +5 -5
  210. package/dist/link/clickableLink.js +27 -30
  211. package/dist/link/link.js +16 -16
  212. package/dist/list/list.js +389 -391
  213. package/dist/list/list__custom.js +6 -10
  214. package/dist/list/list__hint.js +3 -4
  215. package/dist/list/list__item.js +4 -7
  216. package/dist/list/list__link.js +1 -1
  217. package/dist/list/list__users-groups-source.js +3 -3
  218. package/dist/loader/loader.js +16 -19
  219. package/dist/loader/loader__core.js +62 -62
  220. package/dist/loader-inline/loader-inline.js +6 -6
  221. package/dist/loader-ng/loader-ng.js +3 -4
  222. package/dist/loader-screen/loader-screen.js +6 -6
  223. package/dist/loader-screen-ng/loader-screen-ng.js +0 -1
  224. package/dist/login-dialog/login-dialog.js +55 -58
  225. package/dist/login-dialog/service.js +1 -1
  226. package/dist/markdown/code.js +0 -1
  227. package/dist/markdown/markdown.js +1 -1
  228. package/dist/message/message.js +22 -25
  229. package/dist/old-browsers-message/white-list.js +2 -2
  230. package/dist/pager/pager.js +55 -58
  231. package/dist/pager-ng/pager-ng.js +1 -1
  232. package/dist/panel/panel.js +5 -5
  233. package/dist/panel-ng/panel-ng.js +0 -1
  234. package/dist/permissions/permissions.js +14 -16
  235. package/dist/permissions/permissions__cache.js +4 -6
  236. package/dist/permissions-ng/permissions-ng.js +1 -1
  237. package/dist/place-under-ng/place-under-ng.js +0 -1
  238. package/dist/popup/popup.js +118 -121
  239. package/dist/popup/popup.target.js +1 -1
  240. package/dist/popup/position.js +0 -1
  241. package/dist/popup-menu/popup-menu.js +19 -22
  242. package/dist/progress-bar/progress-bar.js +41 -44
  243. package/dist/progress-bar-ng/progress-bar-ng.js +1 -1
  244. package/dist/promised-click-ng/promised-click-ng.js +0 -1
  245. package/dist/query-assist/query-assist.js +507 -501
  246. package/dist/query-assist/query-assist__suggestions.js +1 -1
  247. package/dist/query-assist-ng/query-assist-ng.js +1 -1
  248. package/dist/radio/radio.js +10 -13
  249. package/dist/radio/radio__item.js +19 -22
  250. package/dist/select/select.js +351 -350
  251. package/dist/select/select__popup.js +148 -152
  252. package/dist/select-ng/select-ng.js +1 -1
  253. package/dist/select-ng/select-ng__lazy.js +4 -4
  254. package/dist/select-ng/select-ng__options.js +14 -15
  255. package/dist/shortcuts/core.js +35 -36
  256. package/dist/shortcuts/shortcuts-hoc.js +7 -11
  257. package/dist/shortcuts/shortcuts.js +10 -11
  258. package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -1
  259. package/dist/shortcuts-ng/shortcuts-ng.js +0 -1
  260. package/dist/sidebar-ng/sidebar-ng.js +0 -1
  261. package/dist/storage/storage.js +1 -1
  262. package/dist/storage/storage__fallback.js +8 -10
  263. package/dist/storage/storage__local.js +2 -2
  264. package/dist/style.css +1 -1
  265. package/dist/tab-trap/tab-trap.js +84 -86
  266. package/dist/table/cell.js +6 -6
  267. package/dist/table/disable-hover-hoc.js +23 -25
  268. package/dist/table/header-cell.js +28 -31
  269. package/dist/table/header.js +58 -61
  270. package/dist/table/multitable.js +91 -95
  271. package/dist/table/row-with-focus-sensor.js +15 -18
  272. package/dist/table/row.js +51 -54
  273. package/dist/table/selection-shortcuts-hoc.js +145 -147
  274. package/dist/table/selection.js +7 -9
  275. package/dist/table/smart-table.js +21 -24
  276. package/dist/table/table.js +103 -109
  277. package/dist/table-legacy-ng/table-legacy-ng.js +1 -1
  278. package/dist/table-legacy-ng/table-legacy-ng__pager.js +1 -1
  279. package/dist/table-legacy-ng/table-legacy-ng__selection.js +1 -3
  280. package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +0 -1
  281. package/dist/table-ng/smart-table-ng.js +1 -1
  282. package/dist/table-ng/table-ng.js +1 -1
  283. package/dist/tabs/collapsible-more.js +1 -1
  284. package/dist/tabs/collapsible-tab.js +1 -1
  285. package/dist/tabs/dumb-tabs.js +46 -49
  286. package/dist/tabs/smart-tabs.js +10 -10
  287. package/dist/tabs/tab.js +7 -8
  288. package/dist/tag/tag.js +42 -45
  289. package/dist/tags-input/tags-input.d.ts +1 -1
  290. package/dist/tags-input/tags-input.js +214 -213
  291. package/dist/tags-input-ng/tags-input-ng.js +1 -1
  292. package/dist/tags-list/tags-list.js +20 -20
  293. package/dist/template-ng/template-ng.js +25 -26
  294. package/dist/text/text.js +6 -6
  295. package/dist/toggle/toggle.js +19 -19
  296. package/dist/toggle-ng/toggle-ng.js +1 -1
  297. package/dist/tooltip/tooltip.js +86 -89
  298. package/dist/tooltip-ng/tooltip-ng.js +1 -1
  299. package/dist/user-agreement/service.js +207 -205
  300. package/dist/user-agreement/user-agreement.js +39 -42
  301. package/dist/user-card/smart-user-card-tooltip.d.ts +1 -1
  302. package/dist/user-card/smart-user-card-tooltip.js +32 -35
  303. package/dist/user-card/tooltip.js +26 -26
  304. package/dist/user-card-ng/user-card-ng.js +1 -1
  305. package/package.json +15 -15
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -34,33 +34,18 @@ var Size;
34
34
  Size["FULL"] = "FULL";
35
35
  })(Size || (Size = {}));
36
36
  class Input extends PureComponent {
37
- constructor() {
38
- super(...arguments);
39
- _defineProperty(this, "state", {
40
- empty: true
41
- });
42
- _defineProperty(this, "frame", void 0);
43
- _defineProperty(this, "input", void 0);
44
- _defineProperty(this, "id", getUID('ring-input-'));
45
- _defineProperty(this, "inputRef", el => {
46
- this.input = el;
47
- });
48
- _defineProperty(this, "clear", e => {
49
- this.props.onClear && this.props.onClear(e);
50
- });
51
- _defineProperty(this, "handleInputChange", e => {
52
- if (!this.props.multiline) {
53
- this.props.onChange?.(e);
54
- this.checkValue();
55
- }
56
- });
57
- _defineProperty(this, "handleTextareaChange", e => {
58
- if (this.props.multiline) {
59
- this.props.onChange?.(e);
60
- this.checkValue();
61
- }
62
- });
63
- }
37
+ static defaultProps = {
38
+ size: Size.M,
39
+ onChange: noop,
40
+ inputRef: noop,
41
+ enableShortcuts: ['esc'],
42
+ translations: {
43
+ clear: 'Clear input'
44
+ }
45
+ };
46
+ state = {
47
+ empty: true
48
+ };
64
49
  componentDidMount() {
65
50
  this.frame = requestAnimationFrame(() => this.adapt());
66
51
  }
@@ -72,6 +57,10 @@ class Input extends PureComponent {
72
57
  cancelAnimationFrame(this.frame);
73
58
  }
74
59
  }
60
+ static contextType = ControlsHeightContext;
61
+ frame;
62
+ input;
63
+ id = getUID('ring-input-');
75
64
  getId() {
76
65
  return this.props.id || this.id;
77
66
  }
@@ -93,6 +82,24 @@ class Input extends PureComponent {
93
82
  adapt() {
94
83
  this.checkValue();
95
84
  }
85
+ inputRef = el => {
86
+ this.input = el;
87
+ };
88
+ clear = e => {
89
+ this.props.onClear && this.props.onClear(e);
90
+ };
91
+ handleInputChange = e => {
92
+ if (!this.props.multiline) {
93
+ this.props.onChange?.(e);
94
+ this.checkValue();
95
+ }
96
+ };
97
+ handleTextareaChange = e => {
98
+ if (this.props.multiline) {
99
+ this.props.onChange?.(e);
100
+ this.checkValue();
101
+ }
102
+ };
96
103
  render() {
97
104
  const {
98
105
  // Modifiers
@@ -174,16 +181,6 @@ class Input extends PureComponent {
174
181
  }, error));
175
182
  }
176
183
  }
177
- _defineProperty(Input, "defaultProps", {
178
- size: Size.M,
179
- onChange: noop,
180
- inputRef: noop,
181
- enableShortcuts: ['esc'],
182
- translations: {
183
- clear: 'Clear input'
184
- }
185
- });
186
- _defineProperty(Input, "contextType", ControlsHeightContext);
187
184
  Input.propTypes = {
188
185
  value: PropTypes.string,
189
186
  className: PropTypes.string,
@@ -1,4 +1,3 @@
1
- import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
1
  import angular from 'angular';
3
2
  import classNames from 'classnames';
4
3
  import closeIcon from '@jetbrains/icons/close';
@@ -18,6 +17,28 @@ var modules_c40fa551 = {"errorText":"errorText_rui_d15a","clear":"clear_rui_d15a
18
17
 
19
18
  const angularModule = angular.module('Ring.input', [Button]);
20
19
  class RingInputComponent extends RingAngularComponent {
20
+ static require = {
21
+ ngModelCtrl: '?ngModel'
22
+ };
23
+ static bindings = {
24
+ name: '@',
25
+ required: '@',
26
+ ngMinlength: '@',
27
+ ngMaxlength: '@',
28
+ placeholder: '@',
29
+ ngModel: '<',
30
+ onChange: '&',
31
+ label: '@',
32
+ hint: '@',
33
+ size: '@',
34
+ disabled: '@',
35
+ active: '<',
36
+ error: '@',
37
+ empty: '<',
38
+ clearable: '<',
39
+ borderless: '<',
40
+ multiline: '<'
41
+ };
21
42
  $onInit() {
22
43
  this.closeIcon = closeIcon;
23
44
  if (!this.ngModelCtrl) {
@@ -60,30 +81,7 @@ class RingInputComponent extends RingAngularComponent {
60
81
  [modules_88cfaf40.borderless]: this.borderless
61
82
  });
62
83
  }
63
- }
64
- _defineProperty(RingInputComponent, "require", {
65
- ngModelCtrl: '?ngModel'
66
- });
67
- _defineProperty(RingInputComponent, "bindings", {
68
- name: '@',
69
- required: '@',
70
- ngMinlength: '@',
71
- ngMaxlength: '@',
72
- placeholder: '@',
73
- ngModel: '<',
74
- onChange: '&',
75
- label: '@',
76
- hint: '@',
77
- size: '@',
78
- disabled: '@',
79
- active: '<',
80
- error: '@',
81
- empty: '<',
82
- clearable: '<',
83
- borderless: '<',
84
- multiline: '<'
85
- });
86
- _defineProperty(RingInputComponent, "template", `
84
+ static template = `
87
85
  <div
88
86
  data-test="ring-input-container"
89
87
  ng-class="$ctrl.getContainerClasses()"
@@ -138,7 +136,8 @@ _defineProperty(RingInputComponent, "template", `
138
136
 
139
137
  <div ng-if="!$ctrl.borderless && $ctrl.error" class="${modules_88cfaf40.errorText} ${modules_c40fa551.errorText}">{{$ctrl.error}}</div>
140
138
  </div>
141
- `);
139
+ `;
140
+ }
142
141
  RingInputComponent.$inject = ['$element'];
143
142
  angularModule.component('rgInput', RingInputComponent);
144
143
  var InputNg = angularModule.name;
@@ -1,5 +1,4 @@
1
- import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import React, { createContext, Component } from 'react';
1
+ import React, { Component, createContext } from 'react';
3
2
  import { interpolateLinear } from '../global/linear-function.js';
4
3
 
5
4
  const TITLE_RESIZE_END = 20;
@@ -7,28 +6,25 @@ const TITLE_RESIZE_THRESHOLD = 36;
7
6
  const PhaseContext = /*#__PURE__*/createContext(null);
8
7
  const ScrollHandlerContext = /*#__PURE__*/createContext(null);
9
8
  function adaptiveIslandHOC(ComposedComponent) {
10
- var _class;
11
- return _class = class AdaptiveIsland extends Component {
12
- constructor() {
13
- super(...arguments);
14
- _defineProperty(this, "state", {
15
- phase: null
16
- });
17
- _defineProperty(this, "onContentScroll", _ref => {
18
- var _this$state$phase;
19
- let {
20
- scrollTop,
21
- scrollHeight,
22
- clientHeight
23
- } = _ref;
24
- if (scrollHeight - clientHeight >= interpolateLinear(TITLE_RESIZE_THRESHOLD, TITLE_RESIZE_END, (_this$state$phase = this.state.phase) !== null && _this$state$phase !== void 0 ? _this$state$phase : 0)) {
25
- const phase = Math.min(1, scrollTop / TITLE_RESIZE_END);
26
- this.setState({
27
- phase
28
- });
29
- }
30
- });
31
- }
9
+ return class AdaptiveIsland extends Component {
10
+ static propTypes = ComposedComponent.propTypes;
11
+ state = {
12
+ phase: null
13
+ };
14
+ onContentScroll = _ref => {
15
+ var _this$state$phase;
16
+ let {
17
+ scrollTop,
18
+ scrollHeight,
19
+ clientHeight
20
+ } = _ref;
21
+ if (scrollHeight - clientHeight >= interpolateLinear(TITLE_RESIZE_THRESHOLD, TITLE_RESIZE_END, (_this$state$phase = this.state.phase) !== null && _this$state$phase !== void 0 ? _this$state$phase : 0)) {
22
+ const phase = Math.min(1, scrollTop / TITLE_RESIZE_END);
23
+ this.setState({
24
+ phase
25
+ });
26
+ }
27
+ };
32
28
  render() {
33
29
  return /*#__PURE__*/React.createElement(PhaseContext.Provider, {
34
30
  value: this.state.phase
@@ -36,7 +32,7 @@ function adaptiveIslandHOC(ComposedComponent) {
36
32
  value: this.onContentScroll
37
33
  }, /*#__PURE__*/React.createElement(ComposedComponent, this.props)));
38
34
  }
39
- }, _defineProperty(_class, "propTypes", ComposedComponent.propTypes), _class;
35
+ };
40
36
  }
41
37
 
42
38
  export { PhaseContext, ScrollHandlerContext, adaptiveIslandHOC as default };
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { Component, forwardRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -12,55 +12,25 @@ const scheduleScrollAction = scheduleRAF();
12
12
  const noop = () => {};
13
13
  const END_DISTANCE = 16;
14
14
  class Content extends Component {
15
- constructor() {
16
- super(...arguments);
17
- _defineProperty(this, "state", {
18
- scrolledToTop: true,
19
- scrolledToBottom: false
20
- });
21
- _defineProperty(this, "resizeDetector", createResizeDetector({
22
- strategy: 'scroll'
23
- }));
24
- _defineProperty(this, "wrapperNode", void 0);
25
- _defineProperty(this, "setWrapper", node => {
26
- if (!node) {
27
- return;
28
- }
29
- this.wrapperNode = node;
30
- this.resizeDetector.listenTo(node, this.calculateScrollPosition);
31
- });
32
- _defineProperty(this, "calculateScrollPosition", () => scheduleScrollAction(() => {
33
- const {
34
- scrollableNode
35
- } = this;
36
- if (!scrollableNode) {
37
- return;
38
- }
39
- this.props.onScroll(scrollableNode);
40
- const {
41
- scrollTop,
42
- scrollHeight,
43
- offsetHeight
44
- } = scrollableNode;
45
- const scrolledToTop = scrollTop === 0;
46
- const scrolledToBottom = offsetHeight + scrollTop >= scrollHeight - END_DISTANCE;
47
- if (scrolledToBottom) {
48
- this.props.onScrollToBottom?.();
49
- }
50
- this.setState({
51
- scrolledToTop,
52
- scrolledToBottom
53
- });
54
- }));
55
- _defineProperty(this, "scrollableNode", void 0);
56
- _defineProperty(this, "setScrollableNodeAndCalculatePosition", node => {
57
- if (!node) {
58
- return;
59
- }
60
- this.scrollableNode = node;
61
- this.calculateScrollPosition();
62
- });
63
- }
15
+ static propTypes = {
16
+ children: PropTypes.node,
17
+ className: PropTypes.string,
18
+ scrollableWrapperClassName: PropTypes.string,
19
+ fade: PropTypes.bool,
20
+ bottomBorder: PropTypes.bool,
21
+ onScroll: PropTypes.func,
22
+ onScrollToBottom: PropTypes.func
23
+ };
24
+ static defaultProps = {
25
+ fade: true,
26
+ bottomBorder: false,
27
+ onScroll: noop,
28
+ onScrollToBottom: noop
29
+ };
30
+ state = {
31
+ scrolledToTop: true,
32
+ scrolledToBottom: false
33
+ };
64
34
  componentWillUnmount() {
65
35
  this.scrollableNode = null;
66
36
  if (!this.wrapperNode) {
@@ -68,6 +38,48 @@ class Content extends Component {
68
38
  }
69
39
  this.resizeDetector.removeAllListeners(this.wrapperNode);
70
40
  }
41
+ resizeDetector = createResizeDetector({
42
+ strategy: 'scroll'
43
+ });
44
+ wrapperNode;
45
+ setWrapper = node => {
46
+ if (!node) {
47
+ return;
48
+ }
49
+ this.wrapperNode = node;
50
+ this.resizeDetector.listenTo(node, this.calculateScrollPosition);
51
+ };
52
+ calculateScrollPosition = () => scheduleScrollAction(() => {
53
+ const {
54
+ scrollableNode
55
+ } = this;
56
+ if (!scrollableNode) {
57
+ return;
58
+ }
59
+ this.props.onScroll(scrollableNode);
60
+ const {
61
+ scrollTop,
62
+ scrollHeight,
63
+ offsetHeight
64
+ } = scrollableNode;
65
+ const scrolledToTop = scrollTop === 0;
66
+ const scrolledToBottom = offsetHeight + scrollTop >= scrollHeight - END_DISTANCE;
67
+ if (scrolledToBottom) {
68
+ this.props.onScrollToBottom?.();
69
+ }
70
+ this.setState({
71
+ scrolledToTop,
72
+ scrolledToBottom
73
+ });
74
+ });
75
+ scrollableNode;
76
+ setScrollableNodeAndCalculatePosition = node => {
77
+ if (!node) {
78
+ return;
79
+ }
80
+ this.scrollableNode = node;
81
+ this.calculateScrollPosition();
82
+ };
71
83
  render() {
72
84
  const {
73
85
  children,
@@ -106,21 +118,6 @@ class Content extends Component {
106
118
  }, children), !fade && children));
107
119
  }
108
120
  }
109
- _defineProperty(Content, "propTypes", {
110
- children: PropTypes.node,
111
- className: PropTypes.string,
112
- scrollableWrapperClassName: PropTypes.string,
113
- fade: PropTypes.bool,
114
- bottomBorder: PropTypes.bool,
115
- onScroll: PropTypes.func,
116
- onScrollToBottom: PropTypes.func
117
- });
118
- _defineProperty(Content, "defaultProps", {
119
- fade: true,
120
- bottomBorder: false,
121
- onScroll: noop,
122
- onScrollToBottom: noop
123
- });
124
121
  const ContentWrapper = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React.createElement(ScrollHandlerContext.Consumer, null, onScroll => {
125
122
  const addProps = onScroll != null ? {
126
123
  onScroll,
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { Component } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -27,6 +27,16 @@ const End = {
27
27
  };
28
28
  const BORDER_APPEAR_PHASE = 0.5;
29
29
  class Header extends Component {
30
+ static propTypes = {
31
+ children: PropTypes.node,
32
+ className: PropTypes.string,
33
+ border: PropTypes.bool,
34
+ wrapWithTitle: PropTypes.bool,
35
+ phase: PropTypes.number
36
+ };
37
+ static defaultProps = {
38
+ wrapWithTitle: true
39
+ };
30
40
  style(name) {
31
41
  var _this$props$phase;
32
42
  return interpolateLinear(Start[name], End[name], (_this$props$phase = this.props.phase) !== null && _this$props$phase !== void 0 ? _this$props$phase : 0);
@@ -64,16 +74,6 @@ class Header extends Component {
64
74
  }, children), !wrapWithTitle && children);
65
75
  }
66
76
  }
67
- _defineProperty(Header, "propTypes", {
68
- children: PropTypes.node,
69
- className: PropTypes.string,
70
- border: PropTypes.bool,
71
- wrapWithTitle: PropTypes.bool,
72
- phase: PropTypes.number
73
- });
74
- _defineProperty(Header, "defaultProps", {
75
- wrapWithTitle: true
76
- });
77
77
  const HeaderWrapper = props => /*#__PURE__*/React.createElement(PhaseContext.Consumer, null, phase => {
78
78
  const addProps = phase != null ? {
79
79
  phase
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { Component } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -15,6 +15,13 @@ import '../global/schedule-raf.js';
15
15
  * @name Island
16
16
  */
17
17
  class Island extends Component {
18
+ static propTypes = {
19
+ children: PropTypes.node,
20
+ className: PropTypes.string,
21
+ narrow: PropTypes.bool,
22
+ withoutPaddings: PropTypes.bool,
23
+ 'data-test': PropTypes.string
24
+ };
18
25
  render() {
19
26
  const {
20
27
  children,
@@ -34,13 +41,6 @@ class Island extends Component {
34
41
  }), children);
35
42
  }
36
43
  }
37
- _defineProperty(Island, "propTypes", {
38
- children: PropTypes.node,
39
- className: PropTypes.string,
40
- narrow: PropTypes.bool,
41
- withoutPaddings: PropTypes.bool,
42
- 'data-test': PropTypes.string
43
- });
44
44
  const AdaptiveIsland = adaptiveIslandHOC(Island);
45
45
 
46
46
  export { AdaptiveIsland, Island as default };
@@ -1,9 +1,13 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
 
6
6
  class Content extends PureComponent {
7
+ static propTypes = {
8
+ className: PropTypes.string,
9
+ children: PropTypes.node
10
+ };
7
11
  render() {
8
12
  const {
9
13
  children,
@@ -16,9 +20,5 @@ class Content extends PureComponent {
16
20
  }), children);
17
21
  }
18
22
  }
19
- _defineProperty(Content, "propTypes", {
20
- className: PropTypes.string,
21
- children: PropTypes.node
22
- });
23
23
 
24
24
  export { Content as default };
@@ -1,9 +1,13 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
5
5
 
6
6
  class Header extends PureComponent {
7
+ static propTypes = {
8
+ className: PropTypes.string,
9
+ children: PropTypes.node
10
+ };
7
11
  render() {
8
12
  const {
9
13
  children,
@@ -18,9 +22,5 @@ class Header extends PureComponent {
18
22
  }, children));
19
23
  }
20
24
  }
21
- _defineProperty(Header, "propTypes", {
22
- className: PropTypes.string,
23
- children: PropTypes.node
24
- });
25
25
 
26
26
  export { Header as default };
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -6,6 +6,10 @@ export { default as Header } from './header-legacy.js';
6
6
  export { default as Content } from './content-legacy.js';
7
7
 
8
8
  class Island extends PureComponent {
9
+ static propTypes = {
10
+ className: PropTypes.string,
11
+ children: PropTypes.node
12
+ };
9
13
  render() {
10
14
  const {
11
15
  children,
@@ -18,9 +22,5 @@ class Island extends PureComponent {
18
22
  }), children);
19
23
  }
20
24
  }
21
- _defineProperty(Island, "propTypes", {
22
- className: PropTypes.string,
23
- children: PropTypes.node
24
- });
25
25
 
26
26
  export { Island as default };
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { PureComponent } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
 
@@ -6,27 +6,32 @@ const LEFT_BUTTON = 0;
6
6
  // Cmd/Ctrl/Shift/Alt + Click should trigger default browser behaviour. Same applies to non-left clicks
7
7
  const isPlainLeftClick = e => e.button === LEFT_BUTTON && !e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey;
8
8
  class ClickableLink extends PureComponent {
9
- constructor() {
10
- super(...arguments);
11
- _defineProperty(this, "onClick", e => {
12
- const {
13
- onClick,
14
- onConditionalClick,
15
- onPlainLeftClick
16
- } = this.props;
17
- const isPlainLeft = isPlainLeftClick(e);
18
- if (onClick) {
19
- onClick(e);
20
- }
21
- if (onConditionalClick) {
22
- onConditionalClick(isPlainLeft, e);
23
- }
24
- if (onPlainLeftClick && isPlainLeft) {
25
- e.preventDefault();
26
- onPlainLeftClick(e);
27
- }
28
- });
29
- }
9
+ static propTypes = {
10
+ onClick: PropTypes.func,
11
+ onPlainLeftClick: PropTypes.func,
12
+ onConditionalClick: PropTypes.func,
13
+ activeClassName: PropTypes.string,
14
+ href: PropTypes.string.isRequired,
15
+ children: PropTypes.node.isRequired
16
+ };
17
+ onClick = e => {
18
+ const {
19
+ onClick,
20
+ onConditionalClick,
21
+ onPlainLeftClick
22
+ } = this.props;
23
+ const isPlainLeft = isPlainLeftClick(e);
24
+ if (onClick) {
25
+ onClick(e);
26
+ }
27
+ if (onConditionalClick) {
28
+ onConditionalClick(isPlainLeft, e);
29
+ }
30
+ if (onPlainLeftClick && isPlainLeft) {
31
+ e.preventDefault();
32
+ onPlainLeftClick(e);
33
+ }
34
+ };
30
35
  render() {
31
36
  const {
32
37
  onConditionalClick,
@@ -43,13 +48,5 @@ class ClickableLink extends PureComponent {
43
48
  }), children);
44
49
  }
45
50
  }
46
- _defineProperty(ClickableLink, "propTypes", {
47
- onClick: PropTypes.func,
48
- onPlainLeftClick: PropTypes.func,
49
- onConditionalClick: PropTypes.func,
50
- activeClassName: PropTypes.string,
51
- href: PropTypes.string.isRequired,
52
- children: PropTypes.node.isRequired
53
- });
54
51
 
55
52
  export { ClickableLink as default };
package/dist/link/link.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import 'focus-visible';
3
3
  import React, { PureComponent, memo } from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -33,9 +33,21 @@ const makeWrapText = memoize(innerClassName => {
33
33
  return /*#__PURE__*/memo(WrapText);
34
34
  });
35
35
  function linkHOC(ComposedComponent) {
36
- var _class;
37
36
  const isCustom = typeof ComposedComponent !== 'string' && ComposedComponent !== ClickableLink;
38
- return _class = class Link extends PureComponent {
37
+ return class Link extends PureComponent {
38
+ static propTypes = {
39
+ className: PropTypes.string,
40
+ innerClassName: PropTypes.string,
41
+ active: PropTypes.bool,
42
+ inherit: PropTypes.bool,
43
+ pseudo: PropTypes.bool,
44
+ hover: PropTypes.bool,
45
+ children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
46
+ 'data-test': PropTypes.string,
47
+ href: PropTypes.string,
48
+ onPlainLeftClick: PropTypes.func,
49
+ onClick: PropTypes.func
50
+ };
39
51
  getChildren() {
40
52
  const {
41
53
  children,
@@ -92,19 +104,7 @@ function linkHOC(ComposedComponent) {
92
104
  "data-test": joinDataTestAttributes('ring-link', dataTest)
93
105
  }), this.getChildren());
94
106
  }
95
- }, _defineProperty(_class, "propTypes", {
96
- className: PropTypes.string,
97
- innerClassName: PropTypes.string,
98
- active: PropTypes.bool,
99
- inherit: PropTypes.bool,
100
- pseudo: PropTypes.bool,
101
- hover: PropTypes.bool,
102
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
103
- 'data-test': PropTypes.string,
104
- href: PropTypes.string,
105
- onPlainLeftClick: PropTypes.func,
106
- onClick: PropTypes.func
107
- }), _class;
107
+ };
108
108
  }
109
109
  var Link = linkHOC(ClickableLink);
110
110