@progress/kendo-angular-dialog 5.2.3 → 6.0.0-dev.202201190911
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/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +11 -9
- package/dist/cdn/js/kendo-angular-dialog.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/common/util.js +13 -0
- package/dist/es/dialog/dialog-actions.component.js +8 -3
- package/dist/es/dialog/dialog-titlebar.component.js +1 -1
- package/dist/es/dialog/dialog.component.js +9 -2
- package/dist/es/dialog/dialog.service.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/window/actions/window-close-action.directive.js +1 -1
- package/dist/es/window/actions/window-maximize-action.directive.js +1 -1
- package/dist/es/window/actions/window-minimize-action.directive.js +1 -1
- package/dist/es/window/actions/window-restore-action.directive.js +1 -1
- package/dist/es/window/window.component.js +2 -2
- package/dist/es2015/common/util.d.ts +4 -0
- package/dist/es2015/common/util.js +13 -0
- package/dist/es2015/dialog/dialog-actions.component.js +8 -3
- package/dist/es2015/dialog/dialog-settings.d.ts +12 -2
- package/dist/es2015/dialog/dialog-titlebar.component.js +4 -5
- package/dist/es2015/dialog/dialog.component.d.ts +4 -0
- package/dist/es2015/dialog/dialog.component.js +9 -2
- package/dist/es2015/dialog/dialog.service.d.ts +1 -1
- package/dist/es2015/dialog/dialog.service.js +1 -1
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/window/actions/window-close-action.directive.js +1 -1
- package/dist/es2015/window/actions/window-maximize-action.directive.js +1 -1
- package/dist/es2015/window/actions/window-minimize-action.directive.js +1 -1
- package/dist/es2015/window/actions/window-restore-action.directive.js +1 -1
- package/dist/es2015/window/window.component.js +2 -2
- package/dist/fesm2015/index.js +219 -196
- package/dist/fesm5/index.js +218 -194
- package/dist/npm/common/util.js +13 -0
- package/dist/npm/dialog/dialog-actions.component.js +8 -3
- package/dist/npm/dialog/dialog-titlebar.component.js +1 -1
- package/dist/npm/dialog/dialog.component.js +8 -1
- package/dist/npm/dialog/dialog.service.js +1 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/window/actions/window-close-action.directive.js +1 -1
- package/dist/npm/window/actions/window-maximize-action.directive.js +1 -1
- package/dist/npm/window/actions/window-minimize-action.directive.js +1 -1
- package/dist/npm/window/actions/window-restore-action.directive.js +1 -1
- package/dist/npm/window/window.component.js +2 -2
- package/dist/systemjs/kendo-angular-dialog.js +1 -1
- package/package.json +15 -10
|
@@ -355,14 +355,14 @@ let WindowComponent = class WindowComponent {
|
|
|
355
355
|
* @hidden
|
|
356
356
|
*/
|
|
357
357
|
onComponentFocus() {
|
|
358
|
-
this.renderer.addClass(this.el.nativeElement, 'k-
|
|
358
|
+
this.renderer.addClass(this.el.nativeElement, 'k-focus');
|
|
359
359
|
this.setNextZIndex();
|
|
360
360
|
}
|
|
361
361
|
/**
|
|
362
362
|
* @hidden
|
|
363
363
|
*/
|
|
364
364
|
onComponentBlur() {
|
|
365
|
-
this.renderer.removeClass(this.el.nativeElement, 'k-
|
|
365
|
+
this.renderer.removeClass(this.el.nativeElement, 'k-focus');
|
|
366
366
|
}
|
|
367
367
|
subscribeEvents() {
|
|
368
368
|
if (!isDocumentAvailable()) {
|
package/dist/fesm2015/index.js
CHANGED
|
@@ -5,15 +5,205 @@
|
|
|
5
5
|
import { __decorate, __metadata, __param } from 'tslib';
|
|
6
6
|
import { EventEmitter, TemplateRef, Input, Output, 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
7
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
8
|
-
import {
|
|
8
|
+
import { Subscription, Subject, merge, of } from 'rxjs';
|
|
9
9
|
import { take, filter, map, share, tap, switchMap, takeUntil } from 'rxjs/operators';
|
|
10
|
+
import { LocalizationService, L10N_PREFIX, RTL, MessageService, ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
10
11
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
11
|
-
import { Subscription, Subject, merge, of } from 'rxjs';
|
|
12
12
|
import { DraggableDirective, isChanged, isDocumentAvailable, DraggableModule } from '@progress/kendo-angular-common';
|
|
13
13
|
import { offset, scrollPosition, positionWithScroll, getDocumentElement, getWindowViewPort } from '@progress/kendo-popup-common';
|
|
14
14
|
import { Button } from '@progress/kendo-angular-buttons';
|
|
15
15
|
import { CommonModule } from '@angular/common';
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
const isPresent = (value) => value !== null && value !== undefined;
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
const isTruthy = (value) => !!value;
|
|
25
|
+
const toClassList = (classNames) => String(classNames).trim().split(' ');
|
|
26
|
+
const 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
|
+
const DIALOG_ELEMENTS_HANDLING_ESC_KEY = 'k-dialog-wrapper k-dialog-buttongroup k-dialog-action';
|
|
47
|
+
/**
|
|
48
|
+
* @hidden
|
|
49
|
+
*/
|
|
50
|
+
const DIALOG_ELEMENTS_HANDLING_ARROWS = 'k-dialog-buttongroup';
|
|
51
|
+
/**
|
|
52
|
+
* @hidden
|
|
53
|
+
*/
|
|
54
|
+
const WINDOW_CLASSES = 'k-window';
|
|
55
|
+
/**
|
|
56
|
+
* @hidden
|
|
57
|
+
*/
|
|
58
|
+
const hasClasses = (element, classNames) => {
|
|
59
|
+
const namesList = toClassList(classNames);
|
|
60
|
+
return Boolean(toClassList(element.className).find((className) => namesList.indexOf(className) >= 0));
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* @hidden
|
|
64
|
+
*/
|
|
65
|
+
const isVisible = (element) => {
|
|
66
|
+
const rect = element.getBoundingClientRect();
|
|
67
|
+
return !!(rect.width && rect.height) && window.getComputedStyle(element).visibility !== 'hidden';
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* @hidden
|
|
71
|
+
*/
|
|
72
|
+
const isFocusable = (element, checkVisibility = true) => {
|
|
73
|
+
if (element.tagName) {
|
|
74
|
+
const tagName = element.tagName.toLowerCase();
|
|
75
|
+
const tabIndex = element.getAttribute('tabIndex');
|
|
76
|
+
const validTabIndex = tabIndex !== null && !isNaN(tabIndex) && tabIndex > -1;
|
|
77
|
+
let focusable = false;
|
|
78
|
+
if (focusableRegex.test(tagName)) {
|
|
79
|
+
focusable = !element.disabled;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
focusable = validTabIndex;
|
|
83
|
+
}
|
|
84
|
+
return focusable && (!checkVisibility || isVisible(element));
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* @hidden
|
|
90
|
+
*/
|
|
91
|
+
const setHTMLAttributes = (attributes, renderer, element) => {
|
|
92
|
+
for (const attribute in attributes) {
|
|
93
|
+
if (attribute) {
|
|
94
|
+
renderer.setAttribute(element, attribute, attributes[attribute]);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Receives CSS class declarations either as an object, string or array and returns an array of the class names.
|
|
100
|
+
*
|
|
101
|
+
* @hidden
|
|
102
|
+
*/
|
|
103
|
+
const parseCSSClassNames = (value) => {
|
|
104
|
+
if (isObject(value)) {
|
|
105
|
+
return parseObjectClassNames(value);
|
|
106
|
+
}
|
|
107
|
+
if (isString(value)) {
|
|
108
|
+
return parseStringClassNames(value);
|
|
109
|
+
}
|
|
110
|
+
if (Array.isArray(value)) {
|
|
111
|
+
return parseArrayClassNames(value);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const parseObjectClassNames = (value) => {
|
|
115
|
+
const classes = [];
|
|
116
|
+
Object.keys(value).forEach(className => {
|
|
117
|
+
const currentClassName = splitStringToArray(className);
|
|
118
|
+
if (value[className] && currentClassName[0]) {
|
|
119
|
+
classes.push(...currentClassName);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return classes;
|
|
123
|
+
};
|
|
124
|
+
const parseStringClassNames = (value) => {
|
|
125
|
+
const classes = [];
|
|
126
|
+
const classesArray = splitStringToArray(value);
|
|
127
|
+
classesArray.forEach(className => {
|
|
128
|
+
classes.push(className);
|
|
129
|
+
});
|
|
130
|
+
return classes;
|
|
131
|
+
};
|
|
132
|
+
const parseArrayClassNames = (value) => {
|
|
133
|
+
const classes = [];
|
|
134
|
+
value.forEach((className) => {
|
|
135
|
+
const current = splitStringToArray(className);
|
|
136
|
+
if (current[0]) {
|
|
137
|
+
classes.push(...current);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return classes;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* @hidden
|
|
144
|
+
*/
|
|
145
|
+
const focusableSelector = [
|
|
146
|
+
'a[href]',
|
|
147
|
+
'area[href]',
|
|
148
|
+
'input:not([disabled])',
|
|
149
|
+
'select:not([disabled])',
|
|
150
|
+
'textarea:not([disabled])',
|
|
151
|
+
'button:not([disabled])',
|
|
152
|
+
'iframe',
|
|
153
|
+
'object',
|
|
154
|
+
'embed',
|
|
155
|
+
'*[tabindex]',
|
|
156
|
+
'*[contenteditable]'
|
|
157
|
+
].join(',');
|
|
158
|
+
/**
|
|
159
|
+
* @hidden
|
|
160
|
+
*/
|
|
161
|
+
const preventDefault = ({ originalEvent: event }) => {
|
|
162
|
+
event.stopPropagation();
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* @hidden
|
|
167
|
+
*/
|
|
168
|
+
const RESIZE_DIRECTIONS = ['n', 'e', 's', 'w', 'se', 'sw', 'ne', 'nw'];
|
|
169
|
+
/**
|
|
170
|
+
* @hidden
|
|
171
|
+
*/
|
|
172
|
+
const OFFSET_STYLES = ['top', 'left', 'width', 'height'];
|
|
173
|
+
/**
|
|
174
|
+
* @hidden
|
|
175
|
+
*/
|
|
176
|
+
const isString = (value) => value instanceof String || typeof value === 'string';
|
|
177
|
+
/**
|
|
178
|
+
* @hidden
|
|
179
|
+
*/
|
|
180
|
+
const isObject = (value) => isPresent(value) && !Array.isArray(value) && typeof value === 'object';
|
|
181
|
+
/**
|
|
182
|
+
* @hidden
|
|
183
|
+
*/
|
|
184
|
+
const isNumber = (value) => typeof value === 'number' && isFinite(value);
|
|
185
|
+
/**
|
|
186
|
+
* @hidden
|
|
187
|
+
*/
|
|
188
|
+
const createValueWithUnit = (value) => value + (isNumber(value) ? 'px' : '');
|
|
189
|
+
/**
|
|
190
|
+
* @hidden
|
|
191
|
+
*/
|
|
192
|
+
const splitStringToArray = (value) => value.trim().replace(/\s+/g, " ").split(' ');
|
|
193
|
+
/**
|
|
194
|
+
* @hidden
|
|
195
|
+
*/
|
|
196
|
+
const findPrimaryButton = (buttons) => {
|
|
197
|
+
for (let i = buttons.length - 1; i >= 0; i--) {
|
|
198
|
+
const classList = buttons[i].classList;
|
|
199
|
+
for (let j = 0; j < classList.length; j++) {
|
|
200
|
+
if (classList[j].endsWith('-primary')) {
|
|
201
|
+
return buttons[i];
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
17
207
|
/**
|
|
18
208
|
* Specifies the action buttons of the Dialog
|
|
19
209
|
* ([see example]({% slug actionbuttons_dialog %})).
|
|
@@ -50,9 +240,13 @@ let DialogActionsComponent = class DialogActionsComponent {
|
|
|
50
240
|
* @hidden
|
|
51
241
|
*/
|
|
52
242
|
buttonClass(action) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
243
|
+
let classes = ['k-button k-button-md k-rounded-md'];
|
|
244
|
+
const fillMode = action.fillMode ? action.fillMode : 'solid';
|
|
245
|
+
const themeColor = action.themeColor ? action.themeColor : 'base';
|
|
246
|
+
const cssClasses = action.cssClass ? parseCSSClassNames(action.cssClass) : [];
|
|
247
|
+
classes.push(`k-button-${fillMode} k-button-${fillMode}-${themeColor}`);
|
|
248
|
+
if (cssClasses.length > 0) {
|
|
249
|
+
classes = classes.concat(cssClasses);
|
|
56
250
|
}
|
|
57
251
|
return classes.join(' ');
|
|
58
252
|
}
|
|
@@ -232,16 +426,15 @@ DialogTitleBarComponent = __decorate([
|
|
|
232
426
|
</div>
|
|
233
427
|
|
|
234
428
|
<div class="k-window-actions k-dialog-actions">
|
|
235
|
-
<
|
|
236
|
-
href="#"
|
|
429
|
+
<button
|
|
237
430
|
role="button"
|
|
238
431
|
[attr.title]="closeButtonTitle"
|
|
239
432
|
[attr.aria-label]="closeButtonTitle"
|
|
240
|
-
class="k-button k-flat k-button-icon k-window-action k-dialog-action k-dialog-close"
|
|
433
|
+
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"
|
|
241
434
|
(click)="onCloseClick($event)"
|
|
242
435
|
>
|
|
243
|
-
<span class="k-icon k-i-x"></span>
|
|
244
|
-
</
|
|
436
|
+
<span class="k-button-icon k-icon k-i-x"></span>
|
|
437
|
+
</button>
|
|
245
438
|
</div>
|
|
246
439
|
</ng-container>
|
|
247
440
|
`
|
|
@@ -257,188 +450,11 @@ const packageMetadata = {
|
|
|
257
450
|
name: '@progress/kendo-angular-dialog',
|
|
258
451
|
productName: 'Kendo UI for Angular',
|
|
259
452
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
260
|
-
publishDate:
|
|
453
|
+
publishDate: 1642583375,
|
|
261
454
|
version: '',
|
|
262
455
|
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'
|
|
263
456
|
};
|
|
264
457
|
|
|
265
|
-
/**
|
|
266
|
-
* @hidden
|
|
267
|
-
*/
|
|
268
|
-
const isPresent = (value) => value !== null && value !== undefined;
|
|
269
|
-
/**
|
|
270
|
-
* @hidden
|
|
271
|
-
*/
|
|
272
|
-
const isTruthy = (value) => !!value;
|
|
273
|
-
const toClassList = (classNames) => String(classNames).trim().split(' ');
|
|
274
|
-
const focusableRegex = /^(?:a|input|select|textarea|button|object)$/i;
|
|
275
|
-
/**
|
|
276
|
-
* @hidden
|
|
277
|
-
*/
|
|
278
|
-
var Keys;
|
|
279
|
-
(function (Keys) {
|
|
280
|
-
Keys[Keys["esc"] = 27] = "esc";
|
|
281
|
-
Keys[Keys["tab"] = 9] = "tab";
|
|
282
|
-
Keys[Keys["enter"] = 13] = "enter";
|
|
283
|
-
Keys[Keys["space"] = 32] = "space";
|
|
284
|
-
Keys[Keys["ctrl"] = 17] = "ctrl";
|
|
285
|
-
Keys[Keys["shift"] = 16] = "shift";
|
|
286
|
-
Keys[Keys["left"] = 37] = "left";
|
|
287
|
-
Keys[Keys["up"] = 38] = "up";
|
|
288
|
-
Keys[Keys["right"] = 39] = "right";
|
|
289
|
-
Keys[Keys["down"] = 40] = "down";
|
|
290
|
-
})(Keys || (Keys = {}));
|
|
291
|
-
/**
|
|
292
|
-
* @hidden
|
|
293
|
-
*/
|
|
294
|
-
const DIALOG_ELEMENTS_HANDLING_ESC_KEY = 'k-dialog-wrapper k-dialog-buttongroup k-dialog-action';
|
|
295
|
-
/**
|
|
296
|
-
* @hidden
|
|
297
|
-
*/
|
|
298
|
-
const DIALOG_ELEMENTS_HANDLING_ARROWS = 'k-dialog-buttongroup';
|
|
299
|
-
/**
|
|
300
|
-
* @hidden
|
|
301
|
-
*/
|
|
302
|
-
const WINDOW_CLASSES = 'k-window';
|
|
303
|
-
/**
|
|
304
|
-
* @hidden
|
|
305
|
-
*/
|
|
306
|
-
const hasClasses = (element, classNames) => {
|
|
307
|
-
const namesList = toClassList(classNames);
|
|
308
|
-
return Boolean(toClassList(element.className).find((className) => namesList.indexOf(className) >= 0));
|
|
309
|
-
};
|
|
310
|
-
/**
|
|
311
|
-
* @hidden
|
|
312
|
-
*/
|
|
313
|
-
const isVisible = (element) => {
|
|
314
|
-
const rect = element.getBoundingClientRect();
|
|
315
|
-
return !!(rect.width && rect.height) && window.getComputedStyle(element).visibility !== 'hidden';
|
|
316
|
-
};
|
|
317
|
-
/**
|
|
318
|
-
* @hidden
|
|
319
|
-
*/
|
|
320
|
-
const isFocusable = (element, checkVisibility = true) => {
|
|
321
|
-
if (element.tagName) {
|
|
322
|
-
const tagName = element.tagName.toLowerCase();
|
|
323
|
-
const tabIndex = element.getAttribute('tabIndex');
|
|
324
|
-
const validTabIndex = tabIndex !== null && !isNaN(tabIndex) && tabIndex > -1;
|
|
325
|
-
let focusable = false;
|
|
326
|
-
if (focusableRegex.test(tagName)) {
|
|
327
|
-
focusable = !element.disabled;
|
|
328
|
-
}
|
|
329
|
-
else {
|
|
330
|
-
focusable = validTabIndex;
|
|
331
|
-
}
|
|
332
|
-
return focusable && (!checkVisibility || isVisible(element));
|
|
333
|
-
}
|
|
334
|
-
return false;
|
|
335
|
-
};
|
|
336
|
-
/**
|
|
337
|
-
* @hidden
|
|
338
|
-
*/
|
|
339
|
-
const setHTMLAttributes = (attributes, renderer, element) => {
|
|
340
|
-
for (const attribute in attributes) {
|
|
341
|
-
if (attribute) {
|
|
342
|
-
renderer.setAttribute(element, attribute, attributes[attribute]);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
};
|
|
346
|
-
/**
|
|
347
|
-
* Receives CSS class declarations either as an object, string or array and returns an array of the class names.
|
|
348
|
-
*
|
|
349
|
-
* @hidden
|
|
350
|
-
*/
|
|
351
|
-
const parseCSSClassNames = (value) => {
|
|
352
|
-
if (isObject(value)) {
|
|
353
|
-
return parseObjectClassNames(value);
|
|
354
|
-
}
|
|
355
|
-
if (isString(value)) {
|
|
356
|
-
return parseStringClassNames(value);
|
|
357
|
-
}
|
|
358
|
-
if (Array.isArray(value)) {
|
|
359
|
-
return parseArrayClassNames(value);
|
|
360
|
-
}
|
|
361
|
-
};
|
|
362
|
-
const parseObjectClassNames = (value) => {
|
|
363
|
-
const classes = [];
|
|
364
|
-
Object.keys(value).forEach(className => {
|
|
365
|
-
const currentClassName = splitStringToArray(className);
|
|
366
|
-
if (value[className] && currentClassName[0]) {
|
|
367
|
-
classes.push(...currentClassName);
|
|
368
|
-
}
|
|
369
|
-
});
|
|
370
|
-
return classes;
|
|
371
|
-
};
|
|
372
|
-
const parseStringClassNames = (value) => {
|
|
373
|
-
const classes = [];
|
|
374
|
-
const classesArray = splitStringToArray(value);
|
|
375
|
-
classesArray.forEach(className => {
|
|
376
|
-
classes.push(className);
|
|
377
|
-
});
|
|
378
|
-
return classes;
|
|
379
|
-
};
|
|
380
|
-
const parseArrayClassNames = (value) => {
|
|
381
|
-
const classes = [];
|
|
382
|
-
value.forEach((className) => {
|
|
383
|
-
const current = splitStringToArray(className);
|
|
384
|
-
if (current[0]) {
|
|
385
|
-
classes.push(...current);
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
return classes;
|
|
389
|
-
};
|
|
390
|
-
/**
|
|
391
|
-
* @hidden
|
|
392
|
-
*/
|
|
393
|
-
const focusableSelector = [
|
|
394
|
-
'a[href]',
|
|
395
|
-
'area[href]',
|
|
396
|
-
'input:not([disabled])',
|
|
397
|
-
'select:not([disabled])',
|
|
398
|
-
'textarea:not([disabled])',
|
|
399
|
-
'button:not([disabled])',
|
|
400
|
-
'iframe',
|
|
401
|
-
'object',
|
|
402
|
-
'embed',
|
|
403
|
-
'*[tabindex]',
|
|
404
|
-
'*[contenteditable]'
|
|
405
|
-
].join(',');
|
|
406
|
-
/**
|
|
407
|
-
* @hidden
|
|
408
|
-
*/
|
|
409
|
-
const preventDefault = ({ originalEvent: event }) => {
|
|
410
|
-
event.stopPropagation();
|
|
411
|
-
event.preventDefault();
|
|
412
|
-
};
|
|
413
|
-
/**
|
|
414
|
-
* @hidden
|
|
415
|
-
*/
|
|
416
|
-
const RESIZE_DIRECTIONS = ['n', 'e', 's', 'w', 'se', 'sw', 'ne', 'nw'];
|
|
417
|
-
/**
|
|
418
|
-
* @hidden
|
|
419
|
-
*/
|
|
420
|
-
const OFFSET_STYLES = ['top', 'left', 'width', 'height'];
|
|
421
|
-
/**
|
|
422
|
-
* @hidden
|
|
423
|
-
*/
|
|
424
|
-
const isString = (value) => value instanceof String || typeof value === 'string';
|
|
425
|
-
/**
|
|
426
|
-
* @hidden
|
|
427
|
-
*/
|
|
428
|
-
const isObject = (value) => isPresent(value) && !Array.isArray(value) && typeof value === 'object';
|
|
429
|
-
/**
|
|
430
|
-
* @hidden
|
|
431
|
-
*/
|
|
432
|
-
const isNumber = (value) => typeof value === 'number' && isFinite(value);
|
|
433
|
-
/**
|
|
434
|
-
* @hidden
|
|
435
|
-
*/
|
|
436
|
-
const createValueWithUnit = (value) => value + (isNumber(value) ? 'px' : '');
|
|
437
|
-
/**
|
|
438
|
-
* @hidden
|
|
439
|
-
*/
|
|
440
|
-
const splitStringToArray = (value) => value.trim().replace(/\s+/g, " ").split(' ');
|
|
441
|
-
|
|
442
458
|
/**
|
|
443
459
|
* The settings for the Dialog actions when the Dialog is opened through `DialogService`
|
|
444
460
|
* ([see example]({% slug api_dialog_dialogservice %}#toc-open)).
|
|
@@ -649,7 +665,7 @@ let DialogComponent = class DialogComponent {
|
|
|
649
665
|
*/
|
|
650
666
|
handleInitialFocus() {
|
|
651
667
|
const wrapper = this.wrapper.nativeElement;
|
|
652
|
-
const primaryButton =
|
|
668
|
+
const primaryButton = this.findPrimary(wrapper);
|
|
653
669
|
if (this.autoFocusedElement) {
|
|
654
670
|
const initiallyFocusedElement = wrapper.querySelector(this.autoFocusedElement);
|
|
655
671
|
if (initiallyFocusedElement) {
|
|
@@ -663,6 +679,13 @@ let DialogComponent = class DialogComponent {
|
|
|
663
679
|
wrapper.focus();
|
|
664
680
|
}
|
|
665
681
|
}
|
|
682
|
+
/**
|
|
683
|
+
* @hidden
|
|
684
|
+
*/
|
|
685
|
+
findPrimary(wrapper) {
|
|
686
|
+
const actionBtns = wrapper.querySelectorAll('.k-actions .k-button');
|
|
687
|
+
return findPrimaryButton(actionBtns);
|
|
688
|
+
}
|
|
666
689
|
/**
|
|
667
690
|
* @hidden
|
|
668
691
|
*/
|
|
@@ -998,7 +1021,7 @@ let DialogService = class DialogService {
|
|
|
998
1021
|
* content: "Are you sure?",
|
|
999
1022
|
* actions: [
|
|
1000
1023
|
* { text: "No" },
|
|
1001
|
-
* { text: "Yes",
|
|
1024
|
+
* { text: "Yes", themeColor: 'primary' }
|
|
1002
1025
|
* ]
|
|
1003
1026
|
* });
|
|
1004
1027
|
*
|
|
@@ -2139,14 +2162,14 @@ let WindowComponent = class WindowComponent {
|
|
|
2139
2162
|
* @hidden
|
|
2140
2163
|
*/
|
|
2141
2164
|
onComponentFocus() {
|
|
2142
|
-
this.renderer.addClass(this.el.nativeElement, 'k-
|
|
2165
|
+
this.renderer.addClass(this.el.nativeElement, 'k-focus');
|
|
2143
2166
|
this.setNextZIndex();
|
|
2144
2167
|
}
|
|
2145
2168
|
/**
|
|
2146
2169
|
* @hidden
|
|
2147
2170
|
*/
|
|
2148
2171
|
onComponentBlur() {
|
|
2149
|
-
this.renderer.removeClass(this.el.nativeElement, 'k-
|
|
2172
|
+
this.renderer.removeClass(this.el.nativeElement, 'k-focus');
|
|
2150
2173
|
}
|
|
2151
2174
|
subscribeEvents() {
|
|
2152
2175
|
if (!isDocumentAvailable()) {
|
|
@@ -2528,7 +2551,7 @@ let WindowMaximizeActionDirective = class WindowMaximizeActionDirective extends
|
|
|
2528
2551
|
super(el, renderer, null, localization, ngZone);
|
|
2529
2552
|
this.buttonType = 'button';
|
|
2530
2553
|
this.window = _service;
|
|
2531
|
-
this.
|
|
2554
|
+
this.fillMode = 'flat';
|
|
2532
2555
|
this.icon = 'window-maximize';
|
|
2533
2556
|
}
|
|
2534
2557
|
/**
|
|
@@ -2587,7 +2610,7 @@ let WindowMinimizeActionDirective = class WindowMinimizeActionDirective extends
|
|
|
2587
2610
|
super(el, renderer, null, localization, ngZone);
|
|
2588
2611
|
this.buttonType = 'button';
|
|
2589
2612
|
this.window = _service;
|
|
2590
|
-
this.
|
|
2613
|
+
this.fillMode = 'flat';
|
|
2591
2614
|
this.icon = 'window-minimize';
|
|
2592
2615
|
}
|
|
2593
2616
|
/**
|
|
@@ -2646,7 +2669,7 @@ let WindowCloseActionDirective = class WindowCloseActionDirective extends Button
|
|
|
2646
2669
|
super(el, renderer, null, localization, ngZone);
|
|
2647
2670
|
this.buttonType = 'button';
|
|
2648
2671
|
this.window = _service;
|
|
2649
|
-
this.
|
|
2672
|
+
this.fillMode = 'flat';
|
|
2650
2673
|
this.icon = 'close';
|
|
2651
2674
|
}
|
|
2652
2675
|
/**
|
|
@@ -2697,7 +2720,7 @@ let WindowRestoreActionDirective = class WindowRestoreActionDirective extends Bu
|
|
|
2697
2720
|
super(el, renderer, null, localization, ngZone);
|
|
2698
2721
|
this.buttonType = 'button';
|
|
2699
2722
|
this.window = _service;
|
|
2700
|
-
this.
|
|
2723
|
+
this.fillMode = 'flat';
|
|
2701
2724
|
this.icon = 'window-restore';
|
|
2702
2725
|
}
|
|
2703
2726
|
/**
|