@jetbrains/ring-ui 5.0.156 → 5.0.158

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 (304) hide show
  1. package/components/control-label/control-label.css +1 -1
  2. package/components/control-label/control-label.d.ts +1 -1
  3. package/components/control-label/control-label.js +2 -2
  4. package/components/select/select__popup.d.ts +36 -0
  5. package/components/select/select__popup.js +7 -1
  6. package/dist/_helpers/_rollupPluginBabelHelpers.js +642 -1
  7. package/dist/_helpers/anchor.js +6 -7
  8. package/dist/_helpers/button__classes.js +16 -28
  9. package/dist/_helpers/card.js +107 -95
  10. package/dist/_helpers/control-label.js +1 -1
  11. package/dist/_helpers/dialog__body-scroll-preventer.js +20 -11
  12. package/dist/_helpers/footer.js +29 -34
  13. package/dist/_helpers/query-assist__suggestions.js +91 -74
  14. package/dist/_helpers/select__filter.js +71 -48
  15. package/dist/_helpers/services-link.js +41 -29
  16. package/dist/_helpers/sidebar.js +103 -99
  17. package/dist/_helpers/theme.js +42 -35
  18. package/dist/_helpers/title.js +71 -57
  19. package/dist/alert/alert.js +199 -158
  20. package/dist/alert/container.js +43 -32
  21. package/dist/alert-service/alert-service.js +172 -104
  22. package/dist/analytics/analytics.js +92 -68
  23. package/dist/analytics/analytics__custom-plugin.js +84 -60
  24. package/dist/analytics/analytics__fus-plugin.js +28 -15
  25. package/dist/analytics/analytics__ga-plugin.js +60 -43
  26. package/dist/analytics/analytics__plugin-utils.js +28 -22
  27. package/dist/auth/auth.js +36 -4
  28. package/dist/auth/auth__core.js +1458 -732
  29. package/dist/auth/background-flow.js +129 -87
  30. package/dist/auth/down-notification.js +75 -30
  31. package/dist/auth/iframe-flow.js +136 -75
  32. package/dist/auth/landing.js +90 -30
  33. package/dist/auth/request-builder.js +82 -46
  34. package/dist/auth/response-parser.js +119 -86
  35. package/dist/auth/storage.js +333 -171
  36. package/dist/auth/token-validator.js +244 -137
  37. package/dist/auth/window-flow.js +136 -92
  38. package/dist/auth-dialog/auth-dialog.js +176 -114
  39. package/dist/auth-dialog-service/auth-dialog-service.js +32 -7
  40. package/dist/auth-ng/auth-ng.js +70 -34
  41. package/dist/auth-ng/auth-ng.mock.js +6 -6
  42. package/dist/autofocus-ng/autofocus-ng.js +23 -8
  43. package/dist/avatar/avatar-example-datauri.js +1 -23
  44. package/dist/avatar/avatar.js +155 -119
  45. package/dist/avatar/fallback-avatar.js +41 -22
  46. package/dist/avatar-editor-ng/avatar-editor-ng.js +56 -23
  47. package/dist/avatar-editor-ng/avatar-editor-ng__template.js +1 -28
  48. package/dist/avatar-ng/avatar-ng.js +23 -1
  49. package/dist/badge/badge.js +43 -35
  50. package/dist/badge-ng/badge-ng.js +13 -1
  51. package/dist/breadcrumb-ng/breadcrumb-ng.js +15 -29
  52. package/dist/button/button.js +111 -87
  53. package/dist/button/button__classes.js +1 -0
  54. package/dist/button-group/button-group.js +35 -19
  55. package/dist/button-group/caption.js +22 -14
  56. package/dist/button-group-ng/button-group-ng.js +13 -7
  57. package/dist/button-ng/button-ng.js +154 -133
  58. package/dist/button-set/button-set.js +34 -20
  59. package/dist/button-set-ng/button-set-ng.js +2 -2
  60. package/dist/button-toolbar/button-toolbar.js +33 -19
  61. package/dist/button-toolbar-ng/button-toolbar-ng.js +5 -3
  62. package/dist/caret/caret.js +225 -188
  63. package/dist/checkbox/checkbox.js +104 -76
  64. package/dist/checkbox-ng/checkbox-ng.js +18 -27
  65. package/dist/clipboard/clipboard-fallback.js +10 -10
  66. package/dist/clipboard/clipboard.js +131 -34
  67. package/dist/code/code.js +168 -92
  68. package/dist/compiler-ng/compiler-ng.js +18 -15
  69. package/dist/confirm/confirm.js +108 -66
  70. package/dist/confirm-ng/confirm-ng.js +33 -4
  71. package/dist/confirm-service/confirm-service.js +66 -42
  72. package/dist/content-layout/content-layout.js +64 -43
  73. package/dist/content-layout/sidebar.js +1 -0
  74. package/dist/contenteditable/contenteditable.js +61 -50
  75. package/dist/control-label/control-label.d.ts +1 -1
  76. package/dist/control-label/control-label.js +12 -16
  77. package/dist/data-list/data-list.js +184 -128
  78. package/dist/data-list/data-list.mock.js +11 -2
  79. package/dist/data-list/item.js +174 -143
  80. package/dist/data-list/selection.js +139 -76
  81. package/dist/data-list/title.js +13 -1
  82. package/dist/data-list-ng/data-list-ng.js +31 -1
  83. package/dist/date-picker/consts.js +18 -15
  84. package/dist/date-picker/date-input.js +147 -115
  85. package/dist/date-picker/date-picker.js +285 -228
  86. package/dist/date-picker/date-popup.js +397 -356
  87. package/dist/date-picker/day.js +98 -84
  88. package/dist/date-picker/month-names.js +64 -43
  89. package/dist/date-picker/month-slider.js +74 -51
  90. package/dist/date-picker/month.js +21 -15
  91. package/dist/date-picker/months.js +48 -43
  92. package/dist/date-picker/weekdays.js +18 -12
  93. package/dist/date-picker/years.js +109 -84
  94. package/dist/dialog/dialog.js +189 -141
  95. package/dist/dialog/dialog__body-scroll-preventer.js +5 -0
  96. package/dist/dialog-ng/dialog-ng.js +401 -287
  97. package/dist/dialog-ng/dialog-ng__template.js +1 -70
  98. package/dist/docked-panel-ng/docked-panel-ng.js +33 -18
  99. package/dist/dropdown/anchor.js +10 -0
  100. package/dist/dropdown/dropdown.js +214 -182
  101. package/dist/dropdown-menu/dropdown-menu.js +102 -72
  102. package/dist/editable-heading/editable-heading.js +100 -58
  103. package/dist/error-bubble/error-bubble.js +64 -31
  104. package/dist/error-message/error-message.js +61 -38
  105. package/dist/error-message-ng/error-message-ng.js +11 -22
  106. package/dist/footer/footer.js +11 -1
  107. package/dist/footer-ng/footer-ng.js +64 -36
  108. package/dist/form-ng/form-ng.js +66 -56
  109. package/dist/global/angular-component-factory.js +76 -53
  110. package/dist/global/compose.js +10 -1
  111. package/dist/global/composeRefs.js +12 -7
  112. package/dist/global/controls-height.js +2 -2
  113. package/dist/global/create-stateful-context.js +19 -19
  114. package/dist/global/data-tests.js +15 -7
  115. package/dist/global/dom.js +95 -53
  116. package/dist/global/focus-sensor-hoc.js +134 -122
  117. package/dist/global/fuzzy-highlight.js +41 -27
  118. package/dist/global/get-event-key.js +8 -8
  119. package/dist/global/get-uid.js +8 -4
  120. package/dist/global/inject-styles.js +15 -10
  121. package/dist/global/linear-function.js +2 -2
  122. package/dist/global/listeners.js +53 -27
  123. package/dist/global/memoize.js +13 -6
  124. package/dist/global/normalize-indent.js +51 -19
  125. package/dist/global/promise-with-timeout.js +8 -6
  126. package/dist/global/prop-types.js +5 -3
  127. package/dist/global/react-dom-renderer.js +47 -28
  128. package/dist/global/react-render-adapter.js +19 -13
  129. package/dist/global/rerender-hoc.js +41 -16
  130. package/dist/global/ring-angular-component.js +20 -10
  131. package/dist/global/schedule-raf.js +6 -5
  132. package/dist/global/sniffer.js +1 -1
  133. package/dist/global/theme.js +24 -0
  134. package/dist/global/trivial-template-tag.js +10 -3
  135. package/dist/global/typescript-utils.js +6 -2
  136. package/dist/global/url.js +27 -21
  137. package/dist/global/use-event-callback.js +4 -6
  138. package/dist/grid/col.js +55 -35
  139. package/dist/grid/grid.js +36 -17
  140. package/dist/grid/row.js +48 -35
  141. package/dist/group/group.js +27 -17
  142. package/dist/group-ng/group-ng.js +2 -2
  143. package/dist/header/header.js +80 -33
  144. package/dist/header/logo.js +39 -20
  145. package/dist/header/profile.js +188 -150
  146. package/dist/header/services-link.js +9 -0
  147. package/dist/header/services.js +118 -73
  148. package/dist/header/smart-profile.js +207 -111
  149. package/dist/header/smart-services.js +115 -62
  150. package/dist/header/tray-icon.js +38 -21
  151. package/dist/header/tray.js +34 -21
  152. package/dist/heading/heading.js +25 -26
  153. package/dist/heading-ng/heading-ng.js +11 -1
  154. package/dist/http/http.js +368 -215
  155. package/dist/http/http.mock.js +104 -49
  156. package/dist/hub-source/hub-source.js +191 -83
  157. package/dist/hub-source/hub-source__user.js +45 -11
  158. package/dist/hub-source/hub-source__users-groups.js +67 -37
  159. package/dist/i18n/i18n-context.js +14 -10
  160. package/dist/i18n/i18n.js +11 -7
  161. package/dist/icon/icon.js +94 -76
  162. package/dist/icon/icon__svg.js +31 -24
  163. package/dist/icon/index.js +9 -0
  164. package/dist/icon-ng/icon-ng.js +27 -15
  165. package/dist/input/input.js +184 -145
  166. package/dist/input-ng/input-ng.js +96 -118
  167. package/dist/island/adaptive-island-hoc.js +45 -30
  168. package/dist/island/content.js +130 -115
  169. package/dist/island/header.js +69 -56
  170. package/dist/island/island.js +40 -28
  171. package/dist/island-legacy/content-legacy.js +27 -17
  172. package/dist/island-legacy/header-legacy.js +29 -19
  173. package/dist/island-legacy/island-legacy.js +27 -17
  174. package/dist/island-ng/island-content-ng.js +17 -26
  175. package/dist/island-ng/island-header-ng.js +9 -12
  176. package/dist/island-ng/island-ng-class-fixer.js +3 -0
  177. package/dist/island-ng/island-ng.js +6 -10
  178. package/dist/link/clickableLink.js +61 -44
  179. package/dist/link/link.js +85 -74
  180. package/dist/link-ng/link-ng.js +3 -5
  181. package/dist/list/consts.js +1 -1
  182. package/dist/list/list.js +696 -602
  183. package/dist/list/list__custom.js +61 -44
  184. package/dist/list/list__hint.js +21 -10
  185. package/dist/list/list__item.js +167 -129
  186. package/dist/list/list__link.js +54 -37
  187. package/dist/list/list__separator.js +24 -14
  188. package/dist/list/list__title.js +32 -22
  189. package/dist/list/list__users-groups-source.js +131 -54
  190. package/dist/loader/loader.js +78 -43
  191. package/dist/loader/loader__core.js +257 -189
  192. package/dist/loader-inline/loader-inline.js +37 -23
  193. package/dist/loader-inline-ng/loader-inline-ng.js +2 -2
  194. package/dist/loader-ng/loader-ng.js +46 -19
  195. package/dist/loader-screen/loader-screen.js +48 -25
  196. package/dist/loader-screen-ng/loader-screen-ng.js +46 -30
  197. package/dist/login-dialog/login-dialog.js +162 -111
  198. package/dist/login-dialog/service.js +35 -7
  199. package/dist/markdown/code.js +31 -9
  200. package/dist/markdown/heading.js +3 -5
  201. package/dist/markdown/link.js +13 -6
  202. package/dist/markdown/markdown.js +66 -33
  203. package/dist/message/message.js +157 -125
  204. package/dist/message-bundle-ng/message-bundle-ng.js +128 -44
  205. package/dist/old-browsers-message/old-browsers-message.js +19 -11
  206. package/dist/old-browsers-message/old-browsers-message__stop.js +8 -0
  207. package/dist/old-browsers-message/white-list.js +16 -9
  208. package/dist/pager/pager.js +275 -210
  209. package/dist/pager-ng/pager-ng.js +36 -1
  210. package/dist/panel/panel.js +27 -17
  211. package/dist/panel-ng/panel-ng.js +14 -1
  212. package/dist/permissions/permissions.js +173 -127
  213. package/dist/permissions/permissions__cache.js +225 -194
  214. package/dist/permissions-ng/permissions-ng.js +86 -35
  215. package/dist/place-under-ng/place-under-ng.js +68 -45
  216. package/dist/popup/popup.consts.js +1 -1
  217. package/dist/popup/popup.js +342 -280
  218. package/dist/popup/popup.target.js +8 -9
  219. package/dist/popup/position.js +153 -153
  220. package/dist/popup-menu/popup-menu.js +86 -44
  221. package/dist/progress-bar/progress-bar.js +97 -80
  222. package/dist/progress-bar-ng/progress-bar-ng.js +11 -1
  223. package/dist/promised-click-ng/promised-click-ng.js +92 -58
  224. package/dist/proxy-attrs/proxy-attrs.js +18 -9
  225. package/dist/query-assist/query-assist.js +903 -832
  226. package/dist/query-assist/query-assist__suggestions.js +33 -1
  227. package/dist/query-assist-ng/query-assist-ng.js +38 -1
  228. package/dist/radio/radio.js +36 -19
  229. package/dist/radio/radio__item.js +71 -52
  230. package/dist/radio-ng/radio-ng.js +14 -25
  231. package/dist/save-field-ng/save-field-ng.js +86 -52
  232. package/dist/save-field-ng/save-field-ng__template.js +1 -32
  233. package/dist/select/select.js +937 -835
  234. package/dist/select/select__filter.js +33 -0
  235. package/dist/select/select__popup.d.ts +36 -0
  236. package/dist/select/select__popup.js +480 -358
  237. package/dist/select-ng/select-ng.js +125 -74
  238. package/dist/select-ng/select-ng__lazy.js +101 -50
  239. package/dist/select-ng/select-ng__options.js +107 -81
  240. package/dist/shortcuts/core.js +218 -166
  241. package/dist/shortcuts/shortcut-title.js +11 -6
  242. package/dist/shortcuts/shortcuts-hoc.js +47 -19
  243. package/dist/shortcuts/shortcuts.js +77 -50
  244. package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +104 -53
  245. package/dist/shortcuts-hint-ng/shortcuts-hint-ng__template.js +1 -48
  246. package/dist/shortcuts-ng/shortcuts-ng.js +86 -51
  247. package/dist/sidebar-ng/sidebar-ng.js +53 -22
  248. package/dist/sidebar-ng/sidebar-ng__button-template.js +1 -18
  249. package/dist/sidebar-ng/sidebar-ng__template.js +1 -10
  250. package/dist/storage/storage.js +35 -4
  251. package/dist/storage/storage__fallback.js +224 -149
  252. package/dist/storage/storage__local.js +156 -90
  253. package/dist/style.css +1 -1
  254. package/dist/tab-trap/tab-trap.js +157 -122
  255. package/dist/table/cell.js +28 -14
  256. package/dist/table/disable-hover-hoc.js +53 -33
  257. package/dist/table/header-cell.js +87 -64
  258. package/dist/table/header.js +126 -98
  259. package/dist/table/multitable.js +127 -107
  260. package/dist/table/row-with-focus-sensor.js +73 -25
  261. package/dist/table/row.js +208 -170
  262. package/dist/table/selection-adapter.js +3 -1
  263. package/dist/table/selection-shortcuts-hoc.js +184 -181
  264. package/dist/table/selection.js +228 -156
  265. package/dist/table/smart-table.js +93 -51
  266. package/dist/table/table.js +348 -281
  267. package/dist/table-legacy-ng/table-legacy-ng.js +117 -102
  268. package/dist/table-legacy-ng/table-legacy-ng__pager.js +42 -10
  269. package/dist/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +92 -69
  270. package/dist/table-legacy-ng/table-legacy-ng__selection.js +169 -119
  271. package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +36 -21
  272. package/dist/table-ng/smart-table-ng.js +31 -1
  273. package/dist/table-ng/table-ng.js +31 -1
  274. package/dist/tabs/collapsible-more.js +87 -50
  275. package/dist/tabs/collapsible-tab.js +45 -38
  276. package/dist/tabs/collapsible-tabs.js +161 -94
  277. package/dist/tabs/custom-item.js +2 -4
  278. package/dist/tabs/dumb-tabs.js +122 -75
  279. package/dist/tabs/smart-tabs.js +75 -29
  280. package/dist/tabs/tab-link.js +29 -19
  281. package/dist/tabs/tab.js +33 -19
  282. package/dist/tabs/tabs.js +35 -0
  283. package/dist/tabs-ng/tabs-ng.js +38 -24
  284. package/dist/tabs-ng/tabs-ng__template.js +1 -38
  285. package/dist/tag/tag.js +170 -133
  286. package/dist/tags-input/tags-input.js +428 -327
  287. package/dist/tags-input-ng/tags-input-ng.js +37 -1
  288. package/dist/tags-list/tags-list.js +80 -56
  289. package/dist/template-ng/template-ng.js +50 -39
  290. package/dist/text/text.js +38 -28
  291. package/dist/title-ng/title-ng.js +28 -23
  292. package/dist/toggle/toggle.js +72 -56
  293. package/dist/toggle-ng/toggle-ng.js +14 -1
  294. package/dist/tooltip/tooltip.js +192 -146
  295. package/dist/tooltip-ng/tooltip-ng.js +51 -25
  296. package/dist/user-agreement/service.js +374 -227
  297. package/dist/user-agreement/toolbox.eula.js +1 -160
  298. package/dist/user-agreement/user-agreement.js +128 -86
  299. package/dist/user-card/card.js +32 -0
  300. package/dist/user-card/smart-user-card-tooltip.js +116 -51
  301. package/dist/user-card/tooltip.js +90 -48
  302. package/dist/user-card/user-card.js +32 -0
  303. package/dist/user-card-ng/user-card-ng.js +34 -2
  304. package/package.json +8 -8
@@ -1,10 +1,20 @@
1
- import { _ as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
1
+ import { _ as _createClass, g as _toConsumableArray, h as _objectWithoutProperties, i as _extends, a as _objectSpread2, b as _classCallCheck, c as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/es.array.map.js';
3
+ import 'core-js/modules/es.array.filter.js';
4
+ import 'core-js/modules/es.object.to-string.js';
5
+ import 'core-js/modules/es.array.concat.js';
2
6
  import React from 'react';
3
7
  import { render } from '../global/react-render-adapter.js';
4
8
  import getUID from '../global/get-uid.js';
5
9
  import Alert, { ANIMATION_TIME } from '../alert/alert.js';
6
10
  import Alerts from '../alert/container.js';
11
+ import 'core-js/modules/es.array.iterator.js';
12
+ import 'core-js/modules/es.string.iterator.js';
13
+ import 'core-js/modules/es.weak-map.js';
14
+ import 'core-js/modules/web.dom-collections.iterator.js';
7
15
  import 'react-dom';
16
+ import 'core-js/modules/es.regexp.to-string.js';
17
+ import 'core-js/modules/es.object.values.js';
8
18
  import 'classnames';
9
19
  import 'prop-types';
10
20
  import '@jetbrains/icons/exception';
@@ -16,11 +26,22 @@ import 'util-deprecate';
16
26
  import '../icon/icon__constants.js';
17
27
  import '../_helpers/icon.js';
18
28
  import '../icon/icon__svg.js';
29
+ import 'core-js/modules/es.regexp.exec.js';
30
+ import 'core-js/modules/es.string.replace.js';
31
+ import 'core-js/modules/es.string.starts-with.js';
19
32
  import '../global/memoize.js';
33
+ import 'core-js/modules/es.map.js';
20
34
  import '../loader-inline/loader-inline.js';
21
35
  import '../global/data-tests.js';
36
+ import 'core-js/modules/es.array.reduce.js';
37
+ import 'core-js/modules/es.object.entries.js';
22
38
  import '../_helpers/loader-inline.js';
23
39
  import '../global/dom.js';
40
+ import 'core-js/modules/es.object.assign.js';
41
+ import 'core-js/modules/web.dom-collections.for-each.js';
42
+ import 'core-js/modules/es.string.split.js';
43
+ import 'core-js/modules/es.object.keys.js';
44
+ import 'core-js/modules/es.set.js';
24
45
  import '../button/button.js';
25
46
  import '@jetbrains/icons/chevron-10px';
26
47
  import '../link/clickableLink.js';
@@ -32,124 +53,171 @@ import '../popup/popup.js';
32
53
  import '../global/schedule-raf.js';
33
54
  import '../shortcuts/shortcuts.js';
34
55
  import '../shortcuts/core.js';
56
+ import 'core-js/modules/es.array.includes.js';
57
+ import 'core-js/modules/es.string.includes.js';
58
+ import 'core-js/modules/es.array.slice.js';
59
+ import 'core-js/modules/es.array.splice.js';
60
+ import 'core-js/modules/es.string.match.js';
61
+ import 'core-js/modules/es.array.find-index.js';
35
62
  import 'combokeys';
36
63
  import '../global/sniffer.js';
37
64
  import 'sniffr';
38
65
  import '../tab-trap/tab-trap.js';
39
66
  import '../popup/position.js';
67
+ import 'core-js/modules/es.array.sort.js';
40
68
  import '../popup/popup.consts.js';
41
69
 
70
+ var _excluded = ["message", "key"],
71
+ _excluded2 = ["onCloseRequest", "onClose"];
42
72
  /**
43
73
  * @name Alert Service
44
74
  */
45
- class AlertService {
46
- defaultTimeout = 0;
47
- // This alerts are stored in inverse order (last shown is first in array)
48
- showingAlerts = [];
49
- containerElement = document.createElement('div');
50
- _getShowingAlerts() {
51
- return [...this.showingAlerts];
75
+ var AlertService = /*#__PURE__*/function () {
76
+ function AlertService() {
77
+ _classCallCheck(this, AlertService);
78
+ _defineProperty(this, "defaultTimeout", 0);
79
+ // This alerts are stored in inverse order (last shown is first in array)
80
+ _defineProperty(this, "showingAlerts", []);
81
+ _defineProperty(this, "containerElement", document.createElement('div'));
52
82
  }
53
- renderAlertContainer(alerts) {
54
- if (alerts.length === 0) {
55
- return /*#__PURE__*/React.createElement("span", null);
83
+ _createClass(AlertService, [{
84
+ key: "_getShowingAlerts",
85
+ value: function _getShowingAlerts() {
86
+ return _toConsumableArray(this.showingAlerts);
56
87
  }
57
- return /*#__PURE__*/React.createElement(Alerts, null, alerts.map(alert => {
58
- const {
59
- message,
60
- key,
61
- ...rest
62
- } = alert;
63
- return /*#__PURE__*/React.createElement(Alert, _extends({
64
- key: key
65
- }, rest), message);
66
- }));
67
- }
68
- /**
69
- * Renders alert container into virtual node to skip maintaining container
70
- */
71
- renderAlerts() {
72
- render(this.renderAlertContainer(this.showingAlerts), this.containerElement);
73
- }
74
- findSameAlert(message, type) {
75
- return this.showingAlerts.filter(it => it.type === type && it.message === message)[0];
76
- }
77
- startAlertClosing(alert) {
78
- alert.isClosing = true;
79
- this.renderAlerts();
80
- }
81
- remove(key) {
82
- const alertToClose = this.showingAlerts.filter(alert => alert.key === key)[0];
83
- if (!alertToClose) {
84
- return;
88
+ }, {
89
+ key: "renderAlertContainer",
90
+ value: function renderAlertContainer(alerts) {
91
+ if (alerts.length === 0) {
92
+ return /*#__PURE__*/React.createElement("span", null);
93
+ }
94
+ return /*#__PURE__*/React.createElement(Alerts, null, alerts.map(function (alert) {
95
+ var message = alert.message,
96
+ key = alert.key,
97
+ rest = _objectWithoutProperties(alert, _excluded);
98
+ return /*#__PURE__*/React.createElement(Alert, _extends({
99
+ key: key
100
+ }, rest), message);
101
+ }));
85
102
  }
86
- this.startAlertClosing(alertToClose);
87
- }
88
- removeWithoutAnimation(key) {
89
- this.showingAlerts = this.showingAlerts.filter(alert => alert.key !== key);
90
- this.renderAlerts();
91
- }
92
- stopShakingWhenAnimationDone(shakingAlert) {
93
- setTimeout(() => {
94
- shakingAlert.showWithAnimation = false;
95
- shakingAlert.isShaking = false;
103
+ /**
104
+ * Renders alert container into virtual node to skip maintaining container
105
+ */
106
+ }, {
107
+ key: "renderAlerts",
108
+ value: function renderAlerts() {
109
+ render(this.renderAlertContainer(this.showingAlerts), this.containerElement);
110
+ }
111
+ }, {
112
+ key: "findSameAlert",
113
+ value: function findSameAlert(message, type) {
114
+ return this.showingAlerts.filter(function (it) {
115
+ return it.type === type && it.message === message;
116
+ })[0];
117
+ }
118
+ }, {
119
+ key: "startAlertClosing",
120
+ value: function startAlertClosing(alert) {
121
+ alert.isClosing = true;
96
122
  this.renderAlerts();
97
- }, ANIMATION_TIME);
98
- }
99
- addAlert(message, type) {
100
- let timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.defaultTimeout;
101
- let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
102
- const {
103
- onCloseRequest,
104
- onClose,
105
- ...restOptions
106
- } = options;
107
- const sameAlert = this.findSameAlert(message, type);
108
- if (sameAlert) {
109
- sameAlert.isShaking = true;
123
+ }
124
+ }, {
125
+ key: "remove",
126
+ value: function remove(key) {
127
+ var alertToClose = this.showingAlerts.filter(function (alert) {
128
+ return alert.key === key;
129
+ })[0];
130
+ if (!alertToClose) {
131
+ return;
132
+ }
133
+ this.startAlertClosing(alertToClose);
134
+ }
135
+ }, {
136
+ key: "removeWithoutAnimation",
137
+ value: function removeWithoutAnimation(key) {
138
+ this.showingAlerts = this.showingAlerts.filter(function (alert) {
139
+ return alert.key !== key;
140
+ });
110
141
  this.renderAlerts();
111
- this.stopShakingWhenAnimationDone(sameAlert);
112
- return sameAlert.key;
113
142
  }
114
- const alert = {
115
- key: getUID('alert-service-'),
116
- message,
117
- type,
118
- timeout,
119
- isClosing: false,
120
- onCloseRequest: () => {
121
- onCloseRequest && onCloseRequest();
122
- this.startAlertClosing(alert);
123
- },
124
- onClose: () => {
125
- onClose && onClose();
126
- this.removeWithoutAnimation(alert.key);
127
- },
128
- ...restOptions
129
- };
130
- this.showingAlerts = [alert, ...this.showingAlerts];
131
- this.renderAlerts();
132
- return alert.key;
133
- }
134
- setDefaultTimeout(timeout) {
135
- this.defaultTimeout = timeout;
136
- }
137
- error(message, timeout) {
138
- return this.addAlert(message, Alert.Type.ERROR, timeout);
139
- }
140
- message(message, timeout) {
141
- return this.addAlert(message, Alert.Type.MESSAGE, timeout);
142
- }
143
- warning(message, timeout) {
144
- return this.addAlert(message, Alert.Type.WARNING, timeout);
145
- }
146
- successMessage(message, timeout) {
147
- return this.addAlert(message, Alert.Type.SUCCESS, timeout);
148
- }
149
- loadingMessage(message, timeout) {
150
- return this.addAlert(message, Alert.Type.LOADING, timeout);
151
- }
152
- }
153
- const alertService = new AlertService();
143
+ }, {
144
+ key: "stopShakingWhenAnimationDone",
145
+ value: function stopShakingWhenAnimationDone(shakingAlert) {
146
+ var _this = this;
147
+ setTimeout(function () {
148
+ shakingAlert.showWithAnimation = false;
149
+ shakingAlert.isShaking = false;
150
+ _this.renderAlerts();
151
+ }, ANIMATION_TIME);
152
+ }
153
+ }, {
154
+ key: "addAlert",
155
+ value: function addAlert(message, type) {
156
+ var _this2 = this;
157
+ var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.defaultTimeout;
158
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
159
+ var _onCloseRequest = options.onCloseRequest,
160
+ _onClose = options.onClose,
161
+ restOptions = _objectWithoutProperties(options, _excluded2);
162
+ var sameAlert = this.findSameAlert(message, type);
163
+ if (sameAlert) {
164
+ sameAlert.isShaking = true;
165
+ this.renderAlerts();
166
+ this.stopShakingWhenAnimationDone(sameAlert);
167
+ return sameAlert.key;
168
+ }
169
+ var alert = _objectSpread2({
170
+ key: getUID('alert-service-'),
171
+ message: message,
172
+ type: type,
173
+ timeout: timeout,
174
+ isClosing: false,
175
+ onCloseRequest: function onCloseRequest() {
176
+ _onCloseRequest && _onCloseRequest();
177
+ _this2.startAlertClosing(alert);
178
+ },
179
+ onClose: function onClose() {
180
+ _onClose && _onClose();
181
+ _this2.removeWithoutAnimation(alert.key);
182
+ }
183
+ }, restOptions);
184
+ this.showingAlerts = [alert].concat(_toConsumableArray(this.showingAlerts));
185
+ this.renderAlerts();
186
+ return alert.key;
187
+ }
188
+ }, {
189
+ key: "setDefaultTimeout",
190
+ value: function setDefaultTimeout(timeout) {
191
+ this.defaultTimeout = timeout;
192
+ }
193
+ }, {
194
+ key: "error",
195
+ value: function error(message, timeout) {
196
+ return this.addAlert(message, Alert.Type.ERROR, timeout);
197
+ }
198
+ }, {
199
+ key: "message",
200
+ value: function message(_message, timeout) {
201
+ return this.addAlert(_message, Alert.Type.MESSAGE, timeout);
202
+ }
203
+ }, {
204
+ key: "warning",
205
+ value: function warning(message, timeout) {
206
+ return this.addAlert(message, Alert.Type.WARNING, timeout);
207
+ }
208
+ }, {
209
+ key: "successMessage",
210
+ value: function successMessage(message, timeout) {
211
+ return this.addAlert(message, Alert.Type.SUCCESS, timeout);
212
+ }
213
+ }, {
214
+ key: "loadingMessage",
215
+ value: function loadingMessage(message, timeout) {
216
+ return this.addAlert(message, Alert.Type.LOADING, timeout);
217
+ }
218
+ }]);
219
+ return AlertService;
220
+ }();
221
+ var alertService = new AlertService();
154
222
 
155
223
  export { alertService as default };
@@ -1,84 +1,108 @@
1
+ import { _ as _createClass, d as _typeof, b as _classCallCheck, c as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/es.array.index-of.js';
3
+ import 'core-js/modules/es.object.to-string.js';
4
+ import 'core-js/modules/web.dom-collections.for-each.js';
5
+ import 'core-js/modules/es.regexp.exec.js';
6
+ import 'core-js/modules/es.string.replace.js';
7
+ import 'core-js/modules/es.array.concat.js';
1
8
  import deprecate from 'util-deprecate';
2
9
 
3
- const warnOnDeprecationOfAnalyticsMethod = methodName => deprecate(() => {}, `Method analytics::${methodName} is deprecated, use analytics::trackEvent instead`)();
10
+ var warnOnDeprecationOfAnalyticsMethod = function warnOnDeprecationOfAnalyticsMethod(methodName) {
11
+ return deprecate(function () {}, "Method analytics::".concat(methodName, " is deprecated, use analytics::trackEvent instead"))();
12
+ };
4
13
  /**
5
14
  * @name Analytics
6
15
  */
7
- class Analytics {
8
- _plugins;
9
- constructor() {
16
+ var Analytics = /*#__PURE__*/function () {
17
+ function Analytics() {
18
+ _classCallCheck(this, Analytics);
19
+ _defineProperty(this, "_plugins", void 0);
10
20
  this._plugins = [];
11
21
  }
12
- config(plugins) {
13
- this._plugins = plugins;
14
- }
15
- /**
16
- * @deprecated
17
- */
18
- track(rawTrackingData, additionalData) {
19
- if (!rawTrackingData) {
20
- return;
22
+ _createClass(Analytics, [{
23
+ key: "config",
24
+ value: function config(plugins) {
25
+ this._plugins = plugins;
21
26
  }
22
- warnOnDeprecationOfAnalyticsMethod('track');
23
- let splitIdx = rawTrackingData.indexOf(':');
24
- if (splitIdx < 0) {
25
- splitIdx = rawTrackingData.indexOf('_');
27
+ /**
28
+ * @deprecated
29
+ */
30
+ }, {
31
+ key: "track",
32
+ value: function track(rawTrackingData, additionalData) {
33
+ if (!rawTrackingData) {
34
+ return;
35
+ }
36
+ warnOnDeprecationOfAnalyticsMethod('track');
37
+ var splitIdx = rawTrackingData.indexOf(':');
38
+ if (splitIdx < 0) {
39
+ splitIdx = rawTrackingData.indexOf('_');
40
+ }
41
+ if (splitIdx < 0) {
42
+ splitIdx = rawTrackingData.length;
43
+ }
44
+ var category = rawTrackingData.substr(0, splitIdx);
45
+ var subcategory = rawTrackingData.substr(splitIdx + 1);
46
+ this.trackEvent(category, subcategory, additionalData);
26
47
  }
27
- if (splitIdx < 0) {
28
- splitIdx = rawTrackingData.length;
48
+ /**
49
+ * @deprecated
50
+ */
51
+ }, {
52
+ key: "trackPageView",
53
+ value: function trackPageView(path) {
54
+ warnOnDeprecationOfAnalyticsMethod('trackPageView');
55
+ this._plugins.forEach(function (plugin) {
56
+ plugin.trackPageView(path);
57
+ });
29
58
  }
30
- const category = rawTrackingData.substr(0, splitIdx);
31
- const subcategory = rawTrackingData.substr(splitIdx + 1);
32
- this.trackEvent(category, subcategory, additionalData);
33
- }
34
- /**
35
- * @deprecated
36
- */
37
- trackPageView(path) {
38
- warnOnDeprecationOfAnalyticsMethod('trackPageView');
39
- this._plugins.forEach(plugin => {
40
- plugin.trackPageView(path);
41
- });
42
- }
43
- trackEvent(category, action, additionalData) {
44
- this._plugins.forEach(plugin => {
45
- plugin.trackEvent(category, action, additionalData);
46
- });
47
- }
48
- /**
49
- * @deprecated
50
- */
51
- trackShortcutEvent(category, action, additionalData) {
52
- warnOnDeprecationOfAnalyticsMethod('trackShortcutEvent');
53
- this.trackEvent(category, action, additionalData);
54
- }
55
- /**
56
- * @deprecated
57
- */
58
- trackEntityProperties(entityName, entity, propertiesNames, additionalData) {
59
- warnOnDeprecationOfAnalyticsMethod('trackEntityProperties');
60
- for (let i = 0; i < propertiesNames.length; ++i) {
61
- const keys = propertiesNames[i].split('.');
62
- let value = entity;
63
- if (!keys.length) {
64
- continue;
65
- }
66
- for (let j = 0; j < keys.length; ++j) {
67
- if (typeof value === 'object' && value != null && value.hasOwnProperty(keys[j])) {
68
- value = value[keys[j]];
69
- } else {
70
- value = 'no-value';
71
- break;
59
+ }, {
60
+ key: "trackEvent",
61
+ value: function trackEvent(category, action, additionalData) {
62
+ this._plugins.forEach(function (plugin) {
63
+ plugin.trackEvent(category, action, additionalData);
64
+ });
65
+ }
66
+ /**
67
+ * @deprecated
68
+ */
69
+ }, {
70
+ key: "trackShortcutEvent",
71
+ value: function trackShortcutEvent(category, action, additionalData) {
72
+ warnOnDeprecationOfAnalyticsMethod('trackShortcutEvent');
73
+ this.trackEvent(category, action, additionalData);
74
+ }
75
+ /**
76
+ * @deprecated
77
+ */
78
+ }, {
79
+ key: "trackEntityProperties",
80
+ value: function trackEntityProperties(entityName, entity, propertiesNames, additionalData) {
81
+ warnOnDeprecationOfAnalyticsMethod('trackEntityProperties');
82
+ for (var i = 0; i < propertiesNames.length; ++i) {
83
+ var keys = propertiesNames[i].split('.');
84
+ var value = entity;
85
+ if (!keys.length) {
86
+ continue;
72
87
  }
88
+ for (var j = 0; j < keys.length; ++j) {
89
+ if (_typeof(value) === 'object' && value != null && value.hasOwnProperty(keys[j])) {
90
+ value = value[keys[j]];
91
+ } else {
92
+ value = 'no-value';
93
+ break;
94
+ }
95
+ }
96
+ if (typeof value === 'string') {
97
+ value = value.toLowerCase().replace(/[._]+/g, '-');
98
+ }
99
+ var resultAction = "".concat(keys.join('-'), "__").concat(value);
100
+ this.trackEvent(entityName, resultAction, additionalData);
73
101
  }
74
- if (typeof value === 'string') {
75
- value = value.toLowerCase().replace(/[._]+/g, '-');
76
- }
77
- const resultAction = `${keys.join('-')}__${value}`;
78
- this.trackEvent(entityName, resultAction, additionalData);
79
102
  }
80
- }
81
- }
103
+ }]);
104
+ return Analytics;
105
+ }();
82
106
  var analytics = new Analytics();
83
107
 
84
108
  export { Analytics, analytics as default };
@@ -1,71 +1,95 @@
1
- const DEFAULT_FLUSH_INTERVAL = 10000;
2
- const DEFAULT_FLUSH_MAX_PACK_SIZE = 100;
3
- class AnalyticsCustomPlugin {
4
- _data;
5
- _flush;
6
- _isDevelopment;
7
- _flushInterval;
8
- _flushMaxPackSize;
9
- _hasSendSchedule;
10
- constructor(send, isDevelopment, flushInterval) {
1
+ import { _ as _createClass, a as _objectSpread2, b as _classCallCheck, c as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+
3
+ var DEFAULT_FLUSH_INTERVAL = 10000;
4
+ var DEFAULT_FLUSH_MAX_PACK_SIZE = 100;
5
+ var AnalyticsCustomPlugin = /*#__PURE__*/function () {
6
+ function AnalyticsCustomPlugin(send, isDevelopment, flushInterval) {
7
+ _classCallCheck(this, AnalyticsCustomPlugin);
8
+ _defineProperty(this, "_data", void 0);
9
+ _defineProperty(this, "_flush", void 0);
10
+ _defineProperty(this, "_isDevelopment", void 0);
11
+ _defineProperty(this, "_flushInterval", void 0);
12
+ _defineProperty(this, "_flushMaxPackSize", void 0);
13
+ _defineProperty(this, "_hasSendSchedule", void 0);
11
14
  this._data = [];
12
15
  this.config({
13
- send,
14
- isDevelopment,
15
- flushInterval
16
+ send: send,
17
+ isDevelopment: isDevelopment,
18
+ flushInterval: flushInterval
16
19
  });
17
20
  }
18
- config(config) {
19
- this._flush = () => {
20
- if (this._data.length > 0) {
21
- config.send(this._data);
22
- this._data = [];
23
- }
24
- };
25
- this._isDevelopment = config.isDevelopment;
26
- this._flushInterval = config.flushInterval || DEFAULT_FLUSH_INTERVAL;
27
- this._flushMaxPackSize = config.flushMaxPackSize || DEFAULT_FLUSH_MAX_PACK_SIZE;
28
- }
29
- trackEvent(category, action, additionalData) {
30
- this._processEvent(category, action, additionalData);
31
- }
32
- trackPageView(path, data) {
33
- this._processEvent('page', 'view', data);
34
- }
35
- _initSendSchedule() {
36
- window.addEventListener('beforeunload', () => this._flush?.());
37
- if (this._flush != null) {
38
- setInterval(this._flush, this._flushInterval);
21
+ _createClass(AnalyticsCustomPlugin, [{
22
+ key: "config",
23
+ value: function config(_config) {
24
+ var _this = this;
25
+ this._flush = function () {
26
+ if (_this._data.length > 0) {
27
+ _config.send(_this._data);
28
+ _this._data = [];
29
+ }
30
+ };
31
+ this._isDevelopment = _config.isDevelopment;
32
+ this._flushInterval = _config.flushInterval || DEFAULT_FLUSH_INTERVAL;
33
+ this._flushMaxPackSize = _config.flushMaxPackSize || DEFAULT_FLUSH_MAX_PACK_SIZE;
39
34
  }
40
- this._hasSendSchedule = true;
41
- }
42
- _processEvent(category, action, data) {
43
- if (!this._hasSendSchedule && this._flush) {
44
- this._initSendSchedule();
35
+ }, {
36
+ key: "trackEvent",
37
+ value: function trackEvent(category, action, additionalData) {
38
+ this._processEvent(category, action, additionalData);
45
39
  }
46
- if (this._isDevelopment) {
47
- console.log('TRACKING DATA = ', category, action, data); // eslint-disable-line no-console
40
+ }, {
41
+ key: "trackPageView",
42
+ value: function trackPageView(path, data) {
43
+ this._processEvent('page', 'view', data);
44
+ }
45
+ }, {
46
+ key: "_initSendSchedule",
47
+ value: function _initSendSchedule() {
48
+ var _this2 = this;
49
+ window.addEventListener('beforeunload', function () {
50
+ var _this2$_flush;
51
+ return (_this2$_flush = _this2._flush) === null || _this2$_flush === void 0 ? void 0 : _this2$_flush.call(_this2);
52
+ });
53
+ if (this._flush != null) {
54
+ setInterval(this._flush, this._flushInterval);
55
+ }
56
+ this._hasSendSchedule = true;
48
57
  }
58
+ }, {
59
+ key: "_processEvent",
60
+ value: function _processEvent(category, action, data) {
61
+ if (!this._hasSendSchedule && this._flush) {
62
+ this._initSendSchedule();
63
+ }
64
+ if (this._isDevelopment) {
65
+ console.log('TRACKING DATA = ', category, action, data); // eslint-disable-line no-console
66
+ }
49
67
 
50
- const baseSendingData = {
51
- category,
52
- action,
53
- timestamp: Date.now()
54
- };
55
- this._addDataToFlushingPack(data ? {
56
- ...baseSendingData,
57
- data
58
- } : baseSendingData);
59
- }
60
- _addDataToFlushingPack(sendingData) {
61
- this._data.push(sendingData);
62
- if (this._flushMaxPackSize != null && this._data.length >= this._flushMaxPackSize) {
63
- this._flush?.();
68
+ var baseSendingData = {
69
+ category: category,
70
+ action: action,
71
+ timestamp: Date.now()
72
+ };
73
+ this._addDataToFlushingPack(data ? _objectSpread2(_objectSpread2({}, baseSendingData), {}, {
74
+ data: data
75
+ }) : baseSendingData);
64
76
  }
65
- }
66
- get serializeAdditionalInfo() {
67
- return true;
68
- }
69
- }
77
+ }, {
78
+ key: "_addDataToFlushingPack",
79
+ value: function _addDataToFlushingPack(sendingData) {
80
+ this._data.push(sendingData);
81
+ if (this._flushMaxPackSize != null && this._data.length >= this._flushMaxPackSize) {
82
+ var _this$_flush;
83
+ (_this$_flush = this._flush) === null || _this$_flush === void 0 ? void 0 : _this$_flush.call(this);
84
+ }
85
+ }
86
+ }, {
87
+ key: "serializeAdditionalInfo",
88
+ get: function get() {
89
+ return true;
90
+ }
91
+ }]);
92
+ return AnalyticsCustomPlugin;
93
+ }();
70
94
 
71
95
  export { AnalyticsCustomPlugin as default };