@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 { createPortal } from 'react-dom';
4
4
  import PropTypes from 'prop-types';
@@ -42,37 +42,45 @@ import 'scrollbar-width';
42
42
  */
43
43
  function noop() {}
44
44
  class Dialog extends PureComponent {
45
- constructor() {
46
- super(...arguments);
47
- _defineProperty(this, "state", {
48
- shortcutsScope: getUID('ring-dialog-')
49
- });
50
- _defineProperty(this, "scrollPreventer", preventerFactory(getUID('preventer-')));
51
- _defineProperty(this, "uid", getUID('dialog-'));
52
- _defineProperty(this, "handleClick", event => {
53
- this.props.onOverlayClick(event);
54
- this.props.onCloseAttempt(event);
55
- });
56
- _defineProperty(this, "onCloseClick", event => {
57
- this.props.onCloseClick(event);
58
- this.props.onCloseAttempt(event);
59
- });
60
- _defineProperty(this, "getShortcutsMap", () => {
61
- const onEscape = event => {
62
- if (this.props.show) {
63
- this.props.onEscPress(event);
64
- this.props.onCloseAttempt(event);
65
- }
66
- };
67
- return {
68
- esc: onEscape
69
- };
70
- });
71
- _defineProperty(this, "dialog", void 0);
72
- _defineProperty(this, "dialogRef", tabTrap => {
73
- this.dialog = tabTrap && tabTrap.node;
74
- });
75
- }
45
+ static propTypes = {
46
+ label: PropTypes.string,
47
+ className: PropTypes.string,
48
+ contentClassName: PropTypes.string,
49
+ children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
50
+ show: PropTypes.bool.isRequired,
51
+ showCloseButton: PropTypes.bool,
52
+ closeButtonInside: PropTypes.bool,
53
+ closeButtonTitle: PropTypes.string,
54
+ onOverlayClick: PropTypes.func,
55
+ onEscPress: PropTypes.func,
56
+ onCloseClick: PropTypes.func,
57
+ shortcutOptions: PropTypes.object,
58
+ // onCloseAttempt is a common callback for ESC pressing and overlay clicking.
59
+ // Use it if you don't need different behaviors for this cases.
60
+ onCloseAttempt: PropTypes.func,
61
+ // focusTrap may break popups inside dialog, so use it carefully
62
+ trapFocus: PropTypes.bool,
63
+ portalTarget: PropTypes.instanceOf(HTMLElement),
64
+ autoFocusFirst: PropTypes.bool,
65
+ 'data-test': PropTypes.string
66
+ };
67
+ static defaultProps = {
68
+ label: 'Dialog',
69
+ onOverlayClick: noop,
70
+ onEscPress: noop,
71
+ onCloseClick: noop,
72
+ onCloseAttempt: noop,
73
+ showCloseButton: false,
74
+ closeButtonInside: false,
75
+ shortcutOptions: {
76
+ modal: false
77
+ },
78
+ trapFocus: false,
79
+ autoFocusFirst: true
80
+ };
81
+ state = {
82
+ shortcutsScope: getUID('ring-dialog-')
83
+ };
76
84
  componentDidMount() {
77
85
  this.toggleScrollPreventer();
78
86
  }
@@ -84,6 +92,8 @@ class Dialog extends PureComponent {
84
92
  componentWillUnmount() {
85
93
  this.scrollPreventer.reset();
86
94
  }
95
+ scrollPreventer = preventerFactory(getUID('preventer-'));
96
+ uid = getUID('dialog-');
87
97
  toggleScrollPreventer() {
88
98
  if (this.props.show) {
89
99
  this.scrollPreventer.prevent();
@@ -91,6 +101,29 @@ class Dialog extends PureComponent {
91
101
  this.scrollPreventer.reset();
92
102
  }
93
103
  }
104
+ handleClick = event => {
105
+ this.props.onOverlayClick(event);
106
+ this.props.onCloseAttempt(event);
107
+ };
108
+ onCloseClick = event => {
109
+ this.props.onCloseClick(event);
110
+ this.props.onCloseAttempt(event);
111
+ };
112
+ getShortcutsMap = () => {
113
+ const onEscape = event => {
114
+ if (this.props.show) {
115
+ this.props.onEscPress(event);
116
+ this.props.onCloseAttempt(event);
117
+ }
118
+ };
119
+ return {
120
+ esc: onEscape
121
+ };
122
+ };
123
+ dialog;
124
+ dialogRef = tabTrap => {
125
+ this.dialog = tabTrap && tabTrap.node;
126
+ };
94
127
  render() {
95
128
  const {
96
129
  show,
@@ -109,6 +142,7 @@ class Dialog extends PureComponent {
109
142
  label,
110
143
  closeButtonTitle,
111
144
  dense,
145
+ shortcutOptions,
112
146
  ...restProps
113
147
  } = this.props;
114
148
  const classes = classNames(modules_5e9b8c03.container, className);
@@ -124,7 +158,8 @@ class Dialog extends PureComponent {
124
158
  role: "presentation"
125
159
  }, restProps), /*#__PURE__*/React.createElement(Shortcuts, {
126
160
  map: shortcutsMap,
127
- scope: this.state.shortcutsScope
161
+ scope: this.state.shortcutsScope,
162
+ options: this.props.shortcutOptions
128
163
  }), (onOverlayClick !== noop || onCloseAttempt !== noop) && /*#__PURE__*/React.createElement("div", {
129
164
  // click handler is duplicated in close button
130
165
  role: "presentation",
@@ -153,37 +188,5 @@ class Dialog extends PureComponent {
153
188
  }))), target)), portalTarget instanceof HTMLElement ? portalTarget : document.body);
154
189
  }
155
190
  }
156
- _defineProperty(Dialog, "propTypes", {
157
- label: PropTypes.string,
158
- className: PropTypes.string,
159
- contentClassName: PropTypes.string,
160
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
161
- show: PropTypes.bool.isRequired,
162
- showCloseButton: PropTypes.bool,
163
- closeButtonInside: PropTypes.bool,
164
- closeButtonTitle: PropTypes.string,
165
- onOverlayClick: PropTypes.func,
166
- onEscPress: PropTypes.func,
167
- onCloseClick: PropTypes.func,
168
- // onCloseAttempt is a common callback for ESC pressing and overlay clicking.
169
- // Use it if you don't need different behaviors for this cases.
170
- onCloseAttempt: PropTypes.func,
171
- // focusTrap may break popups inside dialog, so use it carefully
172
- trapFocus: PropTypes.bool,
173
- portalTarget: PropTypes.instanceOf(HTMLElement),
174
- autoFocusFirst: PropTypes.bool,
175
- 'data-test': PropTypes.string
176
- });
177
- _defineProperty(Dialog, "defaultProps", {
178
- label: 'Dialog',
179
- onOverlayClick: noop,
180
- onEscPress: noop,
181
- onCloseClick: noop,
182
- onCloseAttempt: noop,
183
- showCloseButton: false,
184
- closeButtonInside: false,
185
- trapFocus: false,
186
- autoFocusFirst: true
187
- });
188
191
 
189
192
  export { Dialog as default };
@@ -1,4 +1,3 @@
1
- import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
1
  import angular from 'angular';
3
2
  import { createFocusTrap } from 'focus-trap';
4
3
  import { getStyles, getRect } from '../global/dom.js';
@@ -36,21 +35,6 @@ const angularModule = angular.module('Ring.dialog', [Button, PromisedClick, rgCo
36
35
  class DialogController extends RingAngularComponent {
37
36
  constructor() {
38
37
  super(...arguments);
39
- _defineProperty(this, "hide", () => {
40
- if (!this.inSidebar) {
41
- this.scrollPreventer.reset();
42
- }
43
- this.active = false;
44
- this.content = '';
45
- this.focusTrap.deactivate();
46
- Reflect.deleteProperty(this, 'DIALOG_NAMESPACE');
47
- if (shortcuts.indexOfScope(this.dialogService.DIALOG_NAMESPACE) > -1) {
48
- shortcuts.setScope(this.currentShortcutsScope);
49
- }
50
- this._resetFormState();
51
- this.$inject.$scope.$broadcast('dialog.hide');
52
- });
53
- _defineProperty(this, "serverErrorFields", []);
54
38
  this.styles = modules_b378ce5a;
55
39
  this.dialogStyles = modules_5e9b8c03;
56
40
  this.islandStyles = modules_e6a056e1;
@@ -189,6 +173,20 @@ class DialogController extends RingAngularComponent {
189
173
  Object.assign(this.data, config.data);
190
174
  Object.assign(this.buttons, config.buttons);
191
175
  }
176
+ hide = () => {
177
+ if (!this.inSidebar) {
178
+ this.scrollPreventer.reset();
179
+ }
180
+ this.active = false;
181
+ this.content = '';
182
+ this.focusTrap.deactivate();
183
+ Reflect.deleteProperty(this, 'DIALOG_NAMESPACE');
184
+ if (shortcuts.indexOfScope(this.dialogService.DIALOG_NAMESPACE) > -1) {
185
+ shortcuts.setScope(this.currentShortcutsScope);
186
+ }
187
+ this._resetFormState();
188
+ this.$inject.$scope.$broadcast('dialog.hide');
189
+ };
192
190
  _resetFormState() {
193
191
  const dialogForm = this.dialogForm;
194
192
  if (!dialogForm) {
@@ -223,6 +221,7 @@ class DialogController extends RingAngularComponent {
223
221
  }
224
222
  return null;
225
223
  }
224
+ serverErrorFields = [];
226
225
  action(button) {
227
226
  if (button.inProgress) {
228
227
  return undefined;
@@ -284,15 +283,12 @@ class DialogController extends RingAngularComponent {
284
283
  DialogController.$inject = [];
285
284
  DialogController.$inject = ['$scope', '$q', 'dialog', '$element', 'dialogInSidebar', '$compile', '$injector', '$controller', 'rgCompiler', '$sce'];
286
285
  class DialogService extends RingAngularComponent {
286
+ DIALOG_NAMESPACE = 'ring-dialog';
287
+ fallbackDialog = null;
287
288
  constructor() {
288
289
  super(...arguments);
289
290
 
290
291
  // Binding proxy methods to a service instance
291
- _defineProperty(this, "DIALOG_NAMESPACE", 'ring-dialog');
292
- _defineProperty(this, "fallbackDialog", null);
293
- _defineProperty(this, "unregister", () => {
294
- Reflect.deleteProperty(this, 'ctrl');
295
- });
296
292
  ['show', 'hide', 'update', 'done', 'reset'].forEach(key => {
297
293
  this[key] = function methodWrapper() {
298
294
  if (this.ctrl) {
@@ -309,13 +305,16 @@ class DialogService extends RingAngularComponent {
309
305
  register(ctrl) {
310
306
  this.ctrl = ctrl;
311
307
  }
308
+ unregister = () => {
309
+ Reflect.deleteProperty(this, 'ctrl');
310
+ };
312
311
  }
313
312
  DialogService.$inject = [];
314
313
  DialogService.$inject = ['$log'];
315
314
  class DialogInSidebarService extends DialogService {
315
+ DIALOG_NAMESPACE = 'ring-dialog-in-sidebar';
316
316
  constructor() {
317
317
  super(...arguments);
318
- _defineProperty(this, "DIALOG_NAMESPACE", 'ring-dialog-in-sidebar');
319
318
  this.fallbackDialog = this.$inject.dialog;
320
319
  }
321
320
  }
@@ -1,7 +1,6 @@
1
1
  import angular from 'angular';
2
2
  import scheduleRAF from '../global/schedule-raf.js';
3
3
  import { getDocumentScrollTop, getWindowHeight } from '../global/dom.js';
4
- import '../_helpers/_rollupPluginBabelHelpers.js';
5
4
 
6
5
  var modules_655b40c7 = {"unit":"i__const_unit_0","light":"light_rui_f45d","dockedPanel":"dockedPanel_rui_f45d","fixed":"fixed_rui_f45d"};
7
6
 
@@ -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, cloneElement } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import classNames from 'classnames';
@@ -22,82 +22,112 @@ import '../_helpers/button__classes.js';
22
22
  * @name Dropdown
23
23
  */
24
24
  class Dropdown extends Component {
25
- constructor() {
26
- super(...arguments);
27
- _defineProperty(this, "state", {
28
- show: this.props.initShown,
29
- pinned: false
30
- });
31
- _defineProperty(this, "onClick", () => {
32
- if (this.props.disabled) {
33
- return;
34
- }
35
- const {
36
- show,
37
- pinned
38
- } = this.state;
39
- let nextPinned = pinned;
40
- if (this.props.hoverMode) {
41
- if (!pinned) {
42
- nextPinned = true;
43
- if (show) {
44
- this.setState({
45
- pinned: true
46
- });
47
- return;
48
- }
49
- } else {
50
- nextPinned = false;
25
+ static propTypes = {
26
+ /**
27
+ * Can be string, React element, or a function accepting an object with {active, pinned} properties and returning a React element
28
+ * React element should render some interactive HTML element like `button` or `a`
29
+ */
30
+ anchor: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
31
+ children: PropTypes.oneOfType([PropTypes.element, PropTypes.func]).isRequired,
32
+ initShown: PropTypes.bool,
33
+ className: PropTypes.string,
34
+ activeClassName: PropTypes.string,
35
+ clickMode: PropTypes.bool,
36
+ hoverMode: PropTypes.bool,
37
+ hoverShowTimeOut: PropTypes.number,
38
+ hoverHideTimeOut: PropTypes.number,
39
+ disabled: PropTypes.bool,
40
+ onShow: PropTypes.func,
41
+ onHide: PropTypes.func,
42
+ onMouseEnter: PropTypes.func,
43
+ onMouseLeave: PropTypes.func,
44
+ 'data-test': PropTypes.string
45
+ };
46
+ static defaultProps = {
47
+ initShown: false,
48
+ clickMode: true,
49
+ hoverMode: false,
50
+ hoverShowTimeOut: 300,
51
+ hoverHideTimeOut: 600,
52
+ disabled: false,
53
+ onShow: () => {},
54
+ onHide: () => {},
55
+ onMouseEnter: () => {},
56
+ onMouseLeave: () => {}
57
+ };
58
+ state = {
59
+ show: this.props.initShown,
60
+ pinned: false
61
+ };
62
+ onClick = () => {
63
+ if (this.props.disabled) {
64
+ return;
65
+ }
66
+ const {
67
+ show,
68
+ pinned
69
+ } = this.state;
70
+ let nextPinned = pinned;
71
+ if (this.props.hoverMode) {
72
+ if (!pinned) {
73
+ nextPinned = true;
74
+ if (show) {
75
+ this.setState({
76
+ pinned: true
77
+ });
78
+ return;
51
79
  }
52
- }
53
- this._toggle(!show, nextPinned);
54
- });
55
- _defineProperty(this, "onChildCloseAttempt", () => {
56
- let nextPinned = this.state.pinned;
57
- if (this.props.hoverMode) {
80
+ } else {
58
81
  nextPinned = false;
59
82
  }
60
- this._toggle(false, nextPinned);
61
- });
62
- _defineProperty(this, "hoverTimer", void 0);
63
- _defineProperty(this, "onMouseEnter", event => {
64
- if (this.props.disabled) {
65
- return;
66
- }
67
- this._clearTimer();
68
- this.props.onMouseEnter?.(event);
69
- this.hoverTimer = window.setTimeout(() => {
70
- if (!this.state.show) {
71
- this._toggle(true);
72
- }
73
- }, this.props.hoverShowTimeOut);
74
- });
75
- _defineProperty(this, "onMouseLeave", event => {
76
- if (this.props.disabled) {
77
- return;
83
+ }
84
+ this._toggle(!show, nextPinned);
85
+ };
86
+ onChildCloseAttempt = () => {
87
+ let nextPinned = this.state.pinned;
88
+ if (this.props.hoverMode) {
89
+ nextPinned = false;
90
+ }
91
+ this._toggle(false, nextPinned);
92
+ };
93
+ hoverTimer;
94
+ onMouseEnter = event => {
95
+ if (this.props.disabled) {
96
+ return;
97
+ }
98
+ this._clearTimer();
99
+ this.props.onMouseEnter?.(event);
100
+ this.hoverTimer = window.setTimeout(() => {
101
+ if (!this.state.show) {
102
+ this._toggle(true);
78
103
  }
79
- this.props.onMouseLeave?.(event);
80
- if (this.state.pinned) {
81
- return;
104
+ }, this.props.hoverShowTimeOut);
105
+ };
106
+ onMouseLeave = event => {
107
+ if (this.props.disabled) {
108
+ return;
109
+ }
110
+ this.props.onMouseLeave?.(event);
111
+ if (this.state.pinned) {
112
+ return;
113
+ }
114
+ this._clearTimer();
115
+ this.hoverTimer = window.setTimeout(() => {
116
+ if (this.state.show) {
117
+ this._toggle(false);
82
118
  }
83
- this._clearTimer();
84
- this.hoverTimer = window.setTimeout(() => {
85
- if (this.state.show) {
86
- this._toggle(false);
87
- }
88
- }, this.props.hoverHideTimeOut);
89
- });
90
- _defineProperty(this, "handlePopupInteraction", () => {
91
- this.setState(_ref => {
92
- let {
93
- pinned
94
- } = _ref;
95
- return pinned ? null : {
96
- pinned: true
97
- };
98
- });
119
+ }, this.props.hoverHideTimeOut);
120
+ };
121
+ handlePopupInteraction = () => {
122
+ this.setState(_ref => {
123
+ let {
124
+ pinned
125
+ } = _ref;
126
+ return pinned ? null : {
127
+ pinned: true
128
+ };
99
129
  });
100
- }
130
+ };
101
131
  toggle() {
102
132
  let show = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.state.show;
103
133
  this._toggle(show);
@@ -182,38 +212,5 @@ class Dropdown extends Component {
182
212
  }), anchorElement, typeof children === 'function' ? children(childProps) : /*#__PURE__*/cloneElement(children, childProps));
183
213
  }
184
214
  }
185
- _defineProperty(Dropdown, "propTypes", {
186
- /**
187
- * Can be string, React element, or a function accepting an object with {active, pinned} properties and returning a React element
188
- * React element should render some interactive HTML element like `button` or `a`
189
- */
190
- anchor: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
191
- children: PropTypes.oneOfType([PropTypes.element, PropTypes.func]).isRequired,
192
- initShown: PropTypes.bool,
193
- className: PropTypes.string,
194
- activeClassName: PropTypes.string,
195
- clickMode: PropTypes.bool,
196
- hoverMode: PropTypes.bool,
197
- hoverShowTimeOut: PropTypes.number,
198
- hoverHideTimeOut: PropTypes.number,
199
- disabled: PropTypes.bool,
200
- onShow: PropTypes.func,
201
- onHide: PropTypes.func,
202
- onMouseEnter: PropTypes.func,
203
- onMouseLeave: PropTypes.func,
204
- 'data-test': PropTypes.string
205
- });
206
- _defineProperty(Dropdown, "defaultProps", {
207
- initShown: false,
208
- clickMode: true,
209
- hoverMode: false,
210
- hoverShowTimeOut: 300,
211
- hoverHideTimeOut: 600,
212
- disabled: false,
213
- onShow: () => {},
214
- onHide: () => {},
215
- onMouseEnter: () => {},
216
- onMouseLeave: () => {}
217
- });
218
215
 
219
216
  export { Anchor, Dropdown as default };
@@ -1,4 +1,4 @@
1
- import { a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React, { useMemo, cloneElement } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import List, { ActiveItemContext } from '../list/list.js';
@@ -1,4 +1,4 @@
1
- import { a as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import React from 'react';
3
3
  import classNames from 'classnames';
4
4
  import Heading, { Levels } from '../heading/heading.js';
@@ -1,4 +1,3 @@
1
- import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
1
  import React, { PureComponent, Children, cloneElement } from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import classNames from 'classnames';
@@ -15,6 +14,7 @@ import '../global/sniffer.js';
15
14
  import 'sniffr';
16
15
  import '../global/data-tests.js';
17
16
  import '../tab-trap/tab-trap.js';
17
+ import '../_helpers/_rollupPluginBabelHelpers.js';
18
18
  import '../popup/position.js';
19
19
  import '../popup/popup.target.js';
20
20
 
@@ -24,6 +24,11 @@ var modules_ee284100 = {"unit":"i__const_unit_0","light":"light_rui_b075","error
24
24
  * @name Error Bubble
25
25
  */
26
26
  class ErrorBubble extends PureComponent {
27
+ static propTypes = {
28
+ error: PropTypes.string,
29
+ className: PropTypes.string,
30
+ children: PropTypes.node
31
+ };
27
32
  render() {
28
33
  const {
29
34
  children,
@@ -48,10 +53,5 @@ class ErrorBubble extends PureComponent {
48
53
  }, restProps.error)));
49
54
  }
50
55
  }
51
- _defineProperty(ErrorBubble, "propTypes", {
52
- error: PropTypes.string,
53
- className: PropTypes.string,
54
- children: PropTypes.node
55
- });
56
56
 
57
57
  export { ErrorBubble as default };
@@ -1,4 +1,3 @@
1
- import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
1
  import React, { Component } from 'react';
3
2
  import PropTypes from 'prop-types';
4
3
  import classNames from 'classnames';
@@ -6,6 +5,7 @@ import Icon from '../icon/icon.js';
6
5
  import { Size } from '../icon/icon__constants.js';
7
6
  import joinDataTestAttributes from '../global/data-tests.js';
8
7
  import { m as modules_2c5e8509 } from '../_helpers/error-message.js';
8
+ import '../_helpers/_rollupPluginBabelHelpers.js';
9
9
  import 'util-deprecate';
10
10
  import '../_helpers/icon.js';
11
11
  import '../icon/icon__svg.js';
@@ -15,6 +15,15 @@ import '../global/memoize.js';
15
15
  * @name Error Message
16
16
  */
17
17
  class ErrorMessage extends Component {
18
+ static propTypes = {
19
+ icon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
20
+ code: PropTypes.string,
21
+ message: PropTypes.string,
22
+ description: PropTypes.string,
23
+ children: PropTypes.node,
24
+ className: PropTypes.string,
25
+ 'data-test': PropTypes.string
26
+ };
18
27
  render() {
19
28
  const {
20
29
  className,
@@ -43,14 +52,5 @@ class ErrorMessage extends Component {
43
52
  }, description), children));
44
53
  }
45
54
  }
46
- _defineProperty(ErrorMessage, "propTypes", {
47
- icon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
48
- code: PropTypes.string,
49
- message: PropTypes.string,
50
- description: PropTypes.string,
51
- children: PropTypes.node,
52
- className: PropTypes.string,
53
- 'data-test': PropTypes.string
54
- });
55
55
 
56
56
  export { ErrorMessage as default };
@@ -4,7 +4,6 @@ import LinkModule from '../link-ng/link-ng.js';
4
4
  import { m as modules_2c5e8509 } from '../_helpers/error-message.js';
5
5
  import '../icon/icon__constants.js';
6
6
  import '../template-ng/template-ng.js';
7
- import '../_helpers/_rollupPluginBabelHelpers.js';
8
7
  import '../global/ring-angular-component.js';
9
8
  import '../_helpers/icon.js';
10
9
  import '../_helpers/link.js';
@@ -1,4 +1,3 @@
1
- import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
1
  import angular from 'angular';
3
2
  import RingAngularComponent from '../global/ring-angular-component.js';
4
3
  import { m as modules_7385b3fd, c as copyright } from '../_helpers/footer.js';
@@ -6,6 +5,7 @@ import 'react';
6
5
  import 'prop-types';
7
6
  import 'classnames';
8
7
  import '../link/link.js';
8
+ import '../_helpers/_rollupPluginBabelHelpers.js';
9
9
  import 'focus-visible';
10
10
  import '../global/memoize.js';
11
11
  import '../global/data-tests.js';
@@ -18,17 +18,13 @@ import '../_helpers/link.js';
18
18
 
19
19
  const angularModule = angular.module('Ring.footer', []);
20
20
  class rgFooterComponent extends RingAngularComponent {
21
- constructor() {
22
- super(...arguments);
23
- _defineProperty(this, "styles", modules_7385b3fd);
24
- }
25
- }
26
- _defineProperty(rgFooterComponent, "transclude", {
27
- left: '?rgFooterLeft',
28
- center: '?rgFooterCenter',
29
- right: '?rgFooterRight'
30
- });
31
- _defineProperty(rgFooterComponent, "template", `<footer ng-class=":: $ctrl.styles.footer" data-test="ring-footer">
21
+ styles = modules_7385b3fd;
22
+ static transclude = {
23
+ left: '?rgFooterLeft',
24
+ center: '?rgFooterCenter',
25
+ right: '?rgFooterRight'
26
+ };
27
+ static template = `<footer ng-class=":: $ctrl.styles.footer" data-test="ring-footer">
32
28
  <div ng-class=":: $ctrl.styles.columnLeft">
33
29
  <div ng-transclude="left" ng-class=":: $ctrl.styles.columnItem"></div>
34
30
  </div>
@@ -40,20 +36,22 @@ _defineProperty(rgFooterComponent, "template", `<footer ng-class=":: $ctrl.style
40
36
  <div ng-class=":: $ctrl.styles.columnRight">
41
37
  <div ng-transclude="right" ng-class=":: $ctrl.styles.columnItem"></div>
42
38
  </div>
43
- </footer>`);
44
- class rgFooterLineComponent extends RingAngularComponent {}
45
- _defineProperty(rgFooterLineComponent, "transclude", true);
46
- _defineProperty(rgFooterLineComponent, "template", `<div class="${modules_7385b3fd.line}" ng-transclude></div>`);
39
+ </footer>`;
40
+ }
41
+ class rgFooterLineComponent extends RingAngularComponent {
42
+ static transclude = true;
43
+ static template = `<div class="${modules_7385b3fd.line}" ng-transclude></div>`;
44
+ }
47
45
  class rgFooterCopyrightComponent extends RingAngularComponent {
46
+ static template = '<span>{{:: $ctrl.copyrightYears}} {{:: $ctrl.companyName}}</span>';
47
+ static bindings = {
48
+ year: '@',
49
+ companyName: '@'
50
+ };
48
51
  $onInit() {
49
52
  this.copyrightYears = copyright(this.year);
50
53
  }
51
54
  }
52
- _defineProperty(rgFooterCopyrightComponent, "template", '<span>{{:: $ctrl.copyrightYears}} {{:: $ctrl.companyName}}</span>');
53
- _defineProperty(rgFooterCopyrightComponent, "bindings", {
54
- year: '@',
55
- companyName: '@'
56
- });
57
55
  angularModule.component('rgFooter', rgFooterComponent);
58
56
  angularModule.component('rgFooterLine', rgFooterLineComponent);
59
57
  angularModule.component('rgFooterCopyright', rgFooterCopyrightComponent);