@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.
- package/dist/_helpers/_rollupPluginBabelHelpers.js +642 -1
- package/dist/_helpers/anchor.js +6 -7
- package/dist/_helpers/button__classes.js +16 -28
- package/dist/_helpers/card.js +107 -95
- package/dist/_helpers/dialog__body-scroll-preventer.js +20 -11
- package/dist/_helpers/footer.js +29 -34
- package/dist/_helpers/query-assist__suggestions.js +91 -74
- package/dist/_helpers/select__filter.js +71 -48
- package/dist/_helpers/services-link.js +41 -29
- package/dist/_helpers/sidebar.js +103 -99
- package/dist/_helpers/theme.js +42 -35
- package/dist/_helpers/title.js +71 -57
- package/dist/alert/alert.js +199 -158
- package/dist/alert/container.js +43 -32
- package/dist/alert-service/alert-service.js +172 -104
- package/dist/analytics/analytics.js +92 -68
- package/dist/analytics/analytics__custom-plugin.js +84 -60
- package/dist/analytics/analytics__fus-plugin.js +28 -15
- package/dist/analytics/analytics__ga-plugin.js +60 -43
- package/dist/analytics/analytics__plugin-utils.js +28 -22
- package/dist/auth/auth.js +36 -4
- package/dist/auth/auth__core.js +1458 -732
- package/dist/auth/background-flow.js +129 -87
- package/dist/auth/down-notification.js +75 -30
- package/dist/auth/iframe-flow.js +136 -75
- package/dist/auth/landing.js +90 -30
- package/dist/auth/request-builder.js +82 -46
- package/dist/auth/response-parser.js +119 -86
- package/dist/auth/storage.js +333 -171
- package/dist/auth/token-validator.js +244 -137
- package/dist/auth/window-flow.js +136 -92
- package/dist/auth-dialog/auth-dialog.js +176 -114
- package/dist/auth-dialog-service/auth-dialog-service.js +32 -7
- package/dist/auth-ng/auth-ng.js +70 -34
- package/dist/auth-ng/auth-ng.mock.js +6 -6
- package/dist/autofocus-ng/autofocus-ng.js +23 -8
- package/dist/avatar/avatar-example-datauri.js +1 -23
- package/dist/avatar/avatar.js +155 -119
- package/dist/avatar/fallback-avatar.js +41 -22
- package/dist/avatar-editor-ng/avatar-editor-ng.js +56 -23
- package/dist/avatar-editor-ng/avatar-editor-ng__template.js +1 -28
- package/dist/avatar-ng/avatar-ng.js +23 -1
- package/dist/badge/badge.js +43 -35
- package/dist/badge-ng/badge-ng.js +13 -1
- package/dist/breadcrumb-ng/breadcrumb-ng.js +15 -29
- package/dist/button/button.js +111 -87
- package/dist/button/button__classes.js +1 -0
- package/dist/button-group/button-group.js +35 -19
- package/dist/button-group/caption.js +22 -14
- package/dist/button-group-ng/button-group-ng.js +13 -7
- package/dist/button-ng/button-ng.js +154 -133
- package/dist/button-set/button-set.js +34 -20
- package/dist/button-set-ng/button-set-ng.js +2 -2
- package/dist/button-toolbar/button-toolbar.js +33 -19
- package/dist/button-toolbar-ng/button-toolbar-ng.js +5 -3
- package/dist/caret/caret.js +225 -188
- package/dist/checkbox/checkbox.js +104 -76
- package/dist/checkbox-ng/checkbox-ng.js +18 -27
- package/dist/clipboard/clipboard-fallback.js +10 -10
- package/dist/clipboard/clipboard.js +131 -34
- package/dist/code/code.js +168 -92
- package/dist/compiler-ng/compiler-ng.js +18 -15
- package/dist/confirm/confirm.js +108 -66
- package/dist/confirm-ng/confirm-ng.js +33 -4
- package/dist/confirm-service/confirm-service.js +66 -42
- package/dist/content-layout/content-layout.js +64 -43
- package/dist/content-layout/sidebar.js +1 -0
- package/dist/contenteditable/contenteditable.js +61 -50
- package/dist/control-label/control-label.js +11 -15
- package/dist/data-list/data-list.js +184 -128
- package/dist/data-list/data-list.mock.js +11 -2
- package/dist/data-list/item.js +174 -143
- package/dist/data-list/selection.js +139 -76
- package/dist/data-list/title.js +13 -1
- package/dist/data-list-ng/data-list-ng.js +31 -1
- package/dist/date-picker/consts.js +18 -15
- package/dist/date-picker/date-input.js +147 -115
- package/dist/date-picker/date-picker.js +285 -228
- package/dist/date-picker/date-popup.js +397 -356
- package/dist/date-picker/day.js +98 -84
- package/dist/date-picker/month-names.js +64 -43
- package/dist/date-picker/month-slider.js +74 -51
- package/dist/date-picker/month.js +21 -15
- package/dist/date-picker/months.js +48 -43
- package/dist/date-picker/weekdays.js +18 -12
- package/dist/date-picker/years.js +109 -84
- package/dist/dialog/dialog.js +189 -141
- package/dist/dialog/dialog__body-scroll-preventer.js +5 -0
- package/dist/dialog-ng/dialog-ng.js +401 -287
- package/dist/dialog-ng/dialog-ng__template.js +1 -70
- package/dist/docked-panel-ng/docked-panel-ng.js +33 -18
- package/dist/dropdown/anchor.js +10 -0
- package/dist/dropdown/dropdown.js +214 -182
- package/dist/dropdown-menu/dropdown-menu.js +102 -72
- package/dist/editable-heading/editable-heading.js +100 -58
- package/dist/error-bubble/error-bubble.js +64 -31
- package/dist/error-message/error-message.js +61 -38
- package/dist/error-message-ng/error-message-ng.js +11 -22
- package/dist/footer/footer.js +11 -1
- package/dist/footer-ng/footer-ng.js +64 -36
- package/dist/form-ng/form-ng.js +66 -56
- package/dist/global/angular-component-factory.js +76 -53
- package/dist/global/compose.js +10 -1
- package/dist/global/composeRefs.js +12 -7
- package/dist/global/controls-height.js +2 -2
- package/dist/global/create-stateful-context.js +19 -19
- package/dist/global/data-tests.js +15 -7
- package/dist/global/dom.js +95 -53
- package/dist/global/focus-sensor-hoc.js +134 -122
- package/dist/global/fuzzy-highlight.js +41 -27
- package/dist/global/get-event-key.js +8 -8
- package/dist/global/get-uid.js +8 -4
- package/dist/global/inject-styles.js +15 -10
- package/dist/global/linear-function.js +2 -2
- package/dist/global/listeners.js +53 -27
- package/dist/global/memoize.js +13 -6
- package/dist/global/normalize-indent.js +51 -19
- package/dist/global/promise-with-timeout.js +8 -6
- package/dist/global/prop-types.js +5 -3
- package/dist/global/react-dom-renderer.js +47 -28
- package/dist/global/react-render-adapter.js +19 -13
- package/dist/global/rerender-hoc.js +41 -16
- package/dist/global/ring-angular-component.js +20 -10
- package/dist/global/schedule-raf.js +6 -5
- package/dist/global/sniffer.js +1 -1
- package/dist/global/theme.js +24 -0
- package/dist/global/trivial-template-tag.js +10 -3
- package/dist/global/typescript-utils.js +6 -2
- package/dist/global/url.js +27 -21
- package/dist/global/use-event-callback.js +4 -6
- package/dist/grid/col.js +55 -35
- package/dist/grid/grid.js +36 -17
- package/dist/grid/row.js +48 -35
- package/dist/group/group.js +27 -17
- package/dist/group-ng/group-ng.js +2 -2
- package/dist/header/header.js +80 -33
- package/dist/header/logo.js +39 -20
- package/dist/header/profile.js +188 -150
- package/dist/header/services-link.js +9 -0
- package/dist/header/services.js +118 -73
- package/dist/header/smart-profile.js +207 -111
- package/dist/header/smart-services.js +115 -62
- package/dist/header/tray-icon.js +38 -21
- package/dist/header/tray.js +34 -21
- package/dist/heading/heading.js +25 -26
- package/dist/heading-ng/heading-ng.js +11 -1
- package/dist/http/http.js +368 -215
- package/dist/http/http.mock.js +104 -49
- package/dist/hub-source/hub-source.js +191 -83
- package/dist/hub-source/hub-source__user.js +45 -11
- package/dist/hub-source/hub-source__users-groups.js +67 -37
- package/dist/i18n/i18n-context.js +14 -10
- package/dist/i18n/i18n.js +11 -7
- package/dist/icon/icon.js +94 -76
- package/dist/icon/icon__svg.js +31 -24
- package/dist/icon/index.js +9 -0
- package/dist/icon-ng/icon-ng.js +27 -15
- package/dist/input/input.js +184 -145
- package/dist/input-ng/input-ng.js +96 -118
- package/dist/island/adaptive-island-hoc.js +45 -30
- package/dist/island/content.js +130 -115
- package/dist/island/header.js +69 -56
- package/dist/island/island.js +40 -28
- package/dist/island-legacy/content-legacy.js +27 -17
- package/dist/island-legacy/header-legacy.js +29 -19
- package/dist/island-legacy/island-legacy.js +27 -17
- package/dist/island-ng/island-content-ng.js +17 -26
- package/dist/island-ng/island-header-ng.js +9 -12
- package/dist/island-ng/island-ng-class-fixer.js +3 -0
- package/dist/island-ng/island-ng.js +6 -10
- package/dist/link/clickableLink.js +61 -44
- package/dist/link/link.js +85 -74
- package/dist/link-ng/link-ng.js +3 -5
- package/dist/list/consts.js +1 -1
- package/dist/list/list.js +696 -602
- package/dist/list/list__custom.js +61 -44
- package/dist/list/list__hint.js +21 -10
- package/dist/list/list__item.js +167 -129
- package/dist/list/list__link.js +54 -37
- package/dist/list/list__separator.js +24 -14
- package/dist/list/list__title.js +32 -22
- package/dist/list/list__users-groups-source.js +131 -54
- package/dist/loader/loader.js +78 -43
- package/dist/loader/loader__core.js +257 -189
- package/dist/loader-inline/loader-inline.js +37 -23
- package/dist/loader-inline-ng/loader-inline-ng.js +2 -2
- package/dist/loader-ng/loader-ng.js +46 -19
- package/dist/loader-screen/loader-screen.js +48 -25
- package/dist/loader-screen-ng/loader-screen-ng.js +46 -30
- package/dist/login-dialog/login-dialog.js +162 -111
- package/dist/login-dialog/service.js +35 -7
- package/dist/markdown/code.js +31 -9
- package/dist/markdown/heading.js +3 -5
- package/dist/markdown/link.js +13 -6
- package/dist/markdown/markdown.js +66 -33
- package/dist/message/message.js +157 -125
- package/dist/message-bundle-ng/message-bundle-ng.js +128 -44
- package/dist/old-browsers-message/old-browsers-message.js +19 -11
- package/dist/old-browsers-message/old-browsers-message__stop.js +8 -0
- package/dist/old-browsers-message/white-list.js +16 -9
- package/dist/pager/pager.js +275 -210
- package/dist/pager-ng/pager-ng.js +36 -1
- package/dist/panel/panel.js +27 -17
- package/dist/panel-ng/panel-ng.js +14 -1
- package/dist/permissions/permissions.js +173 -127
- package/dist/permissions/permissions__cache.js +225 -194
- package/dist/permissions-ng/permissions-ng.js +86 -35
- package/dist/place-under-ng/place-under-ng.js +68 -45
- package/dist/popup/popup.consts.js +1 -1
- package/dist/popup/popup.js +342 -280
- package/dist/popup/popup.target.js +8 -9
- package/dist/popup/position.js +153 -153
- package/dist/popup-menu/popup-menu.js +86 -44
- package/dist/progress-bar/progress-bar.js +97 -80
- package/dist/progress-bar-ng/progress-bar-ng.js +11 -1
- package/dist/promised-click-ng/promised-click-ng.js +92 -58
- package/dist/proxy-attrs/proxy-attrs.js +18 -9
- package/dist/query-assist/query-assist.js +903 -832
- package/dist/query-assist/query-assist__suggestions.js +33 -1
- package/dist/query-assist-ng/query-assist-ng.js +38 -1
- package/dist/radio/radio.js +36 -19
- package/dist/radio/radio__item.js +71 -52
- package/dist/radio-ng/radio-ng.js +14 -25
- package/dist/save-field-ng/save-field-ng.js +86 -52
- package/dist/save-field-ng/save-field-ng__template.js +1 -32
- package/dist/select/select.js +937 -835
- package/dist/select/select__filter.js +33 -0
- package/dist/select/select__popup.js +472 -359
- package/dist/select-ng/select-ng.js +125 -74
- package/dist/select-ng/select-ng__lazy.js +101 -50
- package/dist/select-ng/select-ng__options.js +107 -81
- package/dist/shortcuts/core.js +218 -166
- package/dist/shortcuts/shortcut-title.js +11 -6
- package/dist/shortcuts/shortcuts-hoc.js +47 -19
- package/dist/shortcuts/shortcuts.js +77 -50
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +104 -53
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng__template.js +1 -48
- package/dist/shortcuts-ng/shortcuts-ng.js +86 -51
- package/dist/sidebar-ng/sidebar-ng.js +53 -22
- package/dist/sidebar-ng/sidebar-ng__button-template.js +1 -18
- package/dist/sidebar-ng/sidebar-ng__template.js +1 -10
- package/dist/storage/storage.js +35 -4
- package/dist/storage/storage__fallback.js +224 -149
- package/dist/storage/storage__local.js +156 -90
- package/dist/tab-trap/tab-trap.js +157 -122
- package/dist/table/cell.js +28 -14
- package/dist/table/disable-hover-hoc.js +53 -33
- package/dist/table/header-cell.js +87 -64
- package/dist/table/header.js +126 -98
- package/dist/table/multitable.js +127 -107
- package/dist/table/row-with-focus-sensor.js +73 -25
- package/dist/table/row.js +208 -170
- package/dist/table/selection-adapter.js +3 -1
- package/dist/table/selection-shortcuts-hoc.js +184 -181
- package/dist/table/selection.js +228 -156
- package/dist/table/smart-table.js +93 -51
- package/dist/table/table.js +348 -281
- package/dist/table-legacy-ng/table-legacy-ng.js +117 -102
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +42 -10
- package/dist/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +92 -69
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +169 -119
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +36 -21
- package/dist/table-ng/smart-table-ng.js +31 -1
- package/dist/table-ng/table-ng.js +31 -1
- package/dist/tabs/collapsible-more.js +87 -50
- package/dist/tabs/collapsible-tab.js +45 -38
- package/dist/tabs/collapsible-tabs.js +161 -94
- package/dist/tabs/custom-item.js +2 -4
- package/dist/tabs/dumb-tabs.js +122 -75
- package/dist/tabs/smart-tabs.js +75 -29
- package/dist/tabs/tab-link.js +29 -19
- package/dist/tabs/tab.js +33 -19
- package/dist/tabs/tabs.js +35 -0
- package/dist/tabs-ng/tabs-ng.js +38 -24
- package/dist/tabs-ng/tabs-ng__template.js +1 -38
- package/dist/tag/tag.js +170 -133
- package/dist/tags-input/tags-input.js +428 -327
- package/dist/tags-input-ng/tags-input-ng.js +37 -1
- package/dist/tags-list/tags-list.js +80 -56
- package/dist/template-ng/template-ng.js +50 -39
- package/dist/text/text.js +38 -28
- package/dist/title-ng/title-ng.js +28 -23
- package/dist/toggle/toggle.js +72 -56
- package/dist/toggle-ng/toggle-ng.js +14 -1
- package/dist/tooltip/tooltip.js +192 -146
- package/dist/tooltip-ng/tooltip-ng.js +51 -25
- package/dist/user-agreement/service.js +374 -227
- package/dist/user-agreement/toolbox.eula.js +1 -160
- package/dist/user-agreement/user-agreement.js +128 -86
- package/dist/user-card/card.js +32 -0
- package/dist/user-card/smart-user-card-tooltip.js +116 -51
- package/dist/user-card/tooltip.js +90 -48
- package/dist/user-card/user-card.js +32 -0
- package/dist/user-card-ng/user-card-ng.js +34 -2
- 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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
135
|
-
|
|
171
|
+
}, {
|
|
172
|
+
key: "setTitle",
|
|
173
|
+
value: function setTitle(title) {
|
|
174
|
+
this.title = title;
|
|
136
175
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
this.
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
this.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
this.
|
|
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
|
-
//
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
|
|
214
|
-
|
|
269
|
+
}, {
|
|
270
|
+
key: "reset",
|
|
271
|
+
value: function reset(result) {
|
|
272
|
+
this.done(result);
|
|
215
273
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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
|
-
|
|
331
|
+
} else if (button.close !== false) {
|
|
332
|
+
this.reset(false);
|
|
248
333
|
}
|
|
249
|
-
|
|
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
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
}]);
|
|
367
|
+
return DialogController;
|
|
368
|
+
}(RingAngularComponent);
|
|
284
369
|
DialogController.$inject = ['$scope', '$q', 'dialog', '$element', 'dialogInSidebar', '$compile', '$injector', '$controller', 'rgCompiler', '$sce'];
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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
|
-
|
|
293
|
-
|
|
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
|
-
|
|
390
|
+
var _this$ctrl;
|
|
391
|
+
return (_this$ctrl = this.ctrl)[key].apply(_this$ctrl, arguments);
|
|
296
392
|
} else if (this.fallbackDialog) {
|
|
297
|
-
|
|
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(
|
|
399
|
+
}.bind(_assertThisInitialized(_this7));
|
|
303
400
|
});
|
|
401
|
+
return _this7;
|
|
304
402
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
|
|
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
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
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
|
-
|
|
322
|
-
DialogInSidebarService.$inject = [
|
|
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
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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:
|
|
335
|
-
left:
|
|
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
|
-
|
|
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
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
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
|
-
|
|
362
|
-
|
|
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
|
-
|
|
385
|
-
|
|
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 = ()
|
|
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', ()
|
|
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', ()
|
|
398
|
-
|
|
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
|
-
|
|
452
|
-
|
|
565
|
+
var element = iElement[0];
|
|
566
|
+
var contentScope;
|
|
453
567
|
function createIncludeNode() {
|
|
454
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
});
|