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