@jetbrains/ring-ui 5.0.156 → 5.0.157

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 (295) hide show
  1. package/dist/_helpers/_rollupPluginBabelHelpers.js +642 -1
  2. package/dist/_helpers/anchor.js +6 -7
  3. package/dist/_helpers/button__classes.js +16 -28
  4. package/dist/_helpers/card.js +107 -95
  5. package/dist/_helpers/dialog__body-scroll-preventer.js +20 -11
  6. package/dist/_helpers/footer.js +29 -34
  7. package/dist/_helpers/query-assist__suggestions.js +91 -74
  8. package/dist/_helpers/select__filter.js +71 -48
  9. package/dist/_helpers/services-link.js +41 -29
  10. package/dist/_helpers/sidebar.js +103 -99
  11. package/dist/_helpers/theme.js +42 -35
  12. package/dist/_helpers/title.js +71 -57
  13. package/dist/alert/alert.js +199 -158
  14. package/dist/alert/container.js +43 -32
  15. package/dist/alert-service/alert-service.js +172 -104
  16. package/dist/analytics/analytics.js +92 -68
  17. package/dist/analytics/analytics__custom-plugin.js +84 -60
  18. package/dist/analytics/analytics__fus-plugin.js +28 -15
  19. package/dist/analytics/analytics__ga-plugin.js +60 -43
  20. package/dist/analytics/analytics__plugin-utils.js +28 -22
  21. package/dist/auth/auth.js +36 -4
  22. package/dist/auth/auth__core.js +1458 -732
  23. package/dist/auth/background-flow.js +129 -87
  24. package/dist/auth/down-notification.js +75 -30
  25. package/dist/auth/iframe-flow.js +136 -75
  26. package/dist/auth/landing.js +90 -30
  27. package/dist/auth/request-builder.js +82 -46
  28. package/dist/auth/response-parser.js +119 -86
  29. package/dist/auth/storage.js +333 -171
  30. package/dist/auth/token-validator.js +244 -137
  31. package/dist/auth/window-flow.js +136 -92
  32. package/dist/auth-dialog/auth-dialog.js +176 -114
  33. package/dist/auth-dialog-service/auth-dialog-service.js +32 -7
  34. package/dist/auth-ng/auth-ng.js +70 -34
  35. package/dist/auth-ng/auth-ng.mock.js +6 -6
  36. package/dist/autofocus-ng/autofocus-ng.js +23 -8
  37. package/dist/avatar/avatar-example-datauri.js +1 -23
  38. package/dist/avatar/avatar.js +155 -119
  39. package/dist/avatar/fallback-avatar.js +41 -22
  40. package/dist/avatar-editor-ng/avatar-editor-ng.js +56 -23
  41. package/dist/avatar-editor-ng/avatar-editor-ng__template.js +1 -28
  42. package/dist/avatar-ng/avatar-ng.js +23 -1
  43. package/dist/badge/badge.js +43 -35
  44. package/dist/badge-ng/badge-ng.js +13 -1
  45. package/dist/breadcrumb-ng/breadcrumb-ng.js +15 -29
  46. package/dist/button/button.js +111 -87
  47. package/dist/button/button__classes.js +1 -0
  48. package/dist/button-group/button-group.js +35 -19
  49. package/dist/button-group/caption.js +22 -14
  50. package/dist/button-group-ng/button-group-ng.js +13 -7
  51. package/dist/button-ng/button-ng.js +154 -133
  52. package/dist/button-set/button-set.js +34 -20
  53. package/dist/button-set-ng/button-set-ng.js +2 -2
  54. package/dist/button-toolbar/button-toolbar.js +33 -19
  55. package/dist/button-toolbar-ng/button-toolbar-ng.js +5 -3
  56. package/dist/caret/caret.js +225 -188
  57. package/dist/checkbox/checkbox.js +104 -76
  58. package/dist/checkbox-ng/checkbox-ng.js +18 -27
  59. package/dist/clipboard/clipboard-fallback.js +10 -10
  60. package/dist/clipboard/clipboard.js +131 -34
  61. package/dist/code/code.js +168 -92
  62. package/dist/compiler-ng/compiler-ng.js +18 -15
  63. package/dist/confirm/confirm.js +108 -66
  64. package/dist/confirm-ng/confirm-ng.js +33 -4
  65. package/dist/confirm-service/confirm-service.js +66 -42
  66. package/dist/content-layout/content-layout.js +64 -43
  67. package/dist/content-layout/sidebar.js +1 -0
  68. package/dist/contenteditable/contenteditable.js +61 -50
  69. package/dist/control-label/control-label.js +11 -15
  70. package/dist/data-list/data-list.js +184 -128
  71. package/dist/data-list/data-list.mock.js +11 -2
  72. package/dist/data-list/item.js +174 -143
  73. package/dist/data-list/selection.js +139 -76
  74. package/dist/data-list/title.js +13 -1
  75. package/dist/data-list-ng/data-list-ng.js +31 -1
  76. package/dist/date-picker/consts.js +18 -15
  77. package/dist/date-picker/date-input.js +147 -115
  78. package/dist/date-picker/date-picker.js +285 -228
  79. package/dist/date-picker/date-popup.js +397 -356
  80. package/dist/date-picker/day.js +98 -84
  81. package/dist/date-picker/month-names.js +64 -43
  82. package/dist/date-picker/month-slider.js +74 -51
  83. package/dist/date-picker/month.js +21 -15
  84. package/dist/date-picker/months.js +48 -43
  85. package/dist/date-picker/weekdays.js +18 -12
  86. package/dist/date-picker/years.js +109 -84
  87. package/dist/dialog/dialog.js +189 -141
  88. package/dist/dialog/dialog__body-scroll-preventer.js +5 -0
  89. package/dist/dialog-ng/dialog-ng.js +401 -287
  90. package/dist/dialog-ng/dialog-ng__template.js +1 -70
  91. package/dist/docked-panel-ng/docked-panel-ng.js +33 -18
  92. package/dist/dropdown/anchor.js +10 -0
  93. package/dist/dropdown/dropdown.js +214 -182
  94. package/dist/dropdown-menu/dropdown-menu.js +102 -72
  95. package/dist/editable-heading/editable-heading.js +100 -58
  96. package/dist/error-bubble/error-bubble.js +64 -31
  97. package/dist/error-message/error-message.js +61 -38
  98. package/dist/error-message-ng/error-message-ng.js +11 -22
  99. package/dist/footer/footer.js +11 -1
  100. package/dist/footer-ng/footer-ng.js +64 -36
  101. package/dist/form-ng/form-ng.js +66 -56
  102. package/dist/global/angular-component-factory.js +76 -53
  103. package/dist/global/compose.js +10 -1
  104. package/dist/global/composeRefs.js +12 -7
  105. package/dist/global/controls-height.js +2 -2
  106. package/dist/global/create-stateful-context.js +19 -19
  107. package/dist/global/data-tests.js +15 -7
  108. package/dist/global/dom.js +95 -53
  109. package/dist/global/focus-sensor-hoc.js +134 -122
  110. package/dist/global/fuzzy-highlight.js +41 -27
  111. package/dist/global/get-event-key.js +8 -8
  112. package/dist/global/get-uid.js +8 -4
  113. package/dist/global/inject-styles.js +15 -10
  114. package/dist/global/linear-function.js +2 -2
  115. package/dist/global/listeners.js +53 -27
  116. package/dist/global/memoize.js +13 -6
  117. package/dist/global/normalize-indent.js +51 -19
  118. package/dist/global/promise-with-timeout.js +8 -6
  119. package/dist/global/prop-types.js +5 -3
  120. package/dist/global/react-dom-renderer.js +47 -28
  121. package/dist/global/react-render-adapter.js +19 -13
  122. package/dist/global/rerender-hoc.js +41 -16
  123. package/dist/global/ring-angular-component.js +20 -10
  124. package/dist/global/schedule-raf.js +6 -5
  125. package/dist/global/sniffer.js +1 -1
  126. package/dist/global/theme.js +24 -0
  127. package/dist/global/trivial-template-tag.js +10 -3
  128. package/dist/global/typescript-utils.js +6 -2
  129. package/dist/global/url.js +27 -21
  130. package/dist/global/use-event-callback.js +4 -6
  131. package/dist/grid/col.js +55 -35
  132. package/dist/grid/grid.js +36 -17
  133. package/dist/grid/row.js +48 -35
  134. package/dist/group/group.js +27 -17
  135. package/dist/group-ng/group-ng.js +2 -2
  136. package/dist/header/header.js +80 -33
  137. package/dist/header/logo.js +39 -20
  138. package/dist/header/profile.js +188 -150
  139. package/dist/header/services-link.js +9 -0
  140. package/dist/header/services.js +118 -73
  141. package/dist/header/smart-profile.js +207 -111
  142. package/dist/header/smart-services.js +115 -62
  143. package/dist/header/tray-icon.js +38 -21
  144. package/dist/header/tray.js +34 -21
  145. package/dist/heading/heading.js +25 -26
  146. package/dist/heading-ng/heading-ng.js +11 -1
  147. package/dist/http/http.js +368 -215
  148. package/dist/http/http.mock.js +104 -49
  149. package/dist/hub-source/hub-source.js +191 -83
  150. package/dist/hub-source/hub-source__user.js +45 -11
  151. package/dist/hub-source/hub-source__users-groups.js +67 -37
  152. package/dist/i18n/i18n-context.js +14 -10
  153. package/dist/i18n/i18n.js +11 -7
  154. package/dist/icon/icon.js +94 -76
  155. package/dist/icon/icon__svg.js +31 -24
  156. package/dist/icon/index.js +9 -0
  157. package/dist/icon-ng/icon-ng.js +27 -15
  158. package/dist/input/input.js +184 -145
  159. package/dist/input-ng/input-ng.js +96 -118
  160. package/dist/island/adaptive-island-hoc.js +45 -30
  161. package/dist/island/content.js +130 -115
  162. package/dist/island/header.js +69 -56
  163. package/dist/island/island.js +40 -28
  164. package/dist/island-legacy/content-legacy.js +27 -17
  165. package/dist/island-legacy/header-legacy.js +29 -19
  166. package/dist/island-legacy/island-legacy.js +27 -17
  167. package/dist/island-ng/island-content-ng.js +17 -26
  168. package/dist/island-ng/island-header-ng.js +9 -12
  169. package/dist/island-ng/island-ng-class-fixer.js +3 -0
  170. package/dist/island-ng/island-ng.js +6 -10
  171. package/dist/link/clickableLink.js +61 -44
  172. package/dist/link/link.js +85 -74
  173. package/dist/link-ng/link-ng.js +3 -5
  174. package/dist/list/consts.js +1 -1
  175. package/dist/list/list.js +696 -602
  176. package/dist/list/list__custom.js +61 -44
  177. package/dist/list/list__hint.js +21 -10
  178. package/dist/list/list__item.js +167 -129
  179. package/dist/list/list__link.js +54 -37
  180. package/dist/list/list__separator.js +24 -14
  181. package/dist/list/list__title.js +32 -22
  182. package/dist/list/list__users-groups-source.js +131 -54
  183. package/dist/loader/loader.js +78 -43
  184. package/dist/loader/loader__core.js +257 -189
  185. package/dist/loader-inline/loader-inline.js +37 -23
  186. package/dist/loader-inline-ng/loader-inline-ng.js +2 -2
  187. package/dist/loader-ng/loader-ng.js +46 -19
  188. package/dist/loader-screen/loader-screen.js +48 -25
  189. package/dist/loader-screen-ng/loader-screen-ng.js +46 -30
  190. package/dist/login-dialog/login-dialog.js +162 -111
  191. package/dist/login-dialog/service.js +35 -7
  192. package/dist/markdown/code.js +31 -9
  193. package/dist/markdown/heading.js +3 -5
  194. package/dist/markdown/link.js +13 -6
  195. package/dist/markdown/markdown.js +66 -33
  196. package/dist/message/message.js +157 -125
  197. package/dist/message-bundle-ng/message-bundle-ng.js +128 -44
  198. package/dist/old-browsers-message/old-browsers-message.js +19 -11
  199. package/dist/old-browsers-message/old-browsers-message__stop.js +8 -0
  200. package/dist/old-browsers-message/white-list.js +16 -9
  201. package/dist/pager/pager.js +275 -210
  202. package/dist/pager-ng/pager-ng.js +36 -1
  203. package/dist/panel/panel.js +27 -17
  204. package/dist/panel-ng/panel-ng.js +14 -1
  205. package/dist/permissions/permissions.js +173 -127
  206. package/dist/permissions/permissions__cache.js +225 -194
  207. package/dist/permissions-ng/permissions-ng.js +86 -35
  208. package/dist/place-under-ng/place-under-ng.js +68 -45
  209. package/dist/popup/popup.consts.js +1 -1
  210. package/dist/popup/popup.js +342 -280
  211. package/dist/popup/popup.target.js +8 -9
  212. package/dist/popup/position.js +153 -153
  213. package/dist/popup-menu/popup-menu.js +86 -44
  214. package/dist/progress-bar/progress-bar.js +97 -80
  215. package/dist/progress-bar-ng/progress-bar-ng.js +11 -1
  216. package/dist/promised-click-ng/promised-click-ng.js +92 -58
  217. package/dist/proxy-attrs/proxy-attrs.js +18 -9
  218. package/dist/query-assist/query-assist.js +903 -832
  219. package/dist/query-assist/query-assist__suggestions.js +33 -1
  220. package/dist/query-assist-ng/query-assist-ng.js +38 -1
  221. package/dist/radio/radio.js +36 -19
  222. package/dist/radio/radio__item.js +71 -52
  223. package/dist/radio-ng/radio-ng.js +14 -25
  224. package/dist/save-field-ng/save-field-ng.js +86 -52
  225. package/dist/save-field-ng/save-field-ng__template.js +1 -32
  226. package/dist/select/select.js +937 -835
  227. package/dist/select/select__filter.js +33 -0
  228. package/dist/select/select__popup.js +472 -359
  229. package/dist/select-ng/select-ng.js +125 -74
  230. package/dist/select-ng/select-ng__lazy.js +101 -50
  231. package/dist/select-ng/select-ng__options.js +107 -81
  232. package/dist/shortcuts/core.js +218 -166
  233. package/dist/shortcuts/shortcut-title.js +11 -6
  234. package/dist/shortcuts/shortcuts-hoc.js +47 -19
  235. package/dist/shortcuts/shortcuts.js +77 -50
  236. package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +104 -53
  237. package/dist/shortcuts-hint-ng/shortcuts-hint-ng__template.js +1 -48
  238. package/dist/shortcuts-ng/shortcuts-ng.js +86 -51
  239. package/dist/sidebar-ng/sidebar-ng.js +53 -22
  240. package/dist/sidebar-ng/sidebar-ng__button-template.js +1 -18
  241. package/dist/sidebar-ng/sidebar-ng__template.js +1 -10
  242. package/dist/storage/storage.js +35 -4
  243. package/dist/storage/storage__fallback.js +224 -149
  244. package/dist/storage/storage__local.js +156 -90
  245. package/dist/tab-trap/tab-trap.js +157 -122
  246. package/dist/table/cell.js +28 -14
  247. package/dist/table/disable-hover-hoc.js +53 -33
  248. package/dist/table/header-cell.js +87 -64
  249. package/dist/table/header.js +126 -98
  250. package/dist/table/multitable.js +127 -107
  251. package/dist/table/row-with-focus-sensor.js +73 -25
  252. package/dist/table/row.js +208 -170
  253. package/dist/table/selection-adapter.js +3 -1
  254. package/dist/table/selection-shortcuts-hoc.js +184 -181
  255. package/dist/table/selection.js +228 -156
  256. package/dist/table/smart-table.js +93 -51
  257. package/dist/table/table.js +348 -281
  258. package/dist/table-legacy-ng/table-legacy-ng.js +117 -102
  259. package/dist/table-legacy-ng/table-legacy-ng__pager.js +42 -10
  260. package/dist/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +92 -69
  261. package/dist/table-legacy-ng/table-legacy-ng__selection.js +169 -119
  262. package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +36 -21
  263. package/dist/table-ng/smart-table-ng.js +31 -1
  264. package/dist/table-ng/table-ng.js +31 -1
  265. package/dist/tabs/collapsible-more.js +87 -50
  266. package/dist/tabs/collapsible-tab.js +45 -38
  267. package/dist/tabs/collapsible-tabs.js +161 -94
  268. package/dist/tabs/custom-item.js +2 -4
  269. package/dist/tabs/dumb-tabs.js +122 -75
  270. package/dist/tabs/smart-tabs.js +75 -29
  271. package/dist/tabs/tab-link.js +29 -19
  272. package/dist/tabs/tab.js +33 -19
  273. package/dist/tabs/tabs.js +35 -0
  274. package/dist/tabs-ng/tabs-ng.js +38 -24
  275. package/dist/tabs-ng/tabs-ng__template.js +1 -38
  276. package/dist/tag/tag.js +170 -133
  277. package/dist/tags-input/tags-input.js +428 -327
  278. package/dist/tags-input-ng/tags-input-ng.js +37 -1
  279. package/dist/tags-list/tags-list.js +80 -56
  280. package/dist/template-ng/template-ng.js +50 -39
  281. package/dist/text/text.js +38 -28
  282. package/dist/title-ng/title-ng.js +28 -23
  283. package/dist/toggle/toggle.js +72 -56
  284. package/dist/toggle-ng/toggle-ng.js +14 -1
  285. package/dist/tooltip/tooltip.js +192 -146
  286. package/dist/tooltip-ng/tooltip-ng.js +51 -25
  287. package/dist/user-agreement/service.js +374 -227
  288. package/dist/user-agreement/toolbox.eula.js +1 -160
  289. package/dist/user-agreement/user-agreement.js +128 -86
  290. package/dist/user-card/card.js +32 -0
  291. package/dist/user-card/smart-user-card-tooltip.js +116 -51
  292. package/dist/user-card/tooltip.js +90 -48
  293. package/dist/user-card/user-card.js +32 -0
  294. package/dist/user-card-ng/user-card-ng.js +34 -2
  295. package/package.json +2 -2
@@ -1,3 +1,17 @@
1
+ import { g as _toConsumableArray, j as _inherits, k as _createSuper, b as _classCallCheck, c as _defineProperty, m as _assertThisInitialized, _ as _createClass, n as _createForOfIteratorHelper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/es.array.concat.js';
3
+ import 'core-js/modules/es.reflect.delete-property.js';
4
+ import 'core-js/modules/es.object.to-string.js';
5
+ import 'core-js/modules/es.symbol.js';
6
+ import 'core-js/modules/es.symbol.description.js';
7
+ import 'core-js/modules/es.object.assign.js';
8
+ import 'core-js/modules/web.dom-collections.for-each.js';
9
+ import 'core-js/modules/es.promise.js';
10
+ import 'core-js/modules/es.promise.finally.js';
11
+ import 'core-js/modules/es.array.filter.js';
12
+ import 'core-js/modules/es.array.from.js';
13
+ import 'core-js/modules/es.string.iterator.js';
14
+ import 'core-js/modules/es.parse-float.js';
1
15
  import angular from 'angular';
2
16
  import { createFocusTrap } from 'focus-trap';
3
17
  import { getStyles, getRect } from '../global/dom.js';
@@ -9,17 +23,36 @@ import rgCompilerModuleName from '../compiler-ng/compiler-ng.js';
9
23
  import { m as modules_5e9b8c03, p as preventerFactory } from '../_helpers/dialog__body-scroll-preventer.js';
10
24
  import { m as modules_e6a056e1 } from '../_helpers/island.js';
11
25
  import dialogTemplate from './dialog-ng__template.js';
26
+ import 'core-js/modules/es.regexp.exec.js';
27
+ import 'core-js/modules/es.string.split.js';
28
+ import 'core-js/modules/es.object.entries.js';
29
+ import 'core-js/modules/es.object.keys.js';
30
+ import 'core-js/modules/es.array.iterator.js';
31
+ import 'core-js/modules/es.set.js';
32
+ import 'core-js/modules/web.dom-collections.iterator.js';
33
+ import 'core-js/modules/es.array.includes.js';
34
+ import 'core-js/modules/es.string.includes.js';
35
+ import 'core-js/modules/es.array.slice.js';
36
+ import 'core-js/modules/es.array.splice.js';
37
+ import 'core-js/modules/es.array.map.js';
38
+ import 'core-js/modules/es.string.match.js';
39
+ import 'core-js/modules/es.array.find-index.js';
12
40
  import 'combokeys';
13
41
  import '../global/sniffer.js';
14
42
  import 'sniffr';
43
+ import 'core-js/modules/es.array.reduce.js';
44
+ import 'core-js/modules/es.object.values.js';
15
45
  import 'classnames';
16
46
  import '../icon-ng/icon-ng.js';
47
+ import 'core-js/modules/es.array.index-of.js';
48
+ import 'core-js/modules/es.string.replace.js';
17
49
  import '../icon/icon__constants.js';
18
50
  import '../template-ng/template-ng.js';
19
51
  import '../_helpers/icon.js';
20
52
  import '../_helpers/button__classes.js';
21
53
  import '../global/controls-height.js';
22
54
  import 'react';
55
+ import 'core-js/modules/es.string.trim.js';
23
56
  import 'scrollbar-width';
24
57
 
25
58
  var modules_b378ce5a = {"unit":"i__const_unit_0","light":"light_rui_2ac4","dialogContainer":"dialogContainer_rui_0b63","wide":"wide_rui_0b63","autoWidth":"autoWidth_rui_0b63","header":"header_rui_0b63","inSidebar":"inSidebar_rui_0b63","scrollableWrapper":"scrollableWrapper_rui_0b63","content":"content_rui_0b63","error":"error_rui_0b63","footer":"footer_rui_0b63","footerDescription":"footerDescription_rui_0b63","footerItems":"footerItems_rui_0b63","footerItem":"footerItem_rui_0b63"};
@@ -31,335 +64,410 @@ rgDialogDirective.$inject = ["$timeout"];
31
64
  * @name Dialog Ng
32
65
  */
33
66
 
34
- const angularModule = angular.module('Ring.dialog', [ButtonNG, PromisedClick, rgCompilerModuleName]);
35
- class DialogController extends RingAngularComponent {
36
- constructor() {
37
- super(...arguments);
38
- this.styles = modules_b378ce5a;
39
- this.dialogStyles = modules_5e9b8c03;
40
- this.islandStyles = modules_e6a056e1;
41
- this.scrollPreventer = preventerFactory();
42
- this.$inject.$q((resolve, reject) => {
43
- this.resolve = resolve;
44
- this.reject = reject;
45
- });
46
- }
47
- $onInit() {
48
- const {
49
- dialog,
50
- dialogInSidebar,
51
- $scope
52
- } = this.$inject;
53
- const dialogService = this.inSidebar ? dialogInSidebar : dialog;
54
- this.focusTrap = createFocusTrap(this.$inject.$element[0], {
55
- fallbackFocus: '[data-anchor="focus-trap-fallback"]',
56
- escapeDeactivates: false
57
- });
58
- this.dialogService = dialogService;
59
- this.previousBodyWidth = null;
60
- $scope.$on('$routeChangeSuccess', this.hide);
61
- $scope.$on('$routeUpdate', this.hide);
62
- $scope.$on('$destroy', dialogService.unregister);
63
- $scope.$watch(() => this.active, () => {
64
- if (this.active) {
65
- shortcutsInstance.bindMap(this.getShortcuts(), {
66
- scope: this.DIALOG_NAMESPACE
67
- });
68
- } else {
69
- this.reset();
67
+ var angularModule = angular.module('Ring.dialog', [ButtonNG, PromisedClick, rgCompilerModuleName]);
68
+ var DialogController = /*#__PURE__*/function (_RingAngularComponent) {
69
+ _inherits(DialogController, _RingAngularComponent);
70
+ var _super = _createSuper(DialogController);
71
+ function DialogController() {
72
+ var _this;
73
+ _classCallCheck(this, DialogController);
74
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
75
+ args[_key] = arguments[_key];
76
+ }
77
+ _this = _super.call.apply(_super, [this].concat(args));
78
+ _defineProperty(_assertThisInitialized(_this), "hide", function () {
79
+ if (!_this.inSidebar) {
80
+ _this.scrollPreventer.reset();
81
+ }
82
+ _this.active = false;
83
+ _this.content = '';
84
+ _this.focusTrap.deactivate();
85
+ Reflect.deleteProperty(_assertThisInitialized(_this), 'DIALOG_NAMESPACE');
86
+ if (shortcutsInstance.indexOfScope(_this.dialogService.DIALOG_NAMESPACE) > -1) {
87
+ shortcutsInstance.setScope(_this.currentShortcutsScope);
70
88
  }
89
+ _this._resetFormState();
90
+ _this.$inject.$scope.$broadcast('dialog.hide');
71
91
  });
72
- dialogService.register(this);
73
- }
74
- getShortcuts() {
75
- const defaultEscHandler = function escHandler() {
76
- this.active = false;
77
- this.focusTrap.deactivate();
78
- this.$inject.$scope.$apply();
79
- }.bind(this);
80
- const dialogShortcuts = {
81
- esc: defaultEscHandler,
82
- enter: this.applyDefaultHandler(false),
83
- 'mod+enter': this.applyDefaultHandler(true)
84
- };
85
- angular.extend(dialogShortcuts, this.shortcuts);
86
- if (this.shortcuts && this.shortcuts.esc) {
87
- /**
88
- * Merge ESC handler
89
- * @type {Function} {dialogShortcuts.esc}
90
- */
91
- const customHandler = dialogShortcuts.esc;
92
- dialogShortcuts.esc = () => {
93
- const result = customHandler();
94
- defaultEscHandler();
95
- return result;
96
- };
97
- }
98
- return dialogShortcuts;
92
+ _defineProperty(_assertThisInitialized(_this), "serverErrorFields", []);
93
+ _this.styles = modules_b378ce5a;
94
+ _this.dialogStyles = modules_5e9b8c03;
95
+ _this.islandStyles = modules_e6a056e1;
96
+ _this.scrollPreventer = preventerFactory();
97
+ _this.$inject.$q(function (resolve, reject) {
98
+ _this.resolve = resolve;
99
+ _this.reject = reject;
100
+ });
101
+ return _this;
99
102
  }
100
- handleClick(event) {
101
- const isOverlayClicked = event.target === event.currentTarget;
102
- if (this.inSidebar || !this.closeOnClick || !isOverlayClicked) {
103
- return;
103
+ _createClass(DialogController, [{
104
+ key: "$onInit",
105
+ value: function $onInit() {
106
+ var _this2 = this;
107
+ var _this$$inject = this.$inject,
108
+ dialog = _this$$inject.dialog,
109
+ dialogInSidebar = _this$$inject.dialogInSidebar,
110
+ $scope = _this$$inject.$scope;
111
+ var dialogService = this.inSidebar ? dialogInSidebar : dialog;
112
+ this.focusTrap = createFocusTrap(this.$inject.$element[0], {
113
+ fallbackFocus: '[data-anchor="focus-trap-fallback"]',
114
+ escapeDeactivates: false
115
+ });
116
+ this.dialogService = dialogService;
117
+ this.previousBodyWidth = null;
118
+ $scope.$on('$routeChangeSuccess', this.hide);
119
+ $scope.$on('$routeUpdate', this.hide);
120
+ $scope.$on('$destroy', dialogService.unregister);
121
+ $scope.$watch(function () {
122
+ return _this2.active;
123
+ }, function () {
124
+ if (_this2.active) {
125
+ shortcutsInstance.bindMap(_this2.getShortcuts(), {
126
+ scope: _this2.DIALOG_NAMESPACE
127
+ });
128
+ } else {
129
+ _this2.reset();
130
+ }
131
+ });
132
+ dialogService.register(this);
104
133
  }
105
- this.hide();
106
- }
107
- setTitle(title) {
108
- this.title = title;
109
- }
110
- compileTemplate() {
111
- if (this.config.data) {
112
- const element = angular.element(this.template);
113
- return {
114
- element,
115
- link: this.$inject.$compile(element)
134
+ }, {
135
+ key: "getShortcuts",
136
+ value: function getShortcuts() {
137
+ var defaultEscHandler = function escHandler() {
138
+ this.active = false;
139
+ this.focusTrap.deactivate();
140
+ this.$inject.$scope.$apply();
141
+ }.bind(this);
142
+ var dialogShortcuts = {
143
+ esc: defaultEscHandler,
144
+ enter: this.applyDefaultHandler(false),
145
+ 'mod+enter': this.applyDefaultHandler(true)
116
146
  };
147
+ angular.extend(dialogShortcuts, this.shortcuts);
148
+ if (this.shortcuts && this.shortcuts.esc) {
149
+ /**
150
+ * Merge ESC handler
151
+ * @type {Function} {dialogShortcuts.esc}
152
+ */
153
+ var customHandler = dialogShortcuts.esc;
154
+ dialogShortcuts.esc = function () {
155
+ var result = customHandler();
156
+ defaultEscHandler();
157
+ return result;
158
+ };
159
+ }
160
+ return dialogShortcuts;
117
161
  }
118
- return this.$inject.rgCompiler(this.config).catch(error => {
119
- this.reject(error);
120
- return this.$inject.$q.reject(error);
121
- });
122
- }
123
- show(config) {
124
- const {
125
- $q,
126
- $scope
127
- } = this.$inject;
128
- if (!this.inSidebar) {
129
- this.scrollPreventer.prevent();
130
- if (config && config.trapFocus === true) {
131
- this.focusTrap.activate();
162
+ }, {
163
+ key: "handleClick",
164
+ value: function handleClick(event) {
165
+ var isOverlayClicked = event.target === event.currentTarget;
166
+ if (this.inSidebar || !this.closeOnClick || !isOverlayClicked) {
167
+ return;
132
168
  }
169
+ this.hide();
133
170
  }
134
- if (this.active) {
135
- this.reset();
171
+ }, {
172
+ key: "setTitle",
173
+ value: function setTitle(title) {
174
+ this.title = title;
136
175
  }
137
-
138
- // Clear dialog errors
139
- this.error = null;
140
- if (this.dialogForm) {
141
- this.dialogForm.$setPristine();
176
+ }, {
177
+ key: "compileTemplate",
178
+ value: function compileTemplate() {
179
+ var _this3 = this;
180
+ if (this.config.data) {
181
+ var element = angular.element(this.template);
182
+ return {
183
+ element: element,
184
+ link: this.$inject.$compile(element)
185
+ };
186
+ }
187
+ return this.$inject.rgCompiler(this.config).catch(function (error) {
188
+ _this3.reject(error);
189
+ return _this3.$inject.$q.reject(error);
190
+ });
142
191
  }
143
- if (config) {
144
- this.title = config.title;
145
- this.buttons = config.buttons;
146
- this.data = config.data || {};
147
- this.wideDialog = config.wideDialog;
148
- this.autoWidth = config.autoWidth;
149
- this.scrollableWrapperClassName = config.scrollableWrapperClassName;
150
- this.cssClass = config.cssClass || '';
151
- this.shortcuts = config.shortcuts;
152
- this.content = config.content;
153
- this.template = config.template;
154
- this.config = config;
155
- this.description = config.description && config.description.split('\n') || [];
156
- this.closeOnClick = config.closeOnClick;
192
+ }, {
193
+ key: "show",
194
+ value: function show(config) {
195
+ var _this4 = this;
196
+ var _this$$inject2 = this.$inject,
197
+ $q = _this$$inject2.$q,
198
+ $scope = _this$$inject2.$scope;
199
+ if (!this.inSidebar) {
200
+ this.scrollPreventer.prevent();
201
+ if (config && config.trapFocus === true) {
202
+ this.focusTrap.activate();
203
+ }
204
+ }
205
+ if (this.active) {
206
+ this.reset();
207
+ }
157
208
 
158
- // Backward compatibility with existing templates which use data directly from scope
159
- $scope.data = this.data;
160
- }
161
- this.currentShortcutsScope = shortcutsInstance.getScope();
162
- this.DIALOG_NAMESPACE = this.dialogService.DIALOG_NAMESPACE;
163
- shortcutsInstance.setScope(this.dialogService.DIALOG_NAMESPACE);
164
- this.active = true;
165
- $scope.$broadcast('dialog.show');
166
- return $q((resolve, reject) => {
167
- this.resolve = resolve;
168
- this.reject = reject;
169
- });
170
- }
171
- update() {
172
- let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
173
- Object.assign(this.data, config.data);
174
- Object.assign(this.buttons, config.buttons);
175
- }
176
- hide = () => {
177
- if (!this.inSidebar) {
178
- this.scrollPreventer.reset();
209
+ // Clear dialog errors
210
+ this.error = null;
211
+ if (this.dialogForm) {
212
+ this.dialogForm.$setPristine();
213
+ }
214
+ if (config) {
215
+ this.title = config.title;
216
+ this.buttons = config.buttons;
217
+ this.data = config.data || {};
218
+ this.wideDialog = config.wideDialog;
219
+ this.autoWidth = config.autoWidth;
220
+ this.scrollableWrapperClassName = config.scrollableWrapperClassName;
221
+ this.cssClass = config.cssClass || '';
222
+ this.shortcuts = config.shortcuts;
223
+ this.content = config.content;
224
+ this.template = config.template;
225
+ this.config = config;
226
+ this.description = config.description && config.description.split('\n') || [];
227
+ this.closeOnClick = config.closeOnClick;
228
+
229
+ // Backward compatibility with existing templates which use data directly from scope
230
+ $scope.data = this.data;
231
+ }
232
+ this.currentShortcutsScope = shortcutsInstance.getScope();
233
+ this.DIALOG_NAMESPACE = this.dialogService.DIALOG_NAMESPACE;
234
+ shortcutsInstance.setScope(this.dialogService.DIALOG_NAMESPACE);
235
+ this.active = true;
236
+ $scope.$broadcast('dialog.show');
237
+ return $q(function (resolve, reject) {
238
+ _this4.resolve = resolve;
239
+ _this4.reject = reject;
240
+ });
179
241
  }
180
- this.active = false;
181
- this.content = '';
182
- this.focusTrap.deactivate();
183
- Reflect.deleteProperty(this, 'DIALOG_NAMESPACE');
184
- if (shortcutsInstance.indexOfScope(this.dialogService.DIALOG_NAMESPACE) > -1) {
185
- shortcutsInstance.setScope(this.currentShortcutsScope);
242
+ }, {
243
+ key: "update",
244
+ value: function update() {
245
+ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
246
+ Object.assign(this.data, config.data);
247
+ Object.assign(this.buttons, config.buttons);
186
248
  }
187
- this._resetFormState();
188
- this.$inject.$scope.$broadcast('dialog.hide');
189
- };
190
- _resetFormState() {
191
- const dialogForm = this.dialogForm;
192
- if (!dialogForm) {
193
- return;
249
+ }, {
250
+ key: "_resetFormState",
251
+ value: function _resetFormState() {
252
+ var dialogForm = this.dialogForm;
253
+ if (!dialogForm) {
254
+ return;
255
+ }
256
+ dialogForm.$setPristine();
257
+ dialogForm.$setUntouched();
258
+ dialogForm.$valid = true;
259
+ dialogForm.$invalid = false;
260
+ dialogForm.$error = {};
194
261
  }
195
- dialogForm.$setPristine();
196
- dialogForm.$setUntouched();
197
- dialogForm.$valid = true;
198
- dialogForm.$invalid = false;
199
- dialogForm.$error = {};
200
- }
201
- done(result) {
202
- this.resetPosition();
203
- this.resolve(result);
204
- this.hide();
205
- }
206
- reset(result) {
207
- this.done(result);
208
- }
209
- getErrorMessage(errorResponse) {
210
- if (errorResponse?.data?.error_description) {
211
- return errorResponse.data.error_description;
262
+ }, {
263
+ key: "done",
264
+ value: function done(result) {
265
+ this.resetPosition();
266
+ this.resolve(result);
267
+ this.hide();
212
268
  }
213
- if (errorResponse?.data?.error) {
214
- return errorResponse.data.error;
269
+ }, {
270
+ key: "reset",
271
+ value: function reset(result) {
272
+ this.done(result);
215
273
  }
216
- return errorResponse;
217
- }
218
- getFieldErrorMessage(errorResponse) {
219
- if (errorResponse && errorResponse.data && errorResponse.data.error) {
220
- return errorResponse.data.error;
274
+ }, {
275
+ key: "getErrorMessage",
276
+ value: function getErrorMessage(errorResponse) {
277
+ var _errorResponse$data, _errorResponse$data2;
278
+ if (errorResponse !== null && errorResponse !== void 0 && (_errorResponse$data = errorResponse.data) !== null && _errorResponse$data !== void 0 && _errorResponse$data.error_description) {
279
+ return errorResponse.data.error_description;
280
+ }
281
+ if (errorResponse !== null && errorResponse !== void 0 && (_errorResponse$data2 = errorResponse.data) !== null && _errorResponse$data2 !== void 0 && _errorResponse$data2.error) {
282
+ return errorResponse.data.error;
283
+ }
284
+ return errorResponse;
221
285
  }
222
- return null;
223
- }
224
- serverErrorFields = [];
225
- action(button) {
226
- if (button.inProgress) {
227
- return undefined;
286
+ }, {
287
+ key: "getFieldErrorMessage",
288
+ value: function getFieldErrorMessage(errorResponse) {
289
+ if (errorResponse && errorResponse.data && errorResponse.data.error) {
290
+ return errorResponse.data.error;
291
+ }
292
+ return null;
228
293
  }
229
- const errorReporter = errorResponse => {
230
- const errorField = errorResponse && errorResponse.data && errorResponse.data.error_field;
231
- if (errorField && this.dialogForm[errorField]) {
232
- this.dialogForm[errorField].$invalid = true;
233
- this.dialogForm[errorField].$error[errorField] = [{
234
- message: this.getFieldErrorMessage(errorResponse)
235
- }];
236
- this.serverErrorFields.push(errorField);
237
- } else {
238
- this.error = this.$inject.$sce.trustAsHtml(this.getErrorMessage(errorResponse));
294
+ }, {
295
+ key: "action",
296
+ value: function action(button) {
297
+ var _this5 = this;
298
+ if (button.inProgress) {
299
+ return undefined;
239
300
  }
240
- };
241
- if (button.action) {
242
- if (!button.keepServerErrors) {
243
- this.serverErrorFields.forEach(errorField => {
244
- this.dialogForm[errorField].$invalid = false;
245
- this.dialogForm[errorField].$error = {};
301
+ var errorReporter = function errorReporter(errorResponse) {
302
+ var errorField = errorResponse && errorResponse.data && errorResponse.data.error_field;
303
+ if (errorField && _this5.dialogForm[errorField]) {
304
+ _this5.dialogForm[errorField].$invalid = true;
305
+ _this5.dialogForm[errorField].$error[errorField] = [{
306
+ message: _this5.getFieldErrorMessage(errorResponse)
307
+ }];
308
+ _this5.serverErrorFields.push(errorField);
309
+ } else {
310
+ _this5.error = _this5.$inject.$sce.trustAsHtml(_this5.getErrorMessage(errorResponse));
311
+ }
312
+ };
313
+ if (button.action) {
314
+ if (!button.keepServerErrors) {
315
+ this.serverErrorFields.forEach(function (errorField) {
316
+ _this5.dialogForm[errorField].$invalid = false;
317
+ _this5.dialogForm[errorField].$error = {};
318
+ });
319
+ this.serverErrorFields = [];
320
+ }
321
+ var actionResult = button.action(this.data, button, errorReporter, this.dialogForm, this.buttons);
322
+ button.inProgress = true;
323
+ return this.$inject.$q.resolve(actionResult).then(function (res) {
324
+ var dontClose = res === false;
325
+ if (!dontClose && button.close !== false) {
326
+ _this5.done(res);
327
+ }
328
+ }).catch(errorReporter).finally(function () {
329
+ button.inProgress = false;
246
330
  });
247
- this.serverErrorFields = [];
331
+ } else if (button.close !== false) {
332
+ this.reset(false);
248
333
  }
249
- const actionResult = button.action(this.data, button, errorReporter, this.dialogForm, this.buttons);
250
- button.inProgress = true;
251
- return this.$inject.$q.resolve(actionResult).then(res => {
252
- const dontClose = res === false;
253
- if (!dontClose && button.close !== false) {
254
- this.done(res);
255
- }
256
- }).catch(errorReporter).finally(() => {
257
- button.inProgress = false;
258
- });
259
- } else if (button.close !== false) {
260
- this.reset(false);
334
+ return undefined;
261
335
  }
262
- return undefined;
263
- }
264
- applyDefaultHandler(isTextAreaShortcut) {
265
- return event => {
266
- if (event.target.matches('textarea') !== isTextAreaShortcut || event.target.matches('button')) {
267
- return;
268
- }
269
- event.stopPropagation();
270
- event.preventDefault();
271
- if (this.dialogForm.$valid && this.buttons) {
272
- for (const button of this.buttons) {
273
- if (button.default && !button.hidden && !button.disabled) {
274
- this.action(button);
275
- this.$inject.$scope.$apply();
276
- return;
336
+ }, {
337
+ key: "applyDefaultHandler",
338
+ value: function applyDefaultHandler(isTextAreaShortcut) {
339
+ var _this6 = this;
340
+ return function (event) {
341
+ if (event.target.matches('textarea') !== isTextAreaShortcut || event.target.matches('button')) {
342
+ return;
343
+ }
344
+ event.stopPropagation();
345
+ event.preventDefault();
346
+ if (_this6.dialogForm.$valid && _this6.buttons) {
347
+ var _iterator = _createForOfIteratorHelper(_this6.buttons),
348
+ _step;
349
+ try {
350
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
351
+ var button = _step.value;
352
+ if (button.default && !button.hidden && !button.disabled) {
353
+ _this6.action(button);
354
+ _this6.$inject.$scope.$apply();
355
+ return;
356
+ }
357
+ }
358
+ } catch (err) {
359
+ _iterator.e(err);
360
+ } finally {
361
+ _iterator.f();
277
362
  }
278
363
  }
279
- }
280
- };
281
- }
282
- }
283
- DialogController.$inject = [];
364
+ };
365
+ }
366
+ }]);
367
+ return DialogController;
368
+ }(RingAngularComponent);
284
369
  DialogController.$inject = ['$scope', '$q', 'dialog', '$element', 'dialogInSidebar', '$compile', '$injector', '$controller', 'rgCompiler', '$sce'];
285
- class DialogService extends RingAngularComponent {
286
- DIALOG_NAMESPACE = 'ring-dialog';
287
- fallbackDialog = null;
288
- constructor() {
289
- super(...arguments);
370
+ var DialogService = /*#__PURE__*/function (_RingAngularComponent2) {
371
+ _inherits(DialogService, _RingAngularComponent2);
372
+ var _super2 = _createSuper(DialogService);
373
+ function DialogService() {
374
+ var _this7;
375
+ _classCallCheck(this, DialogService);
376
+ for (var _len2 = arguments.length, constrArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
377
+ constrArgs[_key2] = arguments[_key2];
378
+ }
379
+ _this7 = _super2.call.apply(_super2, [this].concat(constrArgs));
290
380
 
291
381
  // Binding proxy methods to a service instance
292
- ['show', 'hide', 'update', 'done', 'reset'].forEach(key => {
293
- this[key] = function methodWrapper() {
382
+ _defineProperty(_assertThisInitialized(_this7), "DIALOG_NAMESPACE", 'ring-dialog');
383
+ _defineProperty(_assertThisInitialized(_this7), "fallbackDialog", null);
384
+ _defineProperty(_assertThisInitialized(_this7), "unregister", function () {
385
+ Reflect.deleteProperty(_assertThisInitialized(_this7), 'ctrl');
386
+ });
387
+ ['show', 'hide', 'update', 'done', 'reset'].forEach(function (key) {
388
+ _this7[key] = function methodWrapper() {
294
389
  if (this.ctrl) {
295
- return this.ctrl[key](...arguments);
390
+ var _this$ctrl;
391
+ return (_this$ctrl = this.ctrl)[key].apply(_this$ctrl, arguments);
296
392
  } else if (this.fallbackDialog) {
297
- return this.fallbackDialog[key](...arguments);
393
+ var _this$fallbackDialog;
394
+ return (_this$fallbackDialog = this.fallbackDialog)[key].apply(_this$fallbackDialog, arguments);
298
395
  } else {
299
396
  this.$inject.$log.error('No dialog directive is found');
300
397
  return undefined;
301
398
  }
302
- }.bind(this);
399
+ }.bind(_assertThisInitialized(_this7));
303
400
  });
401
+ return _this7;
304
402
  }
305
- register(ctrl) {
306
- this.ctrl = ctrl;
307
- }
308
- unregister = () => {
309
- Reflect.deleteProperty(this, 'ctrl');
310
- };
311
- }
312
- DialogService.$inject = [];
403
+ _createClass(DialogService, [{
404
+ key: "register",
405
+ value: function register(ctrl) {
406
+ this.ctrl = ctrl;
407
+ }
408
+ }]);
409
+ return DialogService;
410
+ }(RingAngularComponent);
313
411
  DialogService.$inject = ['$log'];
314
- class DialogInSidebarService extends DialogService {
315
- DIALOG_NAMESPACE = 'ring-dialog-in-sidebar';
316
- constructor() {
317
- super(...arguments);
318
- this.fallbackDialog = this.$inject.dialog;
412
+ var DialogInSidebarService = /*#__PURE__*/function (_DialogService) {
413
+ _inherits(DialogInSidebarService, _DialogService);
414
+ var _super3 = _createSuper(DialogInSidebarService);
415
+ function DialogInSidebarService() {
416
+ var _this8;
417
+ _classCallCheck(this, DialogInSidebarService);
418
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
419
+ args[_key3] = arguments[_key3];
420
+ }
421
+ _this8 = _super3.call.apply(_super3, [this].concat(args));
422
+ _defineProperty(_assertThisInitialized(_this8), "DIALOG_NAMESPACE", 'ring-dialog-in-sidebar');
423
+ _this8.fallbackDialog = _this8.$inject.dialog;
424
+ return _this8;
319
425
  }
320
- }
321
- DialogInSidebarService.$inject = [];
322
- DialogInSidebarService.$inject = [...DialogService.$inject, 'dialog'];
426
+ return _createClass(DialogInSidebarService);
427
+ }(DialogService);
428
+ DialogInSidebarService.$inject = [].concat(_toConsumableArray(DialogService.$inject), ['dialog']);
323
429
  function rgDialogDirective($timeout) {
324
430
  function link(scope, iElement, iAttrs, dialogCtrl) {
325
- const node = iElement[0];
326
- const dialogContainer = node.querySelector('*[data-anchor=dialog-container]');
327
- const dialogHeader = node.querySelector('*[data-anchor=dialog-header]');
328
- const dialogCustomFooter = node.querySelector('*[data-anchor=dialog-custom-footer-container]');
431
+ var node = iElement[0];
432
+ var dialogContainer = node.querySelector('*[data-anchor=dialog-container]');
433
+ var dialogHeader = node.querySelector('*[data-anchor=dialog-header]');
434
+ var dialogCustomFooter = node.querySelector('*[data-anchor=dialog-custom-footer-container]');
329
435
 
330
436
  // Left for backward compatibility with existing templates that use data directly from scope
331
437
  scope.dialogForm = dialogCtrl.dialogForm;
332
438
  function setPosition(top, left) {
333
439
  Object.assign(dialogContainer.style, {
334
- top: `${top}px`,
335
- left: `${left}px`
440
+ top: "".concat(top, "px"),
441
+ left: "".concat(left, "px")
336
442
  });
337
443
  }
338
444
 
339
445
  // Focus first input
340
446
  function focusFirst() {
341
- const controls = Array.from(node.querySelectorAll('input,select,button,textarea,*[contentEditable=true]')).filter(inputNode => getStyles(inputNode).display !== 'none');
447
+ var controls = Array.from(node.querySelectorAll('input,select,button,textarea,*[contentEditable=true]')).filter(function (inputNode) {
448
+ return getStyles(inputNode).display !== 'none';
449
+ });
342
450
  if (controls.length) {
343
451
  controls[0].focus();
344
452
  }
345
453
  }
346
454
  function onMousemove(e) {
347
455
  e.preventDefault();
348
- const pageHeight = window.innerHeight;
349
- const pageWidth = window.innerWidth;
350
- const clearance = 10;
351
- const maxTop = pageHeight - clearance;
352
- const maxLeft = pageWidth - clearance;
353
- const newTop = getRect(dialogHeader).top + e.movementY;
354
- const newLeft = getRect(dialogHeader).left + e.movementX;
456
+ var pageHeight = window.innerHeight;
457
+ var pageWidth = window.innerWidth;
458
+ var clearance = 10;
459
+ var maxTop = pageHeight - clearance;
460
+ var maxLeft = pageWidth - clearance;
461
+ var newTop = getRect(dialogHeader).top + e.movementY;
462
+ var newLeft = getRect(dialogHeader).left + e.movementX;
355
463
  if (newTop > maxTop || newTop < clearance) {
356
464
  return;
357
465
  }
358
466
  if (newLeft > maxLeft || newLeft < clearance) {
359
467
  return;
360
468
  }
361
- const offsetY = parseFloat(dialogContainer.style.top) || 0;
362
- const offsetX = parseFloat(dialogContainer.style.left) || 0;
469
+ var offsetY = parseFloat(dialogContainer.style.top) || 0;
470
+ var offsetX = parseFloat(dialogContainer.style.left) || 0;
363
471
  setPosition(offsetY + e.movementY, offsetX + e.movementX);
364
472
  }
365
473
  function onMouseup() {
@@ -381,24 +489,30 @@ function rgDialogDirective($timeout) {
381
489
  }
382
490
  }
383
491
  function setCustomFooter(customFooterElem) {
384
- const placeholder = angular.element(dialogCustomFooter);
385
- const footer = angular.element(`<div class="${this.styles.footer}"></div>`).append(customFooterElem);
492
+ var placeholder = angular.element(dialogCustomFooter);
493
+ var footer = angular.element("<div class=\"".concat(this.styles.footer, "\"></div>")).append(customFooterElem);
386
494
  placeholder.empty();
387
495
  placeholder.append(footer);
388
496
  }
389
- dialogCtrl.resetPosition = () => dialogContainer.removeAttribute('style');
497
+ dialogCtrl.resetPosition = function () {
498
+ return dialogContainer.removeAttribute('style');
499
+ };
390
500
  dialogCtrl.setCustomFooter = setCustomFooter;
391
501
  dialogHeader.addEventListener('mousedown', onMousedown);
392
502
  document.addEventListener('focusin', onFocusin);
393
- scope.$on('rgDialogContentLoaded', () => $timeout(focusFirst));
503
+ scope.$on('rgDialogContentLoaded', function () {
504
+ return $timeout(focusFirst);
505
+ });
394
506
 
395
507
  // Backward compatibility for youtrack (if they are using "content" property)
396
508
  // which is actually ng-include with $includeContentLoaded event in the end
397
- scope.$on('$includeContentLoaded', () => $timeout(focusFirst));
398
- scope.$on('dialog.hide', () => {
509
+ scope.$on('$includeContentLoaded', function () {
510
+ return $timeout(focusFirst);
511
+ });
512
+ scope.$on('dialog.hide', function () {
399
513
  angular.element(dialogCustomFooter).empty();
400
514
  });
401
- scope.$on('$destroy', () => {
515
+ scope.$on('$destroy', function () {
402
516
  dialogHeader.removeEventListener('mousedown', onMousedown);
403
517
  document.removeEventListener('mousemove', onMousemove);
404
518
  document.removeEventListener('mouseup', onMouseup);
@@ -416,7 +530,7 @@ function rgDialogDirective($timeout) {
416
530
  replace: true,
417
531
  template: dialogTemplate,
418
532
  controllerAs: 'dialog',
419
- link
533
+ link: link
420
534
  };
421
535
  }
422
536
  function rgDialogTitleDirective() {
@@ -428,13 +542,13 @@ function rgDialogTitleDirective() {
428
542
  title: '@rgDialogTitle'
429
543
  },
430
544
  require: '^rgDialog',
431
- link
545
+ link: link
432
546
  };
433
547
  }
434
548
  function rgDialogFooterDirective() {
435
549
  function link(scope, iElement, iAttrs, dialogCtrl, transclude) {
436
- scope.$on('rgDialogContentLoaded', () => {
437
- transclude(scope, clone => {
550
+ scope.$on('rgDialogContentLoaded', function () {
551
+ transclude(scope, function (clone) {
438
552
  dialogCtrl.setCustomFooter(clone);
439
553
  });
440
554
  });
@@ -442,16 +556,16 @@ function rgDialogFooterDirective() {
442
556
  return {
443
557
  require: '^rgDialog',
444
558
  transclude: true,
445
- link
559
+ link: link
446
560
  };
447
561
  }
448
562
  function rgDialogContentDirective($compile, $q) {
449
563
  return {
450
564
  link: function link(scope, iElement) {
451
- const element = iElement[0];
452
- let contentScope;
565
+ var element = iElement[0];
566
+ var contentScope;
453
567
  function createIncludeNode() {
454
- const node = document.createElement('ng-include');
568
+ var node = document.createElement('ng-include');
455
569
  node.setAttribute('src', 'dialog.content');
456
570
  return node;
457
571
  }
@@ -461,12 +575,12 @@ function rgDialogContentDirective($compile, $q) {
461
575
  function compileContent() {
462
576
  contentScope = scope.$new();
463
577
  if (angular.isDefined(scope.dialog.content)) {
464
- const templateNode = angular.element(createIncludeNode());
578
+ var templateNode = angular.element(createIncludeNode());
465
579
  element.appendChild(templateNode[0]);
466
580
  return $compile(templateNode)(contentScope)[0];
467
581
  }
468
- return $q.when(scope.dialog.compileTemplate()).then(compiledData => {
469
- const templateScope = isOldDataAPI() ? contentScope : scope.dialog.config.scope || contentScope;
582
+ return $q.when(scope.dialog.compileTemplate()).then(function (compiledData) {
583
+ var templateScope = isOldDataAPI() ? contentScope : scope.dialog.config.scope || contentScope;
470
584
 
471
585
  // XXX(maksimrv): We should put element to directive
472
586
  // before link because some directives (shortcuts)
@@ -493,7 +607,7 @@ function rgDialogContentDirective($compile, $q) {
493
607
  }
494
608
  }
495
609
  scope.$on('dialog.hide', destroy);
496
- scope.$on('dialog.show', () => {
610
+ scope.$on('dialog.show', function () {
497
611
  destroy();
498
612
  compileContent();
499
613
  });