@progress/kendo-angular-common 3.2.2-dev.202211170714 → 11.0.0-develop.79
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 +1 -1
- package/dom-queries/closest-in-scope.d.ts +2 -2
- package/dom-queries/closest.d.ts +2 -2
- package/dom-queries/contains.d.ts +2 -2
- package/dom-queries/find-element.d.ts +1 -1
- package/dom-queries/find-focusable-child.d.ts +1 -1
- package/dom-queries/find-focusable.d.ts +1 -1
- package/dom-queries/has-classes.d.ts +1 -1
- package/dom-queries/is-focusable-with-tab-key.d.ts +1 -1
- package/dom-queries/is-focusable.d.ts +1 -1
- package/dom-queries/is-visible.d.ts +1 -1
- package/dom-queries/matches-classes.d.ts +1 -1
- package/dom-queries/matches-node-name.d.ts +2 -2
- package/dom-queries/rtl-scroll-position.d.ts +1 -1
- package/dom-queries.d.ts +1 -1
- package/draggable/draggable.directive.d.ts +2 -2
- package/draggable/draggable.module.d.ts +1 -1
- package/draggable.d.ts +1 -1
- package/enums/keys.d.ts +1 -1
- package/enums.d.ts +1 -1
- package/{esm2015/dom-queries/closest-in-scope.js → esm2020/dom-queries/closest-in-scope.mjs} +2 -1
- package/{esm2015/dom-queries/closest.js → esm2020/dom-queries/closest.mjs} +1 -1
- package/{esm2015/dom-queries/contains.js → esm2020/dom-queries/contains.mjs} +1 -1
- package/{esm2015/dom-queries/find-element.js → esm2020/dom-queries/find-element.mjs} +1 -1
- package/{esm2015/dom-queries/find-focusable-child.js → esm2020/dom-queries/find-focusable-child.mjs} +1 -1
- package/{esm2015/dom-queries/find-focusable.js → esm2020/dom-queries/find-focusable.mjs} +1 -1
- package/{esm2015/dom-queries/has-classes.js → esm2020/dom-queries/has-classes.mjs} +1 -1
- package/{esm2015/dom-queries/is-focusable-with-tab-key.js → esm2020/dom-queries/is-focusable-with-tab-key.mjs} +1 -1
- package/{esm2015/dom-queries/is-focusable.js → esm2020/dom-queries/is-focusable.mjs} +1 -1
- package/{esm2015/dom-queries/is-visible.js → esm2020/dom-queries/is-visible.mjs} +1 -1
- package/{esm2015/dom-queries/matches-classes.js → esm2020/dom-queries/matches-classes.mjs} +1 -1
- package/{esm2015/dom-queries/matches-node-name.js → esm2020/dom-queries/matches-node-name.mjs} +1 -1
- package/{esm2015/dom-queries/rtl-scroll-position.js → esm2020/dom-queries/rtl-scroll-position.mjs} +1 -1
- package/{esm2015/dom-queries.js → esm2020/dom-queries.mjs} +1 -1
- package/{esm2015/draggable/draggable.directive.js → esm2020/draggable/draggable.directive.mjs} +7 -7
- package/{esm2015/draggable/draggable.module.js → esm2020/draggable/draggable.module.mjs} +5 -5
- package/{esm2015/draggable.js → esm2020/draggable.mjs} +1 -1
- package/{esm2015/enums/keys.js → esm2020/enums/keys.mjs} +1 -1
- package/{esm2015/enums.js → esm2020/enums.mjs} +1 -1
- package/{esm2015/events/events-outside-angular.directive.js → esm2020/events/events-outside-angular.directive.mjs} +8 -8
- package/{esm2015/events/events.module.js → esm2020/events/events.module.mjs} +5 -5
- package/{esm2015/events.js → esm2020/events.mjs} +1 -1
- package/{esm2015/main.js → esm2020/index.mjs} +2 -2
- package/{esm2015/preventable-event.js → esm2020/preventable-event.mjs} +1 -1
- package/{esm2015/kendo-angular-common.js → esm2020/progress-kendo-angular-common.mjs} +2 -2
- package/{esm2015/resize-sensor/compat.service.js → esm2020/resize-sensor/compat.service.mjs} +7 -5
- package/{esm2015/resize-sensor/observer.service.js → esm2020/resize-sensor/observer.service.mjs} +1 -1
- package/{esm2015/resize-sensor/resize-batch.service.js → esm2020/resize-sensor/resize-batch.service.mjs} +5 -5
- package/{esm2015/resize-sensor/resize-sensor.component.js → esm2020/resize-sensor/resize-sensor.component.mjs} +6 -5
- package/{esm2015/resize-sensor/resize-sensor.module.js → esm2020/resize-sensor/resize-sensor.module.mjs} +5 -5
- package/{esm2015/resize-sensor/resize.service.js → esm2020/resize-sensor/resize.service.mjs} +3 -3
- package/{esm2015/resize-sensor.js → esm2020/resize-sensor.mjs} +1 -1
- package/{esm2015/tokens.js → esm2020/tokens.mjs} +1 -1
- package/{esm2015/utils/any-changed.js → esm2020/utils/any-changed.mjs} +1 -1
- package/{esm2015/utils/guid.js → esm2020/utils/guid.mjs} +1 -1
- package/{esm2015/utils/has-observers.js → esm2020/utils/has-observers.mjs} +1 -1
- package/{esm2015/utils/is-changed.js → esm2020/utils/is-changed.mjs} +1 -1
- package/{esm2015/utils/is-document-available.js → esm2020/utils/is-document-available.mjs} +1 -1
- package/{esm2015/utils/scrollbar-width.service.js → esm2020/utils/scrollbar-width.service.mjs} +21 -6
- package/{esm2015/utils.js → esm2020/utils.mjs} +1 -2
- package/events/events-outside-angular.directive.d.ts +2 -2
- package/events/events.module.d.ts +1 -1
- package/events.d.ts +1 -1
- package/fesm2015/progress-kendo-angular-common.mjs +753 -0
- package/{fesm2015/kendo-angular-common.js → fesm2020/progress-kendo-angular-common.mjs} +60 -58
- package/{main.d.ts → index.d.ts} +2 -2
- package/package.json +24 -55
- package/preventable-event.d.ts +1 -1
- package/{kendo-angular-common.d.ts → progress-kendo-angular-common.d.ts} +2 -2
- package/resize-sensor/compat.service.d.ts +3 -3
- package/resize-sensor/observer.service.d.ts +1 -1
- package/resize-sensor/resize-batch.service.d.ts +2 -2
- package/resize-sensor/resize-sensor.component.d.ts +1 -1
- package/resize-sensor/resize-sensor.module.d.ts +1 -1
- package/resize-sensor/resize.service.d.ts +3 -3
- package/resize-sensor.d.ts +1 -1
- package/tokens.d.ts +1 -1
- package/utils/any-changed.d.ts +1 -1
- package/utils/guid.d.ts +1 -1
- package/utils/has-observers.d.ts +1 -1
- package/utils/is-changed.d.ts +1 -1
- package/utils/is-document-available.d.ts +1 -1
- package/utils/scrollbar-width.service.d.ts +5 -1
- package/utils.d.ts +1 -2
- package/bundles/kendo-angular-common.umd.js +0 -5
- package/esm2015/utils/get-scrollbar-width.js +0 -21
- package/utils/get-scrollbar-width.d.ts +0 -8
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2022 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { EventEmitter, Directive, Input, Output, NgModule, Injectable, Component } from '@angular/core';
|
|
7
|
+
import { Draggable } from '@progress/kendo-draggable';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import { auditTime } from 'rxjs/operators';
|
|
10
|
+
import { merge, fromEvent, from } from 'rxjs';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
const isDocumentAvailable = () => typeof document !== 'undefined';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
const isChanged = (propertyName, changes, skipFirstChange = true) => (typeof changes[propertyName] !== 'undefined' &&
|
|
21
|
+
(!changes[propertyName].isFirstChange() || !skipFirstChange) &&
|
|
22
|
+
changes[propertyName].previousValue !== changes[propertyName].currentValue);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
const anyChanged = (propertyNames, changes, skipFirstChange = true) => propertyNames.some(name => isChanged(name, changes, skipFirstChange));
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
const hasObservers = (emitter) => emitter && emitter.observers.length > 0;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @hidden
|
|
36
|
+
*/
|
|
37
|
+
const guid = () => {
|
|
38
|
+
let id = "";
|
|
39
|
+
for (let i = 0; i < 32; i++) {
|
|
40
|
+
const random = Math.random() * 16 | 0; // eslint-disable-line no-bitwise
|
|
41
|
+
if (i === 8 || i === 12 || i === 16 || i === 20) {
|
|
42
|
+
id += "-";
|
|
43
|
+
}
|
|
44
|
+
// eslint-disable-next-line no-bitwise
|
|
45
|
+
id += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16);
|
|
46
|
+
}
|
|
47
|
+
return id;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
class DraggableDirective {
|
|
51
|
+
constructor(element, ngZone) {
|
|
52
|
+
this.element = element;
|
|
53
|
+
this.ngZone = ngZone;
|
|
54
|
+
this.enableDrag = true;
|
|
55
|
+
this.kendoPress = new EventEmitter();
|
|
56
|
+
this.kendoDrag = new EventEmitter();
|
|
57
|
+
this.kendoRelease = new EventEmitter();
|
|
58
|
+
}
|
|
59
|
+
ngOnInit() {
|
|
60
|
+
this.toggleDraggable();
|
|
61
|
+
}
|
|
62
|
+
ngOnChanges(changes) {
|
|
63
|
+
if (isChanged('enableDrag', changes)) {
|
|
64
|
+
this.toggleDraggable();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
ngOnDestroy() {
|
|
68
|
+
this.destroyDraggable();
|
|
69
|
+
}
|
|
70
|
+
toggleDraggable() {
|
|
71
|
+
if (isDocumentAvailable()) {
|
|
72
|
+
this.destroyDraggable();
|
|
73
|
+
if (this.enableDrag) {
|
|
74
|
+
this.draggable = new Draggable({
|
|
75
|
+
drag: (e) => this.kendoDrag.next(e),
|
|
76
|
+
press: (e) => this.kendoPress.next(e),
|
|
77
|
+
release: (e) => this.kendoRelease.next(e)
|
|
78
|
+
});
|
|
79
|
+
this.ngZone.runOutsideAngular(() => { var _a; return (_a = this.draggable) === null || _a === void 0 ? void 0 : _a.bindTo(this.element.nativeElement); });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
destroyDraggable() {
|
|
84
|
+
if (this.draggable) {
|
|
85
|
+
this.draggable.destroy();
|
|
86
|
+
this.draggable = undefined;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
DraggableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DraggableDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
91
|
+
DraggableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: DraggableDirective, selector: "[kendoDraggable]", inputs: { enableDrag: "enableDrag" }, outputs: { kendoPress: "kendoPress", kendoDrag: "kendoDrag", kendoRelease: "kendoRelease" }, usesOnChanges: true, ngImport: i0 });
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DraggableDirective, decorators: [{
|
|
93
|
+
type: Directive,
|
|
94
|
+
args: [{
|
|
95
|
+
selector: '[kendoDraggable]'
|
|
96
|
+
}]
|
|
97
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { enableDrag: [{
|
|
98
|
+
type: Input
|
|
99
|
+
}], kendoPress: [{
|
|
100
|
+
type: Output
|
|
101
|
+
}], kendoDrag: [{
|
|
102
|
+
type: Output
|
|
103
|
+
}], kendoRelease: [{
|
|
104
|
+
type: Output
|
|
105
|
+
}] } });
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @hidden
|
|
109
|
+
*/
|
|
110
|
+
class DraggableModule {
|
|
111
|
+
}
|
|
112
|
+
DraggableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DraggableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
113
|
+
DraggableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DraggableModule, declarations: [DraggableDirective], imports: [CommonModule], exports: [DraggableDirective] });
|
|
114
|
+
DraggableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DraggableModule, imports: [[CommonModule]] });
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DraggableModule, decorators: [{
|
|
116
|
+
type: NgModule,
|
|
117
|
+
args: [{
|
|
118
|
+
declarations: [DraggableDirective],
|
|
119
|
+
exports: [DraggableDirective],
|
|
120
|
+
imports: [CommonModule]
|
|
121
|
+
}]
|
|
122
|
+
}] });
|
|
123
|
+
|
|
124
|
+
const closestInScope = (node, predicate, scope) => {
|
|
125
|
+
while (node && node !== scope && !predicate(node)) {
|
|
126
|
+
node = node.parentNode;
|
|
127
|
+
}
|
|
128
|
+
if (node !== scope) {
|
|
129
|
+
return node;
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const closest = (node, predicate) => {
|
|
135
|
+
while (node && !predicate(node)) {
|
|
136
|
+
node = node.parentNode;
|
|
137
|
+
}
|
|
138
|
+
return node;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const contains = (parent, node, matchSelf = false) => {
|
|
142
|
+
const outside = !closest(node, (child) => child === parent);
|
|
143
|
+
if (outside) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
const el = closest(node, (child) => child === node);
|
|
147
|
+
return el && (matchSelf || el !== parent);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const findElement = (node, predicate, matchSelf = true) => {
|
|
151
|
+
if (!node) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (matchSelf && predicate(node)) {
|
|
155
|
+
return node;
|
|
156
|
+
}
|
|
157
|
+
node = node.firstChild;
|
|
158
|
+
while (node) {
|
|
159
|
+
if (node.nodeType === 1) {
|
|
160
|
+
const element = findElement(node, predicate);
|
|
161
|
+
if (element) {
|
|
162
|
+
return element;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
node = node.nextSibling;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const focusableRegex = /^(?:a|input|select|option|textarea|button|object)$/i;
|
|
170
|
+
const isFocusable = (element) => {
|
|
171
|
+
if (!element.tagName) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
const tagName = element.tagName.toLowerCase();
|
|
175
|
+
const hasTabIndex = Boolean(element.getAttribute('tabIndex'));
|
|
176
|
+
const focusable = !element.disabled && focusableRegex.test(tagName);
|
|
177
|
+
return focusable || hasTabIndex;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const isVisible = (element) => {
|
|
181
|
+
const rect = element.getBoundingClientRect();
|
|
182
|
+
const hasSize = rect.width > 0 && rect.height > 0;
|
|
183
|
+
const hasPosition = rect.x !== 0 && rect.y !== 0;
|
|
184
|
+
// Elements can have zero size due to styling, but they will still count as visible.
|
|
185
|
+
// For example, the selection checkbox has no size, but is made visible through styling.
|
|
186
|
+
return (hasSize || hasPosition) && window.getComputedStyle(element).visibility !== 'hidden';
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const isFocusableWithTabKey = (element, checkVisibility = true) => {
|
|
190
|
+
if (!isFocusable(element)) {
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
const tabIndex = element.getAttribute('tabIndex');
|
|
194
|
+
const visible = !checkVisibility || isVisible(element);
|
|
195
|
+
return visible && tabIndex !== '-1';
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
const findFocusableChild = (element, checkVisibility = true) => {
|
|
199
|
+
return findElement(element, (node) => isFocusableWithTabKey(node, checkVisibility), false);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
const findFocusable = (element, checkVisibility = true) => {
|
|
203
|
+
return findElement(element, (node) => isFocusableWithTabKey(node, checkVisibility));
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const toClassList = (classNames) => String(classNames).trim().split(' ');
|
|
207
|
+
const hasClasses = (element, classNames) => {
|
|
208
|
+
const namesList = toClassList(classNames);
|
|
209
|
+
return Boolean(toClassList(element.className).find((className) => namesList.indexOf(className) >= 0));
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const matchesClasses = (classNames) => (element) => hasClasses(element, classNames);
|
|
213
|
+
|
|
214
|
+
const NODE_NAME_PREDICATES = {};
|
|
215
|
+
const matchesNodeName = (nodeName) => {
|
|
216
|
+
if (!NODE_NAME_PREDICATES[nodeName]) {
|
|
217
|
+
NODE_NAME_PREDICATES[nodeName] = (element) => String(element.nodeName).toLowerCase() === nodeName.toLowerCase();
|
|
218
|
+
}
|
|
219
|
+
return NODE_NAME_PREDICATES[nodeName];
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Normalizes a scroll position value in RTL mode.
|
|
224
|
+
*/
|
|
225
|
+
function rtlScrollPosition(position, element, initial) {
|
|
226
|
+
let result = position;
|
|
227
|
+
if (initial < 0) {
|
|
228
|
+
result = -position;
|
|
229
|
+
}
|
|
230
|
+
else if (initial > 0) {
|
|
231
|
+
result = element.scrollWidth - element.offsetWidth - position;
|
|
232
|
+
}
|
|
233
|
+
return result;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @hidden
|
|
238
|
+
*/
|
|
239
|
+
class EventsOutsideAngularDirective {
|
|
240
|
+
constructor(element, ngZone, renderer) {
|
|
241
|
+
this.element = element;
|
|
242
|
+
this.ngZone = ngZone;
|
|
243
|
+
this.renderer = renderer;
|
|
244
|
+
this.events = {};
|
|
245
|
+
}
|
|
246
|
+
ngOnInit() {
|
|
247
|
+
if (!this.element || !this.element.nativeElement) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const events = this.events;
|
|
251
|
+
this.subscriptions = [];
|
|
252
|
+
this.ngZone.runOutsideAngular(() => {
|
|
253
|
+
var _a;
|
|
254
|
+
for (const name in events) {
|
|
255
|
+
if (Object.hasOwnProperty.call(events, name)) {
|
|
256
|
+
(_a = this.subscriptions) === null || _a === void 0 ? void 0 : _a.push(this.renderer.listen(this.element.nativeElement, name, this.scope ? events[name].bind(this.scope) : events[name]));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
ngOnDestroy() {
|
|
262
|
+
if (this.subscriptions) {
|
|
263
|
+
for (let idx = 0; idx < this.subscriptions.length; idx++) {
|
|
264
|
+
this.subscriptions[idx]();
|
|
265
|
+
}
|
|
266
|
+
this.subscriptions = null;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
EventsOutsideAngularDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EventsOutsideAngularDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
271
|
+
EventsOutsideAngularDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: { events: ["kendoEventsOutsideAngular", "events"], scope: "scope" }, ngImport: i0 });
|
|
272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EventsOutsideAngularDirective, decorators: [{
|
|
273
|
+
type: Directive,
|
|
274
|
+
args: [{
|
|
275
|
+
selector: '[kendoEventsOutsideAngular]'
|
|
276
|
+
}]
|
|
277
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Renderer2 }]; }, propDecorators: { events: [{
|
|
278
|
+
type: Input,
|
|
279
|
+
args: ['kendoEventsOutsideAngular']
|
|
280
|
+
}], scope: [{
|
|
281
|
+
type: Input
|
|
282
|
+
}] } });
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* @hidden
|
|
286
|
+
*/
|
|
287
|
+
class EventsModule {
|
|
288
|
+
}
|
|
289
|
+
EventsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EventsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
290
|
+
EventsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EventsModule, declarations: [EventsOutsideAngularDirective], exports: [EventsOutsideAngularDirective] });
|
|
291
|
+
EventsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EventsModule });
|
|
292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EventsModule, decorators: [{
|
|
293
|
+
type: NgModule,
|
|
294
|
+
args: [{
|
|
295
|
+
declarations: [EventsOutsideAngularDirective],
|
|
296
|
+
exports: [EventsOutsideAngularDirective]
|
|
297
|
+
}]
|
|
298
|
+
}] });
|
|
299
|
+
|
|
300
|
+
class ResizeService {
|
|
301
|
+
constructor(resizeBatchService) {
|
|
302
|
+
this.resizeBatchService = resizeBatchService;
|
|
303
|
+
this.resize = new EventEmitter();
|
|
304
|
+
this.acceptedSize = false;
|
|
305
|
+
this.state = 0 /* Initial */;
|
|
306
|
+
}
|
|
307
|
+
acceptSize(size = this.measure()) {
|
|
308
|
+
this.lastWidth = size.width;
|
|
309
|
+
this.lastHeight = size.height;
|
|
310
|
+
this.acceptedSize = true;
|
|
311
|
+
}
|
|
312
|
+
checkChanges() {
|
|
313
|
+
if (!isDocumentAvailable()) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
if (this.state === 0 /* Initial */) {
|
|
317
|
+
this.state = 1 /* Initializing */;
|
|
318
|
+
// batch initial measure
|
|
319
|
+
this.resizeBatchService.schedule(this, this.init);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
destroy() {
|
|
323
|
+
this.resizeBatchService.cancel(this);
|
|
324
|
+
}
|
|
325
|
+
checkSize() {
|
|
326
|
+
if (!this.parentElement) {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
const { width, height } = this.measure();
|
|
330
|
+
const sameSize = width === this.lastWidth && height === this.lastHeight;
|
|
331
|
+
if (sameSize) {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
this.lastWidth = width;
|
|
335
|
+
this.lastHeight = height;
|
|
336
|
+
this.acceptedSize = false;
|
|
337
|
+
this.resize.emit();
|
|
338
|
+
return true;
|
|
339
|
+
}
|
|
340
|
+
initSize() {
|
|
341
|
+
const size = this.measure();
|
|
342
|
+
this.lastWidth = size.width;
|
|
343
|
+
this.lastHeight = size.height;
|
|
344
|
+
}
|
|
345
|
+
measure() {
|
|
346
|
+
let width = 0;
|
|
347
|
+
let height = 0;
|
|
348
|
+
if (this.parentElement) {
|
|
349
|
+
height = this.parentElement.offsetHeight;
|
|
350
|
+
width = this.parentElement.offsetWidth;
|
|
351
|
+
}
|
|
352
|
+
return { height, width };
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// eslint-disable import/no-deprecated
|
|
357
|
+
// TODO:NG13 CSP
|
|
358
|
+
const div = (style) => {
|
|
359
|
+
const el = document.createElement('div');
|
|
360
|
+
el.style.cssText = style;
|
|
361
|
+
return el;
|
|
362
|
+
};
|
|
363
|
+
const computedProp = (elem, prop) => getComputedStyle(elem, null).getPropertyValue(prop);
|
|
364
|
+
const WRAP_STYLE = 'position: absolute; display: block; left: 0; top: 0; right: 0; bottom: 0; z-index: -1;' +
|
|
365
|
+
'overflow: hidden; visibility: hidden;';
|
|
366
|
+
const EXPAND_CHILD_STYLE = 'position: absolute; left: 0; top: 0; transition: 0s;';
|
|
367
|
+
const SHRINK_CHILD_STYLE = EXPAND_CHILD_STYLE + 'width: 200%; height: 200%;';
|
|
368
|
+
class ResizeCompatService extends ResizeService {
|
|
369
|
+
constructor(resizeBatchService, element, ngZone) {
|
|
370
|
+
super(resizeBatchService);
|
|
371
|
+
this.element = element;
|
|
372
|
+
this.ngZone = ngZone;
|
|
373
|
+
}
|
|
374
|
+
checkChanges() {
|
|
375
|
+
if (this.state === 2 /* Initialized */) {
|
|
376
|
+
if (!this.resizeBatchService.isScheduled(this)) {
|
|
377
|
+
this.resizeBatchService.schedule(this, this.checkSize);
|
|
378
|
+
}
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
super.checkChanges();
|
|
382
|
+
}
|
|
383
|
+
destroy() {
|
|
384
|
+
var _a;
|
|
385
|
+
super.destroy();
|
|
386
|
+
if (this.subscription) {
|
|
387
|
+
this.subscription.unsubscribe();
|
|
388
|
+
}
|
|
389
|
+
if (this.expand) {
|
|
390
|
+
const element = (_a = this.element) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
391
|
+
element.removeChild(this.expand);
|
|
392
|
+
element.removeChild(this.shrink);
|
|
393
|
+
this.expand.removeChild(this.expandChild);
|
|
394
|
+
this.expand = this.expandChild = this.shrink = this.element = null;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
checkSize() {
|
|
398
|
+
if (super.checkSize()) {
|
|
399
|
+
this.reset();
|
|
400
|
+
return true;
|
|
401
|
+
}
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
init() {
|
|
405
|
+
var _a;
|
|
406
|
+
const parentElement = this.parentElement = (_a = this.element) === null || _a === void 0 ? void 0 : _a.nativeElement.parentElement;
|
|
407
|
+
if (computedProp(parentElement, 'position') === 'static') {
|
|
408
|
+
parentElement.style.position = 'relative';
|
|
409
|
+
}
|
|
410
|
+
this.state = 2 /* Initialized */;
|
|
411
|
+
this.render();
|
|
412
|
+
this.reset();
|
|
413
|
+
this.initSize();
|
|
414
|
+
this.subscribe();
|
|
415
|
+
}
|
|
416
|
+
render() {
|
|
417
|
+
var _a;
|
|
418
|
+
const element = (_a = this.element) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
|
419
|
+
element.style.cssText = WRAP_STYLE;
|
|
420
|
+
element.setAttribute('dir', 'ltr');
|
|
421
|
+
this.expand = div(WRAP_STYLE);
|
|
422
|
+
this.expandChild = div(EXPAND_CHILD_STYLE);
|
|
423
|
+
this.expand.appendChild(this.expandChild);
|
|
424
|
+
element.appendChild(this.expand);
|
|
425
|
+
this.shrink = div(WRAP_STYLE);
|
|
426
|
+
const shrinkChild = div(SHRINK_CHILD_STYLE);
|
|
427
|
+
this.shrink.appendChild(shrinkChild);
|
|
428
|
+
element.appendChild(this.shrink);
|
|
429
|
+
}
|
|
430
|
+
reset() {
|
|
431
|
+
const expandChild = this.expandChild;
|
|
432
|
+
expandChild.style.width = 100000 + 'px';
|
|
433
|
+
expandChild.style.height = 100000 + 'px';
|
|
434
|
+
const expand = this.expand;
|
|
435
|
+
expand.scrollLeft = 100000;
|
|
436
|
+
expand.scrollTop = 100000;
|
|
437
|
+
const shrink = this.shrink;
|
|
438
|
+
shrink.scrollLeft = 100000;
|
|
439
|
+
shrink.scrollTop = 100000;
|
|
440
|
+
}
|
|
441
|
+
subscribe() {
|
|
442
|
+
this.ngZone.runOutsideAngular(() => {
|
|
443
|
+
this.subscription = merge(fromEvent(this.shrink, 'scroll'), fromEvent(this.expand, 'scroll'))
|
|
444
|
+
.subscribe(() => {
|
|
445
|
+
this.checkSize();
|
|
446
|
+
});
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
const HAS_OBSERVER = typeof ResizeObserver !== 'undefined';
|
|
452
|
+
/**
|
|
453
|
+
* @hidden
|
|
454
|
+
*/
|
|
455
|
+
class ResizeObserverService extends ResizeService {
|
|
456
|
+
constructor(resizeBatchService, element, ngZone) {
|
|
457
|
+
super(resizeBatchService);
|
|
458
|
+
this.element = element;
|
|
459
|
+
this.ngZone = ngZone;
|
|
460
|
+
}
|
|
461
|
+
static supported() {
|
|
462
|
+
return HAS_OBSERVER;
|
|
463
|
+
}
|
|
464
|
+
destroy() {
|
|
465
|
+
super.destroy();
|
|
466
|
+
if (this.resizeObserver) {
|
|
467
|
+
this.resizeObserver.disconnect();
|
|
468
|
+
this.resizeObserver = null;
|
|
469
|
+
}
|
|
470
|
+
this.parentElement = null;
|
|
471
|
+
}
|
|
472
|
+
init() {
|
|
473
|
+
this.parentElement = this.element.nativeElement.parentElement;
|
|
474
|
+
this.initSize();
|
|
475
|
+
this.state = 2 /* Initialized */;
|
|
476
|
+
this.ngZone.runOutsideAngular(() => {
|
|
477
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
478
|
+
this.checkSize();
|
|
479
|
+
});
|
|
480
|
+
this.resizeObserver.observe(this.parentElement);
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* @hidden
|
|
487
|
+
*/
|
|
488
|
+
class ResizeBatchService {
|
|
489
|
+
constructor(ngZone) {
|
|
490
|
+
this.ngZone = ngZone;
|
|
491
|
+
this.scheduled = [];
|
|
492
|
+
this.resolvedPromise = Promise.resolve(null);
|
|
493
|
+
this.flush = this.flush.bind(this);
|
|
494
|
+
}
|
|
495
|
+
schedule(instance, method) {
|
|
496
|
+
this.scheduled.push({ instance, method });
|
|
497
|
+
if (!this.subscription) {
|
|
498
|
+
this.ngZone.runOutsideAngular(() => {
|
|
499
|
+
this.subscription = from(this.resolvedPromise)
|
|
500
|
+
.subscribe(this.flush);
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
isScheduled(instance) {
|
|
505
|
+
return Boolean(this.scheduled.find(item => item.instance === instance));
|
|
506
|
+
}
|
|
507
|
+
cancel(instance) {
|
|
508
|
+
const scheduled = this.scheduled;
|
|
509
|
+
const count = scheduled.length;
|
|
510
|
+
for (let idx = 0; idx < count; idx++) {
|
|
511
|
+
if (scheduled[idx].instance === instance) {
|
|
512
|
+
scheduled.splice(idx, 1);
|
|
513
|
+
if (!scheduled.length) {
|
|
514
|
+
this.unsubscribe();
|
|
515
|
+
}
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
ngOnDestroy() {
|
|
521
|
+
this.unsubscribe();
|
|
522
|
+
}
|
|
523
|
+
unsubscribe() {
|
|
524
|
+
if (this.subscription) {
|
|
525
|
+
this.subscription.unsubscribe();
|
|
526
|
+
this.subscription = null;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
flush() {
|
|
530
|
+
this.scheduled.forEach(item => {
|
|
531
|
+
item.method.call(item.instance);
|
|
532
|
+
});
|
|
533
|
+
this.scheduled = [];
|
|
534
|
+
this.unsubscribe();
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
ResizeBatchService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeBatchService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
538
|
+
ResizeBatchService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeBatchService });
|
|
539
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeBatchService, decorators: [{
|
|
540
|
+
type: Injectable
|
|
541
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Emit up to 10 resize events per second by default.
|
|
545
|
+
* Chosen as a compromise between responsiveness and performance.
|
|
546
|
+
*/
|
|
547
|
+
const DEFAULT_RATE_LIMIT = 10;
|
|
548
|
+
/**
|
|
549
|
+
* Resize Sensor Component
|
|
550
|
+
*
|
|
551
|
+
* Triggers a "resize" event whenever the parent DOM element size changes.
|
|
552
|
+
*/
|
|
553
|
+
class ResizeSensorComponent {
|
|
554
|
+
constructor(resizeBatchService, element, ngZone) {
|
|
555
|
+
/**
|
|
556
|
+
* The maximum number of resize events to emit per second.
|
|
557
|
+
*
|
|
558
|
+
* Defaults to 10.
|
|
559
|
+
*/
|
|
560
|
+
this.rateLimit = DEFAULT_RATE_LIMIT;
|
|
561
|
+
/**
|
|
562
|
+
* Fires when the parent DOM element has been resized.
|
|
563
|
+
*/
|
|
564
|
+
this.resize = new EventEmitter();
|
|
565
|
+
const serviceType = ResizeObserverService.supported() ? ResizeObserverService : ResizeCompatService;
|
|
566
|
+
this.resizeService = new serviceType(resizeBatchService, element, ngZone);
|
|
567
|
+
const throttleTime = 1000 / (this.rateLimit || DEFAULT_RATE_LIMIT);
|
|
568
|
+
this.subscription = this.resizeService.resize
|
|
569
|
+
.pipe(auditTime(throttleTime))
|
|
570
|
+
.subscribe(() => {
|
|
571
|
+
if (!this.resizeService.acceptedSize) {
|
|
572
|
+
this.resize.emit();
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
ngAfterViewChecked() {
|
|
577
|
+
this.resizeService.checkChanges();
|
|
578
|
+
}
|
|
579
|
+
ngOnDestroy() {
|
|
580
|
+
this.subscription.unsubscribe();
|
|
581
|
+
this.resizeService.destroy();
|
|
582
|
+
}
|
|
583
|
+
acceptSize(size) {
|
|
584
|
+
this.resizeService.acceptSize(size);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
ResizeSensorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeSensorComponent, deps: [{ token: ResizeBatchService }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
588
|
+
ResizeSensorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: { rateLimit: "rateLimit" }, outputs: { resize: "resize" }, ngImport: i0, template: '', isInline: true });
|
|
589
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeSensorComponent, decorators: [{
|
|
590
|
+
type: Component,
|
|
591
|
+
args: [{
|
|
592
|
+
selector: 'kendo-resize-sensor',
|
|
593
|
+
template: ''
|
|
594
|
+
}]
|
|
595
|
+
}], ctorParameters: function () { return [{ type: ResizeBatchService }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { rateLimit: [{
|
|
596
|
+
type: Input
|
|
597
|
+
}], resize: [{
|
|
598
|
+
type: Output
|
|
599
|
+
}] } });
|
|
600
|
+
|
|
601
|
+
const COMPONENT_DIRECTIVES = [ResizeSensorComponent];
|
|
602
|
+
/**
|
|
603
|
+
* Resize Sensor module
|
|
604
|
+
*/
|
|
605
|
+
class ResizeSensorModule {
|
|
606
|
+
}
|
|
607
|
+
ResizeSensorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeSensorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
608
|
+
ResizeSensorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeSensorModule, declarations: [ResizeSensorComponent], exports: [ResizeSensorComponent] });
|
|
609
|
+
ResizeSensorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeSensorModule, providers: [ResizeBatchService] });
|
|
610
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ResizeSensorModule, decorators: [{
|
|
611
|
+
type: NgModule,
|
|
612
|
+
args: [{
|
|
613
|
+
declarations: [COMPONENT_DIRECTIVES],
|
|
614
|
+
exports: [COMPONENT_DIRECTIVES],
|
|
615
|
+
providers: [ResizeBatchService]
|
|
616
|
+
}]
|
|
617
|
+
}] });
|
|
618
|
+
|
|
619
|
+
class KendoInput {
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Enum with key codes.
|
|
624
|
+
*/
|
|
625
|
+
var Keys;
|
|
626
|
+
(function (Keys) {
|
|
627
|
+
Keys[Keys["Alt"] = 18] = "Alt";
|
|
628
|
+
Keys[Keys["ArrowDown"] = 40] = "ArrowDown";
|
|
629
|
+
Keys[Keys["ArrowLeft"] = 37] = "ArrowLeft";
|
|
630
|
+
Keys[Keys["ArrowRight"] = 39] = "ArrowRight";
|
|
631
|
+
Keys[Keys["ArrowUp"] = 38] = "ArrowUp";
|
|
632
|
+
Keys[Keys["Backspace"] = 8] = "Backspace";
|
|
633
|
+
Keys[Keys["Control"] = 17] = "Control";
|
|
634
|
+
Keys[Keys["Delete"] = 46] = "Delete";
|
|
635
|
+
Keys[Keys["Digit0"] = 48] = "Digit0";
|
|
636
|
+
Keys[Keys["Digit1"] = 49] = "Digit1";
|
|
637
|
+
Keys[Keys["Digit2"] = 50] = "Digit2";
|
|
638
|
+
Keys[Keys["Digit3"] = 51] = "Digit3";
|
|
639
|
+
Keys[Keys["Digit4"] = 52] = "Digit4";
|
|
640
|
+
Keys[Keys["Digit5"] = 53] = "Digit5";
|
|
641
|
+
Keys[Keys["Digit6"] = 54] = "Digit6";
|
|
642
|
+
Keys[Keys["Digit7"] = 55] = "Digit7";
|
|
643
|
+
Keys[Keys["Digit8"] = 56] = "Digit8";
|
|
644
|
+
Keys[Keys["Digit9"] = 57] = "Digit9";
|
|
645
|
+
Keys[Keys["End"] = 35] = "End";
|
|
646
|
+
Keys[Keys["Enter"] = 13] = "Enter";
|
|
647
|
+
Keys[Keys["Escape"] = 27] = "Escape";
|
|
648
|
+
Keys[Keys["F1"] = 112] = "F1";
|
|
649
|
+
Keys[Keys["F2"] = 113] = "F2";
|
|
650
|
+
Keys[Keys["F10"] = 121] = "F10";
|
|
651
|
+
Keys[Keys["Home"] = 36] = "Home";
|
|
652
|
+
Keys[Keys["Insert"] = 45] = "Insert";
|
|
653
|
+
Keys[Keys["KeyA"] = 65] = "KeyA";
|
|
654
|
+
Keys[Keys["KeyB"] = 66] = "KeyB";
|
|
655
|
+
Keys[Keys["KeyC"] = 67] = "KeyC";
|
|
656
|
+
Keys[Keys["KeyD"] = 68] = "KeyD";
|
|
657
|
+
Keys[Keys["KeyE"] = 69] = "KeyE";
|
|
658
|
+
Keys[Keys["KeyF"] = 70] = "KeyF";
|
|
659
|
+
Keys[Keys["KeyG"] = 71] = "KeyG";
|
|
660
|
+
Keys[Keys["KeyH"] = 72] = "KeyH";
|
|
661
|
+
Keys[Keys["KeyI"] = 73] = "KeyI";
|
|
662
|
+
Keys[Keys["KeyJ"] = 74] = "KeyJ";
|
|
663
|
+
Keys[Keys["KeyK"] = 75] = "KeyK";
|
|
664
|
+
Keys[Keys["KeyL"] = 76] = "KeyL";
|
|
665
|
+
Keys[Keys["KeyM"] = 77] = "KeyM";
|
|
666
|
+
Keys[Keys["KeyN"] = 78] = "KeyN";
|
|
667
|
+
Keys[Keys["KeyO"] = 79] = "KeyO";
|
|
668
|
+
Keys[Keys["KeyP"] = 80] = "KeyP";
|
|
669
|
+
Keys[Keys["KeyQ"] = 81] = "KeyQ";
|
|
670
|
+
Keys[Keys["KeyR"] = 82] = "KeyR";
|
|
671
|
+
Keys[Keys["KeyS"] = 83] = "KeyS";
|
|
672
|
+
Keys[Keys["KeyT"] = 84] = "KeyT";
|
|
673
|
+
Keys[Keys["KeyU"] = 85] = "KeyU";
|
|
674
|
+
Keys[Keys["KeyV"] = 86] = "KeyV";
|
|
675
|
+
Keys[Keys["KeyW"] = 87] = "KeyW";
|
|
676
|
+
Keys[Keys["KeyX"] = 88] = "KeyX";
|
|
677
|
+
Keys[Keys["KeyY"] = 89] = "KeyY";
|
|
678
|
+
Keys[Keys["KeyZ"] = 90] = "KeyZ";
|
|
679
|
+
Keys[Keys["NumpadDecimal"] = 110] = "NumpadDecimal";
|
|
680
|
+
Keys[Keys["PageDown"] = 34] = "PageDown";
|
|
681
|
+
Keys[Keys["PageUp"] = 33] = "PageUp";
|
|
682
|
+
Keys[Keys["Shift"] = 16] = "Shift";
|
|
683
|
+
Keys[Keys["Space"] = 32] = "Space";
|
|
684
|
+
Keys[Keys["Tab"] = 9] = "Tab";
|
|
685
|
+
})(Keys || (Keys = {}));
|
|
686
|
+
|
|
687
|
+
class PreventableEvent {
|
|
688
|
+
constructor() {
|
|
689
|
+
this.prevented = false;
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Prevents the default action for a specified event.
|
|
693
|
+
* In this way, the source component suppresses
|
|
694
|
+
* the built-in behavior that follows the event.
|
|
695
|
+
*/
|
|
696
|
+
preventDefault() {
|
|
697
|
+
this.prevented = true;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Returns `true` if the event was prevented
|
|
701
|
+
* by any of its subscribers.
|
|
702
|
+
*
|
|
703
|
+
* @returns `true` if the default action was prevented.
|
|
704
|
+
* Otherwise, returns `false`.
|
|
705
|
+
*/
|
|
706
|
+
isDefaultPrevented() {
|
|
707
|
+
return this.prevented;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
const canCreateElement = () => isDocumentAvailable() && document.createElement;
|
|
712
|
+
const propName = '--kendo-scrollbar-width';
|
|
713
|
+
/**
|
|
714
|
+
* @hidden
|
|
715
|
+
*/
|
|
716
|
+
const scrollbarWidth = () => {
|
|
717
|
+
let scrollbarWidth = 0;
|
|
718
|
+
if (canCreateElement()) {
|
|
719
|
+
const div = document.createElement('div');
|
|
720
|
+
div.style.cssText = 'overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block';
|
|
721
|
+
div.innerHTML = ' ';
|
|
722
|
+
document.body.appendChild(div);
|
|
723
|
+
scrollbarWidth = div.offsetWidth - div.scrollWidth;
|
|
724
|
+
document.body.removeChild(div);
|
|
725
|
+
}
|
|
726
|
+
return scrollbarWidth;
|
|
727
|
+
};
|
|
728
|
+
/**
|
|
729
|
+
* @hidden
|
|
730
|
+
*/
|
|
731
|
+
class ScrollbarWidthService {
|
|
732
|
+
constructor() {
|
|
733
|
+
this.changes = new EventEmitter();
|
|
734
|
+
if (typeof window !== 'undefined' && isDocumentAvailable()) {
|
|
735
|
+
document.body.style.setProperty(propName, `${scrollbarWidth()}px`);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
ScrollbarWidthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ScrollbarWidthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
740
|
+
ScrollbarWidthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ScrollbarWidthService, providedIn: 'root' });
|
|
741
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ScrollbarWidthService, decorators: [{
|
|
742
|
+
type: Injectable,
|
|
743
|
+
args: [{
|
|
744
|
+
providedIn: 'root'
|
|
745
|
+
}]
|
|
746
|
+
}], ctorParameters: function () { return []; } });
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Generated bundle index. Do not edit.
|
|
750
|
+
*/
|
|
751
|
+
|
|
752
|
+
export { DraggableDirective, DraggableModule, EventsModule, EventsOutsideAngularDirective, KendoInput, Keys, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent, ResizeSensorModule, ScrollbarWidthService, anyChanged, closest, closestInScope, contains, findElement, findFocusable, findFocusableChild, guid, hasClasses, hasObservers, isChanged, isDocumentAvailable, isFocusable, isFocusableWithTabKey, isVisible, matchesClasses, matchesNodeName, rtlScrollPosition, scrollbarWidth };
|
|
753
|
+
|