@progress/kendo-angular-dialog 6.0.3-dev.202203091004 → 7.0.0-next.202203171702
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/bundles/kendo-angular-dialog.umd.js +5 -0
- package/{dist/es2015/common → common}/actions-layout.d.ts +0 -0
- package/{dist/es2015/common → common}/preventable-event.d.ts +0 -0
- package/{dist/es2015/common → common}/util.d.ts +1 -1
- package/{dist/es2015/dialog → dialog}/dialog-actions.component.d.ts +14 -7
- package/{dist/es2015/dialog → dialog}/dialog-container.directive.d.ts +3 -0
- package/dialog/dialog-container.service.d.ts +16 -0
- package/{dist/es2015/dialog → dialog}/dialog-content-base.d.ts +4 -1
- package/{dist/es2015/dialog → dialog}/dialog-titlebar.component.d.ts +5 -2
- package/{dist/es2015/dialog → dialog}/dialog.component.d.ts +13 -6
- package/{dist/es2015/dialog → dialog}/dialog.service.d.ts +5 -1
- package/dialog/models/dialog-action.d.ts +28 -0
- package/dialog/models/dialog-close-result.d.ts +11 -0
- package/dialog/models/dialog-ref.d.ts +38 -0
- package/dialog/models/dialog-result.d.ts +14 -0
- package/{dist/es2015/dialog → dialog/models}/dialog-settings.d.ts +5 -73
- package/{dist/es/localization/dialog-localization.service.js → dialog/models/index.d.ts} +5 -5
- package/{dist/es2015/dialog.module.d.ts → dialog.module.d.ts} +11 -0
- package/{dist/es2015/dialogs.module.d.ts → dialogs.module.d.ts} +6 -0
- package/{dist/es2015 → esm2015}/common/actions-layout.js +1 -0
- package/{dist/es2015 → esm2015}/common/preventable-event.js +0 -0
- package/{dist/es2015 → esm2015}/common/util.js +0 -5
- package/esm2015/dialog/dialog-actions.component.js +115 -0
- package/esm2015/dialog/dialog-container.directive.js +30 -0
- package/esm2015/dialog/dialog-container.service.js +23 -0
- package/{dist/es2015 → esm2015}/dialog/dialog-content-base.js +18 -10
- package/esm2015/dialog/dialog-titlebar.component.js +136 -0
- package/{dist/es2015 → esm2015}/dialog/dialog.component.js +123 -113
- package/{dist/es2015 → esm2015}/dialog/dialog.service.js +16 -15
- package/{dist/es2015/window/window-container.service.d.ts → esm2015/dialog/models/dialog-action.js} +3 -5
- package/esm2015/dialog/models/dialog-close-result.js +11 -0
- package/esm2015/dialog/models/dialog-ref.js +11 -0
- package/{dist/es/common/actions-layout.js → esm2015/dialog/models/dialog-result.js} +1 -0
- package/{dist/es2015/dialog/dialog-container.service.d.ts → esm2015/dialog/models/dialog-settings.js} +3 -5
- package/esm2015/dialog/models/index.js +9 -0
- package/{dist/es2015 → esm2015}/dialog.module.js +20 -13
- package/{dist/es → esm2015}/dialogs.module.js +12 -12
- package/esm2015/kendo-angular-dialog.js +8 -0
- package/esm2015/localization/custom-messages.component.js +41 -0
- package/{dist/es2015 → esm2015}/localization/dialog-localization.service.js +0 -0
- package/esm2015/localization/localized-messages.directive.js +40 -0
- package/esm2015/localization/messages.js +28 -0
- package/esm2015/localization/titlebar-localization.service.js +44 -0
- package/{dist/es2015 → esm2015}/main.js +8 -2
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/esm2015/shared.module.js +38 -0
- package/esm2015/window/actions/window-close-action.directive.js +59 -0
- package/esm2015/window/actions/window-maximize-action.directive.js +65 -0
- package/esm2015/window/actions/window-minimize-action.directive.js +65 -0
- package/esm2015/window/actions/window-restore-action.directive.js +65 -0
- package/{dist/es2015 → esm2015}/window/drag-resize.service.js +9 -11
- package/esm2015/window/models/index.js +10 -0
- package/esm2015/window/models/window-close-result.js +9 -0
- package/{dist/es2015/window/window-events.js → esm2015/window/models/window-messages.js} +1 -0
- package/esm2015/window/models/window-options.js +5 -0
- package/{dist/es2015/window/window-settings.js → esm2015/window/models/window-ref.js} +0 -11
- package/esm2015/window/models/window-settings.js +10 -0
- package/esm2015/window/models/window-types.js +5 -0
- package/{dist/es2015 → esm2015}/window/navigation.service.js +10 -11
- package/esm2015/window/window-container.directive.js +30 -0
- package/esm2015/window/window-container.service.js +23 -0
- package/{dist/es → esm2015}/window/window-events.js +1 -0
- package/{dist/es2015 → esm2015}/window/window-resize-handle.directive.js +21 -26
- package/{dist/es2015 → esm2015}/window/window-titlebar.component.js +35 -34
- package/{dist/es2015 → esm2015}/window/window.component.js +168 -187
- package/{dist/es2015 → esm2015}/window/window.service.js +15 -14
- package/{dist/es2015 → esm2015}/window.module.js +29 -17
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-dialog.js} +1023 -926
- package/{dist/es2015/shared.module.d.ts → kendo-angular-dialog.d.ts} +3 -7
- package/{dist/es2015/localization → localization}/custom-messages.component.d.ts +4 -1
- package/{dist/es2015/localization → localization}/dialog-localization.service.d.ts +0 -0
- package/{dist/es2015/localization → localization}/localized-messages.directive.d.ts +3 -0
- package/{dist/es2015/localization → localization}/messages.d.ts +3 -0
- package/{dist/es2015/localization → localization}/titlebar-localization.service.d.ts +3 -0
- package/{dist/es2015/main.d.ts → main.d.ts} +7 -2
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +33 -105
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/shared.module.d.ts +21 -0
- package/{dist/es2015/window → window}/actions/window-close-action.directive.d.ts +3 -0
- package/{dist/es2015/window → window}/actions/window-maximize-action.directive.d.ts +4 -1
- package/{dist/es2015/window → window}/actions/window-minimize-action.directive.d.ts +4 -1
- package/{dist/es2015/window → window}/actions/window-restore-action.directive.d.ts +4 -1
- package/{dist/es2015/window → window}/drag-resize.service.d.ts +8 -4
- package/window/models/index.d.ts +10 -0
- package/window/models/window-close-result.d.ts +9 -0
- package/window/models/window-messages.d.ts +26 -0
- package/window/models/window-options.d.ts +20 -0
- package/window/models/window-ref.d.ts +40 -0
- package/{dist/es2015/window → window/models}/window-settings.d.ts +4 -84
- package/window/models/window-types.d.ts +11 -0
- package/{dist/es2015/window → window}/navigation.service.d.ts +4 -1
- package/{dist/es2015/window → window}/window-container.directive.d.ts +3 -0
- package/window/window-container.service.d.ts +16 -0
- package/{dist/es2015/window → window}/window-events.d.ts +0 -0
- package/{dist/es2015/window → window}/window-resize-handle.directive.d.ts +4 -1
- package/{dist/es2015/window → window}/window-titlebar.component.d.ts +6 -3
- package/{dist/es2015/window → window}/window.component.d.ts +42 -25
- package/{dist/es2015/window → window}/window.service.d.ts +5 -1
- package/window.module.d.ts +45 -0
- package/dist/cdn/js/kendo-angular-dialog.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/common/preventable-event.js +0 -29
- package/dist/es/common/util.js +0 -214
- package/dist/es/dialog/dialog-actions.component.js +0 -89
- package/dist/es/dialog/dialog-container.directive.js +0 -31
- package/dist/es/dialog/dialog-container.service.js +0 -31
- package/dist/es/dialog/dialog-content-base.js +0 -45
- package/dist/es/dialog/dialog-settings.js +0 -46
- package/dist/es/dialog/dialog-titlebar.component.js +0 -94
- package/dist/es/dialog/dialog.component.js +0 -462
- package/dist/es/dialog/dialog.service.js +0 -214
- package/dist/es/dialog.module.js +0 -56
- package/dist/es/index.js +0 -22
- package/dist/es/localization/custom-messages.component.js +0 -44
- package/dist/es/localization/localized-messages.directive.js +0 -35
- package/dist/es/localization/messages.js +0 -34
- package/dist/es/localization/titlebar-localization.service.js +0 -34
- package/dist/es/main.js +0 -21
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/shared.module.js +0 -34
- package/dist/es/window/actions/window-close-action.directive.js +0 -63
- package/dist/es/window/actions/window-maximize-action.directive.js +0 -75
- package/dist/es/window/actions/window-minimize-action.directive.js +0 -75
- package/dist/es/window/actions/window-restore-action.directive.js +0 -75
- package/dist/es/window/drag-resize.service.js +0 -351
- package/dist/es/window/navigation.service.js +0 -155
- package/dist/es/window/window-container.directive.js +0 -31
- package/dist/es/window/window-container.service.js +0 -31
- package/dist/es/window/window-resize-handle.directive.js +0 -78
- package/dist/es/window/window-settings.js +0 -34
- package/dist/es/window/window-titlebar.component.js +0 -144
- package/dist/es/window/window.component.js +0 -808
- package/dist/es/window/window.service.js +0 -214
- package/dist/es/window.module.js +0 -76
- package/dist/es2015/dialog/dialog-actions.component.js +0 -98
- package/dist/es2015/dialog/dialog-container.directive.js +0 -30
- package/dist/es2015/dialog/dialog-container.service.js +0 -23
- package/dist/es2015/dialog/dialog-settings.js +0 -30
- package/dist/es2015/dialog/dialog-titlebar.component.js +0 -106
- package/dist/es2015/dialogs.module.js +0 -41
- package/dist/es2015/index.d.ts +0 -22
- package/dist/es2015/index.js +0 -22
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/localization/custom-messages.component.js +0 -36
- package/dist/es2015/localization/localized-messages.directive.js +0 -35
- package/dist/es2015/localization/messages.js +0 -28
- package/dist/es2015/localization/titlebar-localization.service.js +0 -31
- package/dist/es2015/shared.module.js +0 -31
- package/dist/es2015/window/actions/window-close-action.directive.js +0 -60
- package/dist/es2015/window/actions/window-maximize-action.directive.js +0 -68
- package/dist/es2015/window/actions/window-minimize-action.directive.js +0 -68
- package/dist/es2015/window/actions/window-restore-action.directive.js +0 -68
- package/dist/es2015/window/window-container.directive.js +0 -30
- package/dist/es2015/window/window-container.service.js +0 -23
- package/dist/es2015/window.module.d.ts +0 -28
- package/dist/fesm5/index.js +0 -3474
- package/dist/npm/common/actions-layout.js +0 -6
- package/dist/npm/common/preventable-event.js +0 -31
- package/dist/npm/common/util.js +0 -219
- package/dist/npm/dialog/dialog-actions.component.js +0 -91
- package/dist/npm/dialog/dialog-container.directive.js +0 -33
- package/dist/npm/dialog/dialog-container.service.js +0 -33
- package/dist/npm/dialog/dialog-content-base.js +0 -47
- package/dist/npm/dialog/dialog-settings.js +0 -48
- package/dist/npm/dialog/dialog-titlebar.component.js +0 -96
- package/dist/npm/dialog/dialog.component.js +0 -464
- package/dist/npm/dialog/dialog.service.js +0 -216
- package/dist/npm/dialog.module.js +0 -58
- package/dist/npm/dialogs.module.js +0 -46
- package/dist/npm/index.js +0 -40
- package/dist/npm/localization/custom-messages.component.js +0 -46
- package/dist/npm/localization/dialog-localization.service.js +0 -11
- package/dist/npm/localization/localized-messages.directive.js +0 -37
- package/dist/npm/localization/messages.js +0 -36
- package/dist/npm/localization/titlebar-localization.service.js +0 -36
- package/dist/npm/main.js +0 -45
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/shared.module.js +0 -36
- package/dist/npm/window/actions/window-close-action.directive.js +0 -65
- package/dist/npm/window/actions/window-maximize-action.directive.js +0 -77
- package/dist/npm/window/actions/window-minimize-action.directive.js +0 -77
- package/dist/npm/window/actions/window-restore-action.directive.js +0 -77
- package/dist/npm/window/drag-resize.service.js +0 -353
- package/dist/npm/window/navigation.service.js +0 -157
- package/dist/npm/window/window-container.directive.js +0 -33
- package/dist/npm/window/window-container.service.js +0 -33
- package/dist/npm/window/window-events.js +0 -6
- package/dist/npm/window/window-resize-handle.directive.js +0 -80
- package/dist/npm/window/window-settings.js +0 -36
- package/dist/npm/window/window-titlebar.component.js +0 -146
- package/dist/npm/window/window.component.js +0 -810
- package/dist/npm/window/window.service.js +0 -216
- package/dist/npm/window.module.js +0 -78
- package/dist/systemjs/kendo-angular-dialog.js +0 -5
package/dist/fesm5/index.js
DELETED
|
@@ -1,3474 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { __decorate, __metadata, __extends, __param } from 'tslib';
|
|
6
|
-
import { TemplateRef, Input, Output, EventEmitter, HostBinding, Component, ElementRef, InjectionToken, Inject, Optional, NgZone, ContentChildren, QueryList, ViewChildren, ViewChild, Renderer2, ChangeDetectorRef, Injectable, isDevMode, ComponentFactoryResolver, Directive, Host, HostListener, ContentChild, ViewContainerRef, forwardRef, NgModule } from '@angular/core';
|
|
7
|
-
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
8
|
-
import { Subscription, Subject, merge, of } from 'rxjs';
|
|
9
|
-
import { take, filter, map, share, tap, switchMap, takeUntil } from 'rxjs/operators';
|
|
10
|
-
import { L10N_PREFIX, RTL, MessageService, LocalizationService, ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
11
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
12
|
-
import { DraggableDirective, isChanged, isDocumentAvailable, DraggableModule } from '@progress/kendo-angular-common';
|
|
13
|
-
import { offset, scrollPosition, positionWithScroll, getDocumentElement, getWindowViewPort } from '@progress/kendo-popup-common';
|
|
14
|
-
import { Button } from '@progress/kendo-angular-buttons';
|
|
15
|
-
import { CommonModule } from '@angular/common';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @hidden
|
|
19
|
-
*/
|
|
20
|
-
var isPresent = function (value) { return value !== null && value !== undefined; };
|
|
21
|
-
/**
|
|
22
|
-
* @hidden
|
|
23
|
-
*/
|
|
24
|
-
var isTruthy = function (value) { return !!value; };
|
|
25
|
-
var toClassList = function (classNames) { return String(classNames).trim().split(' '); };
|
|
26
|
-
var focusableRegex = /^(?:a|input|select|textarea|button|object)$/i;
|
|
27
|
-
/**
|
|
28
|
-
* @hidden
|
|
29
|
-
*/
|
|
30
|
-
var Keys;
|
|
31
|
-
(function (Keys) {
|
|
32
|
-
Keys[Keys["esc"] = 27] = "esc";
|
|
33
|
-
Keys[Keys["tab"] = 9] = "tab";
|
|
34
|
-
Keys[Keys["enter"] = 13] = "enter";
|
|
35
|
-
Keys[Keys["space"] = 32] = "space";
|
|
36
|
-
Keys[Keys["ctrl"] = 17] = "ctrl";
|
|
37
|
-
Keys[Keys["shift"] = 16] = "shift";
|
|
38
|
-
Keys[Keys["left"] = 37] = "left";
|
|
39
|
-
Keys[Keys["up"] = 38] = "up";
|
|
40
|
-
Keys[Keys["right"] = 39] = "right";
|
|
41
|
-
Keys[Keys["down"] = 40] = "down";
|
|
42
|
-
})(Keys || (Keys = {}));
|
|
43
|
-
/**
|
|
44
|
-
* @hidden
|
|
45
|
-
*/
|
|
46
|
-
var DIALOG_ELEMENTS_HANDLING_ESC_KEY = 'k-dialog-wrapper k-dialog-buttongroup k-dialog-action';
|
|
47
|
-
/**
|
|
48
|
-
* @hidden
|
|
49
|
-
*/
|
|
50
|
-
var DIALOG_ELEMENTS_HANDLING_ARROWS = 'k-dialog-buttongroup';
|
|
51
|
-
/**
|
|
52
|
-
* @hidden
|
|
53
|
-
*/
|
|
54
|
-
var WINDOW_CLASSES = 'k-window';
|
|
55
|
-
/**
|
|
56
|
-
* @hidden
|
|
57
|
-
*/
|
|
58
|
-
var hasClasses = function (element, classNames) {
|
|
59
|
-
var namesList = toClassList(classNames);
|
|
60
|
-
return Boolean(toClassList(element.className).find(function (className) { return namesList.indexOf(className) >= 0; }));
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* @hidden
|
|
64
|
-
*/
|
|
65
|
-
var isVisible = function (element) {
|
|
66
|
-
var rect = element.getBoundingClientRect();
|
|
67
|
-
return !!(rect.width && rect.height) && window.getComputedStyle(element).visibility !== 'hidden';
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* @hidden
|
|
71
|
-
*/
|
|
72
|
-
var isFocusable = function (element, checkVisibility) {
|
|
73
|
-
if (checkVisibility === void 0) { checkVisibility = true; }
|
|
74
|
-
if (element.tagName) {
|
|
75
|
-
var tagName = element.tagName.toLowerCase();
|
|
76
|
-
var tabIndex = element.getAttribute('tabIndex');
|
|
77
|
-
var validTabIndex = tabIndex !== null && !isNaN(tabIndex) && tabIndex > -1;
|
|
78
|
-
var focusable = false;
|
|
79
|
-
if (focusableRegex.test(tagName)) {
|
|
80
|
-
focusable = !element.disabled;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
focusable = validTabIndex;
|
|
84
|
-
}
|
|
85
|
-
return focusable && (!checkVisibility || isVisible(element));
|
|
86
|
-
}
|
|
87
|
-
return false;
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* @hidden
|
|
91
|
-
*/
|
|
92
|
-
var setHTMLAttributes = function (attributes, renderer, element) {
|
|
93
|
-
for (var attribute in attributes) {
|
|
94
|
-
if (attribute) {
|
|
95
|
-
renderer.setAttribute(element, attribute, attributes[attribute]);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Receives CSS class declarations either as an object, string or array and returns an array of the class names.
|
|
101
|
-
*
|
|
102
|
-
* @hidden
|
|
103
|
-
*/
|
|
104
|
-
var parseCSSClassNames = function (value) {
|
|
105
|
-
if (isObject(value)) {
|
|
106
|
-
return parseObjectClassNames(value);
|
|
107
|
-
}
|
|
108
|
-
if (isString(value)) {
|
|
109
|
-
return parseStringClassNames(value);
|
|
110
|
-
}
|
|
111
|
-
if (Array.isArray(value)) {
|
|
112
|
-
return parseArrayClassNames(value);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
var parseObjectClassNames = function (value) {
|
|
116
|
-
var classes = [];
|
|
117
|
-
Object.keys(value).forEach(function (className) {
|
|
118
|
-
var currentClassName = splitStringToArray(className);
|
|
119
|
-
if (value[className] && currentClassName[0]) {
|
|
120
|
-
classes.push.apply(classes, currentClassName);
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
return classes;
|
|
124
|
-
};
|
|
125
|
-
var parseStringClassNames = function (value) {
|
|
126
|
-
var classes = [];
|
|
127
|
-
var classesArray = splitStringToArray(value);
|
|
128
|
-
classesArray.forEach(function (className) {
|
|
129
|
-
classes.push(className);
|
|
130
|
-
});
|
|
131
|
-
return classes;
|
|
132
|
-
};
|
|
133
|
-
var parseArrayClassNames = function (value) {
|
|
134
|
-
var classes = [];
|
|
135
|
-
value.forEach(function (className) {
|
|
136
|
-
var current = splitStringToArray(className);
|
|
137
|
-
if (current[0]) {
|
|
138
|
-
classes.push.apply(classes, current);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
return classes;
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* @hidden
|
|
145
|
-
*/
|
|
146
|
-
var focusableSelector = [
|
|
147
|
-
'a[href]',
|
|
148
|
-
'area[href]',
|
|
149
|
-
'input:not([disabled])',
|
|
150
|
-
'select:not([disabled])',
|
|
151
|
-
'textarea:not([disabled])',
|
|
152
|
-
'button:not([disabled])',
|
|
153
|
-
'iframe',
|
|
154
|
-
'object',
|
|
155
|
-
'embed',
|
|
156
|
-
'*[tabindex]',
|
|
157
|
-
'*[contenteditable]'
|
|
158
|
-
].join(',');
|
|
159
|
-
/**
|
|
160
|
-
* @hidden
|
|
161
|
-
*/
|
|
162
|
-
var preventDefault = function (_a) {
|
|
163
|
-
var event = _a.originalEvent;
|
|
164
|
-
event.stopPropagation();
|
|
165
|
-
event.preventDefault();
|
|
166
|
-
};
|
|
167
|
-
/**
|
|
168
|
-
* @hidden
|
|
169
|
-
*/
|
|
170
|
-
var RESIZE_DIRECTIONS = ['n', 'e', 's', 'w', 'se', 'sw', 'ne', 'nw'];
|
|
171
|
-
/**
|
|
172
|
-
* @hidden
|
|
173
|
-
*/
|
|
174
|
-
var OFFSET_STYLES = ['top', 'left', 'width', 'height'];
|
|
175
|
-
/**
|
|
176
|
-
* @hidden
|
|
177
|
-
*/
|
|
178
|
-
var isString = function (value) { return value instanceof String || typeof value === 'string'; };
|
|
179
|
-
/**
|
|
180
|
-
* @hidden
|
|
181
|
-
*/
|
|
182
|
-
var isObject = function (value) { return isPresent(value) && !Array.isArray(value) && typeof value === 'object'; };
|
|
183
|
-
/**
|
|
184
|
-
* @hidden
|
|
185
|
-
*/
|
|
186
|
-
var isNumber = function (value) { return typeof value === 'number' && isFinite(value); };
|
|
187
|
-
/**
|
|
188
|
-
* @hidden
|
|
189
|
-
*/
|
|
190
|
-
var createValueWithUnit = function (value) { return value + (isNumber(value) ? 'px' : ''); };
|
|
191
|
-
/**
|
|
192
|
-
* @hidden
|
|
193
|
-
*/
|
|
194
|
-
var splitStringToArray = function (value) { return value.trim().replace(/\s+/g, " ").split(' '); };
|
|
195
|
-
/**
|
|
196
|
-
* @hidden
|
|
197
|
-
*/
|
|
198
|
-
var findPrimaryButton = function (buttons) {
|
|
199
|
-
for (var i = buttons.length - 1; i >= 0; i--) {
|
|
200
|
-
var classList = buttons[i].classList;
|
|
201
|
-
for (var j = 0; j < classList.length; j++) {
|
|
202
|
-
if (classList[j].endsWith('-primary')) {
|
|
203
|
-
return buttons[i];
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Specifies the action buttons of the Dialog
|
|
211
|
-
* ([see example]({% slug actionbuttons_dialog %})).
|
|
212
|
-
*/
|
|
213
|
-
var DialogActionsComponent = /** @class */ (function () {
|
|
214
|
-
function DialogActionsComponent(el) {
|
|
215
|
-
this.el = el;
|
|
216
|
-
/**
|
|
217
|
-
* Specifies the possible layout of the action buttons.
|
|
218
|
-
*/
|
|
219
|
-
this.layout = 'stretched';
|
|
220
|
-
/**
|
|
221
|
-
* Fires when the user clicks an action button.
|
|
222
|
-
*/
|
|
223
|
-
this.action = new EventEmitter();
|
|
224
|
-
this.buttonGroupClassName = true;
|
|
225
|
-
}
|
|
226
|
-
Object.defineProperty(DialogActionsComponent.prototype, "className", {
|
|
227
|
-
get: function () {
|
|
228
|
-
return this.layout === 'stretched';
|
|
229
|
-
},
|
|
230
|
-
enumerable: true,
|
|
231
|
-
configurable: true
|
|
232
|
-
});
|
|
233
|
-
/**
|
|
234
|
-
* @hidden
|
|
235
|
-
*/
|
|
236
|
-
DialogActionsComponent.prototype.actionTemplate = function () {
|
|
237
|
-
return this.actions instanceof TemplateRef;
|
|
238
|
-
};
|
|
239
|
-
/**
|
|
240
|
-
* @hidden
|
|
241
|
-
*/
|
|
242
|
-
DialogActionsComponent.prototype.onButtonClick = function (action, _e) {
|
|
243
|
-
this.action.emit(action);
|
|
244
|
-
};
|
|
245
|
-
/**
|
|
246
|
-
* @hidden
|
|
247
|
-
*/
|
|
248
|
-
DialogActionsComponent.prototype.buttonClass = function (action) {
|
|
249
|
-
var classes = ['k-button k-button-md k-rounded-md'];
|
|
250
|
-
var fillMode = action.fillMode ? action.fillMode : 'solid';
|
|
251
|
-
var themeColor = action.themeColor ? action.themeColor : 'base';
|
|
252
|
-
var cssClasses = action.cssClass ? parseCSSClassNames(action.cssClass) : [];
|
|
253
|
-
classes.push("k-button-" + fillMode + " k-button-" + fillMode + "-" + themeColor);
|
|
254
|
-
if (cssClasses.length > 0) {
|
|
255
|
-
classes = classes.concat(cssClasses);
|
|
256
|
-
}
|
|
257
|
-
return classes.join(' ');
|
|
258
|
-
};
|
|
259
|
-
__decorate([
|
|
260
|
-
Input(),
|
|
261
|
-
__metadata("design:type", Object)
|
|
262
|
-
], DialogActionsComponent.prototype, "actions", void 0);
|
|
263
|
-
__decorate([
|
|
264
|
-
Input(),
|
|
265
|
-
__metadata("design:type", String)
|
|
266
|
-
], DialogActionsComponent.prototype, "layout", void 0);
|
|
267
|
-
__decorate([
|
|
268
|
-
Output(),
|
|
269
|
-
__metadata("design:type", EventEmitter)
|
|
270
|
-
], DialogActionsComponent.prototype, "action", void 0);
|
|
271
|
-
__decorate([
|
|
272
|
-
HostBinding('class.k-dialog-buttongroup'),
|
|
273
|
-
HostBinding('class.k-actions'),
|
|
274
|
-
__metadata("design:type", Boolean)
|
|
275
|
-
], DialogActionsComponent.prototype, "buttonGroupClassName", void 0);
|
|
276
|
-
__decorate([
|
|
277
|
-
HostBinding('class.k-actions-stretched'),
|
|
278
|
-
__metadata("design:type", Boolean),
|
|
279
|
-
__metadata("design:paramtypes", [])
|
|
280
|
-
], DialogActionsComponent.prototype, "className", null);
|
|
281
|
-
DialogActionsComponent = __decorate([
|
|
282
|
-
Component({
|
|
283
|
-
selector: 'kendo-dialog-actions',
|
|
284
|
-
template: "\n <ng-content *ngIf=\"!actions\"></ng-content>\n <ng-container *ngIf=\"!actionTemplate()\">\n <button\n type=\"button\"\n [ngClass]=\"buttonClass(action)\"\n (click)=\"onButtonClick(action, $event)\"\n *ngFor=\"let action of actions\"\n [attr.aria-label]=\"action.text\"\n >\n {{ action.text }}\n </button>\n </ng-container>\n <ng-template [ngTemplateOutlet]=\"actions\" *ngIf=\"actionTemplate()\"></ng-template>\n "
|
|
285
|
-
}),
|
|
286
|
-
__metadata("design:paramtypes", [ElementRef])
|
|
287
|
-
], DialogActionsComponent);
|
|
288
|
-
return DialogActionsComponent;
|
|
289
|
-
}());
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* @hidden
|
|
293
|
-
*/
|
|
294
|
-
var PreventableEvent = /** @class */ (function () {
|
|
295
|
-
function PreventableEvent() {
|
|
296
|
-
this.prevented = false;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Prevents the default action for a specified event.
|
|
300
|
-
* In this way, the source component suppresses the built-in behavior that follows the event.
|
|
301
|
-
*/
|
|
302
|
-
PreventableEvent.prototype.preventDefault = function () {
|
|
303
|
-
this.prevented = true;
|
|
304
|
-
};
|
|
305
|
-
/**
|
|
306
|
-
* If the event is prevented by any of its subscribers, returns `true`.
|
|
307
|
-
*
|
|
308
|
-
* @returns `true` if the default action was prevented. Otherwise, returns `false`.
|
|
309
|
-
*/
|
|
310
|
-
PreventableEvent.prototype.isDefaultPrevented = function () {
|
|
311
|
-
return this.prevented;
|
|
312
|
-
};
|
|
313
|
-
return PreventableEvent;
|
|
314
|
-
}());
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* @hidden
|
|
318
|
-
*/
|
|
319
|
-
var DIALOG_LOCALIZATION_SERVICE = new InjectionToken('Dialog LocalizationService');
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* @hidden
|
|
323
|
-
*/
|
|
324
|
-
var TitleBarLocalizationService = /** @class */ (function (_super) {
|
|
325
|
-
__extends(TitleBarLocalizationService, _super);
|
|
326
|
-
function TitleBarLocalizationService(prefix, messageService, rtl, dialogLocalization) {
|
|
327
|
-
var _this = _super.call(this, prefix, messageService, rtl) || this;
|
|
328
|
-
_this.dialogLocalization = dialogLocalization;
|
|
329
|
-
return _this;
|
|
330
|
-
}
|
|
331
|
-
TitleBarLocalizationService.prototype.get = function (shortKey) {
|
|
332
|
-
if (this.dialogLocalization) {
|
|
333
|
-
return this.dialogLocalization.get(shortKey);
|
|
334
|
-
}
|
|
335
|
-
return _super.prototype.get.call(this, shortKey);
|
|
336
|
-
};
|
|
337
|
-
TitleBarLocalizationService = __decorate([
|
|
338
|
-
__param(0, Inject(L10N_PREFIX)),
|
|
339
|
-
__param(1, Optional()),
|
|
340
|
-
__param(2, Optional()), __param(2, Inject(RTL)),
|
|
341
|
-
__param(3, Optional()), __param(3, Inject(DIALOG_LOCALIZATION_SERVICE)),
|
|
342
|
-
__metadata("design:paramtypes", [String, MessageService, Boolean, LocalizationService])
|
|
343
|
-
], TitleBarLocalizationService);
|
|
344
|
-
return TitleBarLocalizationService;
|
|
345
|
-
}(LocalizationService));
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Represents the [Kendo UI DialogTitleBar component for Angular]({% slug api_dialog_dialogtitlebarcomponent %}).
|
|
349
|
-
*
|
|
350
|
-
* It is used as part of the Dialog content when the component is created dynamically by using an [Angular service]({% slug service_dialog %}).
|
|
351
|
-
*/
|
|
352
|
-
var DialogTitleBarComponent = /** @class */ (function () {
|
|
353
|
-
function DialogTitleBarComponent(zone, hostElement, localizationService) {
|
|
354
|
-
this.zone = zone;
|
|
355
|
-
this.hostElement = hostElement;
|
|
356
|
-
this.localizationService = localizationService;
|
|
357
|
-
/**
|
|
358
|
-
* Fires when the close button of the title-bar is clicked.
|
|
359
|
-
*/
|
|
360
|
-
this.close = new EventEmitter();
|
|
361
|
-
}
|
|
362
|
-
Object.defineProperty(DialogTitleBarComponent.prototype, "className", {
|
|
363
|
-
get: function () {
|
|
364
|
-
return true;
|
|
365
|
-
},
|
|
366
|
-
enumerable: true,
|
|
367
|
-
configurable: true
|
|
368
|
-
});
|
|
369
|
-
Object.defineProperty(DialogTitleBarComponent.prototype, "closeButtonTitle", {
|
|
370
|
-
get: function () {
|
|
371
|
-
return this.closeTitle || this.localizationService.get('closeTitle');
|
|
372
|
-
},
|
|
373
|
-
enumerable: true,
|
|
374
|
-
configurable: true
|
|
375
|
-
});
|
|
376
|
-
DialogTitleBarComponent.prototype.ngAfterViewInit = function () {
|
|
377
|
-
var _this = this;
|
|
378
|
-
this.zone.onStable.pipe(take(1)).subscribe(function () {
|
|
379
|
-
var element = _this.hostElement.nativeElement.querySelector('.k-dialog-title');
|
|
380
|
-
element.setAttribute('id', _this.id);
|
|
381
|
-
});
|
|
382
|
-
};
|
|
383
|
-
/**
|
|
384
|
-
* @hidden
|
|
385
|
-
*/
|
|
386
|
-
DialogTitleBarComponent.prototype.onCloseClick = function (e) {
|
|
387
|
-
e.preventDefault();
|
|
388
|
-
var eventArgs = new PreventableEvent();
|
|
389
|
-
this.close.emit(eventArgs);
|
|
390
|
-
};
|
|
391
|
-
__decorate([
|
|
392
|
-
Output(),
|
|
393
|
-
__metadata("design:type", EventEmitter)
|
|
394
|
-
], DialogTitleBarComponent.prototype, "close", void 0);
|
|
395
|
-
__decorate([
|
|
396
|
-
Input(),
|
|
397
|
-
__metadata("design:type", String)
|
|
398
|
-
], DialogTitleBarComponent.prototype, "id", void 0);
|
|
399
|
-
__decorate([
|
|
400
|
-
Input(),
|
|
401
|
-
__metadata("design:type", String)
|
|
402
|
-
], DialogTitleBarComponent.prototype, "closeTitle", void 0);
|
|
403
|
-
__decorate([
|
|
404
|
-
HostBinding('class.k-window-titlebar'),
|
|
405
|
-
HostBinding('class.k-dialog-titlebar'),
|
|
406
|
-
__metadata("design:type", Boolean),
|
|
407
|
-
__metadata("design:paramtypes", [])
|
|
408
|
-
], DialogTitleBarComponent.prototype, "className", null);
|
|
409
|
-
DialogTitleBarComponent = __decorate([
|
|
410
|
-
Component({
|
|
411
|
-
selector: 'kendo-dialog-titlebar',
|
|
412
|
-
providers: [
|
|
413
|
-
TitleBarLocalizationService,
|
|
414
|
-
{
|
|
415
|
-
provide: LocalizationService,
|
|
416
|
-
useExisting: TitleBarLocalizationService
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
provide: L10N_PREFIX,
|
|
420
|
-
useValue: 'kendo.dialog'
|
|
421
|
-
}
|
|
422
|
-
],
|
|
423
|
-
template: "\n <ng-container\n kendoDialogTitleBarLocalizedMessages\n i18n-closeTitle=\"kendo.dialog.closeTitle|The title of the close button\"\n closeTitle=\"Close\"\n >\n <div class=\"k-window-title k-dialog-title\">\n <ng-content></ng-content>\n </div>\n\n <div class=\"k-window-actions k-dialog-actions\">\n <button\n role=\"button\"\n [attr.title]=\"closeButtonTitle\"\n [attr.aria-label]=\"closeButtonTitle\"\n class=\"k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button k-window-action k-dialog-action k-dialog-close\"\n (click)=\"onCloseClick($event)\"\n >\n <span class=\"k-button-icon k-icon k-i-x\"></span>\n </button>\n </div>\n </ng-container>\n "
|
|
424
|
-
}),
|
|
425
|
-
__param(2, Optional()),
|
|
426
|
-
__metadata("design:paramtypes", [NgZone, ElementRef, LocalizationService])
|
|
427
|
-
], DialogTitleBarComponent);
|
|
428
|
-
return DialogTitleBarComponent;
|
|
429
|
-
}());
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* @hidden
|
|
433
|
-
*/
|
|
434
|
-
var packageMetadata = {
|
|
435
|
-
name: '@progress/kendo-angular-dialog',
|
|
436
|
-
productName: 'Kendo UI for Angular',
|
|
437
|
-
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
438
|
-
publishDate: 1646820184,
|
|
439
|
-
version: '',
|
|
440
|
-
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* The settings for the Dialog actions when the Dialog is opened through `DialogService`
|
|
445
|
-
* ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
|
|
446
|
-
*/
|
|
447
|
-
var DialogAction = /** @class */ (function () {
|
|
448
|
-
function DialogAction() {
|
|
449
|
-
}
|
|
450
|
-
return DialogAction;
|
|
451
|
-
}());
|
|
452
|
-
/**
|
|
453
|
-
* Indicates that the **Close** button is clicked. Used when the results from
|
|
454
|
-
* the Dialogs that are opened through `DialogService` are filtered
|
|
455
|
-
* ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
|
|
456
|
-
*/
|
|
457
|
-
var DialogCloseResult = /** @class */ (function () {
|
|
458
|
-
function DialogCloseResult() {
|
|
459
|
-
}
|
|
460
|
-
return DialogCloseResult;
|
|
461
|
-
}());
|
|
462
|
-
/**
|
|
463
|
-
* The settings that can be used when the Dialog is opened through `DialogService`.
|
|
464
|
-
* ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
|
|
465
|
-
*/
|
|
466
|
-
var DialogSettings = /** @class */ (function () {
|
|
467
|
-
function DialogSettings() {
|
|
468
|
-
}
|
|
469
|
-
return DialogSettings;
|
|
470
|
-
}());
|
|
471
|
-
/**
|
|
472
|
-
* Holds references to the object instance and published events of the Dialog.
|
|
473
|
-
* Controls the Dialogs that were opened through the `DialogService`
|
|
474
|
-
* ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
|
|
475
|
-
*/
|
|
476
|
-
var DialogRef = /** @class */ (function () {
|
|
477
|
-
function DialogRef() {
|
|
478
|
-
}
|
|
479
|
-
return DialogRef;
|
|
480
|
-
}());
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Represents the [Kendo UI Dialog component for Angular]({% slug overview_dialog_dialogs %}).
|
|
484
|
-
*/
|
|
485
|
-
var DialogComponent = /** @class */ (function () {
|
|
486
|
-
function DialogComponent(wrapper, renderer, localization, cdr, ngZone) {
|
|
487
|
-
var _this = this;
|
|
488
|
-
this.wrapper = wrapper;
|
|
489
|
-
this.renderer = renderer;
|
|
490
|
-
this.cdr = cdr;
|
|
491
|
-
this.ngZone = ngZone;
|
|
492
|
-
/**
|
|
493
|
-
* Specifies the layout of the action buttons in the Dialog.
|
|
494
|
-
* This option is only applicable if the action buttons are specified through the `actions` options.
|
|
495
|
-
*
|
|
496
|
-
* @default 'stretched'
|
|
497
|
-
*/
|
|
498
|
-
this.actionsLayout = 'stretched';
|
|
499
|
-
/**
|
|
500
|
-
* @hidden
|
|
501
|
-
*/
|
|
502
|
-
this.titleId = null;
|
|
503
|
-
/**
|
|
504
|
-
* @hidden
|
|
505
|
-
*/
|
|
506
|
-
this.contentId = null;
|
|
507
|
-
/**
|
|
508
|
-
* Fires when the user clicks an action button of the Dialog.
|
|
509
|
-
* The event is fired only when the action buttons are specified through the `actions` options.
|
|
510
|
-
*/
|
|
511
|
-
this.action = new EventEmitter();
|
|
512
|
-
/**
|
|
513
|
-
* Fires when the user clicks the **Close** button of the Dialog or the **ESC** key.
|
|
514
|
-
*/
|
|
515
|
-
this.close = new EventEmitter();
|
|
516
|
-
this.tabIndex = 0;
|
|
517
|
-
this.subscriptions = [];
|
|
518
|
-
this.domSubs = new Subscription();
|
|
519
|
-
validatePackage(packageMetadata);
|
|
520
|
-
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
521
|
-
this.subscriptions.push(localization.changes.subscribe(function (_a) {
|
|
522
|
-
var rtl = _a.rtl;
|
|
523
|
-
return (_this.direction = rtl ? 'rtl' : 'ltr');
|
|
524
|
-
}));
|
|
525
|
-
this.titleId = this.generateTitleId();
|
|
526
|
-
this.contentId = this.generateContentId();
|
|
527
|
-
}
|
|
528
|
-
Object.defineProperty(DialogComponent.prototype, "htmlAttributes", {
|
|
529
|
-
get: function () {
|
|
530
|
-
return this._htmlAttributes;
|
|
531
|
-
},
|
|
532
|
-
/**
|
|
533
|
-
* @hidden
|
|
534
|
-
*/
|
|
535
|
-
set: function (attributes) {
|
|
536
|
-
setHTMLAttributes(attributes, this.renderer, this.wrapper.nativeElement);
|
|
537
|
-
var el = this.wrapper.nativeElement;
|
|
538
|
-
var dir = el.getAttribute('dir');
|
|
539
|
-
var tIndex = el.getAttribute('tabindex');
|
|
540
|
-
if (this.direction !== dir && dir) {
|
|
541
|
-
this.direction = dir;
|
|
542
|
-
}
|
|
543
|
-
if (this.tabIndex !== tIndex && tIndex) {
|
|
544
|
-
this.tabIndex = tIndex;
|
|
545
|
-
}
|
|
546
|
-
this._htmlAttributes = attributes;
|
|
547
|
-
},
|
|
548
|
-
enumerable: true,
|
|
549
|
-
configurable: true
|
|
550
|
-
});
|
|
551
|
-
Object.defineProperty(DialogComponent.prototype, "cssClass", {
|
|
552
|
-
get: function () {
|
|
553
|
-
return this._cssClass;
|
|
554
|
-
},
|
|
555
|
-
/**
|
|
556
|
-
* @hidden
|
|
557
|
-
*/
|
|
558
|
-
set: function (classes) {
|
|
559
|
-
this.setServiceClasses(this._cssClass, classes);
|
|
560
|
-
this._cssClass = classes;
|
|
561
|
-
},
|
|
562
|
-
enumerable: true,
|
|
563
|
-
configurable: true
|
|
564
|
-
});
|
|
565
|
-
Object.defineProperty(DialogComponent.prototype, "dir", {
|
|
566
|
-
get: function () {
|
|
567
|
-
return this.direction;
|
|
568
|
-
},
|
|
569
|
-
enumerable: true,
|
|
570
|
-
configurable: true
|
|
571
|
-
});
|
|
572
|
-
DialogComponent.prototype.ngAfterContentInit = function () {
|
|
573
|
-
var _this = this;
|
|
574
|
-
this.bubble('close', this.titlebarContent.first);
|
|
575
|
-
this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-describedby', this.contentId);
|
|
576
|
-
if (this.titlebarContent.first) {
|
|
577
|
-
this.titlebarContent.first.id = this.titleId;
|
|
578
|
-
}
|
|
579
|
-
else {
|
|
580
|
-
this.subscriptions.push(this.titlebarContent.changes.subscribe(function () {
|
|
581
|
-
if (isPresent(_this.titlebarContent.first)) {
|
|
582
|
-
_this.titlebarContent.first.id = _this.titleId;
|
|
583
|
-
_this.ngZone.onStable.pipe(take(1)).subscribe(function () {
|
|
584
|
-
_this.bubble('close', _this.titlebarContent.first);
|
|
585
|
-
_this.renderer.setAttribute(_this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', _this.titleId);
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
}));
|
|
589
|
-
}
|
|
590
|
-
};
|
|
591
|
-
DialogComponent.prototype.ngAfterViewInit = function () {
|
|
592
|
-
var _this = this;
|
|
593
|
-
this.handleInitialFocus();
|
|
594
|
-
this.bubble('close', this.titlebarView.first);
|
|
595
|
-
this.bubble('action', this.actionsView);
|
|
596
|
-
if (this.titlebarView.first || this.titlebarContent.first) {
|
|
597
|
-
//Needed for Dialogs created via service
|
|
598
|
-
this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', this.titleId);
|
|
599
|
-
}
|
|
600
|
-
else {
|
|
601
|
-
this.subscriptions.push(this.titlebarView.changes.subscribe(function () {
|
|
602
|
-
if (isPresent(_this.titlebarView.first)) {
|
|
603
|
-
_this.titlebarView.first.id = _this.titleId;
|
|
604
|
-
_this.ngZone.onStable.pipe(take(1)).subscribe(function () {
|
|
605
|
-
_this.bubble('close', _this.titlebarView.first);
|
|
606
|
-
_this.renderer.setAttribute(_this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', _this.titleId);
|
|
607
|
-
});
|
|
608
|
-
}
|
|
609
|
-
}));
|
|
610
|
-
}
|
|
611
|
-
this.initDomEvents();
|
|
612
|
-
};
|
|
613
|
-
DialogComponent.prototype.ngOnInit = function () {
|
|
614
|
-
this.renderer.removeAttribute(this.wrapper.nativeElement, 'title');
|
|
615
|
-
this.cdr.detectChanges();
|
|
616
|
-
};
|
|
617
|
-
DialogComponent.prototype.ngOnDestroy = function () {
|
|
618
|
-
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
619
|
-
this.subscriptions = [];
|
|
620
|
-
if (this.domSubs) {
|
|
621
|
-
this.domSubs.unsubscribe();
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
/**
|
|
625
|
-
* Focuses the wrapper of the Dialog component.
|
|
626
|
-
*/
|
|
627
|
-
DialogComponent.prototype.focus = function () {
|
|
628
|
-
var wrapper = this.wrapper.nativeElement;
|
|
629
|
-
if (isPresent(wrapper)) {
|
|
630
|
-
wrapper.focus();
|
|
631
|
-
}
|
|
632
|
-
};
|
|
633
|
-
DialogComponent.prototype.initDomEvents = function () {
|
|
634
|
-
var _this = this;
|
|
635
|
-
if (!this.wrapper) {
|
|
636
|
-
return;
|
|
637
|
-
}
|
|
638
|
-
this.ngZone.runOutsideAngular(function () {
|
|
639
|
-
_this.domSubs.add(_this.renderer.listen(_this.wrapper.nativeElement, 'keydown', function (ev) {
|
|
640
|
-
_this.onKeyDown(ev);
|
|
641
|
-
}));
|
|
642
|
-
});
|
|
643
|
-
};
|
|
644
|
-
DialogComponent.prototype.onKeyDown = function (event) {
|
|
645
|
-
var _this = this;
|
|
646
|
-
var target = event.target;
|
|
647
|
-
var parent = target.parentElement;
|
|
648
|
-
if (hasClasses(target, DIALOG_ELEMENTS_HANDLING_ESC_KEY) || hasClasses(parent, DIALOG_ELEMENTS_HANDLING_ESC_KEY)) {
|
|
649
|
-
if (event.keyCode === Keys.esc) {
|
|
650
|
-
this.ngZone.run(function () {
|
|
651
|
-
_this.close.emit(new DialogCloseResult());
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
if (hasClasses(target, 'k-button') && hasClasses(parent, DIALOG_ELEMENTS_HANDLING_ARROWS) &&
|
|
656
|
-
(event.keyCode === Keys.left || event.keyCode === Keys.right)) {
|
|
657
|
-
this.ngZone.run(function () {
|
|
658
|
-
_this.handleActionButtonFocus(parent, event.keyCode);
|
|
659
|
-
});
|
|
660
|
-
}
|
|
661
|
-
if (event.keyCode === Keys.tab) {
|
|
662
|
-
this.ngZone.run(function () {
|
|
663
|
-
_this.keepFocusWithinComponent(target, event);
|
|
664
|
-
});
|
|
665
|
-
}
|
|
666
|
-
};
|
|
667
|
-
DialogComponent.prototype.setServiceClasses = function (prevValue, value) {
|
|
668
|
-
var _this = this;
|
|
669
|
-
var el = this.wrapper.nativeElement;
|
|
670
|
-
if (prevValue) {
|
|
671
|
-
parseCSSClassNames(prevValue).forEach(function (className) {
|
|
672
|
-
_this.renderer.removeClass(el, className);
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
if (value) {
|
|
676
|
-
parseCSSClassNames(value).forEach(function (className) {
|
|
677
|
-
_this.renderer.addClass(el, className);
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
};
|
|
681
|
-
/**
|
|
682
|
-
* @hidden
|
|
683
|
-
*/
|
|
684
|
-
DialogComponent.prototype.handleInitialFocus = function () {
|
|
685
|
-
var wrapper = this.wrapper.nativeElement;
|
|
686
|
-
var primaryButton = this.findPrimary(wrapper);
|
|
687
|
-
if (this.autoFocusedElement) {
|
|
688
|
-
var initiallyFocusedElement = wrapper.querySelector(this.autoFocusedElement);
|
|
689
|
-
if (initiallyFocusedElement) {
|
|
690
|
-
initiallyFocusedElement.focus();
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
else if (this.shouldFocusPrimary(primaryButton)) {
|
|
694
|
-
primaryButton.focus();
|
|
695
|
-
}
|
|
696
|
-
else {
|
|
697
|
-
wrapper.focus();
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
/**
|
|
701
|
-
* @hidden
|
|
702
|
-
*/
|
|
703
|
-
DialogComponent.prototype.findPrimary = function (wrapper) {
|
|
704
|
-
var actionBtns = wrapper.querySelectorAll('.k-actions .k-button');
|
|
705
|
-
return findPrimaryButton(actionBtns);
|
|
706
|
-
};
|
|
707
|
-
/**
|
|
708
|
-
* @hidden
|
|
709
|
-
*/
|
|
710
|
-
DialogComponent.prototype.handleActionButtonFocus = function (parent, key) {
|
|
711
|
-
var focusableActionButtons = this.getAllFocusableChildren(parent);
|
|
712
|
-
for (var i = 0; i < focusableActionButtons.length; i++) {
|
|
713
|
-
var current = focusableActionButtons[i];
|
|
714
|
-
if (current === document.activeElement) {
|
|
715
|
-
if (key === Keys.left && i > 0) {
|
|
716
|
-
focusableActionButtons[i - 1].focus();
|
|
717
|
-
break;
|
|
718
|
-
}
|
|
719
|
-
if (key === Keys.right && i < focusableActionButtons.length - 1) {
|
|
720
|
-
focusableActionButtons[i + 1].focus();
|
|
721
|
-
break;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
};
|
|
726
|
-
/**
|
|
727
|
-
* @hidden
|
|
728
|
-
*/
|
|
729
|
-
DialogComponent.prototype.keepFocusWithinComponent = function (target, event) {
|
|
730
|
-
var wrapper = this.wrapper.nativeElement;
|
|
731
|
-
var _a = this.getFirstAndLastFocusable(wrapper), firstFocusable = _a[0], lastFocusable = _a[1];
|
|
732
|
-
var tabAfterLastFocusable = !event.shiftKey && target === lastFocusable;
|
|
733
|
-
var shiftTabAfterFirstFocusable = event.shiftKey && target === firstFocusable;
|
|
734
|
-
if (tabAfterLastFocusable) {
|
|
735
|
-
event.preventDefault();
|
|
736
|
-
firstFocusable.focus();
|
|
737
|
-
}
|
|
738
|
-
if (shiftTabAfterFirstFocusable) {
|
|
739
|
-
event.preventDefault();
|
|
740
|
-
lastFocusable.focus();
|
|
741
|
-
}
|
|
742
|
-
};
|
|
743
|
-
/**
|
|
744
|
-
* @hidden
|
|
745
|
-
*/
|
|
746
|
-
DialogComponent.prototype.shouldFocusPrimary = function (el) {
|
|
747
|
-
return isPresent(el) && isFocusable(el);
|
|
748
|
-
};
|
|
749
|
-
/**
|
|
750
|
-
* @hidden
|
|
751
|
-
*/
|
|
752
|
-
DialogComponent.prototype.getAllFocusableChildren = function (parent) {
|
|
753
|
-
return parent.querySelectorAll(focusableSelector);
|
|
754
|
-
};
|
|
755
|
-
/**
|
|
756
|
-
* @hidden
|
|
757
|
-
*/
|
|
758
|
-
DialogComponent.prototype.getFirstAndLastFocusable = function (parent) {
|
|
759
|
-
var all = this.getAllFocusableChildren(parent);
|
|
760
|
-
var firstFocusable = all.length > 0 ? all[0] : parent;
|
|
761
|
-
var lastFocusable = all.length > 0 ? all[all.length - 1] : parent;
|
|
762
|
-
return [firstFocusable, lastFocusable];
|
|
763
|
-
};
|
|
764
|
-
/**
|
|
765
|
-
* @hidden
|
|
766
|
-
*/
|
|
767
|
-
DialogComponent.prototype.generateTitleId = function () {
|
|
768
|
-
return 'kendo-dialog-title-' + Math.ceil(Math.random() * 1000000).toString();
|
|
769
|
-
};
|
|
770
|
-
/**
|
|
771
|
-
* @hidden
|
|
772
|
-
*/
|
|
773
|
-
DialogComponent.prototype.generateContentId = function () {
|
|
774
|
-
return 'kendo-dialog-content-' + Math.ceil(Math.random() * 1000000).toString();
|
|
775
|
-
};
|
|
776
|
-
Object.defineProperty(DialogComponent.prototype, "wrapperClass", {
|
|
777
|
-
get: function () {
|
|
778
|
-
return true;
|
|
779
|
-
},
|
|
780
|
-
enumerable: true,
|
|
781
|
-
configurable: true
|
|
782
|
-
});
|
|
783
|
-
Object.defineProperty(DialogComponent.prototype, "styles", {
|
|
784
|
-
get: function () {
|
|
785
|
-
var styles = {};
|
|
786
|
-
if (this.width) {
|
|
787
|
-
styles.width = createValueWithUnit(this.width);
|
|
788
|
-
}
|
|
789
|
-
if (this.height) {
|
|
790
|
-
styles.height = createValueWithUnit(this.height);
|
|
791
|
-
}
|
|
792
|
-
if (this.minWidth) {
|
|
793
|
-
styles.minWidth = createValueWithUnit(this.minWidth);
|
|
794
|
-
}
|
|
795
|
-
if (this.maxWidth) {
|
|
796
|
-
styles.maxWidth = createValueWithUnit(this.maxWidth);
|
|
797
|
-
}
|
|
798
|
-
if (this.minHeight) {
|
|
799
|
-
styles.minHeight = createValueWithUnit(this.minHeight);
|
|
800
|
-
}
|
|
801
|
-
if (this.maxHeight) {
|
|
802
|
-
styles.maxHeight = createValueWithUnit(this.maxHeight);
|
|
803
|
-
}
|
|
804
|
-
return styles;
|
|
805
|
-
},
|
|
806
|
-
enumerable: true,
|
|
807
|
-
configurable: true
|
|
808
|
-
});
|
|
809
|
-
DialogComponent.prototype.bubble = function (eventName, component) {
|
|
810
|
-
var _this = this;
|
|
811
|
-
if (component) {
|
|
812
|
-
var emit = function (e) { return _this[eventName].emit(e); };
|
|
813
|
-
var s = component[eventName].subscribe(emit);
|
|
814
|
-
this.subscriptions.push(s);
|
|
815
|
-
}
|
|
816
|
-
};
|
|
817
|
-
__decorate([
|
|
818
|
-
Input(),
|
|
819
|
-
__metadata("design:type", Array)
|
|
820
|
-
], DialogComponent.prototype, "actions", void 0);
|
|
821
|
-
__decorate([
|
|
822
|
-
Input(),
|
|
823
|
-
__metadata("design:type", String)
|
|
824
|
-
], DialogComponent.prototype, "actionsLayout", void 0);
|
|
825
|
-
__decorate([
|
|
826
|
-
Input(),
|
|
827
|
-
__metadata("design:type", String)
|
|
828
|
-
], DialogComponent.prototype, "autoFocusedElement", void 0);
|
|
829
|
-
__decorate([
|
|
830
|
-
Input(),
|
|
831
|
-
__metadata("design:type", String)
|
|
832
|
-
], DialogComponent.prototype, "title", void 0);
|
|
833
|
-
__decorate([
|
|
834
|
-
Input(),
|
|
835
|
-
__metadata("design:type", Object)
|
|
836
|
-
], DialogComponent.prototype, "width", void 0);
|
|
837
|
-
__decorate([
|
|
838
|
-
Input(),
|
|
839
|
-
__metadata("design:type", Object)
|
|
840
|
-
], DialogComponent.prototype, "minWidth", void 0);
|
|
841
|
-
__decorate([
|
|
842
|
-
Input(),
|
|
843
|
-
__metadata("design:type", Object)
|
|
844
|
-
], DialogComponent.prototype, "maxWidth", void 0);
|
|
845
|
-
__decorate([
|
|
846
|
-
Input(),
|
|
847
|
-
__metadata("design:type", Object)
|
|
848
|
-
], DialogComponent.prototype, "height", void 0);
|
|
849
|
-
__decorate([
|
|
850
|
-
Input(),
|
|
851
|
-
__metadata("design:type", Object)
|
|
852
|
-
], DialogComponent.prototype, "minHeight", void 0);
|
|
853
|
-
__decorate([
|
|
854
|
-
Input(),
|
|
855
|
-
__metadata("design:type", Object)
|
|
856
|
-
], DialogComponent.prototype, "maxHeight", void 0);
|
|
857
|
-
__decorate([
|
|
858
|
-
Output(),
|
|
859
|
-
__metadata("design:type", EventEmitter)
|
|
860
|
-
], DialogComponent.prototype, "action", void 0);
|
|
861
|
-
__decorate([
|
|
862
|
-
Output(),
|
|
863
|
-
__metadata("design:type", EventEmitter)
|
|
864
|
-
], DialogComponent.prototype, "close", void 0);
|
|
865
|
-
__decorate([
|
|
866
|
-
HostBinding('attr.dir'),
|
|
867
|
-
__metadata("design:type", String),
|
|
868
|
-
__metadata("design:paramtypes", [])
|
|
869
|
-
], DialogComponent.prototype, "dir", null);
|
|
870
|
-
__decorate([
|
|
871
|
-
HostBinding('attr.tabIndex'),
|
|
872
|
-
__metadata("design:type", Number)
|
|
873
|
-
], DialogComponent.prototype, "tabIndex", void 0);
|
|
874
|
-
__decorate([
|
|
875
|
-
ContentChildren(DialogTitleBarComponent, { descendants: false }),
|
|
876
|
-
__metadata("design:type", QueryList)
|
|
877
|
-
], DialogComponent.prototype, "titlebarContent", void 0);
|
|
878
|
-
__decorate([
|
|
879
|
-
ViewChildren(DialogTitleBarComponent),
|
|
880
|
-
__metadata("design:type", QueryList)
|
|
881
|
-
], DialogComponent.prototype, "titlebarView", void 0);
|
|
882
|
-
__decorate([
|
|
883
|
-
ViewChild(DialogActionsComponent, { static: false }),
|
|
884
|
-
__metadata("design:type", DialogActionsComponent)
|
|
885
|
-
], DialogComponent.prototype, "actionsView", void 0);
|
|
886
|
-
__decorate([
|
|
887
|
-
HostBinding('class.k-dialog-wrapper'),
|
|
888
|
-
__metadata("design:type", Boolean),
|
|
889
|
-
__metadata("design:paramtypes", [])
|
|
890
|
-
], DialogComponent.prototype, "wrapperClass", null);
|
|
891
|
-
DialogComponent = __decorate([
|
|
892
|
-
Component({
|
|
893
|
-
animations: [
|
|
894
|
-
trigger('overlayAppear', [
|
|
895
|
-
state('in', style({ opacity: 1 })),
|
|
896
|
-
transition('void => *', [style({ opacity: 0.1 }), animate('.3s cubic-bezier(.2, .6, .4, 1)')])
|
|
897
|
-
]),
|
|
898
|
-
trigger('dialogSlideInAppear', [
|
|
899
|
-
state('in', style({ transform: 'translate(0, 0)' })),
|
|
900
|
-
transition('void => *', [style({ transform: 'translate(0, -10%)' }), animate('.3s cubic-bezier(.2, 1, .2, 1)')])
|
|
901
|
-
])
|
|
902
|
-
],
|
|
903
|
-
exportAs: 'kendoDialog',
|
|
904
|
-
providers: [
|
|
905
|
-
LocalizationService,
|
|
906
|
-
{
|
|
907
|
-
provide: DIALOG_LOCALIZATION_SERVICE,
|
|
908
|
-
useExisting: LocalizationService
|
|
909
|
-
},
|
|
910
|
-
{
|
|
911
|
-
provide: L10N_PREFIX,
|
|
912
|
-
useValue: 'kendo.dialog'
|
|
913
|
-
}
|
|
914
|
-
],
|
|
915
|
-
selector: 'kendo-dialog',
|
|
916
|
-
template: "\n <ng-container\n kendoDialogLocalizedMessages\n i18n-closeTitle=\"kendo.dialog.closeTitle|The title of the close button\"\n closeTitle=\"Close\"\n >\n <div class=\"k-overlay\" @overlayAppear></div>\n\n <div class=\"k-window k-dialog\" role=\"dialog\" aria-modal=\"true\" [ngStyle]=\"styles\" @dialogSlideInAppear>\n <kendo-dialog-titlebar *ngIf=\"title\" [closeTitle]=\"closeTitle\" [id]=\"titleId\">{{ title }}</kendo-dialog-titlebar>\n <ng-content select=\"kendo-dialog-titlebar\" *ngIf=\"!title\"></ng-content>\n\n <div [id]=\"contentId\" class=\"k-content k-window-content k-dialog-content\">\n <ng-content *ngIf=\"!contentTemplate\"></ng-content>\n <ng-template [ngTemplateOutlet]=\"contentTemplate\" *ngIf=\"contentTemplate\"></ng-template>\n </div>\n\n <ng-content select=\"kendo-dialog-actions\" *ngIf=\"!actions\"></ng-content>\n <kendo-dialog-actions *ngIf=\"actions\" [actions]=\"actions\" [layout]=\"actionsLayout\"> </kendo-dialog-actions>\n </div>\n </ng-container>\n "
|
|
917
|
-
}),
|
|
918
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
919
|
-
Renderer2,
|
|
920
|
-
LocalizationService,
|
|
921
|
-
ChangeDetectorRef,
|
|
922
|
-
NgZone])
|
|
923
|
-
], DialogComponent);
|
|
924
|
-
return DialogComponent;
|
|
925
|
-
}());
|
|
926
|
-
|
|
927
|
-
/**
|
|
928
|
-
* The base class which will be extended by a component that is provided as content through `content`
|
|
929
|
-
* ([see example]({% slug service_dialog %}#toc-passing-title-content-and-actions-as-a-single-component)).
|
|
930
|
-
*/
|
|
931
|
-
var DialogContentBase = /** @class */ (function () {
|
|
932
|
-
function DialogContentBase(dialog) {
|
|
933
|
-
this.dialog = dialog;
|
|
934
|
-
}
|
|
935
|
-
/**
|
|
936
|
-
* @hidden
|
|
937
|
-
*/
|
|
938
|
-
DialogContentBase.prototype.ngAfterViewInit = function () {
|
|
939
|
-
var _this = this;
|
|
940
|
-
if (this.dialogTitleBar) {
|
|
941
|
-
// when opening component inside dialog with service AND the component has defined its own titlebar
|
|
942
|
-
this.dialogTitleBar.close.pipe(filter(function (e) { return !e.isDefaultPrevented(); })).subscribe(function () {
|
|
943
|
-
_this.dialog.close();
|
|
944
|
-
});
|
|
945
|
-
}
|
|
946
|
-
if (this.dialogActions) {
|
|
947
|
-
if (this.dialogActions.actions) {
|
|
948
|
-
this.dialogActions.action.subscribe(function (action) { return _this.dialog.dialog.instance.action.emit(action); });
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
};
|
|
952
|
-
__decorate([
|
|
953
|
-
ViewChild(DialogTitleBarComponent, { static: false }),
|
|
954
|
-
__metadata("design:type", DialogTitleBarComponent)
|
|
955
|
-
], DialogContentBase.prototype, "dialogTitleBar", void 0);
|
|
956
|
-
__decorate([
|
|
957
|
-
ViewChild(DialogActionsComponent, { static: false }),
|
|
958
|
-
__metadata("design:type", DialogActionsComponent)
|
|
959
|
-
], DialogContentBase.prototype, "dialogActions", void 0);
|
|
960
|
-
return DialogContentBase;
|
|
961
|
-
}());
|
|
962
|
-
|
|
963
|
-
/**
|
|
964
|
-
* @hidden
|
|
965
|
-
*/
|
|
966
|
-
var DialogContainerService = /** @class */ (function () {
|
|
967
|
-
function DialogContainerService() {
|
|
968
|
-
}
|
|
969
|
-
DialogContainerService_1 = DialogContainerService;
|
|
970
|
-
Object.defineProperty(DialogContainerService.prototype, "container", {
|
|
971
|
-
get: function () {
|
|
972
|
-
return DialogContainerService_1.container;
|
|
973
|
-
},
|
|
974
|
-
set: function (container) {
|
|
975
|
-
DialogContainerService_1.container = container;
|
|
976
|
-
},
|
|
977
|
-
enumerable: true,
|
|
978
|
-
configurable: true
|
|
979
|
-
});
|
|
980
|
-
var DialogContainerService_1;
|
|
981
|
-
DialogContainerService.container = null;
|
|
982
|
-
DialogContainerService = DialogContainerService_1 = __decorate([
|
|
983
|
-
Injectable()
|
|
984
|
-
], DialogContainerService);
|
|
985
|
-
return DialogContainerService;
|
|
986
|
-
}());
|
|
987
|
-
|
|
988
|
-
var isNotComponent = function (component) { return isString(component) || component instanceof TemplateRef; };
|
|
989
|
-
var DialogInjector = /** @class */ (function () {
|
|
990
|
-
function DialogInjector(getDialogRef, parentInjector) {
|
|
991
|
-
this.getDialogRef = getDialogRef;
|
|
992
|
-
this.parentInjector = parentInjector;
|
|
993
|
-
}
|
|
994
|
-
DialogInjector.prototype.get = function (token, notFoundValue) {
|
|
995
|
-
if (token === DialogRef) {
|
|
996
|
-
return this.getDialogRef();
|
|
997
|
-
}
|
|
998
|
-
return this.parentInjector.get(token, notFoundValue);
|
|
999
|
-
};
|
|
1000
|
-
return DialogInjector;
|
|
1001
|
-
}());
|
|
1002
|
-
/**
|
|
1003
|
-
* A service for opening Dialog windows dynamically
|
|
1004
|
-
* ([see example]({% slug service_dialog %})).
|
|
1005
|
-
*/
|
|
1006
|
-
var DialogService = /** @class */ (function () {
|
|
1007
|
-
function DialogService(
|
|
1008
|
-
/**
|
|
1009
|
-
* @hidden
|
|
1010
|
-
*/
|
|
1011
|
-
resolver, containerService) {
|
|
1012
|
-
this.resolver = resolver;
|
|
1013
|
-
this.containerService = containerService;
|
|
1014
|
-
}
|
|
1015
|
-
/**
|
|
1016
|
-
* Opens a Dialog window. Requires an element in the application that uses the
|
|
1017
|
-
* [`kendoDialogContainer`]({% slug api_dialog_dialogcontainerdirective %}) directive.
|
|
1018
|
-
* Created Dialogs will be mounted in the DOM directly after that element.
|
|
1019
|
-
*
|
|
1020
|
-
* @param {DialogAction} options - The options that define the Dialog.
|
|
1021
|
-
* @returns {DialogRef} - A reference to the Dialog object and the convenience properties.
|
|
1022
|
-
*
|
|
1023
|
-
* @example
|
|
1024
|
-
*
|
|
1025
|
-
* ```ts-no-run
|
|
1026
|
-
* _@Component({
|
|
1027
|
-
* selector: 'my-app',
|
|
1028
|
-
* template: `
|
|
1029
|
-
* <button kendoButton (click)="open()">Harmless button</button>
|
|
1030
|
-
* <div kendoDialogContainer></div>
|
|
1031
|
-
* `
|
|
1032
|
-
* })
|
|
1033
|
-
* export class AppComponent {
|
|
1034
|
-
* constructor( private dialogService: DialogService ) {}
|
|
1035
|
-
*
|
|
1036
|
-
* public open() {
|
|
1037
|
-
* var dialog = this.dialogService.open({
|
|
1038
|
-
* title: "Please confirm",
|
|
1039
|
-
* content: "Are you sure?",
|
|
1040
|
-
* actions: [
|
|
1041
|
-
* { text: "No" },
|
|
1042
|
-
* { text: "Yes", themeColor: 'primary' }
|
|
1043
|
-
* ]
|
|
1044
|
-
* });
|
|
1045
|
-
*
|
|
1046
|
-
* dialog.result.subscribe((result) => {
|
|
1047
|
-
* if (result instanceof DialogCloseResult) {
|
|
1048
|
-
* console.log("close");
|
|
1049
|
-
* } else {
|
|
1050
|
-
* console.log("action", result);
|
|
1051
|
-
* }
|
|
1052
|
-
* });
|
|
1053
|
-
* }
|
|
1054
|
-
* }
|
|
1055
|
-
* ```
|
|
1056
|
-
*
|
|
1057
|
-
*/
|
|
1058
|
-
DialogService.prototype.open = function (options) {
|
|
1059
|
-
var factory = this.resolver.resolveComponentFactory(DialogComponent);
|
|
1060
|
-
var container = options.appendTo || this.containerService.container;
|
|
1061
|
-
if (!container) {
|
|
1062
|
-
throw new Error("\nCannot attach dialog to the page.\nAdd an element that uses the kendoDialogContainer directive, or set the 'appendTo' property.\nSee https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/service/.\n ");
|
|
1063
|
-
}
|
|
1064
|
-
// create DialogRef to (1) pass as result, (2) provide through injector
|
|
1065
|
-
var dialogRef = {
|
|
1066
|
-
close: function () {
|
|
1067
|
-
/* noop */
|
|
1068
|
-
},
|
|
1069
|
-
content: null,
|
|
1070
|
-
dialog: null,
|
|
1071
|
-
result: null
|
|
1072
|
-
};
|
|
1073
|
-
return this.initializeDialog(options.content, factory, container, dialogRef, options);
|
|
1074
|
-
};
|
|
1075
|
-
DialogService.prototype.initializeDialog = function (component, factory, container, dialogRef, options) {
|
|
1076
|
-
var content = this.contentFrom(component, container, dialogRef);
|
|
1077
|
-
var dialog = container.createComponent(factory, undefined, undefined, content.nodes);
|
|
1078
|
-
dialogRef.dialog = dialog;
|
|
1079
|
-
dialog.changeDetectorRef.markForCheck();
|
|
1080
|
-
// copy @Input options to dialog instance
|
|
1081
|
-
this.applyOptions(dialog.instance, options);
|
|
1082
|
-
// create close handler and result stream
|
|
1083
|
-
var apiClose = new Subject();
|
|
1084
|
-
var close = function (e) {
|
|
1085
|
-
if (e instanceof PreventableEvent) {
|
|
1086
|
-
e = new DialogCloseResult();
|
|
1087
|
-
}
|
|
1088
|
-
apiClose.next(e || new DialogCloseResult());
|
|
1089
|
-
if (content.componentRef) {
|
|
1090
|
-
content.componentRef.destroy();
|
|
1091
|
-
}
|
|
1092
|
-
dialog.destroy();
|
|
1093
|
-
};
|
|
1094
|
-
var result = merge(apiClose,
|
|
1095
|
-
// triggered when the titlebar or actions are defined in DialogSettings
|
|
1096
|
-
merge(dialog.instance.close, dialog.instance.action).pipe(map(function (e) { return (e instanceof PreventableEvent ? new DialogCloseResult() : e); }), filter(function (e) {
|
|
1097
|
-
if (options.preventAction) {
|
|
1098
|
-
// add dialogRef only when using component
|
|
1099
|
-
var dialogRefParameter = isNotComponent(component) ? undefined : dialogRef;
|
|
1100
|
-
return !options.preventAction(e, dialogRefParameter);
|
|
1101
|
-
}
|
|
1102
|
-
return true;
|
|
1103
|
-
}))).pipe(take(1),
|
|
1104
|
-
// Takes care for multiple subscriptions:
|
|
1105
|
-
// We subscribe internaly and the user may subscribe to get a close result - dialog.result.subscribe().
|
|
1106
|
-
// This causes multiple subscriptions to the same source and thus multiple emissions. share() solves that.
|
|
1107
|
-
share());
|
|
1108
|
-
result.subscribe(close);
|
|
1109
|
-
dialogRef.close = close;
|
|
1110
|
-
dialogRef.result = result;
|
|
1111
|
-
if (component && isDevMode()) {
|
|
1112
|
-
var hasContentTitle = content.nodes[0] && content.nodes[0].length > 0;
|
|
1113
|
-
var hasContentActions = content.nodes[2] && content.nodes[2].length > 0;
|
|
1114
|
-
var multipleTitles = options.title && hasContentTitle;
|
|
1115
|
-
var multipleActions = options.actions && hasContentActions;
|
|
1116
|
-
if (component.prototype instanceof DialogContentBase) {
|
|
1117
|
-
// content component extends DialogContentBase
|
|
1118
|
-
if (multipleTitles || multipleActions) {
|
|
1119
|
-
console.warn("\n Multiple Title and/or Actions configurations detected.\n When using a component as content, provide the title and actions either in the component's markup\n or via the title and actions properties of the DialogSettings object, but not both.\n See https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/service/#toc-passing-title-content-and-actions-as-a-single-component'");
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
else {
|
|
1123
|
-
if (hasContentTitle || hasContentActions) {
|
|
1124
|
-
console.warn("\n When Title and/or Actions markup is provided in content component's template,\n the component needs to inherit the DialogContentBase class to ensure that close and result events are properly hooked.\n See https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/service/#toc-passing-title-content-and-actions-as-a-single-component'");
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
return dialogRef;
|
|
1129
|
-
};
|
|
1130
|
-
DialogService.prototype.applyOptions = function (instance, options) {
|
|
1131
|
-
instance.title = options.title;
|
|
1132
|
-
instance.actions = options.actions;
|
|
1133
|
-
instance.actionsLayout = options.actionsLayout || 'stretched';
|
|
1134
|
-
instance.width = options.width;
|
|
1135
|
-
instance.minWidth = options.minWidth;
|
|
1136
|
-
instance.maxWidth = options.maxWidth;
|
|
1137
|
-
instance.height = options.height;
|
|
1138
|
-
instance.minHeight = options.minHeight;
|
|
1139
|
-
instance.maxHeight = options.maxHeight;
|
|
1140
|
-
instance.autoFocusedElement = options.autoFocusedElement;
|
|
1141
|
-
instance.closeTitle = options.closeTitle;
|
|
1142
|
-
instance.cssClass = options.cssClass;
|
|
1143
|
-
instance.htmlAttributes = options.htmlAttributes;
|
|
1144
|
-
if (options.content instanceof TemplateRef) {
|
|
1145
|
-
instance.contentTemplate = options.content;
|
|
1146
|
-
}
|
|
1147
|
-
};
|
|
1148
|
-
DialogService.prototype.contentFrom = function (content, container, dialogRef) {
|
|
1149
|
-
var renderer = container.injector.get(Renderer2);
|
|
1150
|
-
var nodes = [];
|
|
1151
|
-
var titleNodes = [];
|
|
1152
|
-
var actionNodes = [];
|
|
1153
|
-
var componentRef = null;
|
|
1154
|
-
if (typeof content === 'string') {
|
|
1155
|
-
nodes = [renderer.createText(content)];
|
|
1156
|
-
}
|
|
1157
|
-
else if (content && !(content instanceof TemplateRef)) {
|
|
1158
|
-
// Component
|
|
1159
|
-
var injector = new DialogInjector(function () { return dialogRef; }, container.injector);
|
|
1160
|
-
var factory = this.resolver.resolveComponentFactory(content);
|
|
1161
|
-
componentRef = container.createComponent(factory, undefined, injector);
|
|
1162
|
-
titleNodes = Array.from(componentRef.location.nativeElement.querySelectorAll('kendo-dialog-titlebar'));
|
|
1163
|
-
nodes = [componentRef.location.nativeElement];
|
|
1164
|
-
actionNodes = Array.from(componentRef.location.nativeElement.querySelectorAll('kendo-dialog-actions'));
|
|
1165
|
-
dialogRef.content = componentRef;
|
|
1166
|
-
}
|
|
1167
|
-
return {
|
|
1168
|
-
componentRef: componentRef,
|
|
1169
|
-
nodes: [
|
|
1170
|
-
titleNodes,
|
|
1171
|
-
nodes,
|
|
1172
|
-
actionNodes // <ng-content select="kendo-dialog-actions">
|
|
1173
|
-
]
|
|
1174
|
-
};
|
|
1175
|
-
};
|
|
1176
|
-
DialogService = __decorate([
|
|
1177
|
-
Injectable(),
|
|
1178
|
-
__param(1, Inject(DialogContainerService)),
|
|
1179
|
-
__metadata("design:paramtypes", [ComponentFactoryResolver,
|
|
1180
|
-
DialogContainerService])
|
|
1181
|
-
], DialogService);
|
|
1182
|
-
return DialogService;
|
|
1183
|
-
}());
|
|
1184
|
-
|
|
1185
|
-
/**
|
|
1186
|
-
* @hidden
|
|
1187
|
-
*/
|
|
1188
|
-
var newZIndex = 10002;
|
|
1189
|
-
/**
|
|
1190
|
-
* @hidden
|
|
1191
|
-
*/
|
|
1192
|
-
var DEFAULT_OPTIONS = {
|
|
1193
|
-
draggable: true,
|
|
1194
|
-
height: null,
|
|
1195
|
-
left: null,
|
|
1196
|
-
minHeight: 100,
|
|
1197
|
-
minWidth: 120,
|
|
1198
|
-
position: 'absolute',
|
|
1199
|
-
resizable: true,
|
|
1200
|
-
state: 'default',
|
|
1201
|
-
top: null,
|
|
1202
|
-
width: null
|
|
1203
|
-
};
|
|
1204
|
-
/**
|
|
1205
|
-
* @hidden
|
|
1206
|
-
*/
|
|
1207
|
-
var createMoveStream = function (el, ev) { return function (mouseDown) {
|
|
1208
|
-
return el.kendoDrag
|
|
1209
|
-
.pipe(takeUntil(el.kendoRelease.pipe(tap(function () { ev.emit(); }))), map(function (_a) {
|
|
1210
|
-
var pageX = _a.pageX, pageY = _a.pageY;
|
|
1211
|
-
return ({
|
|
1212
|
-
originalX: mouseDown.pageX,
|
|
1213
|
-
originalY: mouseDown.pageY,
|
|
1214
|
-
pageX: pageX,
|
|
1215
|
-
pageY: pageY
|
|
1216
|
-
});
|
|
1217
|
-
}));
|
|
1218
|
-
}; };
|
|
1219
|
-
/**
|
|
1220
|
-
* @hidden
|
|
1221
|
-
*/
|
|
1222
|
-
var DragResizeService = /** @class */ (function () {
|
|
1223
|
-
function DragResizeService(ngZone) {
|
|
1224
|
-
this.ngZone = ngZone;
|
|
1225
|
-
this.close = new EventEmitter();
|
|
1226
|
-
this.focus = new EventEmitter();
|
|
1227
|
-
this.change = new EventEmitter();
|
|
1228
|
-
this.stateChange = new EventEmitter();
|
|
1229
|
-
this.dragStart = new EventEmitter();
|
|
1230
|
-
this.dragEnd = new EventEmitter();
|
|
1231
|
-
this.resizeStart = new EventEmitter();
|
|
1232
|
-
this.resizeEnd = new EventEmitter();
|
|
1233
|
-
this.options = Object.assign({}, DEFAULT_OPTIONS);
|
|
1234
|
-
this.lastAction = null;
|
|
1235
|
-
this.subscriptions = new Subscription();
|
|
1236
|
-
this.dragSubscription = new Subscription();
|
|
1237
|
-
}
|
|
1238
|
-
DragResizeService.prototype.ngOnDestroy = function () {
|
|
1239
|
-
if (this.subscriptions) {
|
|
1240
|
-
this.subscriptions.unsubscribe();
|
|
1241
|
-
}
|
|
1242
|
-
if (this.dragSubscription) {
|
|
1243
|
-
this.dragSubscription.unsubscribe();
|
|
1244
|
-
}
|
|
1245
|
-
};
|
|
1246
|
-
DragResizeService.prototype.init = function (el) {
|
|
1247
|
-
var state$$1 = this.options.state;
|
|
1248
|
-
var options = this.options;
|
|
1249
|
-
this.window = el;
|
|
1250
|
-
if (state$$1 !== 'default') {
|
|
1251
|
-
this.restoreOptions = Object.assign({}, options);
|
|
1252
|
-
}
|
|
1253
|
-
if (state$$1 === 'minimized') {
|
|
1254
|
-
options.height = 0;
|
|
1255
|
-
options.minHeight = 0;
|
|
1256
|
-
}
|
|
1257
|
-
if (state$$1 === 'maximized') {
|
|
1258
|
-
options.position = 'fixed';
|
|
1259
|
-
}
|
|
1260
|
-
};
|
|
1261
|
-
DragResizeService.prototype.onDrag = function (el) {
|
|
1262
|
-
var _this = this;
|
|
1263
|
-
this.subscriptions.add(this.ngZone.runOutsideAngular(function () {
|
|
1264
|
-
var startPosition;
|
|
1265
|
-
var dragStarted;
|
|
1266
|
-
_this.dragSubscription = el.kendoPress
|
|
1267
|
-
.pipe(tap(function (ev) {
|
|
1268
|
-
if (!ev.isTouch) {
|
|
1269
|
-
preventDefault(ev);
|
|
1270
|
-
}
|
|
1271
|
-
_this.focus.emit();
|
|
1272
|
-
startPosition = _this.currentPosition();
|
|
1273
|
-
dragStarted = false;
|
|
1274
|
-
}), switchMap(createMoveStream(el, _this.dragEnd)))
|
|
1275
|
-
.subscribe(function (_a) {
|
|
1276
|
-
var pageX = _a.pageX, pageY = _a.pageY, originalX = _a.originalX, originalY = _a.originalY;
|
|
1277
|
-
if (!dragStarted) {
|
|
1278
|
-
_this.ensureWidth();
|
|
1279
|
-
_this.dragStart.emit();
|
|
1280
|
-
dragStarted = true;
|
|
1281
|
-
}
|
|
1282
|
-
_this.handleDrag({
|
|
1283
|
-
originalX: originalX, originalY: originalY,
|
|
1284
|
-
pageX: pageX, pageY: pageY, startPosition: startPosition
|
|
1285
|
-
});
|
|
1286
|
-
});
|
|
1287
|
-
}));
|
|
1288
|
-
};
|
|
1289
|
-
DragResizeService.prototype.handleDrag = function (_a) {
|
|
1290
|
-
var originalX = _a.originalX, originalY = _a.originalY, pageX = _a.pageX, pageY = _a.pageY, startPosition = _a.startPosition;
|
|
1291
|
-
this.options.left = startPosition.x + pageX - originalX;
|
|
1292
|
-
this.options.top = startPosition.y + pageY - originalY;
|
|
1293
|
-
if (this.options.state === 'minimized' && isPresent(this.restoreOptions)) {
|
|
1294
|
-
this.restoreOptions.left = this.options.left;
|
|
1295
|
-
this.restoreOptions.top = this.options.top;
|
|
1296
|
-
}
|
|
1297
|
-
this.change.emit({
|
|
1298
|
-
left: startPosition.x + pageX - originalX,
|
|
1299
|
-
top: startPosition.y + pageY - originalY
|
|
1300
|
-
});
|
|
1301
|
-
};
|
|
1302
|
-
DragResizeService.prototype.onResize = function (handle, direction) {
|
|
1303
|
-
var _this = this;
|
|
1304
|
-
this.subscriptions.add(this.ngZone.runOutsideAngular(function () {
|
|
1305
|
-
var startOffsetAndPosition;
|
|
1306
|
-
var resizeStarted = false;
|
|
1307
|
-
handle.kendoPress.pipe(tap(function (ev) {
|
|
1308
|
-
preventDefault(ev);
|
|
1309
|
-
_this.focus.emit();
|
|
1310
|
-
startOffsetAndPosition = _this.currentOffsetAndPosition();
|
|
1311
|
-
resizeStarted = false;
|
|
1312
|
-
}), switchMap(createMoveStream(handle, _this.resizeEnd)))
|
|
1313
|
-
.subscribe(function (_a) {
|
|
1314
|
-
var pageX = _a.pageX, pageY = _a.pageY, originalX = _a.originalX, originalY = _a.originalY;
|
|
1315
|
-
if (!resizeStarted) {
|
|
1316
|
-
_this.resizeStart.emit(direction);
|
|
1317
|
-
resizeStarted = true;
|
|
1318
|
-
}
|
|
1319
|
-
var deltaX = pageX - originalX;
|
|
1320
|
-
var deltaY = pageY - originalY;
|
|
1321
|
-
_this.handleResize(startOffsetAndPosition, direction, deltaX, deltaY);
|
|
1322
|
-
});
|
|
1323
|
-
}));
|
|
1324
|
-
};
|
|
1325
|
-
DragResizeService.prototype.handleResize = function (initial, dir, deltaX, deltaY) {
|
|
1326
|
-
var _this = this;
|
|
1327
|
-
var old = this.options;
|
|
1328
|
-
var ev = {};
|
|
1329
|
-
if (dir.indexOf('e') >= 0) {
|
|
1330
|
-
var newWidth = initial.width + deltaX;
|
|
1331
|
-
if (newWidth !== old.width && newWidth >= old.minWidth) {
|
|
1332
|
-
ev.width = newWidth;
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
if (dir.indexOf('n') >= 0) {
|
|
1336
|
-
var newHeight = initial.height - deltaY;
|
|
1337
|
-
var newTop = initial.y + deltaY;
|
|
1338
|
-
if (newHeight !== old.height && newHeight >= old.minHeight && newTop !== old.top) {
|
|
1339
|
-
ev.height = newHeight;
|
|
1340
|
-
ev.top = newTop;
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
if (dir.indexOf('s') >= 0) {
|
|
1344
|
-
var newHeight = initial.height + deltaY;
|
|
1345
|
-
if (newHeight !== old.height && newHeight >= old.minHeight) {
|
|
1346
|
-
ev.height = newHeight;
|
|
1347
|
-
}
|
|
1348
|
-
}
|
|
1349
|
-
if (dir.indexOf('w') >= 0) {
|
|
1350
|
-
var newLeft = initial.x + deltaX;
|
|
1351
|
-
var newWidth = initial.width - deltaX;
|
|
1352
|
-
if (newWidth !== old.width && newWidth >= old.minWidth && newLeft !== old.left) {
|
|
1353
|
-
ev.width = newWidth;
|
|
1354
|
-
ev.left = newLeft;
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
if (isPresent(ev.width) || isPresent(ev.height)) {
|
|
1358
|
-
OFFSET_STYLES.forEach(function (style$$1) {
|
|
1359
|
-
if (isPresent(ev[style$$1])) {
|
|
1360
|
-
_this.options[style$$1] = ev[style$$1];
|
|
1361
|
-
}
|
|
1362
|
-
});
|
|
1363
|
-
this.change.emit(ev);
|
|
1364
|
-
}
|
|
1365
|
-
};
|
|
1366
|
-
DragResizeService.prototype.restoreAction = function () {
|
|
1367
|
-
this.lastAction = 'restore';
|
|
1368
|
-
this.defaultState();
|
|
1369
|
-
};
|
|
1370
|
-
DragResizeService.prototype.defaultState = function () {
|
|
1371
|
-
if (isPresent(this.restoreOptions)) {
|
|
1372
|
-
this.options = Object.assign({}, this.restoreOptions);
|
|
1373
|
-
}
|
|
1374
|
-
this.options.state = 'default';
|
|
1375
|
-
this.stateChange.emit('default');
|
|
1376
|
-
};
|
|
1377
|
-
DragResizeService.prototype.storeOptions = function () {
|
|
1378
|
-
this.restoreOptions = Object.assign({}, this.options);
|
|
1379
|
-
};
|
|
1380
|
-
DragResizeService.prototype.maximizeAction = function () {
|
|
1381
|
-
this.lastAction = 'maximize';
|
|
1382
|
-
this.maximizeState();
|
|
1383
|
-
};
|
|
1384
|
-
DragResizeService.prototype.maximizeState = function () {
|
|
1385
|
-
this.storeOptions();
|
|
1386
|
-
var wnd = this.windowViewPort;
|
|
1387
|
-
this.options = Object.assign({}, this.options, {
|
|
1388
|
-
height: wnd.height,
|
|
1389
|
-
left: 0,
|
|
1390
|
-
position: 'fixed',
|
|
1391
|
-
state: 'maximized',
|
|
1392
|
-
top: 0,
|
|
1393
|
-
width: wnd.width
|
|
1394
|
-
});
|
|
1395
|
-
this.stateChange.emit('maximized');
|
|
1396
|
-
};
|
|
1397
|
-
DragResizeService.prototype.minimizeAction = function () {
|
|
1398
|
-
this.lastAction = 'minimize';
|
|
1399
|
-
this.minimizeState();
|
|
1400
|
-
};
|
|
1401
|
-
DragResizeService.prototype.minimizeState = function () {
|
|
1402
|
-
this.storeOptions();
|
|
1403
|
-
this.options = Object.assign({}, this.options, {
|
|
1404
|
-
height: null,
|
|
1405
|
-
minHeight: 0,
|
|
1406
|
-
state: 'minimized'
|
|
1407
|
-
});
|
|
1408
|
-
this.stateChange.emit('minimized');
|
|
1409
|
-
};
|
|
1410
|
-
/**
|
|
1411
|
-
* Handles manual changes of the 'state' property.
|
|
1412
|
-
* Required to distinguish them from action clicks.
|
|
1413
|
-
*/
|
|
1414
|
-
DragResizeService.prototype.applyManualState = function () {
|
|
1415
|
-
var state$$1 = this.options.state;
|
|
1416
|
-
switch (state$$1) {
|
|
1417
|
-
case 'default':
|
|
1418
|
-
this.clearHeight();
|
|
1419
|
-
this.defaultState();
|
|
1420
|
-
break;
|
|
1421
|
-
case 'maximized':
|
|
1422
|
-
this.clearHeight();
|
|
1423
|
-
this.maximizeState();
|
|
1424
|
-
break;
|
|
1425
|
-
case 'minimized':
|
|
1426
|
-
this.minimizeState();
|
|
1427
|
-
break;
|
|
1428
|
-
default:
|
|
1429
|
-
break;
|
|
1430
|
-
}
|
|
1431
|
-
};
|
|
1432
|
-
DragResizeService.prototype.closeAction = function () {
|
|
1433
|
-
this.close.emit();
|
|
1434
|
-
};
|
|
1435
|
-
DragResizeService.prototype.ensureWidth = function () {
|
|
1436
|
-
var windowOffset = offset(this.window.nativeElement);
|
|
1437
|
-
if (!isPresent(this.options.width)) {
|
|
1438
|
-
this.options.width = windowOffset.width;
|
|
1439
|
-
this.change.emit({ width: windowOffset.width });
|
|
1440
|
-
}
|
|
1441
|
-
};
|
|
1442
|
-
DragResizeService.prototype.clearHeight = function () {
|
|
1443
|
-
if (this.options.height === 0) {
|
|
1444
|
-
delete this.options.height;
|
|
1445
|
-
}
|
|
1446
|
-
if (this.options.minHeight === 0) {
|
|
1447
|
-
delete this.options.minHeight;
|
|
1448
|
-
}
|
|
1449
|
-
};
|
|
1450
|
-
DragResizeService.prototype.center = function () {
|
|
1451
|
-
if (this.options.state === 'maximized') {
|
|
1452
|
-
return;
|
|
1453
|
-
}
|
|
1454
|
-
var scroll = scrollPosition(this.window.nativeElement);
|
|
1455
|
-
var wnd = this.windowViewPort;
|
|
1456
|
-
var wrapper = offset(this.window.nativeElement);
|
|
1457
|
-
var ev = {};
|
|
1458
|
-
if (!isPresent(this.options.left)) {
|
|
1459
|
-
this.options.left = scroll.x + Math.max(0, (wnd.width - wrapper.width) / 2);
|
|
1460
|
-
ev.left = this.options.left;
|
|
1461
|
-
}
|
|
1462
|
-
if (!isPresent(this.options.top)) {
|
|
1463
|
-
this.options.top = scroll.y + Math.max(0, (wnd.height - wrapper.height) / 2);
|
|
1464
|
-
ev.top = this.options.top;
|
|
1465
|
-
}
|
|
1466
|
-
this.change.emit(ev);
|
|
1467
|
-
};
|
|
1468
|
-
DragResizeService.prototype.currentOffsetAndPosition = function () {
|
|
1469
|
-
var o = this.options;
|
|
1470
|
-
var off = offset(this.window.nativeElement);
|
|
1471
|
-
return Object.assign({}, this.currentPosition(), {
|
|
1472
|
-
height: o.height ? o.height : off.height,
|
|
1473
|
-
width: o.width ? o.width : off.width
|
|
1474
|
-
});
|
|
1475
|
-
};
|
|
1476
|
-
DragResizeService.prototype.currentPosition = function () {
|
|
1477
|
-
var o = this.options;
|
|
1478
|
-
if (!o.top || !o.left) {
|
|
1479
|
-
this.setPosition();
|
|
1480
|
-
}
|
|
1481
|
-
return {
|
|
1482
|
-
x: this.options.left,
|
|
1483
|
-
y: this.options.top
|
|
1484
|
-
};
|
|
1485
|
-
};
|
|
1486
|
-
DragResizeService.prototype.setPosition = function () {
|
|
1487
|
-
var wrapper = positionWithScroll(this.window.nativeElement, getDocumentElement(this.window.nativeElement));
|
|
1488
|
-
this.options.left = wrapper.left;
|
|
1489
|
-
this.options.top = wrapper.top;
|
|
1490
|
-
};
|
|
1491
|
-
DragResizeService.prototype.setRestoreOption = function (style$$1, value) {
|
|
1492
|
-
if (isPresent(this.restoreOptions)) {
|
|
1493
|
-
this.restoreOptions[style$$1] = value;
|
|
1494
|
-
}
|
|
1495
|
-
};
|
|
1496
|
-
Object.defineProperty(DragResizeService.prototype, "nextPossibleZIndex", {
|
|
1497
|
-
get: function () {
|
|
1498
|
-
return newZIndex;
|
|
1499
|
-
},
|
|
1500
|
-
enumerable: true,
|
|
1501
|
-
configurable: true
|
|
1502
|
-
});
|
|
1503
|
-
Object.defineProperty(DragResizeService.prototype, "nextZIndex", {
|
|
1504
|
-
get: function () {
|
|
1505
|
-
return newZIndex++;
|
|
1506
|
-
},
|
|
1507
|
-
enumerable: true,
|
|
1508
|
-
configurable: true
|
|
1509
|
-
});
|
|
1510
|
-
Object.defineProperty(DragResizeService.prototype, "windowViewPort", {
|
|
1511
|
-
get: function () {
|
|
1512
|
-
return getWindowViewPort(this.window.nativeElement);
|
|
1513
|
-
},
|
|
1514
|
-
enumerable: true,
|
|
1515
|
-
configurable: true
|
|
1516
|
-
});
|
|
1517
|
-
DragResizeService = __decorate([
|
|
1518
|
-
Injectable(),
|
|
1519
|
-
__metadata("design:paramtypes", [NgZone])
|
|
1520
|
-
], DragResizeService);
|
|
1521
|
-
return DragResizeService;
|
|
1522
|
-
}());
|
|
1523
|
-
|
|
1524
|
-
/**
|
|
1525
|
-
* @hidden
|
|
1526
|
-
*/
|
|
1527
|
-
var ResizeHandleDirective = /** @class */ (function () {
|
|
1528
|
-
function ResizeHandleDirective(draggable, el, renderer, service) {
|
|
1529
|
-
this.draggable = draggable;
|
|
1530
|
-
this.el = el;
|
|
1531
|
-
this.renderer = renderer;
|
|
1532
|
-
this.service = service;
|
|
1533
|
-
this.subscriptions = new Subscription();
|
|
1534
|
-
}
|
|
1535
|
-
Object.defineProperty(ResizeHandleDirective.prototype, "hostClass", {
|
|
1536
|
-
get: function () {
|
|
1537
|
-
return true;
|
|
1538
|
-
},
|
|
1539
|
-
enumerable: true,
|
|
1540
|
-
configurable: true
|
|
1541
|
-
});
|
|
1542
|
-
ResizeHandleDirective.prototype.ngOnInit = function () {
|
|
1543
|
-
var _this = this;
|
|
1544
|
-
this.setDisplay();
|
|
1545
|
-
this.renderer.addClass(this.el.nativeElement, 'k-resize-' + this.direction);
|
|
1546
|
-
this.subscriptions.add(of(this.draggable).subscribe(function (handle) {
|
|
1547
|
-
_this.service.onResize(handle, _this.direction);
|
|
1548
|
-
}));
|
|
1549
|
-
this.subscriptions.add(this.service.resizeStart.subscribe(function (dir) {
|
|
1550
|
-
if (dir !== _this.direction) {
|
|
1551
|
-
_this.setDisplay('none');
|
|
1552
|
-
}
|
|
1553
|
-
}));
|
|
1554
|
-
this.subscriptions.add(this.service.dragStart.subscribe(function () {
|
|
1555
|
-
_this.setDisplay('none');
|
|
1556
|
-
}));
|
|
1557
|
-
this.subscriptions.add(merge(this.service.resizeEnd, this.service.dragEnd).subscribe(function () {
|
|
1558
|
-
_this.setDisplay('block');
|
|
1559
|
-
}));
|
|
1560
|
-
this.subscriptions.add(this.service.stateChange.subscribe(function (state$$1) {
|
|
1561
|
-
_this.setDisplay(state$$1 === 'default' ? 'block' : 'none');
|
|
1562
|
-
}));
|
|
1563
|
-
};
|
|
1564
|
-
ResizeHandleDirective.prototype.ngOnDestroy = function () {
|
|
1565
|
-
this.subscriptions.unsubscribe();
|
|
1566
|
-
};
|
|
1567
|
-
ResizeHandleDirective.prototype.setDisplay = function (value) {
|
|
1568
|
-
if (value === void 0) { value = 'block'; }
|
|
1569
|
-
this.renderer.setStyle(this.el.nativeElement, 'display', this.service.options.state === 'default' ? value : 'none');
|
|
1570
|
-
};
|
|
1571
|
-
__decorate([
|
|
1572
|
-
Input(),
|
|
1573
|
-
__metadata("design:type", String)
|
|
1574
|
-
], ResizeHandleDirective.prototype, "direction", void 0);
|
|
1575
|
-
__decorate([
|
|
1576
|
-
HostBinding('class.k-resize-handle'),
|
|
1577
|
-
__metadata("design:type", Boolean),
|
|
1578
|
-
__metadata("design:paramtypes", [])
|
|
1579
|
-
], ResizeHandleDirective.prototype, "hostClass", null);
|
|
1580
|
-
ResizeHandleDirective = __decorate([
|
|
1581
|
-
Directive({
|
|
1582
|
-
selector: '[kendoWindowResizeHandle]'
|
|
1583
|
-
}),
|
|
1584
|
-
__param(0, Host()),
|
|
1585
|
-
__metadata("design:paramtypes", [DraggableDirective,
|
|
1586
|
-
ElementRef,
|
|
1587
|
-
Renderer2,
|
|
1588
|
-
DragResizeService])
|
|
1589
|
-
], ResizeHandleDirective);
|
|
1590
|
-
return ResizeHandleDirective;
|
|
1591
|
-
}());
|
|
1592
|
-
|
|
1593
|
-
var WindowTitleBarComponent = /** @class */ (function () {
|
|
1594
|
-
function WindowTitleBarComponent(el, service, ngZone) {
|
|
1595
|
-
this.el = el;
|
|
1596
|
-
this.ngZone = ngZone;
|
|
1597
|
-
this.service = service;
|
|
1598
|
-
}
|
|
1599
|
-
WindowTitleBarComponent.prototype.ngOnInit = function () {
|
|
1600
|
-
this.dragDirective = new DraggableDirective(this.el, this.ngZone);
|
|
1601
|
-
this.dragDirective.ngOnInit();
|
|
1602
|
-
if (this.isDraggable) {
|
|
1603
|
-
this.subscribeDrag();
|
|
1604
|
-
}
|
|
1605
|
-
this.subscribeStateChange();
|
|
1606
|
-
};
|
|
1607
|
-
WindowTitleBarComponent.prototype.ngOnDestroy = function () {
|
|
1608
|
-
this.dragDirective.ngOnDestroy();
|
|
1609
|
-
this.unsubscribeDrag();
|
|
1610
|
-
this.unsubscribeState();
|
|
1611
|
-
};
|
|
1612
|
-
/**
|
|
1613
|
-
* @hidden
|
|
1614
|
-
*/
|
|
1615
|
-
WindowTitleBarComponent.prototype.subscribeDrag = function () {
|
|
1616
|
-
var _this = this;
|
|
1617
|
-
this.unsubscribeDrag();
|
|
1618
|
-
this.dragSubscription = of(this.dragDirective).subscribe(function (titleBar) {
|
|
1619
|
-
_this.service.onDrag(titleBar);
|
|
1620
|
-
});
|
|
1621
|
-
};
|
|
1622
|
-
/**
|
|
1623
|
-
* @hidden
|
|
1624
|
-
*/
|
|
1625
|
-
WindowTitleBarComponent.prototype.subscribeStateChange = function () {
|
|
1626
|
-
var _this = this;
|
|
1627
|
-
this.stateSubscription = this.service.stateChange.subscribe(function (state$$1) {
|
|
1628
|
-
if (_this.service.options.draggable) {
|
|
1629
|
-
if (state$$1 === 'maximized') {
|
|
1630
|
-
_this.unsubscribeDrag();
|
|
1631
|
-
}
|
|
1632
|
-
else {
|
|
1633
|
-
_this.subscribeDrag();
|
|
1634
|
-
}
|
|
1635
|
-
}
|
|
1636
|
-
});
|
|
1637
|
-
};
|
|
1638
|
-
/**
|
|
1639
|
-
* @hidden
|
|
1640
|
-
*/
|
|
1641
|
-
WindowTitleBarComponent.prototype.unsubscribeDrag = function () {
|
|
1642
|
-
if (this.dragSubscription) {
|
|
1643
|
-
this.service.dragSubscription.unsubscribe();
|
|
1644
|
-
this.dragSubscription.unsubscribe();
|
|
1645
|
-
this.dragSubscription = null;
|
|
1646
|
-
}
|
|
1647
|
-
};
|
|
1648
|
-
/**
|
|
1649
|
-
* @hidden
|
|
1650
|
-
*/
|
|
1651
|
-
WindowTitleBarComponent.prototype.unsubscribeState = function () {
|
|
1652
|
-
if (this.stateSubscription) {
|
|
1653
|
-
this.stateSubscription.unsubscribe();
|
|
1654
|
-
this.stateSubscription = null;
|
|
1655
|
-
}
|
|
1656
|
-
};
|
|
1657
|
-
Object.defineProperty(WindowTitleBarComponent.prototype, "className", {
|
|
1658
|
-
get: function () {
|
|
1659
|
-
return true;
|
|
1660
|
-
},
|
|
1661
|
-
enumerable: true,
|
|
1662
|
-
configurable: true
|
|
1663
|
-
});
|
|
1664
|
-
Object.defineProperty(WindowTitleBarComponent.prototype, "touchAction", {
|
|
1665
|
-
get: function () {
|
|
1666
|
-
if (this.isDraggable) {
|
|
1667
|
-
return 'none';
|
|
1668
|
-
}
|
|
1669
|
-
},
|
|
1670
|
-
enumerable: true,
|
|
1671
|
-
configurable: true
|
|
1672
|
-
});
|
|
1673
|
-
/**
|
|
1674
|
-
* @hidden
|
|
1675
|
-
*/
|
|
1676
|
-
WindowTitleBarComponent.prototype.handle = function (ev) {
|
|
1677
|
-
var target = ev.target;
|
|
1678
|
-
var state$$1 = this.service.options.state;
|
|
1679
|
-
if (!hasClasses(target, 'k-icon') && !isFocusable(target, false) && this.service.options.resizable) {
|
|
1680
|
-
if (state$$1 === 'default') {
|
|
1681
|
-
this.service.maximizeAction();
|
|
1682
|
-
}
|
|
1683
|
-
else if (state$$1 === 'maximized') {
|
|
1684
|
-
this.service.restoreAction();
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
|
-
};
|
|
1688
|
-
Object.defineProperty(WindowTitleBarComponent.prototype, "isDraggable", {
|
|
1689
|
-
get: function () {
|
|
1690
|
-
var options = this.service.options;
|
|
1691
|
-
return options.draggable && options.state !== 'maximized';
|
|
1692
|
-
},
|
|
1693
|
-
enumerable: true,
|
|
1694
|
-
configurable: true
|
|
1695
|
-
});
|
|
1696
|
-
__decorate([
|
|
1697
|
-
Input(),
|
|
1698
|
-
__metadata("design:type", TemplateRef)
|
|
1699
|
-
], WindowTitleBarComponent.prototype, "template", void 0);
|
|
1700
|
-
__decorate([
|
|
1701
|
-
HostBinding('class.k-window-titlebar'),
|
|
1702
|
-
HostBinding('class.k-dialog-titlebar'),
|
|
1703
|
-
__metadata("design:type", Boolean),
|
|
1704
|
-
__metadata("design:paramtypes", [])
|
|
1705
|
-
], WindowTitleBarComponent.prototype, "className", null);
|
|
1706
|
-
__decorate([
|
|
1707
|
-
HostBinding('style.touch-action'),
|
|
1708
|
-
__metadata("design:type", String),
|
|
1709
|
-
__metadata("design:paramtypes", [])
|
|
1710
|
-
], WindowTitleBarComponent.prototype, "touchAction", null);
|
|
1711
|
-
__decorate([
|
|
1712
|
-
HostListener('dblclick', ['$event']),
|
|
1713
|
-
__metadata("design:type", Function),
|
|
1714
|
-
__metadata("design:paramtypes", [Object]),
|
|
1715
|
-
__metadata("design:returntype", void 0)
|
|
1716
|
-
], WindowTitleBarComponent.prototype, "handle", null);
|
|
1717
|
-
WindowTitleBarComponent = __decorate([
|
|
1718
|
-
Component({
|
|
1719
|
-
selector: 'kendo-window-titlebar',
|
|
1720
|
-
template: "\n <ng-content *ngIf=\"!template\"></ng-content>\n <ng-template\n [ngTemplateOutlet]=\"template\"\n [ngTemplateOutletContext]=\"{'$implicit': service}\" *ngIf=\"template\">\n </ng-template>\n "
|
|
1721
|
-
}),
|
|
1722
|
-
__metadata("design:paramtypes", [ElementRef, DragResizeService, NgZone])
|
|
1723
|
-
], WindowTitleBarComponent);
|
|
1724
|
-
return WindowTitleBarComponent;
|
|
1725
|
-
}());
|
|
1726
|
-
|
|
1727
|
-
/**
|
|
1728
|
-
* @hidden
|
|
1729
|
-
*/
|
|
1730
|
-
var NavigationService = /** @class */ (function () {
|
|
1731
|
-
function NavigationService(window, ngZone) {
|
|
1732
|
-
this.window = window;
|
|
1733
|
-
this.ngZone = ngZone;
|
|
1734
|
-
}
|
|
1735
|
-
NavigationService.prototype.process = function (ev) {
|
|
1736
|
-
var _this = this;
|
|
1737
|
-
var key = ev.keyCode;
|
|
1738
|
-
switch (key) {
|
|
1739
|
-
case Keys.up:
|
|
1740
|
-
case Keys.down:
|
|
1741
|
-
case Keys.left:
|
|
1742
|
-
case Keys.right: {
|
|
1743
|
-
ev.preventDefault();
|
|
1744
|
-
this.ngZone.run(function () {
|
|
1745
|
-
_this.handleArrow(key, ev);
|
|
1746
|
-
});
|
|
1747
|
-
break;
|
|
1748
|
-
}
|
|
1749
|
-
case Keys.esc:
|
|
1750
|
-
this.ngZone.run(function () {
|
|
1751
|
-
_this.handleEscape();
|
|
1752
|
-
});
|
|
1753
|
-
break;
|
|
1754
|
-
default:
|
|
1755
|
-
break;
|
|
1756
|
-
}
|
|
1757
|
-
};
|
|
1758
|
-
NavigationService.prototype.handleArrow = function (key, ev) {
|
|
1759
|
-
var options = this.window.options;
|
|
1760
|
-
if (ev.altKey) {
|
|
1761
|
-
this.handleStateChange(key, options.state);
|
|
1762
|
-
return;
|
|
1763
|
-
}
|
|
1764
|
-
if ((ev.ctrlKey || ev.metaKey) && options.state === 'default') {
|
|
1765
|
-
this.handleResize(key);
|
|
1766
|
-
}
|
|
1767
|
-
else {
|
|
1768
|
-
this.handleDrag(key);
|
|
1769
|
-
}
|
|
1770
|
-
};
|
|
1771
|
-
NavigationService.prototype.handleEscape = function () {
|
|
1772
|
-
this.window.closeAction();
|
|
1773
|
-
};
|
|
1774
|
-
NavigationService.prototype.handleDrag = function (key) {
|
|
1775
|
-
var options = this.window.options;
|
|
1776
|
-
if (!options.draggable) {
|
|
1777
|
-
return;
|
|
1778
|
-
}
|
|
1779
|
-
var offset$$1 = this.window.currentOffsetAndPosition();
|
|
1780
|
-
var restoreOptions = this.window.restoreOptions;
|
|
1781
|
-
var ev = {};
|
|
1782
|
-
var delta = 10;
|
|
1783
|
-
if (key === Keys.left || key === Keys.up) {
|
|
1784
|
-
delta *= -1;
|
|
1785
|
-
}
|
|
1786
|
-
switch (key) {
|
|
1787
|
-
case Keys.left:
|
|
1788
|
-
case Keys.right: {
|
|
1789
|
-
ev.left = offset$$1.x + delta;
|
|
1790
|
-
options.left = ev.left;
|
|
1791
|
-
break;
|
|
1792
|
-
}
|
|
1793
|
-
case Keys.up:
|
|
1794
|
-
case Keys.down: {
|
|
1795
|
-
ev.top = offset$$1.y + delta;
|
|
1796
|
-
options.top = ev.top;
|
|
1797
|
-
break;
|
|
1798
|
-
}
|
|
1799
|
-
default:
|
|
1800
|
-
break;
|
|
1801
|
-
}
|
|
1802
|
-
if (options.state === 'minimized' && isPresent(restoreOptions)) {
|
|
1803
|
-
restoreOptions.left = options.left;
|
|
1804
|
-
restoreOptions.top = options.top;
|
|
1805
|
-
}
|
|
1806
|
-
this.window.change.emit(ev);
|
|
1807
|
-
};
|
|
1808
|
-
NavigationService.prototype.handleResize = function (key) {
|
|
1809
|
-
var _this = this;
|
|
1810
|
-
var options = this.window.options;
|
|
1811
|
-
if (!options.resizable) {
|
|
1812
|
-
return;
|
|
1813
|
-
}
|
|
1814
|
-
var offset$$1 = this.window.currentOffsetAndPosition();
|
|
1815
|
-
var newWidth;
|
|
1816
|
-
var newHeight;
|
|
1817
|
-
var ev = {};
|
|
1818
|
-
var delta = 10;
|
|
1819
|
-
if (key === Keys.left || key === Keys.up) {
|
|
1820
|
-
delta *= -1;
|
|
1821
|
-
}
|
|
1822
|
-
switch (key) {
|
|
1823
|
-
case Keys.left:
|
|
1824
|
-
case Keys.right: {
|
|
1825
|
-
newWidth = offset$$1.width + delta;
|
|
1826
|
-
if (newWidth !== options.width && newWidth >= options.minWidth) {
|
|
1827
|
-
ev.width = newWidth;
|
|
1828
|
-
}
|
|
1829
|
-
break;
|
|
1830
|
-
}
|
|
1831
|
-
case Keys.up:
|
|
1832
|
-
case Keys.down: {
|
|
1833
|
-
newHeight = offset$$1.height + delta;
|
|
1834
|
-
if (newHeight !== options.height && newHeight >= options.minHeight) {
|
|
1835
|
-
ev.height = newHeight;
|
|
1836
|
-
}
|
|
1837
|
-
break;
|
|
1838
|
-
}
|
|
1839
|
-
default:
|
|
1840
|
-
break;
|
|
1841
|
-
}
|
|
1842
|
-
if (isPresent(ev.width) || isPresent(ev.height)) {
|
|
1843
|
-
OFFSET_STYLES.forEach(function (style$$1) {
|
|
1844
|
-
if (isPresent(ev[style$$1])) {
|
|
1845
|
-
_this.window.options[style$$1] = ev[style$$1];
|
|
1846
|
-
}
|
|
1847
|
-
});
|
|
1848
|
-
this.window.change.emit(ev);
|
|
1849
|
-
}
|
|
1850
|
-
};
|
|
1851
|
-
NavigationService.prototype.handleStateChange = function (key, state$$1) {
|
|
1852
|
-
if ((state$$1 === 'minimized' && key === Keys.up) ||
|
|
1853
|
-
(state$$1 === 'maximized' && key === Keys.down)) {
|
|
1854
|
-
this.window.restoreAction();
|
|
1855
|
-
return;
|
|
1856
|
-
}
|
|
1857
|
-
if (state$$1 === 'default') {
|
|
1858
|
-
if (key === Keys.up) {
|
|
1859
|
-
this.window.maximizeAction();
|
|
1860
|
-
}
|
|
1861
|
-
else if (key === Keys.down) {
|
|
1862
|
-
this.window.minimizeAction();
|
|
1863
|
-
}
|
|
1864
|
-
}
|
|
1865
|
-
};
|
|
1866
|
-
NavigationService = __decorate([
|
|
1867
|
-
Injectable(),
|
|
1868
|
-
__metadata("design:paramtypes", [DragResizeService,
|
|
1869
|
-
NgZone])
|
|
1870
|
-
], NavigationService);
|
|
1871
|
-
return NavigationService;
|
|
1872
|
-
}());
|
|
1873
|
-
|
|
1874
|
-
/**
|
|
1875
|
-
* Represents the [Kendo UI Window component for Angular]({% slug overview_window_dialogs %}).
|
|
1876
|
-
*/
|
|
1877
|
-
var WindowComponent = /** @class */ (function () {
|
|
1878
|
-
function WindowComponent(el, renderer, service, navigation, ngZone, localization) {
|
|
1879
|
-
var _this = this;
|
|
1880
|
-
this.el = el;
|
|
1881
|
-
this.renderer = renderer;
|
|
1882
|
-
this.service = service;
|
|
1883
|
-
this.navigation = navigation;
|
|
1884
|
-
this.ngZone = ngZone;
|
|
1885
|
-
this.localization = localization;
|
|
1886
|
-
/**
|
|
1887
|
-
* Specifies if the content of the component is persisted in the DOM when minimized.
|
|
1888
|
-
* @default false
|
|
1889
|
-
*/
|
|
1890
|
-
this.keepContent = false;
|
|
1891
|
-
/**
|
|
1892
|
-
* Fires when the user starts to move the Window.
|
|
1893
|
-
*/
|
|
1894
|
-
this.dragStart = new EventEmitter();
|
|
1895
|
-
/**
|
|
1896
|
-
* Fires when the Window was moved by the user.
|
|
1897
|
-
*/
|
|
1898
|
-
this.dragEnd = new EventEmitter();
|
|
1899
|
-
/**
|
|
1900
|
-
* Fires when the user starts to resize the Window.
|
|
1901
|
-
*/
|
|
1902
|
-
this.resizeStart = new EventEmitter();
|
|
1903
|
-
/**
|
|
1904
|
-
* Fires when the Window was resized by the user.
|
|
1905
|
-
*/
|
|
1906
|
-
this.resizeEnd = new EventEmitter();
|
|
1907
|
-
/**
|
|
1908
|
-
* Fires when the user closes the Window.
|
|
1909
|
-
*/
|
|
1910
|
-
this.close = new EventEmitter();
|
|
1911
|
-
/**
|
|
1912
|
-
* Fires when the `width` property of the component was updated. The event is triggered only after the resizing
|
|
1913
|
-
* has ended. The event data contains the new width. Allows a two-way binding of the `width` property.
|
|
1914
|
-
*/
|
|
1915
|
-
this.widthChange = new EventEmitter();
|
|
1916
|
-
/**
|
|
1917
|
-
* Fires when the `height` property of the component was updated. The event is triggered only after the resizing
|
|
1918
|
-
* has ended. The event data contains the new height. Allows a two-way binding of the `height` property.
|
|
1919
|
-
*/
|
|
1920
|
-
this.heightChange = new EventEmitter();
|
|
1921
|
-
/**
|
|
1922
|
-
* Fires when the `top` property of the component was updated. The event is triggered only after the dragging
|
|
1923
|
-
* and resizing have ended. The event data contains the new top offset. Allows a two-way binding of the `top` property.
|
|
1924
|
-
*/
|
|
1925
|
-
this.topChange = new EventEmitter();
|
|
1926
|
-
/**
|
|
1927
|
-
* Fires when the `left` property of the component was updated. The event is triggered only after the dragging
|
|
1928
|
-
* and resizing have ended. The event data contains the new left offset. Allows a two-way binding of the `left` property.
|
|
1929
|
-
*/
|
|
1930
|
-
this.leftChange = new EventEmitter();
|
|
1931
|
-
/**
|
|
1932
|
-
* Fires when the `state` property of the component was updated. The event data contains the new state. Allows a
|
|
1933
|
-
* two-way binding of the `state` property.
|
|
1934
|
-
*/
|
|
1935
|
-
this.stateChange = new EventEmitter();
|
|
1936
|
-
/**
|
|
1937
|
-
* @hidden
|
|
1938
|
-
*/
|
|
1939
|
-
this.messages = {};
|
|
1940
|
-
this.tabIndex = 0;
|
|
1941
|
-
this.draged = false;
|
|
1942
|
-
this.resized = false;
|
|
1943
|
-
this.windowSubscription = new Subscription();
|
|
1944
|
-
this.domSubs = new Subscription();
|
|
1945
|
-
validatePackage(packageMetadata);
|
|
1946
|
-
this.direction = this.localization.rtl ? 'rtl' : 'ltr';
|
|
1947
|
-
this.localizationChangeSubscription = this.localization.changes
|
|
1948
|
-
.subscribe(function (_a) {
|
|
1949
|
-
var rtl = _a.rtl;
|
|
1950
|
-
return _this.direction = rtl ? 'rtl' : 'ltr';
|
|
1951
|
-
});
|
|
1952
|
-
this.resizeDirections = RESIZE_DIRECTIONS;
|
|
1953
|
-
this.subscribeEvents();
|
|
1954
|
-
}
|
|
1955
|
-
Object.defineProperty(WindowComponent.prototype, "draggable", {
|
|
1956
|
-
get: function () {
|
|
1957
|
-
return this.options.draggable;
|
|
1958
|
-
},
|
|
1959
|
-
/**
|
|
1960
|
-
* Specifies whether the user will be able to drag the component.
|
|
1961
|
-
* @default true
|
|
1962
|
-
*/
|
|
1963
|
-
set: function (value) {
|
|
1964
|
-
this.options.draggable = value;
|
|
1965
|
-
},
|
|
1966
|
-
enumerable: true,
|
|
1967
|
-
configurable: true
|
|
1968
|
-
});
|
|
1969
|
-
Object.defineProperty(WindowComponent.prototype, "resizable", {
|
|
1970
|
-
get: function () {
|
|
1971
|
-
return this.options.resizable;
|
|
1972
|
-
},
|
|
1973
|
-
/**
|
|
1974
|
-
* Specifies whether the user will be able to resize the component.
|
|
1975
|
-
* @default true
|
|
1976
|
-
*/
|
|
1977
|
-
set: function (value) {
|
|
1978
|
-
this.options.resizable = value;
|
|
1979
|
-
},
|
|
1980
|
-
enumerable: true,
|
|
1981
|
-
configurable: true
|
|
1982
|
-
});
|
|
1983
|
-
Object.defineProperty(WindowComponent.prototype, "cssClass", {
|
|
1984
|
-
get: function () {
|
|
1985
|
-
return this._cssClass;
|
|
1986
|
-
},
|
|
1987
|
-
/**
|
|
1988
|
-
* @hidden
|
|
1989
|
-
*/
|
|
1990
|
-
set: function (classes) {
|
|
1991
|
-
this.setServiceClasses(this._cssClass, classes);
|
|
1992
|
-
this._cssClass = classes;
|
|
1993
|
-
},
|
|
1994
|
-
enumerable: true,
|
|
1995
|
-
configurable: true
|
|
1996
|
-
});
|
|
1997
|
-
Object.defineProperty(WindowComponent.prototype, "htmlAttributes", {
|
|
1998
|
-
get: function () {
|
|
1999
|
-
return this._htmlAttributes;
|
|
2000
|
-
},
|
|
2001
|
-
/**
|
|
2002
|
-
* @hidden
|
|
2003
|
-
*/
|
|
2004
|
-
set: function (attributes) {
|
|
2005
|
-
setHTMLAttributes(attributes, this.renderer, this.el.nativeElement);
|
|
2006
|
-
var el = this.el.nativeElement;
|
|
2007
|
-
var dir = el.getAttribute('dir');
|
|
2008
|
-
var tIndex = el.getAttribute('tabindex');
|
|
2009
|
-
if (this.direction !== dir) {
|
|
2010
|
-
this.direction = dir;
|
|
2011
|
-
}
|
|
2012
|
-
if (this.tabIndex !== tIndex) {
|
|
2013
|
-
this.tabIndex = tIndex;
|
|
2014
|
-
}
|
|
2015
|
-
this._htmlAttributes = attributes;
|
|
2016
|
-
},
|
|
2017
|
-
enumerable: true,
|
|
2018
|
-
configurable: true
|
|
2019
|
-
});
|
|
2020
|
-
Object.defineProperty(WindowComponent.prototype, "state", {
|
|
2021
|
-
get: function () {
|
|
2022
|
-
return this.options.state;
|
|
2023
|
-
},
|
|
2024
|
-
/**
|
|
2025
|
-
* Specifies the initial state of the component.
|
|
2026
|
-
* If not specified, the value is set to `default`.
|
|
2027
|
-
*
|
|
2028
|
-
* The possible values are:
|
|
2029
|
-
* * `minimized`
|
|
2030
|
-
* * `maximized`
|
|
2031
|
-
* * `default`
|
|
2032
|
-
*/
|
|
2033
|
-
set: function (value) {
|
|
2034
|
-
this.options.state = value;
|
|
2035
|
-
},
|
|
2036
|
-
enumerable: true,
|
|
2037
|
-
configurable: true
|
|
2038
|
-
});
|
|
2039
|
-
Object.defineProperty(WindowComponent.prototype, "minWidth", {
|
|
2040
|
-
get: function () {
|
|
2041
|
-
return this.options.minWidth;
|
|
2042
|
-
},
|
|
2043
|
-
/**
|
|
2044
|
-
* Specifies the minimum width of the component.
|
|
2045
|
-
* The `minWidth` property has to be set in pixels.
|
|
2046
|
-
* @default 120
|
|
2047
|
-
*/
|
|
2048
|
-
set: function (value) {
|
|
2049
|
-
this.setOption('minWidth', value);
|
|
2050
|
-
},
|
|
2051
|
-
enumerable: true,
|
|
2052
|
-
configurable: true
|
|
2053
|
-
});
|
|
2054
|
-
Object.defineProperty(WindowComponent.prototype, "minHeight", {
|
|
2055
|
-
get: function () {
|
|
2056
|
-
return this.options.minHeight;
|
|
2057
|
-
},
|
|
2058
|
-
/**
|
|
2059
|
-
* Specifies the minimum height of the Window.
|
|
2060
|
-
* The `minHeight` property has to be set in pixels.
|
|
2061
|
-
* @default 100
|
|
2062
|
-
*/
|
|
2063
|
-
set: function (value) {
|
|
2064
|
-
this.setOption('minHeight', value);
|
|
2065
|
-
},
|
|
2066
|
-
enumerable: true,
|
|
2067
|
-
configurable: true
|
|
2068
|
-
});
|
|
2069
|
-
Object.defineProperty(WindowComponent.prototype, "width", {
|
|
2070
|
-
get: function () {
|
|
2071
|
-
return this.options.width;
|
|
2072
|
-
},
|
|
2073
|
-
/**
|
|
2074
|
-
* Specifies the width of the Window.
|
|
2075
|
-
* The `width` property has to be set in pixels.
|
|
2076
|
-
*/
|
|
2077
|
-
set: function (value) {
|
|
2078
|
-
this.setOption('width', value);
|
|
2079
|
-
},
|
|
2080
|
-
enumerable: true,
|
|
2081
|
-
configurable: true
|
|
2082
|
-
});
|
|
2083
|
-
Object.defineProperty(WindowComponent.prototype, "height", {
|
|
2084
|
-
get: function () {
|
|
2085
|
-
return this.options.height;
|
|
2086
|
-
},
|
|
2087
|
-
/**
|
|
2088
|
-
* Specifies the height of the Window.
|
|
2089
|
-
* The `height` property has to be set in pixels.
|
|
2090
|
-
*/
|
|
2091
|
-
set: function (value) {
|
|
2092
|
-
this.setOption('height', value);
|
|
2093
|
-
},
|
|
2094
|
-
enumerable: true,
|
|
2095
|
-
configurable: true
|
|
2096
|
-
});
|
|
2097
|
-
Object.defineProperty(WindowComponent.prototype, "top", {
|
|
2098
|
-
get: function () {
|
|
2099
|
-
return this.options.top;
|
|
2100
|
-
},
|
|
2101
|
-
/**
|
|
2102
|
-
* Specifies the initial top offset of the Window.
|
|
2103
|
-
* The `top` property has to be set in pixels.
|
|
2104
|
-
*/
|
|
2105
|
-
set: function (value) {
|
|
2106
|
-
this.setOption('top', value);
|
|
2107
|
-
},
|
|
2108
|
-
enumerable: true,
|
|
2109
|
-
configurable: true
|
|
2110
|
-
});
|
|
2111
|
-
Object.defineProperty(WindowComponent.prototype, "left", {
|
|
2112
|
-
get: function () {
|
|
2113
|
-
return this.options.left;
|
|
2114
|
-
},
|
|
2115
|
-
/**
|
|
2116
|
-
* Specifies the initial left offset of the Window.
|
|
2117
|
-
* Numeric values are treated as pixels.
|
|
2118
|
-
*/
|
|
2119
|
-
set: function (value) {
|
|
2120
|
-
this.setOption('left', value);
|
|
2121
|
-
},
|
|
2122
|
-
enumerable: true,
|
|
2123
|
-
configurable: true
|
|
2124
|
-
});
|
|
2125
|
-
Object.defineProperty(WindowComponent.prototype, "closeButtonTitle", {
|
|
2126
|
-
get: function () {
|
|
2127
|
-
if (this.messages && this.messages.closeTitle) {
|
|
2128
|
-
return this.messages.closeTitle;
|
|
2129
|
-
}
|
|
2130
|
-
return this.localization.get('closeTitle');
|
|
2131
|
-
},
|
|
2132
|
-
enumerable: true,
|
|
2133
|
-
configurable: true
|
|
2134
|
-
});
|
|
2135
|
-
Object.defineProperty(WindowComponent.prototype, "restoreButtonTitle", {
|
|
2136
|
-
get: function () {
|
|
2137
|
-
if (this.messages && this.messages.restoreTitle) {
|
|
2138
|
-
return this.messages.restoreTitle;
|
|
2139
|
-
}
|
|
2140
|
-
return this.localization.get('restoreTitle');
|
|
2141
|
-
},
|
|
2142
|
-
enumerable: true,
|
|
2143
|
-
configurable: true
|
|
2144
|
-
});
|
|
2145
|
-
Object.defineProperty(WindowComponent.prototype, "maximizeButtonTitle", {
|
|
2146
|
-
get: function () {
|
|
2147
|
-
if (this.messages && this.messages.maximizeTitle) {
|
|
2148
|
-
return this.messages.maximizeTitle;
|
|
2149
|
-
}
|
|
2150
|
-
return this.localization.get('maximizeTitle');
|
|
2151
|
-
},
|
|
2152
|
-
enumerable: true,
|
|
2153
|
-
configurable: true
|
|
2154
|
-
});
|
|
2155
|
-
Object.defineProperty(WindowComponent.prototype, "minimizeButtonTitle", {
|
|
2156
|
-
get: function () {
|
|
2157
|
-
if (this.messages && this.messages.minimizeTitle) {
|
|
2158
|
-
return this.messages.minimizeTitle;
|
|
2159
|
-
}
|
|
2160
|
-
return this.localization.get('minimizeTitle');
|
|
2161
|
-
},
|
|
2162
|
-
enumerable: true,
|
|
2163
|
-
configurable: true
|
|
2164
|
-
});
|
|
2165
|
-
Object.defineProperty(WindowComponent.prototype, "hostClasses", {
|
|
2166
|
-
get: function () {
|
|
2167
|
-
return true;
|
|
2168
|
-
},
|
|
2169
|
-
enumerable: true,
|
|
2170
|
-
configurable: true
|
|
2171
|
-
});
|
|
2172
|
-
Object.defineProperty(WindowComponent.prototype, "dir", {
|
|
2173
|
-
get: function () {
|
|
2174
|
-
return this.direction;
|
|
2175
|
-
},
|
|
2176
|
-
enumerable: true,
|
|
2177
|
-
configurable: true
|
|
2178
|
-
});
|
|
2179
|
-
WindowComponent.prototype.ngAfterViewInit = function () {
|
|
2180
|
-
var _this = this;
|
|
2181
|
-
this.setNextZIndex();
|
|
2182
|
-
this.handleInitialFocus();
|
|
2183
|
-
this.ngZone.runOutsideAngular(function () {
|
|
2184
|
-
return Promise.resolve(null).then(function () { return _this.setInitialOffset(); });
|
|
2185
|
-
});
|
|
2186
|
-
this.initDomEvents();
|
|
2187
|
-
};
|
|
2188
|
-
WindowComponent.prototype.ngOnInit = function () {
|
|
2189
|
-
this.renderer.removeAttribute(this.el.nativeElement, 'title');
|
|
2190
|
-
this.service.init(this.el);
|
|
2191
|
-
};
|
|
2192
|
-
WindowComponent.prototype.ngOnChanges = function (changes) {
|
|
2193
|
-
var _this = this;
|
|
2194
|
-
OFFSET_STYLES.forEach(function (style$$1) {
|
|
2195
|
-
if (isChanged(style$$1, changes)) {
|
|
2196
|
-
_this.setStyle(style$$1, _this.options[style$$1]);
|
|
2197
|
-
}
|
|
2198
|
-
});
|
|
2199
|
-
if (isChanged('draggable', changes)) {
|
|
2200
|
-
var titleBar = isPresent(this.titleBarContent) ? this.titleBarContent : this.titleBarView;
|
|
2201
|
-
if (isTruthy(changes.draggable.currentValue)) {
|
|
2202
|
-
titleBar.subscribeDrag();
|
|
2203
|
-
}
|
|
2204
|
-
else {
|
|
2205
|
-
titleBar.unsubscribeDrag();
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2208
|
-
if (isChanged('state', changes)) {
|
|
2209
|
-
if (isPresent(this.service.lastAction)) {
|
|
2210
|
-
this.service.lastAction = null;
|
|
2211
|
-
}
|
|
2212
|
-
else {
|
|
2213
|
-
this.service.applyManualState();
|
|
2214
|
-
this.updateAllOffset();
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
};
|
|
2218
|
-
WindowComponent.prototype.ngOnDestroy = function () {
|
|
2219
|
-
if (this.windowSubscription) {
|
|
2220
|
-
this.windowSubscription.unsubscribe();
|
|
2221
|
-
}
|
|
2222
|
-
if (this.domSubs) {
|
|
2223
|
-
this.domSubs.unsubscribe();
|
|
2224
|
-
}
|
|
2225
|
-
this.localizationChangeSubscription.unsubscribe();
|
|
2226
|
-
};
|
|
2227
|
-
/**
|
|
2228
|
-
* Focuses the wrapper of the Window component.
|
|
2229
|
-
*/
|
|
2230
|
-
WindowComponent.prototype.focus = function () {
|
|
2231
|
-
var wrapper = this.el.nativeElement;
|
|
2232
|
-
if (isPresent(wrapper)) {
|
|
2233
|
-
wrapper.focus();
|
|
2234
|
-
}
|
|
2235
|
-
};
|
|
2236
|
-
/**
|
|
2237
|
-
* Brings the current Window component on top of other Window components on the page.
|
|
2238
|
-
*/
|
|
2239
|
-
WindowComponent.prototype.bringToFront = function () {
|
|
2240
|
-
this.setNextZIndex();
|
|
2241
|
-
};
|
|
2242
|
-
/**
|
|
2243
|
-
* Manually updates the `width` or `height` option of the Window.
|
|
2244
|
-
* The required style will be applied to the Window wrapper element and the
|
|
2245
|
-
* corresponding property of the component instance will be updated.
|
|
2246
|
-
* This method is intended to be used for sizing dynamically created components using the
|
|
2247
|
-
* [`WindowService`]({% slug api_dialog_windowservice %})
|
|
2248
|
-
* @param {WindowDimensionSetting} dimension - The option that will be updated
|
|
2249
|
-
* @param {number} value - The value set in pixels
|
|
2250
|
-
*/
|
|
2251
|
-
WindowComponent.prototype.setDimension = function (dimension, value) {
|
|
2252
|
-
this.setOption(dimension, value);
|
|
2253
|
-
this.setStyle(dimension, value);
|
|
2254
|
-
};
|
|
2255
|
-
/**
|
|
2256
|
-
* Manually updates the `top` or `left` offset of the Window.
|
|
2257
|
-
* The required style will be applied to the Window wrapper element and the
|
|
2258
|
-
* corresponding property of the component instance will be updated.
|
|
2259
|
-
* This method is intended to be used for positioning dynamically created components using the
|
|
2260
|
-
* [`WindowService`]({% slug api_dialog_windowservice %})
|
|
2261
|
-
* @param {WindowOffsetSetting} offset - The option that will be updated
|
|
2262
|
-
* @param {number} value - The value set in pixels
|
|
2263
|
-
*/
|
|
2264
|
-
WindowComponent.prototype.setOffset = function (offset$$1, value) {
|
|
2265
|
-
this.setOption(offset$$1, value);
|
|
2266
|
-
this.setStyle(offset$$1, value);
|
|
2267
|
-
};
|
|
2268
|
-
Object.defineProperty(WindowComponent.prototype, "showDefaultTitleBar", {
|
|
2269
|
-
get: function () {
|
|
2270
|
-
return !isPresent(this.titleBarContent);
|
|
2271
|
-
},
|
|
2272
|
-
enumerable: true,
|
|
2273
|
-
configurable: true
|
|
2274
|
-
});
|
|
2275
|
-
Object.defineProperty(WindowComponent.prototype, "styleMinWidth", {
|
|
2276
|
-
get: function () {
|
|
2277
|
-
return this.minWidth + 'px';
|
|
2278
|
-
},
|
|
2279
|
-
enumerable: true,
|
|
2280
|
-
configurable: true
|
|
2281
|
-
});
|
|
2282
|
-
Object.defineProperty(WindowComponent.prototype, "styleMinHeight", {
|
|
2283
|
-
get: function () {
|
|
2284
|
-
return this.minHeight + 'px';
|
|
2285
|
-
},
|
|
2286
|
-
enumerable: true,
|
|
2287
|
-
configurable: true
|
|
2288
|
-
});
|
|
2289
|
-
Object.defineProperty(WindowComponent.prototype, "stylePosition", {
|
|
2290
|
-
get: function () {
|
|
2291
|
-
return this.options.position;
|
|
2292
|
-
},
|
|
2293
|
-
enumerable: true,
|
|
2294
|
-
configurable: true
|
|
2295
|
-
});
|
|
2296
|
-
Object.defineProperty(WindowComponent.prototype, "wrapperMaximizedClass", {
|
|
2297
|
-
get: function () {
|
|
2298
|
-
return this.state === 'maximized';
|
|
2299
|
-
},
|
|
2300
|
-
enumerable: true,
|
|
2301
|
-
configurable: true
|
|
2302
|
-
});
|
|
2303
|
-
Object.defineProperty(WindowComponent.prototype, "wrapperMinimizedClass", {
|
|
2304
|
-
get: function () {
|
|
2305
|
-
return this.state === 'minimized';
|
|
2306
|
-
},
|
|
2307
|
-
enumerable: true,
|
|
2308
|
-
configurable: true
|
|
2309
|
-
});
|
|
2310
|
-
/**
|
|
2311
|
-
* @hidden
|
|
2312
|
-
*/
|
|
2313
|
-
WindowComponent.prototype.onComponentFocus = function () {
|
|
2314
|
-
this.renderer.addClass(this.el.nativeElement, 'k-focus');
|
|
2315
|
-
this.setNextZIndex();
|
|
2316
|
-
};
|
|
2317
|
-
/**
|
|
2318
|
-
* @hidden
|
|
2319
|
-
*/
|
|
2320
|
-
WindowComponent.prototype.onComponentBlur = function () {
|
|
2321
|
-
this.renderer.removeClass(this.el.nativeElement, 'k-focus');
|
|
2322
|
-
};
|
|
2323
|
-
WindowComponent.prototype.subscribeEvents = function () {
|
|
2324
|
-
var _this = this;
|
|
2325
|
-
if (!isDocumentAvailable()) {
|
|
2326
|
-
return;
|
|
2327
|
-
}
|
|
2328
|
-
this.windowSubscription.add(this.service.focus.subscribe(function () {
|
|
2329
|
-
_this.el.nativeElement.focus();
|
|
2330
|
-
}));
|
|
2331
|
-
this.windowSubscription.add(this.service.dragStart.subscribe(function () {
|
|
2332
|
-
_this.draged = true;
|
|
2333
|
-
_this.ngZone.run(function () {
|
|
2334
|
-
_this.dragStart.emit();
|
|
2335
|
-
});
|
|
2336
|
-
}));
|
|
2337
|
-
this.windowSubscription.add(this.service.dragEnd.subscribe(function () {
|
|
2338
|
-
if (_this.draged) {
|
|
2339
|
-
_this.draged = false;
|
|
2340
|
-
_this.ngZone.run(function () {
|
|
2341
|
-
_this.dragEnd.emit();
|
|
2342
|
-
});
|
|
2343
|
-
}
|
|
2344
|
-
}));
|
|
2345
|
-
this.windowSubscription.add(this.service.close.subscribe(function () {
|
|
2346
|
-
_this.close.emit();
|
|
2347
|
-
}));
|
|
2348
|
-
this.windowSubscription.add(this.service.resizeStart.subscribe(function () {
|
|
2349
|
-
_this.resized = true;
|
|
2350
|
-
_this.ngZone.run(function () {
|
|
2351
|
-
_this.resizeStart.emit();
|
|
2352
|
-
});
|
|
2353
|
-
}));
|
|
2354
|
-
this.windowSubscription.add(this.service.resizeEnd.subscribe(function () {
|
|
2355
|
-
if (_this.resized) {
|
|
2356
|
-
_this.resized = false;
|
|
2357
|
-
_this.ngZone.run(function () {
|
|
2358
|
-
_this.resizeEnd.emit();
|
|
2359
|
-
});
|
|
2360
|
-
}
|
|
2361
|
-
}));
|
|
2362
|
-
this.windowSubscription.add(this.service.change.subscribe(function (ev) {
|
|
2363
|
-
OFFSET_STYLES.forEach(function (style$$1) {
|
|
2364
|
-
if (isPresent(ev[style$$1])) {
|
|
2365
|
-
_this.setStyle(style$$1, ev[style$$1]);
|
|
2366
|
-
if (_this.state !== 'maximized') {
|
|
2367
|
-
var emitter_1 = _this[style$$1 + 'Change'];
|
|
2368
|
-
if (emitter_1.observers.length) {
|
|
2369
|
-
_this.ngZone.run(function () {
|
|
2370
|
-
emitter_1.emit(ev[style$$1]);
|
|
2371
|
-
});
|
|
2372
|
-
}
|
|
2373
|
-
}
|
|
2374
|
-
}
|
|
2375
|
-
});
|
|
2376
|
-
}));
|
|
2377
|
-
this.windowSubscription.add(this.service.stateChange.subscribe(function (state$$1) {
|
|
2378
|
-
if (isPresent(_this.service.lastAction)) {
|
|
2379
|
-
_this.updateAllOffset();
|
|
2380
|
-
_this.stateChange.emit(state$$1);
|
|
2381
|
-
}
|
|
2382
|
-
}));
|
|
2383
|
-
};
|
|
2384
|
-
WindowComponent.prototype.initDomEvents = function () {
|
|
2385
|
-
var _this = this;
|
|
2386
|
-
if (!this.el) {
|
|
2387
|
-
return;
|
|
2388
|
-
}
|
|
2389
|
-
this.ngZone.runOutsideAngular(function () {
|
|
2390
|
-
_this.domSubs.add(_this.renderer.listen(_this.el.nativeElement, 'keydown', function (ev) {
|
|
2391
|
-
_this.onKeyDown(ev);
|
|
2392
|
-
}));
|
|
2393
|
-
});
|
|
2394
|
-
};
|
|
2395
|
-
WindowComponent.prototype.onKeyDown = function (event) {
|
|
2396
|
-
if (hasClasses(event.target, WINDOW_CLASSES)) {
|
|
2397
|
-
this.navigation.process(event);
|
|
2398
|
-
}
|
|
2399
|
-
};
|
|
2400
|
-
WindowComponent.prototype.setServiceClasses = function (prevValue, value) {
|
|
2401
|
-
var _this = this;
|
|
2402
|
-
var el = this.el.nativeElement;
|
|
2403
|
-
if (prevValue) {
|
|
2404
|
-
parseCSSClassNames(prevValue).forEach(function (className) {
|
|
2405
|
-
_this.renderer.removeClass(el, className);
|
|
2406
|
-
});
|
|
2407
|
-
}
|
|
2408
|
-
if (value) {
|
|
2409
|
-
parseCSSClassNames(value).forEach(function (className) {
|
|
2410
|
-
_this.renderer.addClass(el, className);
|
|
2411
|
-
});
|
|
2412
|
-
}
|
|
2413
|
-
};
|
|
2414
|
-
WindowComponent.prototype.setNextZIndex = function () {
|
|
2415
|
-
var currentZIndex = this.el.nativeElement.style['z-index'];
|
|
2416
|
-
var nextPossibleZIndex = this.service.nextPossibleZIndex;
|
|
2417
|
-
if (!currentZIndex || (nextPossibleZIndex - currentZIndex > 1)) {
|
|
2418
|
-
this.renderer.setStyle(this.el.nativeElement, "z-index", this.service.nextZIndex);
|
|
2419
|
-
}
|
|
2420
|
-
};
|
|
2421
|
-
WindowComponent.prototype.setInitialOffset = function () {
|
|
2422
|
-
if (this.state !== 'maximized') {
|
|
2423
|
-
this.updateAllOffset();
|
|
2424
|
-
if (!isPresent(this.left) || !isPresent(this.top)) {
|
|
2425
|
-
this.service.center();
|
|
2426
|
-
}
|
|
2427
|
-
}
|
|
2428
|
-
else {
|
|
2429
|
-
var viewPort = this.service.windowViewPort;
|
|
2430
|
-
this.setStyle('width', viewPort.width);
|
|
2431
|
-
this.setStyle('height', viewPort.height);
|
|
2432
|
-
this.setStyle('top', 0);
|
|
2433
|
-
this.setStyle('left', 0);
|
|
2434
|
-
}
|
|
2435
|
-
};
|
|
2436
|
-
WindowComponent.prototype.updateAllOffset = function () {
|
|
2437
|
-
var _this = this;
|
|
2438
|
-
OFFSET_STYLES.forEach(function (style$$1) {
|
|
2439
|
-
if (isPresent(_this[style$$1])) {
|
|
2440
|
-
_this.setStyle(style$$1, _this[style$$1]);
|
|
2441
|
-
}
|
|
2442
|
-
else {
|
|
2443
|
-
_this.removeStyle(style$$1);
|
|
2444
|
-
}
|
|
2445
|
-
});
|
|
2446
|
-
};
|
|
2447
|
-
WindowComponent.prototype.setStyle = function (style$$1, value) {
|
|
2448
|
-
this.renderer.setStyle(this.el.nativeElement, style$$1, value + 'px');
|
|
2449
|
-
};
|
|
2450
|
-
WindowComponent.prototype.removeStyle = function (style$$1) {
|
|
2451
|
-
this.renderer.removeStyle(this.el.nativeElement, style$$1);
|
|
2452
|
-
};
|
|
2453
|
-
Object.defineProperty(WindowComponent.prototype, "options", {
|
|
2454
|
-
get: function () {
|
|
2455
|
-
return this.service.options;
|
|
2456
|
-
},
|
|
2457
|
-
enumerable: true,
|
|
2458
|
-
configurable: true
|
|
2459
|
-
});
|
|
2460
|
-
WindowComponent.prototype.setOption = function (style$$1, value) {
|
|
2461
|
-
if (typeof value !== 'number' && typeof value !== 'string') {
|
|
2462
|
-
return;
|
|
2463
|
-
}
|
|
2464
|
-
var parsedValue = (typeof value === 'number') ? value : parseInt(value, 10);
|
|
2465
|
-
this.options[style$$1] = parsedValue;
|
|
2466
|
-
this.service.setRestoreOption(style$$1, parsedValue);
|
|
2467
|
-
};
|
|
2468
|
-
WindowComponent.prototype.handleInitialFocus = function () {
|
|
2469
|
-
var wrapper = this.el.nativeElement;
|
|
2470
|
-
if (this.autoFocusedElement) {
|
|
2471
|
-
var initiallyFocusedElement = wrapper.querySelector(this.autoFocusedElement);
|
|
2472
|
-
if (initiallyFocusedElement) {
|
|
2473
|
-
initiallyFocusedElement.focus();
|
|
2474
|
-
}
|
|
2475
|
-
}
|
|
2476
|
-
else {
|
|
2477
|
-
this.focus();
|
|
2478
|
-
}
|
|
2479
|
-
};
|
|
2480
|
-
__decorate([
|
|
2481
|
-
Input(),
|
|
2482
|
-
__metadata("design:type", String)
|
|
2483
|
-
], WindowComponent.prototype, "autoFocusedElement", void 0);
|
|
2484
|
-
__decorate([
|
|
2485
|
-
Input(),
|
|
2486
|
-
__metadata("design:type", String)
|
|
2487
|
-
], WindowComponent.prototype, "title", void 0);
|
|
2488
|
-
__decorate([
|
|
2489
|
-
Input(),
|
|
2490
|
-
__metadata("design:type", Boolean),
|
|
2491
|
-
__metadata("design:paramtypes", [Boolean])
|
|
2492
|
-
], WindowComponent.prototype, "draggable", null);
|
|
2493
|
-
__decorate([
|
|
2494
|
-
Input(),
|
|
2495
|
-
__metadata("design:type", Boolean),
|
|
2496
|
-
__metadata("design:paramtypes", [Boolean])
|
|
2497
|
-
], WindowComponent.prototype, "resizable", null);
|
|
2498
|
-
__decorate([
|
|
2499
|
-
Input(),
|
|
2500
|
-
__metadata("design:type", Boolean)
|
|
2501
|
-
], WindowComponent.prototype, "keepContent", void 0);
|
|
2502
|
-
__decorate([
|
|
2503
|
-
Input(),
|
|
2504
|
-
__metadata("design:type", String),
|
|
2505
|
-
__metadata("design:paramtypes", [String])
|
|
2506
|
-
], WindowComponent.prototype, "state", null);
|
|
2507
|
-
__decorate([
|
|
2508
|
-
Input(),
|
|
2509
|
-
__metadata("design:type", Number),
|
|
2510
|
-
__metadata("design:paramtypes", [Number])
|
|
2511
|
-
], WindowComponent.prototype, "minWidth", null);
|
|
2512
|
-
__decorate([
|
|
2513
|
-
Input(),
|
|
2514
|
-
__metadata("design:type", Number),
|
|
2515
|
-
__metadata("design:paramtypes", [Number])
|
|
2516
|
-
], WindowComponent.prototype, "minHeight", null);
|
|
2517
|
-
__decorate([
|
|
2518
|
-
Input(),
|
|
2519
|
-
__metadata("design:type", Number),
|
|
2520
|
-
__metadata("design:paramtypes", [Number])
|
|
2521
|
-
], WindowComponent.prototype, "width", null);
|
|
2522
|
-
__decorate([
|
|
2523
|
-
Input(),
|
|
2524
|
-
__metadata("design:type", Number),
|
|
2525
|
-
__metadata("design:paramtypes", [Number])
|
|
2526
|
-
], WindowComponent.prototype, "height", null);
|
|
2527
|
-
__decorate([
|
|
2528
|
-
Input(),
|
|
2529
|
-
__metadata("design:type", Number),
|
|
2530
|
-
__metadata("design:paramtypes", [Number])
|
|
2531
|
-
], WindowComponent.prototype, "top", null);
|
|
2532
|
-
__decorate([
|
|
2533
|
-
Input(),
|
|
2534
|
-
__metadata("design:type", Number),
|
|
2535
|
-
__metadata("design:paramtypes", [Number])
|
|
2536
|
-
], WindowComponent.prototype, "left", null);
|
|
2537
|
-
__decorate([
|
|
2538
|
-
Output(),
|
|
2539
|
-
__metadata("design:type", EventEmitter)
|
|
2540
|
-
], WindowComponent.prototype, "dragStart", void 0);
|
|
2541
|
-
__decorate([
|
|
2542
|
-
Output(),
|
|
2543
|
-
__metadata("design:type", EventEmitter)
|
|
2544
|
-
], WindowComponent.prototype, "dragEnd", void 0);
|
|
2545
|
-
__decorate([
|
|
2546
|
-
Output(),
|
|
2547
|
-
__metadata("design:type", EventEmitter)
|
|
2548
|
-
], WindowComponent.prototype, "resizeStart", void 0);
|
|
2549
|
-
__decorate([
|
|
2550
|
-
Output(),
|
|
2551
|
-
__metadata("design:type", EventEmitter)
|
|
2552
|
-
], WindowComponent.prototype, "resizeEnd", void 0);
|
|
2553
|
-
__decorate([
|
|
2554
|
-
Output(),
|
|
2555
|
-
__metadata("design:type", EventEmitter)
|
|
2556
|
-
], WindowComponent.prototype, "close", void 0);
|
|
2557
|
-
__decorate([
|
|
2558
|
-
Output(),
|
|
2559
|
-
__metadata("design:type", EventEmitter)
|
|
2560
|
-
], WindowComponent.prototype, "widthChange", void 0);
|
|
2561
|
-
__decorate([
|
|
2562
|
-
Output(),
|
|
2563
|
-
__metadata("design:type", EventEmitter)
|
|
2564
|
-
], WindowComponent.prototype, "heightChange", void 0);
|
|
2565
|
-
__decorate([
|
|
2566
|
-
Output(),
|
|
2567
|
-
__metadata("design:type", EventEmitter)
|
|
2568
|
-
], WindowComponent.prototype, "topChange", void 0);
|
|
2569
|
-
__decorate([
|
|
2570
|
-
Output(),
|
|
2571
|
-
__metadata("design:type", EventEmitter)
|
|
2572
|
-
], WindowComponent.prototype, "leftChange", void 0);
|
|
2573
|
-
__decorate([
|
|
2574
|
-
Output(),
|
|
2575
|
-
__metadata("design:type", EventEmitter)
|
|
2576
|
-
], WindowComponent.prototype, "stateChange", void 0);
|
|
2577
|
-
__decorate([
|
|
2578
|
-
HostBinding('attr.tabIndex'),
|
|
2579
|
-
__metadata("design:type", Number)
|
|
2580
|
-
], WindowComponent.prototype, "tabIndex", void 0);
|
|
2581
|
-
__decorate([
|
|
2582
|
-
HostBinding('class.k-window'),
|
|
2583
|
-
__metadata("design:type", Boolean),
|
|
2584
|
-
__metadata("design:paramtypes", [])
|
|
2585
|
-
], WindowComponent.prototype, "hostClasses", null);
|
|
2586
|
-
__decorate([
|
|
2587
|
-
HostBinding('attr.dir'),
|
|
2588
|
-
__metadata("design:type", String),
|
|
2589
|
-
__metadata("design:paramtypes", [])
|
|
2590
|
-
], WindowComponent.prototype, "dir", null);
|
|
2591
|
-
__decorate([
|
|
2592
|
-
ViewChild(WindowTitleBarComponent, { static: false }),
|
|
2593
|
-
__metadata("design:type", WindowTitleBarComponent)
|
|
2594
|
-
], WindowComponent.prototype, "titleBarView", void 0);
|
|
2595
|
-
__decorate([
|
|
2596
|
-
ContentChild(WindowTitleBarComponent, { static: false }),
|
|
2597
|
-
__metadata("design:type", WindowTitleBarComponent)
|
|
2598
|
-
], WindowComponent.prototype, "titleBarContent", void 0);
|
|
2599
|
-
__decorate([
|
|
2600
|
-
ViewChildren(ResizeHandleDirective),
|
|
2601
|
-
__metadata("design:type", QueryList)
|
|
2602
|
-
], WindowComponent.prototype, "resizeHandles", void 0);
|
|
2603
|
-
__decorate([
|
|
2604
|
-
HostBinding('style.minWidth'),
|
|
2605
|
-
__metadata("design:type", String),
|
|
2606
|
-
__metadata("design:paramtypes", [])
|
|
2607
|
-
], WindowComponent.prototype, "styleMinWidth", null);
|
|
2608
|
-
__decorate([
|
|
2609
|
-
HostBinding('style.minHeight'),
|
|
2610
|
-
__metadata("design:type", String),
|
|
2611
|
-
__metadata("design:paramtypes", [])
|
|
2612
|
-
], WindowComponent.prototype, "styleMinHeight", null);
|
|
2613
|
-
__decorate([
|
|
2614
|
-
HostBinding('style.position'),
|
|
2615
|
-
__metadata("design:type", String),
|
|
2616
|
-
__metadata("design:paramtypes", [])
|
|
2617
|
-
], WindowComponent.prototype, "stylePosition", null);
|
|
2618
|
-
__decorate([
|
|
2619
|
-
HostBinding('class.k-window-maximized'),
|
|
2620
|
-
__metadata("design:type", Boolean),
|
|
2621
|
-
__metadata("design:paramtypes", [])
|
|
2622
|
-
], WindowComponent.prototype, "wrapperMaximizedClass", null);
|
|
2623
|
-
__decorate([
|
|
2624
|
-
HostBinding('class.k-window-minimized'),
|
|
2625
|
-
__metadata("design:type", Boolean),
|
|
2626
|
-
__metadata("design:paramtypes", [])
|
|
2627
|
-
], WindowComponent.prototype, "wrapperMinimizedClass", null);
|
|
2628
|
-
__decorate([
|
|
2629
|
-
HostListener('focus'),
|
|
2630
|
-
__metadata("design:type", Function),
|
|
2631
|
-
__metadata("design:paramtypes", []),
|
|
2632
|
-
__metadata("design:returntype", void 0)
|
|
2633
|
-
], WindowComponent.prototype, "onComponentFocus", null);
|
|
2634
|
-
__decorate([
|
|
2635
|
-
HostListener('blur'),
|
|
2636
|
-
__metadata("design:type", Function),
|
|
2637
|
-
__metadata("design:paramtypes", []),
|
|
2638
|
-
__metadata("design:returntype", void 0)
|
|
2639
|
-
], WindowComponent.prototype, "onComponentBlur", null);
|
|
2640
|
-
WindowComponent = __decorate([
|
|
2641
|
-
Component({
|
|
2642
|
-
exportAs: 'kendoWindow',
|
|
2643
|
-
providers: [
|
|
2644
|
-
DragResizeService,
|
|
2645
|
-
NavigationService,
|
|
2646
|
-
LocalizationService,
|
|
2647
|
-
{
|
|
2648
|
-
provide: L10N_PREFIX,
|
|
2649
|
-
useValue: 'kendo.window'
|
|
2650
|
-
}
|
|
2651
|
-
],
|
|
2652
|
-
selector: 'kendo-window',
|
|
2653
|
-
template: "\n <ng-container kendoWindowLocalizedMessages\n i18n-closeTitle=\"kendo.window.closeTitle|The title of the close button\"\n closeTitle=\"Close\"\n\n i18n-restoreTitle=\"kendo.window.restoreTitle|The title of the restore button\"\n restoreTitle=\"Restore\"\n\n i18n-maximizeTitle=\"kendo.window.maximizeTitle|The title of the maximize button\"\n maximizeTitle=\"Maximize\"\n\n i18n-minimizeTitle=\"kendo.window.minimizeTitle|The title of the minimize button\"\n minimizeTitle=\"Minimize\"\n >\n <ng-container>\n\n <kendo-window-titlebar *ngIf=\"showDefaultTitleBar\" [template]=\"titleBarTemplate\">\n <div class=\"k-window-title\">{{ title }}</div>\n <div class=\"k-window-actions\">\n <button kendoWindowMinimizeAction [attr.title]=\"minimizeButtonTitle\" [attr.aria-label]=\"minimizeButtonTitle\"></button>\n <button kendoWindowMaximizeAction [attr.title]=\"maximizeButtonTitle\" [attr.aria-label]=\"maximizeButtonTitle\"></button>\n <button kendoWindowRestoreAction [attr.title]=\"restoreButtonTitle\" [attr.aria-label]=\"restoreButtonTitle\"></button>\n <button kendoWindowCloseAction [attr.title]=\"closeButtonTitle\" [attr.aria-label]=\"closeButtonTitle\"></button>\n </div>\n </kendo-window-titlebar>\n <ng-content select=\"kendo-window-titlebar\" *ngIf=\"!showDefaultTitleBar\"></ng-content>\n\n <div *ngIf=\"state !== 'minimized' || keepContent\"\n [hidden]=\"state === 'minimized' && keepContent\"\n class=\"k-content k-window-content\"\n >\n <ng-content *ngIf=\"!contentTemplate\"></ng-content>\n <ng-template [ngTemplateOutlet]=\"contentTemplate\" *ngIf=\"contentTemplate\"></ng-template>\n </div>\n\n <ng-template [ngIf]='resizable'>\n <div *ngFor='let dir of resizeDirections'\n [direction]=\"dir\"\n kendoWindowResizeHandle\n kendoDraggable>\n </div>\n </ng-template>\n "
|
|
2654
|
-
}),
|
|
2655
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
2656
|
-
Renderer2,
|
|
2657
|
-
DragResizeService,
|
|
2658
|
-
NavigationService,
|
|
2659
|
-
NgZone,
|
|
2660
|
-
LocalizationService])
|
|
2661
|
-
], WindowComponent);
|
|
2662
|
-
return WindowComponent;
|
|
2663
|
-
}());
|
|
2664
|
-
|
|
2665
|
-
var WindowMaximizeActionDirective = /** @class */ (function (_super) {
|
|
2666
|
-
__extends(WindowMaximizeActionDirective, _super);
|
|
2667
|
-
function WindowMaximizeActionDirective(el, renderer, _service, localization, ngZone) {
|
|
2668
|
-
var _this = _super.call(this, el, renderer, null, localization, ngZone) || this;
|
|
2669
|
-
_this.buttonType = 'button';
|
|
2670
|
-
_this.window = _service;
|
|
2671
|
-
_this.fillMode = 'flat';
|
|
2672
|
-
_this.icon = 'window-maximize';
|
|
2673
|
-
return _this;
|
|
2674
|
-
}
|
|
2675
|
-
/**
|
|
2676
|
-
* @hidden
|
|
2677
|
-
*/
|
|
2678
|
-
WindowMaximizeActionDirective.prototype.onClick = function () {
|
|
2679
|
-
if (!this.isDisabled) {
|
|
2680
|
-
this.window.maximizeAction();
|
|
2681
|
-
}
|
|
2682
|
-
};
|
|
2683
|
-
Object.defineProperty(WindowMaximizeActionDirective.prototype, "visible", {
|
|
2684
|
-
get: function () {
|
|
2685
|
-
return this.window.options.state === 'default' ? 'inline-flex' : 'none';
|
|
2686
|
-
},
|
|
2687
|
-
enumerable: true,
|
|
2688
|
-
configurable: true
|
|
2689
|
-
});
|
|
2690
|
-
__decorate([
|
|
2691
|
-
Input(),
|
|
2692
|
-
__metadata("design:type", Object)
|
|
2693
|
-
], WindowMaximizeActionDirective.prototype, "window", void 0);
|
|
2694
|
-
__decorate([
|
|
2695
|
-
HostBinding('attr.type'),
|
|
2696
|
-
__metadata("design:type", String)
|
|
2697
|
-
], WindowMaximizeActionDirective.prototype, "buttonType", void 0);
|
|
2698
|
-
__decorate([
|
|
2699
|
-
HostListener('click'),
|
|
2700
|
-
__metadata("design:type", Function),
|
|
2701
|
-
__metadata("design:paramtypes", []),
|
|
2702
|
-
__metadata("design:returntype", void 0)
|
|
2703
|
-
], WindowMaximizeActionDirective.prototype, "onClick", null);
|
|
2704
|
-
__decorate([
|
|
2705
|
-
HostBinding('style.display'),
|
|
2706
|
-
__metadata("design:type", String),
|
|
2707
|
-
__metadata("design:paramtypes", [])
|
|
2708
|
-
], WindowMaximizeActionDirective.prototype, "visible", null);
|
|
2709
|
-
WindowMaximizeActionDirective = __decorate([
|
|
2710
|
-
Directive({
|
|
2711
|
-
exportAs: 'kendoWindowMaximizeAction',
|
|
2712
|
-
providers: [
|
|
2713
|
-
LocalizationService,
|
|
2714
|
-
{
|
|
2715
|
-
provide: L10N_PREFIX,
|
|
2716
|
-
useValue: 'kendo.button'
|
|
2717
|
-
}
|
|
2718
|
-
],
|
|
2719
|
-
selector: 'button[kendoWindowMaximizeAction]' // tslint:disable-line
|
|
2720
|
-
}),
|
|
2721
|
-
__param(2, Optional()),
|
|
2722
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
2723
|
-
Renderer2,
|
|
2724
|
-
DragResizeService,
|
|
2725
|
-
LocalizationService,
|
|
2726
|
-
NgZone])
|
|
2727
|
-
], WindowMaximizeActionDirective);
|
|
2728
|
-
return WindowMaximizeActionDirective;
|
|
2729
|
-
}(Button));
|
|
2730
|
-
|
|
2731
|
-
var WindowMinimizeActionDirective = /** @class */ (function (_super) {
|
|
2732
|
-
__extends(WindowMinimizeActionDirective, _super);
|
|
2733
|
-
function WindowMinimizeActionDirective(el, renderer, _service, localization, ngZone) {
|
|
2734
|
-
var _this = _super.call(this, el, renderer, null, localization, ngZone) || this;
|
|
2735
|
-
_this.buttonType = 'button';
|
|
2736
|
-
_this.window = _service;
|
|
2737
|
-
_this.fillMode = 'flat';
|
|
2738
|
-
_this.icon = 'window-minimize';
|
|
2739
|
-
return _this;
|
|
2740
|
-
}
|
|
2741
|
-
/**
|
|
2742
|
-
* @hidden
|
|
2743
|
-
*/
|
|
2744
|
-
WindowMinimizeActionDirective.prototype.onClick = function () {
|
|
2745
|
-
if (!this.isDisabled) {
|
|
2746
|
-
this.window.minimizeAction();
|
|
2747
|
-
}
|
|
2748
|
-
};
|
|
2749
|
-
Object.defineProperty(WindowMinimizeActionDirective.prototype, "visible", {
|
|
2750
|
-
get: function () {
|
|
2751
|
-
return this.window.options.state === 'default' ? 'inline-flex' : 'none';
|
|
2752
|
-
},
|
|
2753
|
-
enumerable: true,
|
|
2754
|
-
configurable: true
|
|
2755
|
-
});
|
|
2756
|
-
__decorate([
|
|
2757
|
-
Input(),
|
|
2758
|
-
__metadata("design:type", Object)
|
|
2759
|
-
], WindowMinimizeActionDirective.prototype, "window", void 0);
|
|
2760
|
-
__decorate([
|
|
2761
|
-
HostBinding('attr.type'),
|
|
2762
|
-
__metadata("design:type", String)
|
|
2763
|
-
], WindowMinimizeActionDirective.prototype, "buttonType", void 0);
|
|
2764
|
-
__decorate([
|
|
2765
|
-
HostListener('click'),
|
|
2766
|
-
__metadata("design:type", Function),
|
|
2767
|
-
__metadata("design:paramtypes", []),
|
|
2768
|
-
__metadata("design:returntype", void 0)
|
|
2769
|
-
], WindowMinimizeActionDirective.prototype, "onClick", null);
|
|
2770
|
-
__decorate([
|
|
2771
|
-
HostBinding('style.display'),
|
|
2772
|
-
__metadata("design:type", String),
|
|
2773
|
-
__metadata("design:paramtypes", [])
|
|
2774
|
-
], WindowMinimizeActionDirective.prototype, "visible", null);
|
|
2775
|
-
WindowMinimizeActionDirective = __decorate([
|
|
2776
|
-
Directive({
|
|
2777
|
-
exportAs: 'kendoWindowMinimizeAction',
|
|
2778
|
-
providers: [
|
|
2779
|
-
LocalizationService,
|
|
2780
|
-
{
|
|
2781
|
-
provide: L10N_PREFIX,
|
|
2782
|
-
useValue: 'kendo.button'
|
|
2783
|
-
}
|
|
2784
|
-
],
|
|
2785
|
-
selector: 'button[kendoWindowMinimizeAction]' // tslint:disable-line
|
|
2786
|
-
}),
|
|
2787
|
-
__param(2, Optional()),
|
|
2788
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
2789
|
-
Renderer2,
|
|
2790
|
-
DragResizeService,
|
|
2791
|
-
LocalizationService,
|
|
2792
|
-
NgZone])
|
|
2793
|
-
], WindowMinimizeActionDirective);
|
|
2794
|
-
return WindowMinimizeActionDirective;
|
|
2795
|
-
}(Button));
|
|
2796
|
-
|
|
2797
|
-
var WindowCloseActionDirective = /** @class */ (function (_super) {
|
|
2798
|
-
__extends(WindowCloseActionDirective, _super);
|
|
2799
|
-
function WindowCloseActionDirective(el, renderer, _service, localization, ngZone) {
|
|
2800
|
-
var _this = _super.call(this, el, renderer, null, localization, ngZone) || this;
|
|
2801
|
-
_this.buttonType = 'button';
|
|
2802
|
-
_this.window = _service;
|
|
2803
|
-
_this.fillMode = 'flat';
|
|
2804
|
-
_this.icon = 'close';
|
|
2805
|
-
return _this;
|
|
2806
|
-
}
|
|
2807
|
-
/**
|
|
2808
|
-
* @hidden
|
|
2809
|
-
*/
|
|
2810
|
-
WindowCloseActionDirective.prototype.onClick = function () {
|
|
2811
|
-
if (!this.isDisabled) {
|
|
2812
|
-
this.window.closeAction();
|
|
2813
|
-
}
|
|
2814
|
-
};
|
|
2815
|
-
__decorate([
|
|
2816
|
-
Input(),
|
|
2817
|
-
__metadata("design:type", Object)
|
|
2818
|
-
], WindowCloseActionDirective.prototype, "window", void 0);
|
|
2819
|
-
__decorate([
|
|
2820
|
-
HostBinding('attr.type'),
|
|
2821
|
-
__metadata("design:type", String)
|
|
2822
|
-
], WindowCloseActionDirective.prototype, "buttonType", void 0);
|
|
2823
|
-
__decorate([
|
|
2824
|
-
HostListener('click'),
|
|
2825
|
-
__metadata("design:type", Function),
|
|
2826
|
-
__metadata("design:paramtypes", []),
|
|
2827
|
-
__metadata("design:returntype", void 0)
|
|
2828
|
-
], WindowCloseActionDirective.prototype, "onClick", null);
|
|
2829
|
-
WindowCloseActionDirective = __decorate([
|
|
2830
|
-
Directive({
|
|
2831
|
-
exportAs: 'kendoWindowCloseAction',
|
|
2832
|
-
providers: [
|
|
2833
|
-
LocalizationService,
|
|
2834
|
-
{
|
|
2835
|
-
provide: L10N_PREFIX,
|
|
2836
|
-
useValue: 'kendo.button'
|
|
2837
|
-
}
|
|
2838
|
-
],
|
|
2839
|
-
selector: 'button[kendoWindowCloseAction]' // tslint:disable-line
|
|
2840
|
-
}),
|
|
2841
|
-
__param(2, Optional()),
|
|
2842
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
2843
|
-
Renderer2,
|
|
2844
|
-
DragResizeService,
|
|
2845
|
-
LocalizationService,
|
|
2846
|
-
NgZone])
|
|
2847
|
-
], WindowCloseActionDirective);
|
|
2848
|
-
return WindowCloseActionDirective;
|
|
2849
|
-
}(Button));
|
|
2850
|
-
|
|
2851
|
-
var WindowRestoreActionDirective = /** @class */ (function (_super) {
|
|
2852
|
-
__extends(WindowRestoreActionDirective, _super);
|
|
2853
|
-
function WindowRestoreActionDirective(el, renderer, _service, localization, ngZone) {
|
|
2854
|
-
var _this = _super.call(this, el, renderer, null, localization, ngZone) || this;
|
|
2855
|
-
_this.buttonType = 'button';
|
|
2856
|
-
_this.window = _service;
|
|
2857
|
-
_this.fillMode = 'flat';
|
|
2858
|
-
_this.icon = 'window-restore';
|
|
2859
|
-
return _this;
|
|
2860
|
-
}
|
|
2861
|
-
/**
|
|
2862
|
-
* @hidden
|
|
2863
|
-
*/
|
|
2864
|
-
WindowRestoreActionDirective.prototype.onClick = function () {
|
|
2865
|
-
if (!this.isDisabled) {
|
|
2866
|
-
this.window.restoreAction();
|
|
2867
|
-
}
|
|
2868
|
-
};
|
|
2869
|
-
Object.defineProperty(WindowRestoreActionDirective.prototype, "visible", {
|
|
2870
|
-
get: function () {
|
|
2871
|
-
return this.window.options.state === 'default' ? 'none' : 'inline-flex';
|
|
2872
|
-
},
|
|
2873
|
-
enumerable: true,
|
|
2874
|
-
configurable: true
|
|
2875
|
-
});
|
|
2876
|
-
__decorate([
|
|
2877
|
-
Input(),
|
|
2878
|
-
__metadata("design:type", Object)
|
|
2879
|
-
], WindowRestoreActionDirective.prototype, "window", void 0);
|
|
2880
|
-
__decorate([
|
|
2881
|
-
HostBinding('attr.type'),
|
|
2882
|
-
__metadata("design:type", String)
|
|
2883
|
-
], WindowRestoreActionDirective.prototype, "buttonType", void 0);
|
|
2884
|
-
__decorate([
|
|
2885
|
-
HostListener('click'),
|
|
2886
|
-
__metadata("design:type", Function),
|
|
2887
|
-
__metadata("design:paramtypes", []),
|
|
2888
|
-
__metadata("design:returntype", void 0)
|
|
2889
|
-
], WindowRestoreActionDirective.prototype, "onClick", null);
|
|
2890
|
-
__decorate([
|
|
2891
|
-
HostBinding('style.display'),
|
|
2892
|
-
__metadata("design:type", String),
|
|
2893
|
-
__metadata("design:paramtypes", [])
|
|
2894
|
-
], WindowRestoreActionDirective.prototype, "visible", null);
|
|
2895
|
-
WindowRestoreActionDirective = __decorate([
|
|
2896
|
-
Directive({
|
|
2897
|
-
exportAs: 'kendoWindowRestoreAction',
|
|
2898
|
-
providers: [
|
|
2899
|
-
LocalizationService,
|
|
2900
|
-
{
|
|
2901
|
-
provide: L10N_PREFIX,
|
|
2902
|
-
useValue: 'kendo.button'
|
|
2903
|
-
}
|
|
2904
|
-
],
|
|
2905
|
-
selector: 'button[kendoWindowRestoreAction]' // tslint:disable-line
|
|
2906
|
-
}),
|
|
2907
|
-
__param(2, Optional()),
|
|
2908
|
-
__metadata("design:paramtypes", [ElementRef,
|
|
2909
|
-
Renderer2,
|
|
2910
|
-
DragResizeService,
|
|
2911
|
-
LocalizationService,
|
|
2912
|
-
NgZone])
|
|
2913
|
-
], WindowRestoreActionDirective);
|
|
2914
|
-
return WindowRestoreActionDirective;
|
|
2915
|
-
}(Button));
|
|
2916
|
-
|
|
2917
|
-
/**
|
|
2918
|
-
* The settings for the Window actions when the Window is opened through `WindowService`
|
|
2919
|
-
* ([see example]({% slug api_dialog_windowservice %}#toc-open)).
|
|
2920
|
-
*/
|
|
2921
|
-
var WindowSettings = /** @class */ (function () {
|
|
2922
|
-
function WindowSettings() {
|
|
2923
|
-
}
|
|
2924
|
-
return WindowSettings;
|
|
2925
|
-
}());
|
|
2926
|
-
/**
|
|
2927
|
-
* Indicates that the **Close** button of a Window that is opened through `WindowService` is clicked.
|
|
2928
|
-
*/
|
|
2929
|
-
var WindowCloseResult = /** @class */ (function () {
|
|
2930
|
-
function WindowCloseResult() {
|
|
2931
|
-
}
|
|
2932
|
-
return WindowCloseResult;
|
|
2933
|
-
}());
|
|
2934
|
-
/**
|
|
2935
|
-
* Holds references to the object instance of the Window.
|
|
2936
|
-
* Controls the Windows that were opened through `WindowService`
|
|
2937
|
-
* ([see example]({% slug api_dialog_windowservice %}#toc-open)).
|
|
2938
|
-
*/
|
|
2939
|
-
var WindowRef = /** @class */ (function () {
|
|
2940
|
-
function WindowRef() {
|
|
2941
|
-
}
|
|
2942
|
-
return WindowRef;
|
|
2943
|
-
}());
|
|
2944
|
-
|
|
2945
|
-
/**
|
|
2946
|
-
* @hidden
|
|
2947
|
-
*/
|
|
2948
|
-
var WindowContainerService = /** @class */ (function () {
|
|
2949
|
-
function WindowContainerService() {
|
|
2950
|
-
}
|
|
2951
|
-
WindowContainerService_1 = WindowContainerService;
|
|
2952
|
-
Object.defineProperty(WindowContainerService.prototype, "container", {
|
|
2953
|
-
get: function () {
|
|
2954
|
-
return WindowContainerService_1.container;
|
|
2955
|
-
},
|
|
2956
|
-
set: function (container) {
|
|
2957
|
-
WindowContainerService_1.container = container;
|
|
2958
|
-
},
|
|
2959
|
-
enumerable: true,
|
|
2960
|
-
configurable: true
|
|
2961
|
-
});
|
|
2962
|
-
var WindowContainerService_1;
|
|
2963
|
-
WindowContainerService.container = null;
|
|
2964
|
-
WindowContainerService = WindowContainerService_1 = __decorate([
|
|
2965
|
-
Injectable()
|
|
2966
|
-
], WindowContainerService);
|
|
2967
|
-
return WindowContainerService;
|
|
2968
|
-
}());
|
|
2969
|
-
|
|
2970
|
-
var isNotComponent$1 = function (component) { return isString(component) || component instanceof TemplateRef; };
|
|
2971
|
-
var WindowInjector = /** @class */ (function () {
|
|
2972
|
-
function WindowInjector(getWindowRef, parentInjector) {
|
|
2973
|
-
this.getWindowRef = getWindowRef;
|
|
2974
|
-
this.parentInjector = parentInjector;
|
|
2975
|
-
}
|
|
2976
|
-
WindowInjector.prototype.get = function (token, notFoundValue) {
|
|
2977
|
-
if (token === WindowRef) {
|
|
2978
|
-
return this.getWindowRef();
|
|
2979
|
-
}
|
|
2980
|
-
return this.parentInjector.get(token, notFoundValue);
|
|
2981
|
-
};
|
|
2982
|
-
return WindowInjector;
|
|
2983
|
-
}());
|
|
2984
|
-
/**
|
|
2985
|
-
* A service for opening Windows dynamically
|
|
2986
|
-
* ([see example]({% slug service_window %})).
|
|
2987
|
-
*/
|
|
2988
|
-
var WindowService = /** @class */ (function () {
|
|
2989
|
-
function WindowService(
|
|
2990
|
-
/**
|
|
2991
|
-
* @hidden
|
|
2992
|
-
*/
|
|
2993
|
-
resolver, containerService) {
|
|
2994
|
-
this.resolver = resolver;
|
|
2995
|
-
this.containerService = containerService;
|
|
2996
|
-
}
|
|
2997
|
-
/**
|
|
2998
|
-
* Opens a Window component.
|
|
2999
|
-
*
|
|
3000
|
-
* @param {WindowSettings} settings - The settings that define the Window.
|
|
3001
|
-
* @returns {WindowRef} - A reference to the Window object.
|
|
3002
|
-
*
|
|
3003
|
-
* @example
|
|
3004
|
-
*
|
|
3005
|
-
* ```ts-no-run
|
|
3006
|
-
* _@Component({
|
|
3007
|
-
* selector: 'my-app',
|
|
3008
|
-
* template: `
|
|
3009
|
-
* <button kendoButton (click)="open()">Open window</button>
|
|
3010
|
-
* <div kendoWindowContainer></div>
|
|
3011
|
-
* `
|
|
3012
|
-
* })
|
|
3013
|
-
* export class AppComponent {
|
|
3014
|
-
* constructor( private windowService: WindowService ) {}
|
|
3015
|
-
*
|
|
3016
|
-
* public open() {
|
|
3017
|
-
* var window = this.windowService.open({
|
|
3018
|
-
* title: "My window",
|
|
3019
|
-
* content: "My content!"
|
|
3020
|
-
* });
|
|
3021
|
-
*
|
|
3022
|
-
* window.result.subscribe((result) => {
|
|
3023
|
-
* if (result instanceof WindowCloseResult) {
|
|
3024
|
-
* console.log("Window was closed");
|
|
3025
|
-
* }
|
|
3026
|
-
* });
|
|
3027
|
-
* }
|
|
3028
|
-
* }
|
|
3029
|
-
* ```
|
|
3030
|
-
*
|
|
3031
|
-
*/
|
|
3032
|
-
WindowService.prototype.open = function (settings) {
|
|
3033
|
-
var factory = this.resolver.resolveComponentFactory(WindowComponent);
|
|
3034
|
-
var container = settings.appendTo || this.containerService.container;
|
|
3035
|
-
if (!container) {
|
|
3036
|
-
throw new Error("Cannot attach window to the page.\n Add an element that uses the kendoWindowContainer directive, or set the 'appendTo' property.\n See https://www.telerik.com/kendo-angular-ui/components/dialogs/window/service/\n ");
|
|
3037
|
-
}
|
|
3038
|
-
var windowRef = {
|
|
3039
|
-
close: function () { },
|
|
3040
|
-
content: null,
|
|
3041
|
-
result: null,
|
|
3042
|
-
window: null
|
|
3043
|
-
};
|
|
3044
|
-
var content = this.contentFrom(settings.content, container, windowRef);
|
|
3045
|
-
var window = container.createComponent(factory, undefined, undefined, content.nodes);
|
|
3046
|
-
windowRef.window = window;
|
|
3047
|
-
this.applyOptions(window.instance, settings);
|
|
3048
|
-
var apiClose = new Subject();
|
|
3049
|
-
var close = function (e) {
|
|
3050
|
-
apiClose.next(e || new WindowCloseResult());
|
|
3051
|
-
if (content.componentRef) {
|
|
3052
|
-
content.componentRef.destroy();
|
|
3053
|
-
}
|
|
3054
|
-
window.destroy();
|
|
3055
|
-
};
|
|
3056
|
-
var result = merge(apiClose, window.instance.close.pipe(map(function (e) { return (e ? e : new WindowCloseResult()); }), filter(function (e) {
|
|
3057
|
-
if (settings.preventClose) {
|
|
3058
|
-
// add windowRef only when using component
|
|
3059
|
-
var windowRefParameter = isNotComponent$1(settings.content) ? undefined : windowRef;
|
|
3060
|
-
return !settings.preventClose(e, windowRefParameter);
|
|
3061
|
-
}
|
|
3062
|
-
return true;
|
|
3063
|
-
}))).pipe(take(1),
|
|
3064
|
-
// Takes care for multiple subscriptions:
|
|
3065
|
-
// We subscribe internally and the user may subscribe to get a close result - window.result.subscribe().
|
|
3066
|
-
// This causes multiple subscriptions to the same source and thus multiple emissions. share() solves that.
|
|
3067
|
-
share());
|
|
3068
|
-
result.subscribe(close);
|
|
3069
|
-
windowRef.close = close;
|
|
3070
|
-
windowRef.result = result;
|
|
3071
|
-
window.changeDetectorRef.markForCheck();
|
|
3072
|
-
return windowRef;
|
|
3073
|
-
};
|
|
3074
|
-
WindowService.prototype.applyOptions = function (instance, options) {
|
|
3075
|
-
if (isPresent(options.htmlAttributes)) {
|
|
3076
|
-
instance.htmlAttributes = options.htmlAttributes;
|
|
3077
|
-
}
|
|
3078
|
-
if (isPresent(options.cssClass)) {
|
|
3079
|
-
instance.cssClass = options.cssClass;
|
|
3080
|
-
}
|
|
3081
|
-
if (isPresent(options.title)) {
|
|
3082
|
-
instance.title = options.title;
|
|
3083
|
-
}
|
|
3084
|
-
if (isPresent(options.keepContent)) {
|
|
3085
|
-
instance.keepContent = options.keepContent;
|
|
3086
|
-
}
|
|
3087
|
-
if (isPresent(options.width)) {
|
|
3088
|
-
instance.width = options.width;
|
|
3089
|
-
}
|
|
3090
|
-
if (isPresent(options.minWidth)) {
|
|
3091
|
-
instance.minWidth = options.minWidth;
|
|
3092
|
-
}
|
|
3093
|
-
if (isPresent(options.height)) {
|
|
3094
|
-
instance.height = options.height;
|
|
3095
|
-
}
|
|
3096
|
-
if (isPresent(options.minHeight)) {
|
|
3097
|
-
instance.minHeight = options.minHeight;
|
|
3098
|
-
}
|
|
3099
|
-
if (isPresent(options.left)) {
|
|
3100
|
-
instance.left = options.left;
|
|
3101
|
-
}
|
|
3102
|
-
if (isPresent(options.top)) {
|
|
3103
|
-
instance.top = options.top;
|
|
3104
|
-
}
|
|
3105
|
-
if (isPresent(options.draggable)) {
|
|
3106
|
-
instance.draggable = options.draggable;
|
|
3107
|
-
}
|
|
3108
|
-
if (isPresent(options.resizable)) {
|
|
3109
|
-
instance.resizable = options.resizable;
|
|
3110
|
-
}
|
|
3111
|
-
if (isPresent(options.messages && options.messages.closeTitle)) {
|
|
3112
|
-
instance.messages.closeTitle = options.messages.closeTitle;
|
|
3113
|
-
}
|
|
3114
|
-
if (isPresent(options.messages && options.messages.restoreTitle)) {
|
|
3115
|
-
instance.messages.restoreTitle = options.messages.restoreTitle;
|
|
3116
|
-
}
|
|
3117
|
-
if (isPresent(options.messages && options.messages.maximizeTitle)) {
|
|
3118
|
-
instance.messages.maximizeTitle = options.messages.maximizeTitle;
|
|
3119
|
-
}
|
|
3120
|
-
if (isPresent(options.messages && options.messages.minimizeTitle)) {
|
|
3121
|
-
instance.messages.minimizeTitle = options.messages.minimizeTitle;
|
|
3122
|
-
}
|
|
3123
|
-
if (isPresent(options.autoFocusedElement)) {
|
|
3124
|
-
instance.autoFocusedElement = options.autoFocusedElement;
|
|
3125
|
-
}
|
|
3126
|
-
if (isPresent(options.state)) {
|
|
3127
|
-
instance.state = options.state;
|
|
3128
|
-
if (options.state === 'minimized') {
|
|
3129
|
-
instance.keepContent = true;
|
|
3130
|
-
}
|
|
3131
|
-
}
|
|
3132
|
-
if (options.content instanceof TemplateRef) {
|
|
3133
|
-
instance.contentTemplate = options.content;
|
|
3134
|
-
}
|
|
3135
|
-
if (options.titleBarContent instanceof TemplateRef) {
|
|
3136
|
-
instance.titleBarTemplate = options.titleBarContent;
|
|
3137
|
-
}
|
|
3138
|
-
};
|
|
3139
|
-
WindowService.prototype.contentFrom = function (content, container, windowRef) {
|
|
3140
|
-
var renderer = container.injector.get(Renderer2);
|
|
3141
|
-
var nodes = [];
|
|
3142
|
-
var componentRef = null;
|
|
3143
|
-
if (typeof content === 'string') {
|
|
3144
|
-
nodes = [renderer.createText(content)];
|
|
3145
|
-
}
|
|
3146
|
-
else if (content && !(content instanceof TemplateRef)) {
|
|
3147
|
-
var injector = new WindowInjector(function () { return windowRef; }, container.injector);
|
|
3148
|
-
var factory = this.resolver.resolveComponentFactory(content);
|
|
3149
|
-
componentRef = container.createComponent(factory, undefined, injector);
|
|
3150
|
-
nodes = [componentRef.location.nativeElement];
|
|
3151
|
-
windowRef.content = componentRef;
|
|
3152
|
-
}
|
|
3153
|
-
return {
|
|
3154
|
-
componentRef: componentRef,
|
|
3155
|
-
nodes: [
|
|
3156
|
-
[],
|
|
3157
|
-
nodes // Content
|
|
3158
|
-
]
|
|
3159
|
-
};
|
|
3160
|
-
};
|
|
3161
|
-
WindowService = __decorate([
|
|
3162
|
-
Injectable(),
|
|
3163
|
-
__param(1, Inject(WindowContainerService)),
|
|
3164
|
-
__metadata("design:paramtypes", [ComponentFactoryResolver,
|
|
3165
|
-
WindowContainerService])
|
|
3166
|
-
], WindowService);
|
|
3167
|
-
return WindowService;
|
|
3168
|
-
}());
|
|
3169
|
-
|
|
3170
|
-
/**
|
|
3171
|
-
* Provides an insertion point for the Dialogs which are created through the
|
|
3172
|
-
* Dialog service ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
|
|
3173
|
-
* Created Dialogs will be mounted after that element.
|
|
3174
|
-
*
|
|
3175
|
-
* @example
|
|
3176
|
-
* ```html-no-run
|
|
3177
|
-
* <div kendoDialogContainer></div>
|
|
3178
|
-
* ```
|
|
3179
|
-
*/
|
|
3180
|
-
var DialogContainerDirective = /** @class */ (function () {
|
|
3181
|
-
function DialogContainerDirective(container, service) {
|
|
3182
|
-
service.container = container;
|
|
3183
|
-
}
|
|
3184
|
-
DialogContainerDirective = __decorate([
|
|
3185
|
-
Directive({
|
|
3186
|
-
selector: '[kendoDialogContainer]'
|
|
3187
|
-
}),
|
|
3188
|
-
__metadata("design:paramtypes", [ViewContainerRef,
|
|
3189
|
-
DialogContainerService])
|
|
3190
|
-
], DialogContainerDirective);
|
|
3191
|
-
return DialogContainerDirective;
|
|
3192
|
-
}());
|
|
3193
|
-
|
|
3194
|
-
/**
|
|
3195
|
-
* @hidden
|
|
3196
|
-
*/
|
|
3197
|
-
var Messages = /** @class */ (function (_super) {
|
|
3198
|
-
__extends(Messages, _super);
|
|
3199
|
-
function Messages() {
|
|
3200
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
3201
|
-
}
|
|
3202
|
-
__decorate([
|
|
3203
|
-
Input(),
|
|
3204
|
-
__metadata("design:type", String)
|
|
3205
|
-
], Messages.prototype, "closeTitle", void 0);
|
|
3206
|
-
__decorate([
|
|
3207
|
-
Input(),
|
|
3208
|
-
__metadata("design:type", String)
|
|
3209
|
-
], Messages.prototype, "restoreTitle", void 0);
|
|
3210
|
-
__decorate([
|
|
3211
|
-
Input(),
|
|
3212
|
-
__metadata("design:type", String)
|
|
3213
|
-
], Messages.prototype, "maximizeTitle", void 0);
|
|
3214
|
-
__decorate([
|
|
3215
|
-
Input(),
|
|
3216
|
-
__metadata("design:type", String)
|
|
3217
|
-
], Messages.prototype, "minimizeTitle", void 0);
|
|
3218
|
-
return Messages;
|
|
3219
|
-
}(ComponentMessages));
|
|
3220
|
-
|
|
3221
|
-
/**
|
|
3222
|
-
* @hidden
|
|
3223
|
-
*/
|
|
3224
|
-
var LocalizedMessagesDirective = /** @class */ (function (_super) {
|
|
3225
|
-
__extends(LocalizedMessagesDirective, _super);
|
|
3226
|
-
function LocalizedMessagesDirective(service) {
|
|
3227
|
-
var _this = _super.call(this) || this;
|
|
3228
|
-
_this.service = service;
|
|
3229
|
-
return _this;
|
|
3230
|
-
}
|
|
3231
|
-
LocalizedMessagesDirective_1 = LocalizedMessagesDirective;
|
|
3232
|
-
var LocalizedMessagesDirective_1;
|
|
3233
|
-
LocalizedMessagesDirective = LocalizedMessagesDirective_1 = __decorate([
|
|
3234
|
-
Directive({
|
|
3235
|
-
providers: [
|
|
3236
|
-
{
|
|
3237
|
-
provide: Messages,
|
|
3238
|
-
useExisting: forwardRef(function () { return LocalizedMessagesDirective_1; })
|
|
3239
|
-
}
|
|
3240
|
-
],
|
|
3241
|
-
selector: "\n [kendoDialogLocalizedMessages],\n [kendoWindowLocalizedMessages],\n [kendoDialogTitleBarLocalizedMessages]\n "
|
|
3242
|
-
}),
|
|
3243
|
-
__metadata("design:paramtypes", [LocalizationService])
|
|
3244
|
-
], LocalizedMessagesDirective);
|
|
3245
|
-
return LocalizedMessagesDirective;
|
|
3246
|
-
}(Messages));
|
|
3247
|
-
|
|
3248
|
-
/**
|
|
3249
|
-
* Custom component messages override default component messages
|
|
3250
|
-
* ([see example]({% slug globalization_dialogs %}#toc-localization)).
|
|
3251
|
-
*/
|
|
3252
|
-
var CustomMessagesComponent = /** @class */ (function (_super) {
|
|
3253
|
-
__extends(CustomMessagesComponent, _super);
|
|
3254
|
-
function CustomMessagesComponent(service) {
|
|
3255
|
-
var _this = _super.call(this) || this;
|
|
3256
|
-
_this.service = service;
|
|
3257
|
-
return _this;
|
|
3258
|
-
}
|
|
3259
|
-
CustomMessagesComponent_1 = CustomMessagesComponent;
|
|
3260
|
-
Object.defineProperty(CustomMessagesComponent.prototype, "override", {
|
|
3261
|
-
get: function () {
|
|
3262
|
-
return true;
|
|
3263
|
-
},
|
|
3264
|
-
enumerable: true,
|
|
3265
|
-
configurable: true
|
|
3266
|
-
});
|
|
3267
|
-
var CustomMessagesComponent_1;
|
|
3268
|
-
CustomMessagesComponent = CustomMessagesComponent_1 = __decorate([
|
|
3269
|
-
Component({
|
|
3270
|
-
providers: [
|
|
3271
|
-
{
|
|
3272
|
-
provide: Messages,
|
|
3273
|
-
useExisting: forwardRef(function () { return CustomMessagesComponent_1; }) // tslint:disable-line:no-forward-ref
|
|
3274
|
-
}
|
|
3275
|
-
],
|
|
3276
|
-
selector: 'kendo-dialog-messages, kendo-window-messages',
|
|
3277
|
-
template: ""
|
|
3278
|
-
}),
|
|
3279
|
-
__metadata("design:paramtypes", [LocalizationService])
|
|
3280
|
-
], CustomMessagesComponent);
|
|
3281
|
-
return CustomMessagesComponent;
|
|
3282
|
-
}(Messages));
|
|
3283
|
-
|
|
3284
|
-
/**
|
|
3285
|
-
* @hidden
|
|
3286
|
-
*/
|
|
3287
|
-
var SHARED_DIRECTIVES = [
|
|
3288
|
-
DialogActionsComponent,
|
|
3289
|
-
CustomMessagesComponent,
|
|
3290
|
-
LocalizedMessagesDirective
|
|
3291
|
-
];
|
|
3292
|
-
/**
|
|
3293
|
-
* @hidden
|
|
3294
|
-
*/
|
|
3295
|
-
var SharedModule = /** @class */ (function () {
|
|
3296
|
-
function SharedModule() {
|
|
3297
|
-
}
|
|
3298
|
-
SharedModule = __decorate([
|
|
3299
|
-
NgModule({
|
|
3300
|
-
declarations: [SHARED_DIRECTIVES],
|
|
3301
|
-
exports: [SHARED_DIRECTIVES, CommonModule],
|
|
3302
|
-
imports: [CommonModule]
|
|
3303
|
-
})
|
|
3304
|
-
], SharedModule);
|
|
3305
|
-
return SharedModule;
|
|
3306
|
-
}());
|
|
3307
|
-
|
|
3308
|
-
/**
|
|
3309
|
-
* @hidden
|
|
3310
|
-
*/
|
|
3311
|
-
var DIALOG_DIRECTIVES = [
|
|
3312
|
-
DialogComponent,
|
|
3313
|
-
DialogTitleBarComponent
|
|
3314
|
-
];
|
|
3315
|
-
/**
|
|
3316
|
-
* Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
|
|
3317
|
-
* definition for the Dialog component that includes all Dialog components and directives.
|
|
3318
|
-
* Imports `DialogModule` into the [root module]({{ site.data.urls.angular['ngmodules'] }}#angular-modularity)
|
|
3319
|
-
* of your application or into any other sub-module that will use the Dialog component.
|
|
3320
|
-
*
|
|
3321
|
-
* @example
|
|
3322
|
-
* ```ts-no-run
|
|
3323
|
-
* import { NgModule } from '@angular/core';
|
|
3324
|
-
* import { BrowserModule } from '@angular/platform-browser';
|
|
3325
|
-
* import { DialogModule } from '@progress/kendo-angular-dialog';
|
|
3326
|
-
* import { AppComponent } from './app.component';
|
|
3327
|
-
*
|
|
3328
|
-
* _@NgModule({
|
|
3329
|
-
* bootstrap: [AppComponent],
|
|
3330
|
-
* declarations: [AppComponent],
|
|
3331
|
-
* imports: [BrowserModule, DialogModule]
|
|
3332
|
-
* })
|
|
3333
|
-
* export class AppModule {
|
|
3334
|
-
* }
|
|
3335
|
-
* ```
|
|
3336
|
-
*/
|
|
3337
|
-
var DialogModule = /** @class */ (function () {
|
|
3338
|
-
function DialogModule() {
|
|
3339
|
-
}
|
|
3340
|
-
DialogModule = __decorate([
|
|
3341
|
-
NgModule({
|
|
3342
|
-
declarations: [DIALOG_DIRECTIVES, DialogContainerDirective],
|
|
3343
|
-
entryComponents: [DIALOG_DIRECTIVES],
|
|
3344
|
-
exports: [DIALOG_DIRECTIVES, SHARED_DIRECTIVES, DialogContainerDirective],
|
|
3345
|
-
imports: [SharedModule],
|
|
3346
|
-
providers: [DialogContainerService, DialogService]
|
|
3347
|
-
})
|
|
3348
|
-
], DialogModule);
|
|
3349
|
-
return DialogModule;
|
|
3350
|
-
}());
|
|
3351
|
-
|
|
3352
|
-
/**
|
|
3353
|
-
* Provides an insertion point for the Windows which are created through the
|
|
3354
|
-
* Window service ([see example]({% slug api_dialog_windowservice %}#toc-open)).
|
|
3355
|
-
* Created Windows will be mounted after that element.
|
|
3356
|
-
*
|
|
3357
|
-
* @example
|
|
3358
|
-
* ```html-no-run
|
|
3359
|
-
* <div kendoWindowContainer></div>
|
|
3360
|
-
* ```
|
|
3361
|
-
*/
|
|
3362
|
-
var WindowContainerDirective = /** @class */ (function () {
|
|
3363
|
-
function WindowContainerDirective(container, service) {
|
|
3364
|
-
service.container = container;
|
|
3365
|
-
}
|
|
3366
|
-
WindowContainerDirective = __decorate([
|
|
3367
|
-
Directive({
|
|
3368
|
-
selector: '[kendoWindowContainer]'
|
|
3369
|
-
}),
|
|
3370
|
-
__metadata("design:paramtypes", [ViewContainerRef,
|
|
3371
|
-
WindowContainerService])
|
|
3372
|
-
], WindowContainerDirective);
|
|
3373
|
-
return WindowContainerDirective;
|
|
3374
|
-
}());
|
|
3375
|
-
|
|
3376
|
-
var WINDOW_DIRECTIVES = [
|
|
3377
|
-
ResizeHandleDirective,
|
|
3378
|
-
WindowComponent,
|
|
3379
|
-
WindowTitleBarComponent,
|
|
3380
|
-
WindowCloseActionDirective,
|
|
3381
|
-
WindowMinimizeActionDirective,
|
|
3382
|
-
WindowMaximizeActionDirective,
|
|
3383
|
-
WindowRestoreActionDirective
|
|
3384
|
-
];
|
|
3385
|
-
var ENTRY_COMPONENTS = [
|
|
3386
|
-
WindowComponent,
|
|
3387
|
-
WindowTitleBarComponent
|
|
3388
|
-
];
|
|
3389
|
-
var exportedModules = [
|
|
3390
|
-
WindowComponent,
|
|
3391
|
-
WindowCloseActionDirective,
|
|
3392
|
-
WindowMinimizeActionDirective,
|
|
3393
|
-
WindowMaximizeActionDirective,
|
|
3394
|
-
WindowRestoreActionDirective,
|
|
3395
|
-
WindowTitleBarComponent
|
|
3396
|
-
];
|
|
3397
|
-
/**
|
|
3398
|
-
* Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
|
|
3399
|
-
* definition for the Window component. Imports `WindowModule` into the
|
|
3400
|
-
* [root module]({{ site.data.urls.angular['ngmodules'] }}#angular-modularity)
|
|
3401
|
-
* of your application or into any other sub-module that will use the Window component.
|
|
3402
|
-
*
|
|
3403
|
-
* @example
|
|
3404
|
-
* ```ts-no-run
|
|
3405
|
-
* import { NgModule } from '@angular/core';
|
|
3406
|
-
* import { BrowserModule } from '@angular/platform-browser';
|
|
3407
|
-
* import { WindowModule } from '@progress/kendo-angular-window';
|
|
3408
|
-
* import { AppComponent } from './app.component';
|
|
3409
|
-
*
|
|
3410
|
-
* _@NgModule({
|
|
3411
|
-
* bootstrap: [AppComponent],
|
|
3412
|
-
* declarations: [AppComponent],
|
|
3413
|
-
* imports: [BrowserModule, WindowModule]
|
|
3414
|
-
* })
|
|
3415
|
-
* export class AppModule {
|
|
3416
|
-
* }
|
|
3417
|
-
* ```
|
|
3418
|
-
*/
|
|
3419
|
-
var WindowModule = /** @class */ (function () {
|
|
3420
|
-
function WindowModule() {
|
|
3421
|
-
}
|
|
3422
|
-
WindowModule = __decorate([
|
|
3423
|
-
NgModule({
|
|
3424
|
-
declarations: [WINDOW_DIRECTIVES, WindowContainerDirective],
|
|
3425
|
-
entryComponents: [ENTRY_COMPONENTS],
|
|
3426
|
-
exports: [exportedModules, SHARED_DIRECTIVES, WindowContainerDirective],
|
|
3427
|
-
imports: [SharedModule, DraggableModule],
|
|
3428
|
-
providers: [WindowContainerService, WindowService]
|
|
3429
|
-
})
|
|
3430
|
-
], WindowModule);
|
|
3431
|
-
return WindowModule;
|
|
3432
|
-
}());
|
|
3433
|
-
|
|
3434
|
-
/**
|
|
3435
|
-
* Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }})
|
|
3436
|
-
* definition for the Dialogs components.
|
|
3437
|
-
*
|
|
3438
|
-
* @example
|
|
3439
|
-
*
|
|
3440
|
-
* ```ts-no-run
|
|
3441
|
-
* import { DialogsModule } from '@progress/kendo-angular-dialog';
|
|
3442
|
-
*
|
|
3443
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
3444
|
-
* import { NgModule } from '@angular/core';
|
|
3445
|
-
*
|
|
3446
|
-
* import { AppComponent } from './app.component';
|
|
3447
|
-
*
|
|
3448
|
-
* _@NgModule({
|
|
3449
|
-
* declarations: [AppComponent],
|
|
3450
|
-
* imports: [BrowserModule, DialogsModule],
|
|
3451
|
-
* bootstrap: [AppComponent]
|
|
3452
|
-
* })
|
|
3453
|
-
* export class AppModule {}
|
|
3454
|
-
*
|
|
3455
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
3456
|
-
*
|
|
3457
|
-
* ```
|
|
3458
|
-
*/
|
|
3459
|
-
var DialogsModule = /** @class */ (function () {
|
|
3460
|
-
function DialogsModule() {
|
|
3461
|
-
}
|
|
3462
|
-
DialogsModule = __decorate([
|
|
3463
|
-
NgModule({
|
|
3464
|
-
exports: [DialogModule, WindowModule]
|
|
3465
|
-
})
|
|
3466
|
-
], DialogsModule);
|
|
3467
|
-
return DialogsModule;
|
|
3468
|
-
}());
|
|
3469
|
-
|
|
3470
|
-
/**
|
|
3471
|
-
* Generated bundle index. Do not edit.
|
|
3472
|
-
*/
|
|
3473
|
-
|
|
3474
|
-
export { DIALOG_DIRECTIVES, DialogContainerDirective, DialogContainerService, CustomMessagesComponent, DIALOG_LOCALIZATION_SERVICE, LocalizedMessagesDirective, Messages, TitleBarLocalizationService, SHARED_DIRECTIVES, SharedModule, DragResizeService, NavigationService, WindowContainerDirective, WindowContainerService, ResizeHandleDirective, DialogComponent, DialogTitleBarComponent, DialogContentBase, DialogActionsComponent, DialogService, DialogCloseResult, DialogRef, DialogSettings, DialogAction, WindowComponent, WindowTitleBarComponent, WindowMaximizeActionDirective, WindowMinimizeActionDirective, WindowCloseActionDirective, WindowRestoreActionDirective, WindowSettings, WindowRef, WindowCloseResult, WindowService, DialogModule, WindowModule, DialogsModule };
|