@progress/kendo-angular-common 2.0.3-dev.202202251000 → 3.0.0-dev.202204131617

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