@progress/kendo-angular-dialog 21.4.1-develop.1 → 22.0.0-develop.1
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/dialog/dialog-content-base.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-dialog.mjs +84 -84
- package/localization/messages.d.ts +1 -1
- package/package.json +11 -19
- package/schematics/ngAdd/index.js +1 -1
- package/esm2022/common/actions-layout.mjs +0 -5
- package/esm2022/common/animation-types.mjs +0 -5
- package/esm2022/common/dialog-animation-direction.mjs +0 -5
- package/esm2022/common/preventable-event.mjs +0 -30
- package/esm2022/common/util.mjs +0 -167
- package/esm2022/dialog/dialog-actions.component.mjs +0 -182
- package/esm2022/dialog/dialog-animations/animate-content.mjs +0 -19
- package/esm2022/dialog/dialog-animations/animations.mjs +0 -69
- package/esm2022/dialog/dialog-animations/create-animation-player.mjs +0 -18
- package/esm2022/dialog/dialog-container.directive.mjs +0 -31
- package/esm2022/dialog/dialog-container.service.mjs +0 -26
- package/esm2022/dialog/dialog-content-base.mjs +0 -57
- package/esm2022/dialog/dialog-titlebar.component.mjs +0 -170
- package/esm2022/dialog/dialog.component.mjs +0 -650
- package/esm2022/dialog/dialog.service.mjs +0 -210
- package/esm2022/dialog/models/dialog-action-divider.mjs +0 -5
- package/esm2022/dialog/models/dialog-action.mjs +0 -40
- package/esm2022/dialog/models/dialog-animation.mjs +0 -5
- package/esm2022/dialog/models/dialog-close-result.mjs +0 -12
- package/esm2022/dialog/models/dialog-ref.mjs +0 -39
- package/esm2022/dialog/models/dialog-result.mjs +0 -5
- package/esm2022/dialog/models/dialog-settings.mjs +0 -95
- package/esm2022/dialog/models/index.mjs +0 -12
- package/esm2022/dialog/models/theme-color.mjs +0 -5
- package/esm2022/dialog.module.mjs +0 -49
- package/esm2022/dialogs.module.mjs +0 -59
- package/esm2022/directives.mjs +0 -95
- package/esm2022/index.mjs +0 -33
- package/esm2022/localization/custom-messages.component.mjs +0 -65
- package/esm2022/localization/dialog-localization.service.mjs +0 -9
- package/esm2022/localization/localized-messages.directive.mjs +0 -43
- package/esm2022/localization/messages.mjs +0 -45
- package/esm2022/localization/titlebar-localization.service.mjs +0 -45
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-dialog.mjs +0 -8
- package/esm2022/window/actions/window-close-action.directive.mjs +0 -119
- package/esm2022/window/actions/window-maximize-action.directive.mjs +0 -125
- package/esm2022/window/actions/window-minimize-action.directive.mjs +0 -125
- package/esm2022/window/actions/window-restore-action.directive.mjs +0 -125
- package/esm2022/window/drag-resize.service.mjs +0 -335
- package/esm2022/window/models/index.mjs +0 -11
- package/esm2022/window/models/theme-color.mjs +0 -5
- package/esm2022/window/models/window-close-result.mjs +0 -10
- package/esm2022/window/models/window-messages.mjs +0 -5
- package/esm2022/window/models/window-options.mjs +0 -5
- package/esm2022/window/models/window-ref.mjs +0 -25
- package/esm2022/window/models/window-settings.mjs +0 -92
- package/esm2022/window/models/window-types.mjs +0 -5
- package/esm2022/window/navigation.service.mjs +0 -160
- package/esm2022/window/window-container.directive.mjs +0 -31
- package/esm2022/window/window-container.service.mjs +0 -26
- package/esm2022/window/window-events.mjs +0 -5
- package/esm2022/window/window-resize-handle.directive.mjs +0 -74
- package/esm2022/window/window-titlebar.component.mjs +0 -173
- package/esm2022/window/window.component.mjs +0 -831
- package/esm2022/window/window.service.mjs +0 -206
- package/esm2022/window.module.mjs +0 -53
|
@@ -1,650 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, EventEmitter, HostBinding, Input, ViewChild, Output, ElementRef, Renderer2, ChangeDetectorRef, NgZone, ContentChildren, QueryList, ViewChildren } from '@angular/core';
|
|
6
|
-
import { NgStyle, NgTemplateOutlet } from '@angular/common';
|
|
7
|
-
import { animate, AnimationBuilder, state, style, transition, trigger } from '@angular/animations';
|
|
8
|
-
import { DialogActionsComponent } from './dialog-actions.component';
|
|
9
|
-
import { DialogTitleBarComponent } from './dialog-titlebar.component';
|
|
10
|
-
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
11
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
12
|
-
import { packageMetadata } from '../package-metadata';
|
|
13
|
-
import { hasClasses, isPresent, isFocusable, DIALOG_ELEMENTS_HANDLING_ARROWS, DIALOG_ELEMENTS_HANDLING_ESC_KEY, createValueWithUnit, parseCSSClassNames, findPrimaryButton } from '../common/util';
|
|
14
|
-
import { focusableSelector, shouldShowValidationUI, getLicenseMessage, setHTMLAttributes, Keys, normalizeKeys } from '@progress/kendo-angular-common';
|
|
15
|
-
import { DialogCloseResult } from './models/dialog-close-result';
|
|
16
|
-
import { DIALOG_LOCALIZATION_SERVICE } from './../localization/dialog-localization.service';
|
|
17
|
-
import { take } from 'rxjs/operators';
|
|
18
|
-
import { Subscription } from 'rxjs';
|
|
19
|
-
import { animateContent } from './dialog-animations/animate-content';
|
|
20
|
-
import { isDocumentAvailable, WatermarkOverlayComponent } from '@progress/kendo-angular-common';
|
|
21
|
-
import { LocalizedMessagesDirective } from '../localization/localized-messages.directive';
|
|
22
|
-
import * as i0 from "@angular/core";
|
|
23
|
-
import * as i1 from "@progress/kendo-angular-l10n";
|
|
24
|
-
import * as i2 from "@angular/animations";
|
|
25
|
-
const DEFAULT_ANIMATION_CONFIG = { duration: 300, type: 'translate' };
|
|
26
|
-
/**
|
|
27
|
-
* Represents the [Kendo UI Dialog component for Angular]({% slug overview_dialog_dialogs %}).
|
|
28
|
-
*
|
|
29
|
-
* Use this component to display modal dialog windows in your application.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```ts
|
|
33
|
-
* import { Component } from '@angular/core';
|
|
34
|
-
*
|
|
35
|
-
* @Component({
|
|
36
|
-
* selector: 'my-app',
|
|
37
|
-
* template: `
|
|
38
|
-
* <kendo-dialog title="Example Dialog">
|
|
39
|
-
* <p>Dialog content goes here.</p>
|
|
40
|
-
* </kendo-dialog>
|
|
41
|
-
* `
|
|
42
|
-
* })
|
|
43
|
-
* export class AppComponent {}
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* @remarks
|
|
47
|
-
* Supported children components are: {@link DialogTitleBarComponent}, {@link DialogActionsComponent}, {@link CustomMessagesComponent}.
|
|
48
|
-
*/
|
|
49
|
-
export class DialogComponent {
|
|
50
|
-
wrapper;
|
|
51
|
-
renderer;
|
|
52
|
-
cdr;
|
|
53
|
-
ngZone;
|
|
54
|
-
builder;
|
|
55
|
-
/**
|
|
56
|
-
* Specifies the action buttons to render in the Dialog.
|
|
57
|
-
*
|
|
58
|
-
* @type {DialogAction[]}
|
|
59
|
-
*/
|
|
60
|
-
actions;
|
|
61
|
-
/**
|
|
62
|
-
* Sets the layout of the action buttons in the Dialog. Applies only if you specify action buttons through the `actions` option.
|
|
63
|
-
*
|
|
64
|
-
* @type {ActionsLayout}
|
|
65
|
-
* @default 'stretched'
|
|
66
|
-
*/
|
|
67
|
-
actionsLayout = 'stretched';
|
|
68
|
-
/**
|
|
69
|
-
* Sets the query selector for the element to receive initial focus. ([See examples.]({% slug initial_focus_dialog %}))
|
|
70
|
-
*
|
|
71
|
-
* @type {string}
|
|
72
|
-
*/
|
|
73
|
-
autoFocusedElement;
|
|
74
|
-
/**
|
|
75
|
-
* Sets the text in the Dialog title bar.
|
|
76
|
-
*
|
|
77
|
-
* @type {string}
|
|
78
|
-
*/
|
|
79
|
-
title;
|
|
80
|
-
/**
|
|
81
|
-
* Sets the width of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
|
82
|
-
*
|
|
83
|
-
* @type {number | string}
|
|
84
|
-
*/
|
|
85
|
-
width;
|
|
86
|
-
/**
|
|
87
|
-
* Sets the minimum width of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
|
88
|
-
*
|
|
89
|
-
* @type {number | string}
|
|
90
|
-
*/
|
|
91
|
-
minWidth;
|
|
92
|
-
/**
|
|
93
|
-
* Sets the maximum width of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
|
94
|
-
*
|
|
95
|
-
* @type {number | string}
|
|
96
|
-
*/
|
|
97
|
-
maxWidth;
|
|
98
|
-
/**
|
|
99
|
-
* Sets the height of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
|
100
|
-
*
|
|
101
|
-
* @type {number | string}
|
|
102
|
-
*/
|
|
103
|
-
height;
|
|
104
|
-
/**
|
|
105
|
-
* Sets the minimum height of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
|
106
|
-
*
|
|
107
|
-
* @type {number | string}
|
|
108
|
-
*/
|
|
109
|
-
minHeight;
|
|
110
|
-
/**
|
|
111
|
-
* Sets the maximum height of the Dialog. Use a number for pixels or a string for units (for example, `50%`).
|
|
112
|
-
*
|
|
113
|
-
* @type {number | string}
|
|
114
|
-
*/
|
|
115
|
-
maxHeight;
|
|
116
|
-
/**
|
|
117
|
-
* Configures the Dialog opening animation ([see example]({% slug animations_dialog %})).
|
|
118
|
-
* The default animation type is `translate` and the duration is `300ms`.
|
|
119
|
-
*
|
|
120
|
-
* @type {boolean | DialogAnimation}
|
|
121
|
-
* @default true
|
|
122
|
-
*/
|
|
123
|
-
animation = true;
|
|
124
|
-
/**
|
|
125
|
-
* Sets a predefined theme color for the Dialog. The color applies to the title bar background and border, and updates the text color.
|
|
126
|
-
*
|
|
127
|
-
* @type {DialogThemeColor}
|
|
128
|
-
*/
|
|
129
|
-
set themeColor(themeColor) {
|
|
130
|
-
this.handleThemeColorClass(this.themeColor, themeColor);
|
|
131
|
-
this._themeColor = themeColor;
|
|
132
|
-
}
|
|
133
|
-
get themeColor() {
|
|
134
|
-
return this._themeColor;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* @hidden
|
|
138
|
-
*/
|
|
139
|
-
set htmlAttributes(attributes) {
|
|
140
|
-
setHTMLAttributes(attributes, this.renderer, this.wrapper.nativeElement);
|
|
141
|
-
const el = this.wrapper.nativeElement;
|
|
142
|
-
const dir = el.getAttribute('dir');
|
|
143
|
-
const tIndex = el.getAttribute('tabindex');
|
|
144
|
-
if (this.direction !== dir && dir) {
|
|
145
|
-
this.direction = dir;
|
|
146
|
-
}
|
|
147
|
-
if (this.tabIndex !== tIndex && tIndex) {
|
|
148
|
-
this.tabIndex = tIndex;
|
|
149
|
-
}
|
|
150
|
-
this._htmlAttributes = attributes;
|
|
151
|
-
}
|
|
152
|
-
get htmlAttributes() {
|
|
153
|
-
return this._htmlAttributes;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* @hidden
|
|
157
|
-
*/
|
|
158
|
-
set cssClass(classes) {
|
|
159
|
-
this.setServiceClasses(this._cssClass, classes);
|
|
160
|
-
this._cssClass = classes;
|
|
161
|
-
}
|
|
162
|
-
get cssClass() {
|
|
163
|
-
return this._cssClass;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* @hidden
|
|
167
|
-
*/
|
|
168
|
-
contentTemplate;
|
|
169
|
-
/**
|
|
170
|
-
* @hidden
|
|
171
|
-
*/
|
|
172
|
-
titleId = null;
|
|
173
|
-
/**
|
|
174
|
-
* @hidden
|
|
175
|
-
*/
|
|
176
|
-
contentId = null;
|
|
177
|
-
/**
|
|
178
|
-
* @hidden
|
|
179
|
-
*/
|
|
180
|
-
closeTitle;
|
|
181
|
-
/**
|
|
182
|
-
* @hidden
|
|
183
|
-
*/
|
|
184
|
-
showLicenseWatermark = false;
|
|
185
|
-
/**
|
|
186
|
-
* @hidden
|
|
187
|
-
*/
|
|
188
|
-
licenseMessage;
|
|
189
|
-
/**
|
|
190
|
-
* Emits when the user clicks an action button in the Dialog. Fires only if you specify action buttons through the `actions` option.
|
|
191
|
-
*
|
|
192
|
-
* @type {EventEmitter<DialogAction>}
|
|
193
|
-
*/
|
|
194
|
-
action = new EventEmitter();
|
|
195
|
-
/**
|
|
196
|
-
* Emits when the user clicks the **Close** button or presses the `ESC` key.
|
|
197
|
-
*
|
|
198
|
-
* @type {EventEmitter<any>}
|
|
199
|
-
*/
|
|
200
|
-
close = new EventEmitter();
|
|
201
|
-
get dir() {
|
|
202
|
-
return this.direction;
|
|
203
|
-
}
|
|
204
|
-
tabIndex = 0;
|
|
205
|
-
titlebarContent;
|
|
206
|
-
titlebarView;
|
|
207
|
-
actionsView;
|
|
208
|
-
dialog;
|
|
209
|
-
_htmlAttributes;
|
|
210
|
-
_cssClass;
|
|
211
|
-
_themeColor = null;
|
|
212
|
-
direction;
|
|
213
|
-
subscriptions = [];
|
|
214
|
-
domSubs = new Subscription();
|
|
215
|
-
constructor(wrapper, renderer, localization, cdr, ngZone, builder) {
|
|
216
|
-
this.wrapper = wrapper;
|
|
217
|
-
this.renderer = renderer;
|
|
218
|
-
this.cdr = cdr;
|
|
219
|
-
this.ngZone = ngZone;
|
|
220
|
-
this.builder = builder;
|
|
221
|
-
const isValid = validatePackage(packageMetadata);
|
|
222
|
-
this.licenseMessage = getLicenseMessage(packageMetadata);
|
|
223
|
-
this.showLicenseWatermark = shouldShowValidationUI(isValid);
|
|
224
|
-
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
225
|
-
this.subscriptions.push(localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr')));
|
|
226
|
-
this.titleId = this.generateTitleId();
|
|
227
|
-
this.contentId = this.generateContentId();
|
|
228
|
-
}
|
|
229
|
-
ngAfterContentInit() {
|
|
230
|
-
this.bubble('close', this.titlebarContent.first);
|
|
231
|
-
this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-describedby', this.contentId);
|
|
232
|
-
if (this.titlebarContent.first) {
|
|
233
|
-
this.titlebarContent.first.id = this.titleId;
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
this.subscriptions.push(this.titlebarContent.changes.subscribe(() => {
|
|
237
|
-
if (isPresent(this.titlebarContent.first)) {
|
|
238
|
-
this.titlebarContent.first.id = this.titleId;
|
|
239
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
240
|
-
this.bubble('close', this.titlebarContent.first);
|
|
241
|
-
this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', this.titleId);
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}));
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
ngAfterViewInit() {
|
|
248
|
-
if (!isDocumentAvailable()) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
252
|
-
this.handleInitialFocus();
|
|
253
|
-
});
|
|
254
|
-
this.bubble('close', this.titlebarView.first);
|
|
255
|
-
this.bubble('action', this.actionsView);
|
|
256
|
-
if (this.titlebarView.first || this.titlebarContent.first) {
|
|
257
|
-
//Needed for Dialogs created via service
|
|
258
|
-
this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', this.titleId);
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
this.subscriptions.push(this.titlebarView.changes.subscribe(() => {
|
|
262
|
-
if (isPresent(this.titlebarView.first)) {
|
|
263
|
-
this.titlebarView.first.id = this.titleId;
|
|
264
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
265
|
-
this.bubble('close', this.titlebarView.first);
|
|
266
|
-
this.renderer.setAttribute(this.wrapper.nativeElement.querySelector('.k-dialog'), 'aria-labelledby', this.titleId);
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
}));
|
|
270
|
-
}
|
|
271
|
-
this.initDomEvents();
|
|
272
|
-
this.handleThemeColorClass(null, this.themeColor);
|
|
273
|
-
}
|
|
274
|
-
ngOnInit() {
|
|
275
|
-
if (this.animation) {
|
|
276
|
-
animateContent(this.animation, DEFAULT_ANIMATION_CONFIG, this.dialog.nativeElement, this.builder);
|
|
277
|
-
}
|
|
278
|
-
this.renderer.removeAttribute(this.wrapper.nativeElement, 'title');
|
|
279
|
-
this.cdr.detectChanges();
|
|
280
|
-
}
|
|
281
|
-
ngOnDestroy() {
|
|
282
|
-
this.subscriptions.forEach(s => s.unsubscribe());
|
|
283
|
-
this.subscriptions = [];
|
|
284
|
-
if (this.domSubs) {
|
|
285
|
-
this.domSubs.unsubscribe();
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Focuses the wrapper of the Dialog component.
|
|
290
|
-
*/
|
|
291
|
-
focus() {
|
|
292
|
-
const wrapper = this.wrapper.nativeElement;
|
|
293
|
-
if (isPresent(wrapper)) {
|
|
294
|
-
wrapper.focus();
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
initDomEvents() {
|
|
298
|
-
if (!this.wrapper) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
this.ngZone.runOutsideAngular(() => {
|
|
302
|
-
this.domSubs.add(this.renderer.listen(this.wrapper.nativeElement, 'keydown', (ev) => {
|
|
303
|
-
this.onKeyDown(ev);
|
|
304
|
-
}));
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
onKeyDown(event) {
|
|
308
|
-
const target = event.target;
|
|
309
|
-
const parent = target.parentElement;
|
|
310
|
-
const code = normalizeKeys(event);
|
|
311
|
-
if (hasClasses(target, DIALOG_ELEMENTS_HANDLING_ESC_KEY) || hasClasses(parent, DIALOG_ELEMENTS_HANDLING_ESC_KEY)) {
|
|
312
|
-
if (code === Keys.Escape) {
|
|
313
|
-
this.ngZone.run(() => {
|
|
314
|
-
this.close.emit(new DialogCloseResult());
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
if (hasClasses(target, 'k-button') && hasClasses(parent, DIALOG_ELEMENTS_HANDLING_ARROWS) &&
|
|
319
|
-
(code === Keys.ArrowLeft || code === Keys.ArrowRight)) {
|
|
320
|
-
this.ngZone.run(() => {
|
|
321
|
-
this.handleActionButtonFocus(parent, code);
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
if (code === Keys.Tab) {
|
|
325
|
-
this.ngZone.run(() => {
|
|
326
|
-
this.keepFocusWithinComponent(target, event);
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
setServiceClasses(prevValue, value) {
|
|
331
|
-
const el = this.wrapper.nativeElement;
|
|
332
|
-
if (prevValue) {
|
|
333
|
-
parseCSSClassNames(prevValue).forEach(className => {
|
|
334
|
-
this.renderer.removeClass(el, className);
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
if (value) {
|
|
338
|
-
parseCSSClassNames(value).forEach(className => {
|
|
339
|
-
this.renderer.addClass(el, className);
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* @hidden
|
|
345
|
-
*/
|
|
346
|
-
handleInitialFocus() {
|
|
347
|
-
const wrapper = this.wrapper.nativeElement;
|
|
348
|
-
const primaryButton = this.findPrimary(wrapper);
|
|
349
|
-
if (this.autoFocusedElement) {
|
|
350
|
-
const initiallyFocusedElement = wrapper.querySelector(this.autoFocusedElement);
|
|
351
|
-
if (initiallyFocusedElement) {
|
|
352
|
-
initiallyFocusedElement.focus();
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
else if (this.shouldFocusPrimary(primaryButton)) {
|
|
356
|
-
primaryButton.focus();
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
wrapper.focus();
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* @hidden
|
|
364
|
-
*/
|
|
365
|
-
findPrimary(wrapper) {
|
|
366
|
-
const actionBtns = wrapper.querySelectorAll('.k-actions .k-button');
|
|
367
|
-
return findPrimaryButton(actionBtns);
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* @hidden
|
|
371
|
-
*/
|
|
372
|
-
handleActionButtonFocus(parent, key) {
|
|
373
|
-
const focusableActionButtons = this.getAllFocusableChildren(parent);
|
|
374
|
-
for (let i = 0; i < focusableActionButtons.length; i++) {
|
|
375
|
-
const current = focusableActionButtons[i];
|
|
376
|
-
if (current === document.activeElement) {
|
|
377
|
-
if (key === Keys.ArrowLeft && i > 0) {
|
|
378
|
-
focusableActionButtons[i - 1].focus();
|
|
379
|
-
break;
|
|
380
|
-
}
|
|
381
|
-
if (key === Keys.ArrowRight && i < focusableActionButtons.length - 1) {
|
|
382
|
-
focusableActionButtons[i + 1].focus();
|
|
383
|
-
break;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* @hidden
|
|
390
|
-
*/
|
|
391
|
-
keepFocusWithinComponent(target, event) {
|
|
392
|
-
const wrapper = this.wrapper.nativeElement;
|
|
393
|
-
const [firstFocusable, lastFocusable] = this.getFirstAndLastFocusable(wrapper);
|
|
394
|
-
const tabAfterLastFocusable = !event.shiftKey && target === lastFocusable;
|
|
395
|
-
const shiftTabAfterFirstFocusable = event.shiftKey && target === firstFocusable;
|
|
396
|
-
if (tabAfterLastFocusable) {
|
|
397
|
-
event.preventDefault();
|
|
398
|
-
firstFocusable.focus();
|
|
399
|
-
}
|
|
400
|
-
if (shiftTabAfterFirstFocusable) {
|
|
401
|
-
event.preventDefault();
|
|
402
|
-
lastFocusable.focus();
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
/**
|
|
406
|
-
* @hidden
|
|
407
|
-
*/
|
|
408
|
-
shouldFocusPrimary(el) {
|
|
409
|
-
return isPresent(el) && isFocusable(el);
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* @hidden
|
|
413
|
-
*/
|
|
414
|
-
getAllFocusableChildren(parent) {
|
|
415
|
-
return parent.querySelectorAll(focusableSelector);
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* @hidden
|
|
419
|
-
*/
|
|
420
|
-
getFirstAndLastFocusable(parent) {
|
|
421
|
-
const all = this.getAllFocusableChildren(parent);
|
|
422
|
-
const firstFocusable = all.length > 0 ? all[0] : parent;
|
|
423
|
-
const lastFocusable = all.length > 0 ? all[all.length - 1] : parent;
|
|
424
|
-
return [firstFocusable, lastFocusable];
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* @hidden
|
|
428
|
-
*/
|
|
429
|
-
generateTitleId() {
|
|
430
|
-
return 'kendo-dialog-title-' + Math.ceil(Math.random() * 1000000).toString();
|
|
431
|
-
}
|
|
432
|
-
/**
|
|
433
|
-
* @hidden
|
|
434
|
-
*/
|
|
435
|
-
generateContentId() {
|
|
436
|
-
return 'kendo-dialog-content-' + Math.ceil(Math.random() * 1000000).toString();
|
|
437
|
-
}
|
|
438
|
-
get wrapperClass() {
|
|
439
|
-
return true;
|
|
440
|
-
}
|
|
441
|
-
get styles() {
|
|
442
|
-
const styles = {};
|
|
443
|
-
if (this.width) {
|
|
444
|
-
styles.width = createValueWithUnit(this.width);
|
|
445
|
-
}
|
|
446
|
-
if (this.height) {
|
|
447
|
-
styles.height = createValueWithUnit(this.height);
|
|
448
|
-
}
|
|
449
|
-
if (this.minWidth) {
|
|
450
|
-
styles.minWidth = createValueWithUnit(this.minWidth);
|
|
451
|
-
}
|
|
452
|
-
if (this.maxWidth) {
|
|
453
|
-
styles.maxWidth = createValueWithUnit(this.maxWidth);
|
|
454
|
-
}
|
|
455
|
-
if (this.minHeight) {
|
|
456
|
-
styles.minHeight = createValueWithUnit(this.minHeight);
|
|
457
|
-
}
|
|
458
|
-
if (this.maxHeight) {
|
|
459
|
-
styles.maxHeight = createValueWithUnit(this.maxHeight);
|
|
460
|
-
}
|
|
461
|
-
return styles;
|
|
462
|
-
}
|
|
463
|
-
bubble(eventName, component) {
|
|
464
|
-
if (component) {
|
|
465
|
-
const emit = e => this[eventName].emit(e);
|
|
466
|
-
const s = component[eventName].subscribe(emit);
|
|
467
|
-
this.subscriptions.push(s);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
handleThemeColorClass(previousValue, currentValue) {
|
|
471
|
-
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
|
|
472
|
-
const dialog = this.dialog.nativeElement;
|
|
473
|
-
if (previousValue) {
|
|
474
|
-
const classToRemove = `k-dialog-${previousValue}`;
|
|
475
|
-
this.renderer.removeClass(dialog, classToRemove);
|
|
476
|
-
}
|
|
477
|
-
if (currentValue) {
|
|
478
|
-
const classToAdd = `k-dialog-${currentValue}`;
|
|
479
|
-
this.renderer.addClass(dialog, classToAdd);
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DialogComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i2.AnimationBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
484
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DialogComponent, isStandalone: true, selector: "kendo-dialog", inputs: { actions: "actions", actionsLayout: "actionsLayout", autoFocusedElement: "autoFocusedElement", title: "title", width: "width", minWidth: "minWidth", maxWidth: "maxWidth", height: "height", minHeight: "minHeight", maxHeight: "maxHeight", animation: "animation", themeColor: "themeColor" }, outputs: { action: "action", close: "close" }, host: { properties: { "attr.dir": "this.dir", "attr.tabIndex": "this.tabIndex", "class.k-dialog-wrapper": "this.wrapperClass" } }, providers: [
|
|
485
|
-
LocalizationService,
|
|
486
|
-
{
|
|
487
|
-
provide: DIALOG_LOCALIZATION_SERVICE,
|
|
488
|
-
useExisting: LocalizationService
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
provide: L10N_PREFIX,
|
|
492
|
-
useValue: 'kendo.dialog'
|
|
493
|
-
}
|
|
494
|
-
], queries: [{ propertyName: "titlebarContent", predicate: DialogTitleBarComponent }], viewQueries: [{ propertyName: "actionsView", first: true, predicate: DialogActionsComponent, descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true, static: true }, { propertyName: "titlebarView", predicate: DialogTitleBarComponent, descendants: true }], exportAs: ["kendoDialog"], ngImport: i0, template: `
|
|
495
|
-
<ng-container
|
|
496
|
-
kendoDialogLocalizedMessages
|
|
497
|
-
i18n-closeTitle="kendo.dialog.closeTitle|The title of the close button"
|
|
498
|
-
closeTitle="Close"
|
|
499
|
-
>
|
|
500
|
-
<div class="k-overlay" @overlayAppear></div>
|
|
501
|
-
|
|
502
|
-
<div #dialog class="k-window k-dialog" role="dialog" aria-modal="true" [ngStyle]="styles">
|
|
503
|
-
@if (title) {
|
|
504
|
-
<kendo-dialog-titlebar [closeTitle]="closeTitle" [id]="titleId">{{ title }}</kendo-dialog-titlebar>
|
|
505
|
-
}
|
|
506
|
-
@if (!title) {
|
|
507
|
-
<ng-content select="kendo-dialog-titlebar"></ng-content>
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
<div [id]="contentId" class="k-window-content k-dialog-content">
|
|
511
|
-
@if (!contentTemplate) {
|
|
512
|
-
<ng-content></ng-content>
|
|
513
|
-
}
|
|
514
|
-
@if (contentTemplate) {
|
|
515
|
-
<ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
|
|
516
|
-
}
|
|
517
|
-
</div>
|
|
518
|
-
|
|
519
|
-
@if (!actions) {
|
|
520
|
-
<ng-content select="kendo-dialog-actions"></ng-content>
|
|
521
|
-
}
|
|
522
|
-
@if (actions) {
|
|
523
|
-
<kendo-dialog-actions [actions]="actions" [layout]="actionsLayout"> </kendo-dialog-actions>
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
@if (showLicenseWatermark) {
|
|
527
|
-
<div kendoWatermarkOverlay [licenseMessage]="licenseMessage"></div>
|
|
528
|
-
}
|
|
529
|
-
</div>
|
|
530
|
-
</ng-container>
|
|
531
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "\n [kendoDialogLocalizedMessages],\n [kendoWindowLocalizedMessages],\n [kendoDialogTitleBarLocalizedMessages]\n " }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: DialogTitleBarComponent, selector: "kendo-dialog-titlebar", inputs: ["id", "closeTitle"], outputs: ["close"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }, { kind: "component", type: WatermarkOverlayComponent, selector: "div[kendoWatermarkOverlay]", inputs: ["licenseMessage"] }], animations: [
|
|
532
|
-
trigger('overlayAppear', [
|
|
533
|
-
state('in', style({ opacity: 1 })),
|
|
534
|
-
transition('void => *', [style({ opacity: 0.1 }), animate('.3s cubic-bezier(.2, .6, .4, 1)')])
|
|
535
|
-
])
|
|
536
|
-
] });
|
|
537
|
-
}
|
|
538
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DialogComponent, decorators: [{
|
|
539
|
-
type: Component,
|
|
540
|
-
args: [{
|
|
541
|
-
animations: [
|
|
542
|
-
trigger('overlayAppear', [
|
|
543
|
-
state('in', style({ opacity: 1 })),
|
|
544
|
-
transition('void => *', [style({ opacity: 0.1 }), animate('.3s cubic-bezier(.2, .6, .4, 1)')])
|
|
545
|
-
])
|
|
546
|
-
],
|
|
547
|
-
exportAs: 'kendoDialog',
|
|
548
|
-
providers: [
|
|
549
|
-
LocalizationService,
|
|
550
|
-
{
|
|
551
|
-
provide: DIALOG_LOCALIZATION_SERVICE,
|
|
552
|
-
useExisting: LocalizationService
|
|
553
|
-
},
|
|
554
|
-
{
|
|
555
|
-
provide: L10N_PREFIX,
|
|
556
|
-
useValue: 'kendo.dialog'
|
|
557
|
-
}
|
|
558
|
-
],
|
|
559
|
-
selector: 'kendo-dialog',
|
|
560
|
-
template: `
|
|
561
|
-
<ng-container
|
|
562
|
-
kendoDialogLocalizedMessages
|
|
563
|
-
i18n-closeTitle="kendo.dialog.closeTitle|The title of the close button"
|
|
564
|
-
closeTitle="Close"
|
|
565
|
-
>
|
|
566
|
-
<div class="k-overlay" @overlayAppear></div>
|
|
567
|
-
|
|
568
|
-
<div #dialog class="k-window k-dialog" role="dialog" aria-modal="true" [ngStyle]="styles">
|
|
569
|
-
@if (title) {
|
|
570
|
-
<kendo-dialog-titlebar [closeTitle]="closeTitle" [id]="titleId">{{ title }}</kendo-dialog-titlebar>
|
|
571
|
-
}
|
|
572
|
-
@if (!title) {
|
|
573
|
-
<ng-content select="kendo-dialog-titlebar"></ng-content>
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
<div [id]="contentId" class="k-window-content k-dialog-content">
|
|
577
|
-
@if (!contentTemplate) {
|
|
578
|
-
<ng-content></ng-content>
|
|
579
|
-
}
|
|
580
|
-
@if (contentTemplate) {
|
|
581
|
-
<ng-template [ngTemplateOutlet]="contentTemplate"></ng-template>
|
|
582
|
-
}
|
|
583
|
-
</div>
|
|
584
|
-
|
|
585
|
-
@if (!actions) {
|
|
586
|
-
<ng-content select="kendo-dialog-actions"></ng-content>
|
|
587
|
-
}
|
|
588
|
-
@if (actions) {
|
|
589
|
-
<kendo-dialog-actions [actions]="actions" [layout]="actionsLayout"> </kendo-dialog-actions>
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
@if (showLicenseWatermark) {
|
|
593
|
-
<div kendoWatermarkOverlay [licenseMessage]="licenseMessage"></div>
|
|
594
|
-
}
|
|
595
|
-
</div>
|
|
596
|
-
</ng-container>
|
|
597
|
-
`,
|
|
598
|
-
standalone: true,
|
|
599
|
-
imports: [LocalizedMessagesDirective, NgStyle, DialogTitleBarComponent, NgTemplateOutlet, DialogActionsComponent, WatermarkOverlayComponent]
|
|
600
|
-
}]
|
|
601
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i2.AnimationBuilder }], propDecorators: { actions: [{
|
|
602
|
-
type: Input
|
|
603
|
-
}], actionsLayout: [{
|
|
604
|
-
type: Input
|
|
605
|
-
}], autoFocusedElement: [{
|
|
606
|
-
type: Input
|
|
607
|
-
}], title: [{
|
|
608
|
-
type: Input
|
|
609
|
-
}], width: [{
|
|
610
|
-
type: Input
|
|
611
|
-
}], minWidth: [{
|
|
612
|
-
type: Input
|
|
613
|
-
}], maxWidth: [{
|
|
614
|
-
type: Input
|
|
615
|
-
}], height: [{
|
|
616
|
-
type: Input
|
|
617
|
-
}], minHeight: [{
|
|
618
|
-
type: Input
|
|
619
|
-
}], maxHeight: [{
|
|
620
|
-
type: Input
|
|
621
|
-
}], animation: [{
|
|
622
|
-
type: Input
|
|
623
|
-
}], themeColor: [{
|
|
624
|
-
type: Input
|
|
625
|
-
}], action: [{
|
|
626
|
-
type: Output
|
|
627
|
-
}], close: [{
|
|
628
|
-
type: Output
|
|
629
|
-
}], dir: [{
|
|
630
|
-
type: HostBinding,
|
|
631
|
-
args: ['attr.dir']
|
|
632
|
-
}], tabIndex: [{
|
|
633
|
-
type: HostBinding,
|
|
634
|
-
args: ['attr.tabIndex']
|
|
635
|
-
}], titlebarContent: [{
|
|
636
|
-
type: ContentChildren,
|
|
637
|
-
args: [DialogTitleBarComponent, { descendants: false }]
|
|
638
|
-
}], titlebarView: [{
|
|
639
|
-
type: ViewChildren,
|
|
640
|
-
args: [DialogTitleBarComponent]
|
|
641
|
-
}], actionsView: [{
|
|
642
|
-
type: ViewChild,
|
|
643
|
-
args: [DialogActionsComponent, { static: false }]
|
|
644
|
-
}], dialog: [{
|
|
645
|
-
type: ViewChild,
|
|
646
|
-
args: ['dialog', { static: true }]
|
|
647
|
-
}], wrapperClass: [{
|
|
648
|
-
type: HostBinding,
|
|
649
|
-
args: ['class.k-dialog-wrapper']
|
|
650
|
-
}] } });
|