@progress/kendo-angular-listview 3.0.2 → 4.0.0-next.202204010900

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 (152) hide show
  1. package/bundles/kendo-angular-listview.umd.js +5 -0
  2. package/{dist/es2015/data-binding → data-binding}/data-binding.directive.d.ts +5 -1
  3. package/{dist/es2015/editing → editing}/commands/add-command.directive.d.ts +3 -0
  4. package/{dist/es2015/editing → editing}/commands/cancel-command.directive.d.ts +3 -0
  5. package/{dist/es2015/editing → editing}/commands/edit-command.directive.d.ts +3 -0
  6. package/{dist/es2015/editing → editing}/commands/remove-command.directive.d.ts +3 -0
  7. package/{dist/es2015/editing → editing}/commands/save-command.directive.d.ts +3 -0
  8. package/{dist/es2015/editing → editing}/edit-template.directive.d.ts +3 -0
  9. package/{dist/es2015/editing → editing}/edit.service.d.ts +6 -3
  10. package/{dist/es2015/editing → editing}/events/add-event-args.interface.d.ts +0 -0
  11. package/{dist/es2015/editing → editing}/events/cancel-event-args.interface.d.ts +0 -0
  12. package/{dist/es2015/editing → editing}/events/edit-event-args.interface.d.ts +0 -0
  13. package/{dist/es2015/editing → editing}/events/remove-event-args.interface.d.ts +0 -0
  14. package/{dist/es2015/editing → editing}/events/save-event-args.interface.d.ts +0 -0
  15. package/{dist/es2015 → esm2015}/data-binding/data-binding.directive.js +15 -16
  16. package/esm2015/editing/commands/add-command.directive.js +49 -0
  17. package/{dist/es2015 → esm2015}/editing/commands/cancel-command.directive.js +17 -23
  18. package/{dist/es2015 → esm2015}/editing/commands/edit-command.directive.js +17 -23
  19. package/{dist/es2015 → esm2015}/editing/commands/remove-command.directive.js +17 -23
  20. package/{dist/es2015 → esm2015}/editing/commands/save-command.directive.js +17 -23
  21. package/{dist/es2015 → esm2015}/editing/edit-template.directive.js +14 -12
  22. package/{dist/es2015 → esm2015}/editing/edit.service.js +9 -13
  23. package/{dist/es → esm2015}/editing/events/add-event-args.interface.js +1 -0
  24. package/{dist/es2015 → esm2015}/editing/events/cancel-event-args.interface.js +1 -0
  25. package/{dist/es2015 → esm2015}/editing/events/edit-event-args.interface.js +1 -0
  26. package/{dist/es2015 → esm2015}/editing/events/remove-event-args.interface.js +1 -0
  27. package/{dist/es → esm2015}/editing/events/save-event-args.interface.js +1 -0
  28. package/{dist/es/editing/events/remove-event-args.interface.js → esm2015/kendo-angular-listview.js} +4 -0
  29. package/{dist/es2015 → esm2015}/listview.component.js +242 -155
  30. package/{dist/es2015 → esm2015}/listview.module.js +56 -26
  31. package/{dist/es → esm2015}/main.js +5 -0
  32. package/{dist/es → esm2015}/models/listview-data-result.js +1 -0
  33. package/{dist/es → esm2015}/models/page-change-event.js +1 -0
  34. package/{dist/es2015 → esm2015}/models/page-size-change-event.js +0 -0
  35. package/{dist/es → esm2015}/models/page-size-item.js +1 -0
  36. package/{dist/es → esm2015}/models/pager-position.js +1 -0
  37. package/{dist/es → esm2015}/models/pager-settings.js +1 -0
  38. package/{dist/es → esm2015}/models/pager-type.js +1 -0
  39. package/{dist/es → esm2015}/models/scroll-bottom-event.js +1 -0
  40. package/{dist/es2015 → esm2015}/navigation/listview-navigable-item.directive.js +15 -18
  41. package/{dist/es2015 → esm2015}/navigation/navigation.service.js +8 -13
  42. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  43. package/esm2015/templates/footer-template.directive.js +24 -0
  44. package/esm2015/templates/header-template.directive.js +24 -0
  45. package/{dist/es2015 → esm2015}/templates/item-template.directive.js +12 -11
  46. package/esm2015/templates/loader-template.directive.js +24 -0
  47. package/esm2015/templates/template-context.directive.js +33 -0
  48. package/{dist/es2015 → esm2015}/utils.js +0 -0
  49. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-listview.js} +521 -417
  50. package/{dist/es/editing/events/cancel-event-args.interface.js → kendo-angular-listview.d.ts} +5 -0
  51. package/{dist/es2015/listview.component.d.ts → listview.component.d.ts} +13 -7
  52. package/listview.module.d.ts +39 -0
  53. package/{dist/es2015/main.d.ts → main.d.ts} +5 -0
  54. package/{dist/es2015/models → models}/listview-data-result.d.ts +0 -0
  55. package/{dist/es2015/models → models}/page-change-event.d.ts +0 -0
  56. package/{dist/es2015/models → models}/page-size-change-event.d.ts +0 -0
  57. package/{dist/es2015/models → models}/page-size-item.d.ts +0 -0
  58. package/{dist/es2015/models → models}/pager-position.d.ts +0 -0
  59. package/{dist/es2015/models → models}/pager-settings.d.ts +0 -0
  60. package/{dist/es2015/models → models}/pager-type.d.ts +0 -0
  61. package/{dist/es2015/models → models}/scroll-bottom-event.d.ts +0 -0
  62. package/{dist/es2015/navigation → navigation}/listview-navigable-item.directive.d.ts +3 -0
  63. package/{dist/es2015/navigation → navigation}/navigation.service.d.ts +5 -1
  64. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  65. package/package.json +36 -108
  66. package/schematics/ngAdd/index.js +5 -2
  67. package/schematics/ngAdd/index.js.map +1 -1
  68. package/{dist/es2015/templates → templates}/footer-template.directive.d.ts +3 -0
  69. package/{dist/es2015/templates → templates}/header-template.directive.d.ts +3 -0
  70. package/{dist/es2015/templates → templates}/item-template.directive.d.ts +3 -0
  71. package/{dist/es2015/templates → templates}/loader-template.directive.d.ts +3 -0
  72. package/{dist/es2015/templates → templates}/template-context.directive.d.ts +4 -1
  73. package/{dist/es2015/utils.d.ts → utils.d.ts} +0 -0
  74. package/dist/cdn/js/kendo-angular-listview.js +0 -20
  75. package/dist/cdn/main.js +0 -5
  76. package/dist/es/data-binding/data-binding.directive.js +0 -69
  77. package/dist/es/editing/commands/add-command.directive.js +0 -58
  78. package/dist/es/editing/commands/cancel-command.directive.js +0 -74
  79. package/dist/es/editing/commands/edit-command.directive.js +0 -62
  80. package/dist/es/editing/commands/remove-command.directive.js +0 -61
  81. package/dist/es/editing/commands/save-command.directive.js +0 -74
  82. package/dist/es/editing/edit-template.directive.js +0 -32
  83. package/dist/es/editing/edit.service.js +0 -136
  84. package/dist/es/editing/events/edit-event-args.interface.js +0 -4
  85. package/dist/es/index.js +0 -17
  86. package/dist/es/listview.component.js +0 -534
  87. package/dist/es/listview.module.js +0 -83
  88. package/dist/es/models/page-size-change-event.js +0 -18
  89. package/dist/es/navigation/listview-navigable-item.directive.js +0 -70
  90. package/dist/es/navigation/navigation.service.js +0 -162
  91. package/dist/es/package-metadata.js +0 -15
  92. package/dist/es/templates/footer-template.directive.js +0 -24
  93. package/dist/es/templates/header-template.directive.js +0 -24
  94. package/dist/es/templates/item-template.directive.js +0 -30
  95. package/dist/es/templates/loader-template.directive.js +0 -24
  96. package/dist/es/templates/template-context.directive.js +0 -40
  97. package/dist/es/utils.js +0 -103
  98. package/dist/es2015/editing/commands/add-command.directive.js +0 -55
  99. package/dist/es2015/editing/events/add-event-args.interface.js +0 -4
  100. package/dist/es2015/editing/events/save-event-args.interface.js +0 -4
  101. package/dist/es2015/index.d.ts +0 -17
  102. package/dist/es2015/index.js +0 -17
  103. package/dist/es2015/index.metadata.json +0 -1
  104. package/dist/es2015/listview.module.d.ts +0 -18
  105. package/dist/es2015/main.js +0 -13
  106. package/dist/es2015/models/listview-data-result.js +0 -4
  107. package/dist/es2015/models/page-change-event.js +0 -4
  108. package/dist/es2015/models/page-size-item.js +0 -4
  109. package/dist/es2015/models/pager-position.js +0 -4
  110. package/dist/es2015/models/pager-settings.js +0 -4
  111. package/dist/es2015/models/pager-type.js +0 -4
  112. package/dist/es2015/models/scroll-bottom-event.js +0 -4
  113. package/dist/es2015/templates/footer-template.directive.js +0 -23
  114. package/dist/es2015/templates/header-template.directive.js +0 -23
  115. package/dist/es2015/templates/loader-template.directive.js +0 -23
  116. package/dist/es2015/templates/template-context.directive.js +0 -35
  117. package/dist/fesm5/index.js +0 -1528
  118. package/dist/npm/data-binding/data-binding.directive.js +0 -71
  119. package/dist/npm/editing/commands/add-command.directive.js +0 -60
  120. package/dist/npm/editing/commands/cancel-command.directive.js +0 -76
  121. package/dist/npm/editing/commands/edit-command.directive.js +0 -64
  122. package/dist/npm/editing/commands/remove-command.directive.js +0 -63
  123. package/dist/npm/editing/commands/save-command.directive.js +0 -76
  124. package/dist/npm/editing/edit-template.directive.js +0 -34
  125. package/dist/npm/editing/edit.service.js +0 -140
  126. package/dist/npm/editing/events/add-event-args.interface.js +0 -6
  127. package/dist/npm/editing/events/cancel-event-args.interface.js +0 -6
  128. package/dist/npm/editing/events/edit-event-args.interface.js +0 -6
  129. package/dist/npm/editing/events/remove-event-args.interface.js +0 -6
  130. package/dist/npm/editing/events/save-event-args.interface.js +0 -6
  131. package/dist/npm/index.js +0 -29
  132. package/dist/npm/listview.component.js +0 -536
  133. package/dist/npm/listview.module.js +0 -85
  134. package/dist/npm/main.js +0 -24
  135. package/dist/npm/models/listview-data-result.js +0 -6
  136. package/dist/npm/models/page-change-event.js +0 -6
  137. package/dist/npm/models/page-size-change-event.js +0 -20
  138. package/dist/npm/models/page-size-item.js +0 -6
  139. package/dist/npm/models/pager-position.js +0 -6
  140. package/dist/npm/models/pager-settings.js +0 -6
  141. package/dist/npm/models/pager-type.js +0 -6
  142. package/dist/npm/models/scroll-bottom-event.js +0 -6
  143. package/dist/npm/navigation/listview-navigable-item.directive.js +0 -72
  144. package/dist/npm/navigation/navigation.service.js +0 -164
  145. package/dist/npm/package-metadata.js +0 -17
  146. package/dist/npm/templates/footer-template.directive.js +0 -26
  147. package/dist/npm/templates/header-template.directive.js +0 -26
  148. package/dist/npm/templates/item-template.directive.js +0 -32
  149. package/dist/npm/templates/loader-template.directive.js +0 -26
  150. package/dist/npm/templates/template-context.directive.js +0 -42
  151. package/dist/npm/utils.js +0 -105
  152. package/dist/systemjs/kendo-angular-listview.js +0 -5
@@ -1,1528 +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, __param, __extends } from 'tslib';
6
- import { Injectable, Input, Directive, ElementRef, Renderer2, TemplateRef, Optional, NgZone, EventEmitter, HostBinding, ContentChild, ViewChild, ViewChildren, QueryList, Output, Component, ChangeDetectionStrategy, ViewContainerRef, HostListener, NgModule } from '@angular/core';
7
- import { isDocumentAvailable, Keys, isChanged, hasObservers, EventsModule } from '@progress/kendo-angular-common';
8
- import { validatePackage } from '@progress/kendo-licensing';
9
- import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
10
- import { Subject, Subscription } from 'rxjs';
11
- import { FormGroup, FormControl } from '@angular/forms';
12
- import { switchMap, take } from 'rxjs/operators';
13
- import { PageSizeChangeEvent, PagerModule } from '@progress/kendo-angular-pager';
14
- import { CommonModule } from '@angular/common';
15
- import { Button } from '@progress/kendo-angular-buttons';
16
-
17
- /**
18
- * @hidden
19
- */
20
- var packageMetadata = {
21
- name: '@progress/kendo-angular-listview',
22
- productName: 'Kendo UI for Angular',
23
- productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
24
- publishDate: 1646219074,
25
- version: '',
26
- 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'
27
- };
28
-
29
- var LISTVIEW_ITEM_SELECTOR = '.k-listview-item';
30
- /**
31
- * @hidden
32
- */
33
- var isPresent = function (item) { return item !== null && item !== undefined; };
34
- /**
35
- * @hidden
36
- *
37
- * Polyfill for `Element.matches`.
38
- * https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
39
- */
40
- var match = function (element, selector) {
41
- var matcher = element.matches || element.msMatchesSelector || element.webkitMatchesSelector;
42
- if (!isPresent(matcher)) {
43
- return false;
44
- }
45
- return matcher.call(element, selector);
46
- };
47
- /**
48
- * @hidden
49
- *
50
- * Checks if a target element has the `.k-listview-item` CSS class.
51
- */
52
- var isListViewItem = function (element) {
53
- if (!isPresent(element)) {
54
- return false;
55
- }
56
- return match(element, LISTVIEW_ITEM_SELECTOR);
57
- };
58
- /**
59
- * @hidden
60
- *
61
- * Extracts and parses to a number the `data-kendo-listview-item-index` attribute value from the targeted element.
62
- */
63
- var getListItemIndex = function (item) {
64
- if (!isPresent(item)) {
65
- return null;
66
- }
67
- return Number(item.getAttribute('data-kendo-listview-item-index'));
68
- };
69
- /**
70
- * @hidden
71
- *
72
- * Gets the new focus target from a blur event.
73
- * Queries both event.relatedTarget and document.activeElement for compatibility with IE.
74
- */
75
- var relatedTarget = function (event) {
76
- if (!isPresent(event.relatedTarget) || !isDocumentAvailable()) {
77
- return null;
78
- }
79
- return event.relatedTarget || document.activeElement;
80
- };
81
- /**
82
- * @hidden
83
- *
84
- * If the given contender number is not defined or lower than the specified min - returns min, if its above the specified max - returns max.
85
- * If the number is in the given bounds, it is returned.
86
- */
87
- var fitIntoRange = function (contender, min, max) {
88
- if (!isPresent(contender) || contender <= min) {
89
- return min;
90
- }
91
- else if (contender >= max) {
92
- return max;
93
- }
94
- else {
95
- return contender;
96
- }
97
- };
98
- /**
99
- * @hidden
100
- */
101
- var closestWithMatch = function (element, selector) {
102
- var parent = element;
103
- while (parent !== null && parent.nodeType === 1) {
104
- if (match(parent, selector)) {
105
- return parent;
106
- }
107
- parent = parent.parentElement || parent.parentNode;
108
- }
109
- return null;
110
- };
111
- /**
112
- * @hidden
113
- *
114
- * Extracts and parses to a number the `data-kendo-listview-item-index` attribute value from the targeted element.
115
- */
116
- var getClosestListItemIndex = function (element) {
117
- if (!isPresent(element)) {
118
- return null;
119
- }
120
- var closestListViewItem = closestWithMatch(element, LISTVIEW_ITEM_SELECTOR);
121
- return getListItemIndex(closestListViewItem);
122
- };
123
-
124
- /**
125
- * @hidden
126
- *
127
- * Provided per ListView instance. Keeps the availability, active index and focused state of the current ListView.
128
- * Emits `changes` when any of the aforementioned states changes.
129
- */
130
- var NavigationService = /** @class */ (function () {
131
- function NavigationService() {
132
- /**
133
- * Emits every time a change in active index/focus/blur/navigation availability occurs.
134
- */
135
- this.changes = new Subject();
136
- /**
137
- * Specifies if a ListView item currently holds focus.
138
- */
139
- this.isFocused = false;
140
- /**
141
- * Keeps track of the index of the items that should be the current focus target (tabindex="0").
142
- * When set to `null`/`undefined`, the navigation is disabled and the items should not render a tabindex.
143
- */
144
- this.activeIndex = null;
145
- }
146
- Object.defineProperty(NavigationService.prototype, "isEnabled", {
147
- /**
148
- * Sets or gets if the navigation is enabled.
149
- * When no activeIndex is present, the navigation is inferred as disabled.
150
- * Toggling the service availability clears the current active index or activates the first one.
151
- */
152
- get: function () {
153
- return isPresent(this.activeIndex);
154
- },
155
- set: function (enabled) {
156
- if (enabled) {
157
- this.activeIndex = 0;
158
- }
159
- else {
160
- this.activeIndex = null;
161
- }
162
- this.changes.next();
163
- },
164
- enumerable: true,
165
- configurable: true
166
- });
167
- /**
168
- * Shows if the checked index should be the current available focus target (tabindex="0").
169
- */
170
- NavigationService.prototype.isActive = function (index) {
171
- return index === this.activeIndex;
172
- };
173
- NavigationService.prototype.handleKeyDown = function (event, totalItemsCount) {
174
- var keyCode = event.keyCode;
175
- switch (keyCode) {
176
- case Keys.ArrowLeft:
177
- case Keys.ArrowUp:
178
- this.navigateToPrevious();
179
- break;
180
- case Keys.ArrowRight:
181
- case Keys.ArrowDown:
182
- this.navigateToNext(totalItemsCount);
183
- break;
184
- case Keys.Home:
185
- var firstIndex = 0;
186
- this.navigateTo(firstIndex);
187
- break;
188
- case Keys.End:
189
- var lastIndex = totalItemsCount - 1;
190
- this.navigateTo(lastIndex);
191
- break;
192
- default: return;
193
- }
194
- // the following line is executed only if the pressed key matches one of the listview hotkeys -
195
- // they `break`, while the `default` case `return`s
196
- event.preventDefault();
197
- };
198
- NavigationService.prototype.handleFocusIn = function (event) {
199
- var target = event.target;
200
- if (!isListViewItem(target)) {
201
- var listViewItemSelector = '.k-listview-item';
202
- var closestListViewItem = closestWithMatch(target, listViewItemSelector);
203
- var isListViewItemChild = isPresent(closestListViewItem);
204
- if (isListViewItemChild) {
205
- var itemIndex = getListItemIndex(closestListViewItem);
206
- this.setActiveIndex(itemIndex);
207
- }
208
- return;
209
- }
210
- var targetIndex = getListItemIndex(target);
211
- // don't emit if the no change in focused state has occurred and the targeted index is the same as the current activeIndex
212
- if (this.isFocused && targetIndex === this.activeIndex) {
213
- return;
214
- }
215
- this.activeIndex = targetIndex;
216
- this.isFocused = true;
217
- this.changes.next();
218
- };
219
- NavigationService.prototype.handleFocusOut = function (event) {
220
- // don't emit if the blurred item is not a listview item or if the new focus target is another listview item
221
- if (!isListViewItem(event.target) || isListViewItem(relatedTarget(event))) {
222
- return;
223
- }
224
- this.isFocused = false;
225
- this.changes.next();
226
- };
227
- /**
228
- * Sets the `activeIndex` and triggers changes without focusing the corresponding ListView item.
229
- */
230
- NavigationService.prototype.setActiveIndex = function (index) {
231
- if (!this.isEnabled) {
232
- return;
233
- }
234
- if (index === this.activeIndex) {
235
- return;
236
- }
237
- this.activeIndex = index;
238
- this.changes.next();
239
- };
240
- /**
241
- * Focuses item at the targeted index. If no index is passed, the current `activeIndex` is used.
242
- * The passed target index is normalized to fit the min/max available indices bounds.
243
- */
244
- NavigationService.prototype.focusIndex = function (index, totalItemsCount) {
245
- if (!this.isEnabled) {
246
- return;
247
- }
248
- var parsed = parseInt(index, 10);
249
- var firstIndex = 0;
250
- var lastIndex = totalItemsCount - 1;
251
- var targetIndex = isNaN(parsed) ? this.activeIndex : fitIntoRange(parsed, firstIndex, lastIndex);
252
- this.navigateTo(targetIndex);
253
- };
254
- NavigationService.prototype.navigateTo = function (index) {
255
- if (this.isFocused && this.activeIndex === index) {
256
- return;
257
- }
258
- this.isFocused = true;
259
- this.activeIndex = index;
260
- this.changes.next();
261
- };
262
- NavigationService.prototype.navigateToPrevious = function () {
263
- var previousIndex = Math.max(this.activeIndex - 1, 0);
264
- this.navigateTo(previousIndex);
265
- };
266
- NavigationService.prototype.navigateToNext = function (totalItemsCount) {
267
- var lastAvailableIndex = totalItemsCount - 1;
268
- var nextIndex = Math.min(this.activeIndex + 1, lastAvailableIndex);
269
- this.navigateTo(nextIndex);
270
- };
271
- NavigationService = __decorate([
272
- Injectable()
273
- ], NavigationService);
274
- return NavigationService;
275
- }());
276
-
277
- /**
278
- * @hidden
279
- */
280
- var ListViewNavigableItemDirective = /** @class */ (function () {
281
- function ListViewNavigableItemDirective(hostElement, renderer, navigationService) {
282
- this.hostElement = hostElement;
283
- this.renderer = renderer;
284
- this.navigationService = navigationService;
285
- }
286
- ListViewNavigableItemDirective.prototype.ngOnChanges = function () {
287
- this.updateNavigationState();
288
- };
289
- ListViewNavigableItemDirective.prototype.ngOnInit = function () {
290
- this.navigationSubscription = this.navigationService.changes
291
- .subscribe(this.updateNavigationState.bind(this));
292
- };
293
- ListViewNavigableItemDirective.prototype.ngOnDestroy = function () {
294
- if (isPresent(this.navigationSubscription)) {
295
- this.navigationSubscription.unsubscribe();
296
- }
297
- };
298
- ListViewNavigableItemDirective.prototype.updateNavigationState = function () {
299
- this.updateTabIndex();
300
- this.updateFocusedState();
301
- };
302
- ListViewNavigableItemDirective.prototype.updateFocusedState = function () {
303
- var shouldFocus = this.navigationService.isActive(this.index) && this.navigationService.isFocused;
304
- var focusedCssClass = 'k-state-focused';
305
- if (shouldFocus) {
306
- this.renderer.addClass(this.hostElement.nativeElement, focusedCssClass);
307
- this.hostElement.nativeElement.focus();
308
- }
309
- else {
310
- this.renderer.removeClass(this.hostElement.nativeElement, focusedCssClass);
311
- }
312
- };
313
- ListViewNavigableItemDirective.prototype.updateTabIndex = function () {
314
- if (!this.navigationService.isEnabled) {
315
- this.renderer.removeAttribute(this.hostElement.nativeElement, 'tabindex');
316
- }
317
- else if (this.navigationService.isActive(this.index)) {
318
- this.renderer.setAttribute(this.hostElement.nativeElement, 'tabindex', '0');
319
- }
320
- else {
321
- this.renderer.setAttribute(this.hostElement.nativeElement, 'tabindex', '-1');
322
- }
323
- };
324
- __decorate([
325
- Input(),
326
- __metadata("design:type", Number)
327
- ], ListViewNavigableItemDirective.prototype, "index", void 0);
328
- ListViewNavigableItemDirective = __decorate([
329
- Directive({
330
- selector: '[kendoListViewNavigableItem]'
331
- }),
332
- __metadata("design:paramtypes", [ElementRef,
333
- Renderer2,
334
- NavigationService])
335
- ], ListViewNavigableItemDirective);
336
- return ListViewNavigableItemDirective;
337
- }());
338
-
339
- /**
340
- * Renders the list item content. To define an item template, nest an `<ng-template>` tag
341
- * with the `kendoListViewItemTemplate` directive inside the `<kendo-listview>` tag
342
- * [see example]({% slug templates_listview %}#toc-item-template).
343
- *
344
- * The following values are available as context variables:
345
- * - `let-dataItem="dataItem"` (`any`) - The current data item. Also available as implicit context variable.
346
- * - `let-index="index"` (`number`) - The current item index.
347
- * - `let-isFirst="isFirst"` (`boolean`) - Indicates whether the current data item will be rendered as the first item on the list.
348
- * - `let-isLast="isLast"` (`boolean`)- Indicates whether the current data item will be rendered as the last item on the list.
349
- */
350
- var ItemTemplateDirective = /** @class */ (function () {
351
- function ItemTemplateDirective(templateRef) {
352
- this.templateRef = templateRef;
353
- }
354
- ItemTemplateDirective = __decorate([
355
- Directive({
356
- selector: '[kendoListViewItemTemplate]'
357
- }),
358
- __metadata("design:paramtypes", [TemplateRef])
359
- ], ItemTemplateDirective);
360
- return ItemTemplateDirective;
361
- }());
362
-
363
- /**
364
- * Renders the header content of the ListView. To define a header template, nest an `<ng-template>` tag
365
- * with the `kendoListViewHeaderTemplate` directive inside the `<kendo-listview>` tag
366
- * [see example]({% slug templates_listview %}#toc-header-template).
367
- */
368
- var HeaderTemplateDirective = /** @class */ (function () {
369
- function HeaderTemplateDirective(templateRef) {
370
- this.templateRef = templateRef;
371
- }
372
- HeaderTemplateDirective = __decorate([
373
- Directive({
374
- selector: '[kendoListViewHeaderTemplate]'
375
- }),
376
- __metadata("design:paramtypes", [TemplateRef])
377
- ], HeaderTemplateDirective);
378
- return HeaderTemplateDirective;
379
- }());
380
-
381
- /**
382
- * Renders the footer content of the ListView. To define a footer template, nest an `<ng-template>` tag
383
- * with the `kendoListViewFooterTemplate` directive inside the `<kendo-listview>` tag
384
- * [see example]({% slug templates_listview %}#toc-footer-template).
385
- */
386
- var FooterTemplateDirective = /** @class */ (function () {
387
- function FooterTemplateDirective(templateRef) {
388
- this.templateRef = templateRef;
389
- }
390
- FooterTemplateDirective = __decorate([
391
- Directive({
392
- selector: '[kendoListViewFooterTemplate]'
393
- }),
394
- __metadata("design:paramtypes", [TemplateRef])
395
- ], FooterTemplateDirective);
396
- return FooterTemplateDirective;
397
- }());
398
-
399
- /**
400
- * Overrides the default loader content of the ListView. To define a loader template, nest an `<ng-template>` tag
401
- * with the `kendoListViewLoaderTemplate` directive inside the `<kendo-listview>` tag
402
- * [see example]({% slug templates_listview %}#toc-loader-template).
403
- */
404
- var LoaderTemplateDirective = /** @class */ (function () {
405
- function LoaderTemplateDirective(templateRef) {
406
- this.templateRef = templateRef;
407
- }
408
- LoaderTemplateDirective = __decorate([
409
- Directive({
410
- selector: '[kendoListViewLoaderTemplate]'
411
- }),
412
- __metadata("design:paramtypes", [TemplateRef])
413
- ], LoaderTemplateDirective);
414
- return LoaderTemplateDirective;
415
- }());
416
-
417
- /**
418
- * Represents the edit template of the ListView ([see example]({% slug editing_template_forms_listview %})).
419
- * Helps to customize the content of the edited items. To define the template, nest an `<ng-template>`
420
- * tag with the `kendoListViewEditTemplate` directive inside a `<kendo-listview>` tag.
421
- *
422
- * The template context contains the following fields:
423
- * - `formGroup`&mdash;The current [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }}).
424
- * If you use the ListView inside [Template-Driven Forms]({{ site.data.urls.angular['forms'] }}), it will be `undefined`.
425
- * - `itemIndex`&mdash;The current item index. If inside a new item, `itemIndex` is `-1`.
426
- * - `dataItem`&mdash;The current data item.
427
- * - `isNew`&mdash;The state of the current item.
428
- */
429
- var EditTemplateDirective = /** @class */ (function () {
430
- function EditTemplateDirective(templateRef) {
431
- this.templateRef = templateRef;
432
- }
433
- EditTemplateDirective = __decorate([
434
- Directive({
435
- selector: '[kendoListViewEditTemplate]'
436
- }),
437
- __param(0, Optional()),
438
- __metadata("design:paramtypes", [TemplateRef])
439
- ], EditTemplateDirective);
440
- return EditTemplateDirective;
441
- }());
442
-
443
- /**
444
- * @hidden
445
- */
446
- var isEqual = function (index) { return function (item) { return item.index === index; }; };
447
- /**
448
- * @hidden
449
- */
450
- var isNotEqual = function (index) { return function (item) { return item.index !== index; }; };
451
- /**
452
- * @hidden
453
- */
454
- var isNewItem = function (index) { return index === -1 || index === undefined; };
455
- /**
456
- * @hidden
457
- */
458
- var EditService = /** @class */ (function () {
459
- function EditService(ngZone) {
460
- var _this = this;
461
- this.ngZone = ngZone;
462
- this.changes = new EventEmitter();
463
- this.editedIndices = [];
464
- this.changedSource = new Subject();
465
- this.changed = this.changedSource.asObservable().pipe(switchMap(function () { return _this.ngZone.onStable.asObservable().pipe(take(1)); }));
466
- }
467
- EditService.prototype.editItem = function (index, group) {
468
- if (group === void 0) { group = undefined; }
469
- this.editedIndices.push({ index: index, group: group });
470
- this.onChanged();
471
- };
472
- EditService.prototype.addItem = function (group) {
473
- this.newItem = { group: group };
474
- this.onChanged();
475
- };
476
- EditService.prototype.isEditing = function () {
477
- return this.editedIndices.length > 0;
478
- };
479
- Object.defineProperty(EditService.prototype, "hasNewItem", {
480
- get: function () {
481
- return isPresent(this.newItem);
482
- },
483
- enumerable: true,
484
- configurable: true
485
- });
486
- Object.defineProperty(EditService.prototype, "newDataItem", {
487
- get: function () {
488
- if (this.hasNewItem) {
489
- return this.newItem.group.value;
490
- }
491
- return {};
492
- },
493
- enumerable: true,
494
- configurable: true
495
- });
496
- Object.defineProperty(EditService.prototype, "newItemGroup", {
497
- get: function () {
498
- if (this.hasNewItem) {
499
- return this.newItem.group;
500
- }
501
- return new FormGroup({});
502
- },
503
- enumerable: true,
504
- configurable: true
505
- });
506
- EditService.prototype.editGroup = function (index) {
507
- return this.context(index).group;
508
- };
509
- EditService.prototype.close = function (index) {
510
- if (isNewItem(index)) {
511
- this.newItem = undefined;
512
- return;
513
- }
514
- this.editedIndices = this.editedIndices.filter(isNotEqual(index));
515
- this.onChanged();
516
- };
517
- EditService.prototype.context = function (index) {
518
- if (isNewItem(index)) {
519
- return this.newItem;
520
- }
521
- return this.findByIndex(index);
522
- };
523
- EditService.prototype.isEdited = function (index) {
524
- if (isNewItem(index) && isPresent(this.newItem)) {
525
- return true;
526
- }
527
- return isPresent(this.findByIndex(index));
528
- };
529
- EditService.prototype.hasEdited = function (index) {
530
- return isPresent(this.context(index));
531
- };
532
- EditService.prototype.beginEdit = function (itemIndex) {
533
- this.changes.emit({ action: 'edit', itemIndex: itemIndex });
534
- };
535
- EditService.prototype.beginAdd = function () {
536
- this.changes.emit({ action: 'add' });
537
- };
538
- EditService.prototype.endEdit = function (itemIndex) {
539
- var formGroup = this.context(itemIndex).group;
540
- this.changes.emit({ action: 'cancel', itemIndex: itemIndex, formGroup: formGroup, isNew: isNewItem(itemIndex) });
541
- };
542
- EditService.prototype.save = function (itemIndex) {
543
- var formGroup = this.context(itemIndex).group;
544
- this.changes.emit({ action: 'save', itemIndex: itemIndex, formGroup: formGroup, isNew: isNewItem(itemIndex) });
545
- };
546
- EditService.prototype.remove = function (itemIndex) {
547
- this.changes.emit({ action: 'remove', itemIndex: itemIndex });
548
- };
549
- EditService.prototype.findByIndex = function (index) {
550
- return this.editedIndices.find(isEqual(index));
551
- };
552
- EditService.prototype.onChanged = function () {
553
- var _this = this;
554
- this.ngZone.runOutsideAngular(function () {
555
- _this.changedSource.next();
556
- });
557
- };
558
- EditService = __decorate([
559
- Injectable(),
560
- __metadata("design:paramtypes", [NgZone])
561
- ], EditService);
562
- return EditService;
563
- }());
564
-
565
- var DEFAULT_PAGER_SETTINGS = {
566
- position: 'bottom',
567
- buttonCount: 5,
568
- info: true,
569
- previousNext: true,
570
- type: 'numeric',
571
- pageSizeValues: [5, 10, 20]
572
- };
573
- var createControl = function (source) { return function (acc, key) {
574
- acc[key] = new FormControl(source[key]);
575
- return acc;
576
- }; };
577
- /**
578
- * Represents the Kendo UI ListView component for Angular.
579
- */
580
- var ListViewComponent = /** @class */ (function () {
581
- function ListViewComponent(ngZone, element, renderer, editService, navigationService) {
582
- this.ngZone = ngZone;
583
- this.element = element;
584
- this.renderer = renderer;
585
- this.editService = editService;
586
- this.navigationService = navigationService;
587
- /**
588
- * @hidden
589
- */
590
- this.className = true;
591
- /**
592
- * Specifies if the loading indicator of the ListView will be displayed
593
- * ([see example]({% slug paging_listview %}#toc-remote-binding)).
594
- */
595
- this.loading = false;
596
- /**
597
- * Specifies the content container `role` attribute
598
- * ([more details]({% slug accessibility_listview %}#toc-wai-aria-support)).
599
- * By default, the container `role` is set to `listbox`.
600
- */
601
- this.containerRole = 'listbox';
602
- /**
603
- * Specifies the list item `role` attribute
604
- * ([more details]({% slug accessibility_listview %}#toc-wai-aria-support)).
605
- * By default, the list item `role` is set to `option`.
606
- */
607
- this.listItemRole = 'option';
608
- /**
609
- * Fires when the user scrolls to the last record on the page
610
- * ([see endless scrolling example]({% slug scrollmodes_listview %}#toc-endless-scrolling)).
611
- */
612
- this.scrollBottom = new EventEmitter();
613
- /**
614
- * Fires when the page or the page size of the ListView is changed
615
- * ([see example]({% slug paging_listview %}#toc-remote-binding)).
616
- * You have to handle the event yourself and page the data.
617
- */
618
- this.pageChange = new EventEmitter();
619
- /**
620
- * Fires when the page size of the ListView is changed. This event can be prevented (`$event.preventDefault()`).
621
- * If not prevented, the `pageChange` event will be fired subsequently.
622
- */
623
- this.pageSizeChange = new EventEmitter();
624
- /**
625
- * Fires when the user clicks the **Edit** command button to edit an item
626
- * ([see example]({% slug editing_template_forms_listview %}#toc-editing-records)).
627
- */
628
- this.edit = new EventEmitter();
629
- /**
630
- * Fires when the user clicks the **Cancel** command button to close an item
631
- * ([see example]({% slug editing_template_forms_listview %}#toc-cancelling-editing)).
632
- */
633
- this.cancel = new EventEmitter();
634
- /**
635
- * Fires when the user clicks the **Save** command button to save changes in an item
636
- * ([see example]({% slug editing_template_forms_listview %}#toc-saving-records)).
637
- */
638
- this.save = new EventEmitter();
639
- /**
640
- * Fires when the user clicks the **Remove** command button to remove an item
641
- * ([see example]({% slug editing_template_forms_listview %}#toc-removing-records)).
642
- */
643
- this.remove = new EventEmitter();
644
- /**
645
- * Fires when the user clicks the **Add** command button to add a new item
646
- * ([see example]({% slug editing_template_forms_listview %}#toc-adding-records)).
647
- */
648
- this.add = new EventEmitter();
649
- this._skip = 0;
650
- this._navigable = false;
651
- validatePackage(packageMetadata);
652
- this.attachEditHandlers();
653
- }
654
- Object.defineProperty(ListViewComponent.prototype, "navigable", {
655
- get: function () {
656
- return this._navigable;
657
- },
658
- /**
659
- * Specifies whether the keyboard navigation is enabled
660
- * ([see example]({% slug keyboard_navigation_listview %})).
661
- * By default, the navigation is disabled.
662
- */
663
- set: function (navigable) {
664
- if (!navigable && isPresent(this.removeNavigationListeners)) {
665
- this.removeNavigationListeners();
666
- this.removeNavigationListeners = null;
667
- this.navigationService.isEnabled = false;
668
- }
669
- else if (navigable && !isPresent(this.removeNavigationListeners)) {
670
- this.addNavigationListeners();
671
- this.navigationService.isEnabled = true;
672
- }
673
- this._navigable = navigable;
674
- },
675
- enumerable: true,
676
- configurable: true
677
- });
678
- Object.defineProperty(ListViewComponent.prototype, "skip", {
679
- get: function () {
680
- return this._skip;
681
- },
682
- /**
683
- * Defines the number of records to be skipped by the pager
684
- * ([more details]({% slug paging_listview %})).
685
- */
686
- set: function (skip) {
687
- var parsed = parseInt(skip, 10);
688
- var defaultSkipValue = 0;
689
- this._skip = !isNaN(parsed) ? parsed : defaultSkipValue;
690
- },
691
- enumerable: true,
692
- configurable: true
693
- });
694
- Object.defineProperty(ListViewComponent.prototype, "pageable", {
695
- get: function () {
696
- return this._pageable;
697
- },
698
- /**
699
- * Configures whether the ListView will render a pager
700
- * ([more details]({% slug paging_listview %})).
701
- * Providing a boolean value will render a pager with the default settings.
702
- */
703
- set: function (pageable) {
704
- this._pageable = pageable;
705
- this.pagerSettings = pageable ? Object.assign({}, DEFAULT_PAGER_SETTINGS, pageable) : null;
706
- },
707
- enumerable: true,
708
- configurable: true
709
- });
710
- Object.defineProperty(ListViewComponent.prototype, "items", {
711
- /**
712
- * @hidden
713
- *
714
- * Gets the data items passed to the ListView.
715
- * If a ListViewDataResult is passed, the data value is used. If an array is passed - it's directly used.
716
- */
717
- get: function () {
718
- if (!isPresent(this.data)) {
719
- return [];
720
- }
721
- return Array.isArray(this.data) ? this.data : this.data.data;
722
- },
723
- enumerable: true,
724
- configurable: true
725
- });
726
- Object.defineProperty(ListViewComponent.prototype, "total", {
727
- /**
728
- * @hidden
729
- *
730
- * Gets the total number of records passed to the ListView.
731
- * If a ListViewDataResult is passed, the total value is used. If an array is passed - its length is used.
732
- */
733
- get: function () {
734
- if (!isPresent(this.data)) {
735
- return 0;
736
- }
737
- return Array.isArray(this.data) ? this.data.length : this.data.total;
738
- },
739
- enumerable: true,
740
- configurable: true
741
- });
742
- Object.defineProperty(ListViewComponent.prototype, "containerTabindex", {
743
- /**
744
- * @hidden
745
- */
746
- get: function () {
747
- // workaround for FF, where a scrollable container is focusable even without a tabindex and creates an unwanted tab stop
748
- // https://bugzilla.mozilla.org/show_bug.cgi?id=616594
749
- return this.navigable ? -1 : null;
750
- },
751
- enumerable: true,
752
- configurable: true
753
- });
754
- Object.defineProperty(ListViewComponent.prototype, "activeIndex", {
755
- /**
756
- * Gets the current active item index
757
- * ([see example]({% slug keyboard_navigation_listview %}#toc-controlling-the-focus)).
758
- * Returns `null` when the keyboard navigation is disabled.
759
- */
760
- get: function () {
761
- return this.navigationService.activeIndex;
762
- },
763
- enumerable: true,
764
- configurable: true
765
- });
766
- ListViewComponent.prototype.ngOnChanges = function (changes) {
767
- if (isChanged('height', changes, false)) {
768
- this.renderer.setStyle(this.element.nativeElement, 'height', this.height + "px");
769
- }
770
- };
771
- ListViewComponent.prototype.ngOnDestroy = function () {
772
- if (isPresent(this.editServiceSubscription)) {
773
- this.editServiceSubscription.unsubscribe();
774
- }
775
- };
776
- /**
777
- * @hidden
778
- */
779
- ListViewComponent.prototype.templateContext = function (index) {
780
- return {
781
- "$implicit": this.items[index],
782
- "isLast": index === this.items.length - 1,
783
- "isFirst": index === 0,
784
- "dataItem": this.items[index],
785
- "index": index
786
- };
787
- };
788
- /**
789
- * @hidden
790
- */
791
- ListViewComponent.prototype.editTemplateContext = function (index) {
792
- var isNew = index === -1;
793
- var group = isNew ? this.editService.newItemGroup : this.editService.editGroup(index);
794
- return {
795
- "$implicit": group,
796
- "formGroup": group,
797
- "dataItem": isNew ? this.editService.newDataItem : this.items[index],
798
- "isNew": isNew,
799
- "index": index
800
- };
801
- };
802
- /**
803
- * Focuses the item at the specified index ([see example]({% slug keyboard_navigation_listview %}#toc-controlling-the-focus)):
804
- * - If no index is specified, the current active index will be focused.
805
- * - If the passed value is below `0`, the first item receives focus.
806
- * - If the passed value is above the last available index, the last item receives focus.
807
- *
808
- * > The index param is based on the logical structure of the ListView and does not correspond to the data item index -
809
- * > i.e. the index `0` corresponds to the first rendered list item. Paging is not taken into account.
810
- * > Also, for the focusing to work, the `navigable` prop must first be set to `true`.
811
- */
812
- ListViewComponent.prototype.focus = function (index) {
813
- var totalRenderedItems = this.listViewItems.length;
814
- this.navigationService.focusIndex(index, totalRenderedItems);
815
- };
816
- /**
817
- * Creates a new item editor ([see example]({% slug editing_template_forms_listview %}#toc-adding-records)).
818
- *
819
- * @param {FormGroup} group - The [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }}) that describes
820
- * the edit form. If called with a data item, it will build the `FormGroup` from the data item fields.
821
- */
822
- ListViewComponent.prototype.addItem = function (group) {
823
- var isFormGroup = group instanceof FormGroup;
824
- if (!isFormGroup) {
825
- var fields = Object.keys(group).reduce(createControl(group), {});
826
- group = new FormGroup(fields);
827
- }
828
- this.editService.addItem(group);
829
- };
830
- /**
831
- * Switches the specified item to edit mode ([see example]({% slug editing_template_forms_listview %}#toc-editing-records)).
832
- *
833
- * @param index - The item index that will be switched to edit mode.
834
- * @param group - The [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }})
835
- * that describes the edit form.
836
- */
837
- ListViewComponent.prototype.editItem = function (index, group) {
838
- this.editService.editItem(index, group);
839
- };
840
- /**
841
- * Closes the editor for a given item ([see example]({% slug editing_template_forms_grid %}#toc-cancelling-editing)).
842
- *
843
- * @param {number} index - The item index that will be switched out of the edit mode. If no index is provided, it is assumed
844
- * that the new item editor will be closed.
845
- */
846
- ListViewComponent.prototype.closeItem = function (index) {
847
- this.editService.close(index);
848
- };
849
- /**
850
- * @hidden
851
- */
852
- ListViewComponent.prototype.isEdited = function (index) {
853
- return this.editService.isEdited(index);
854
- };
855
- /**
856
- * @hidden
857
- */
858
- ListViewComponent.prototype.handlePageChange = function (event) {
859
- this.scrollToContainerTop();
860
- var firstIndex = 0;
861
- this.navigationService.setActiveIndex(firstIndex);
862
- this.pageChange.emit(event);
863
- };
864
- /**
865
- * @hidden
866
- */
867
- ListViewComponent.prototype.handleContentScroll = function () {
868
- var _this = this;
869
- if (!hasObservers(this.scrollBottom)) {
870
- return;
871
- }
872
- var THRESHOLD = 2;
873
- var _a = this.contentContainer.nativeElement, scrollHeight = _a.scrollHeight, scrollTop = _a.scrollTop, clientHeight = _a.clientHeight;
874
- var atBottom = scrollHeight - clientHeight - scrollTop <= THRESHOLD;
875
- if (atBottom) {
876
- this.ngZone.run(function () {
877
- var event = { sender: _this };
878
- _this.scrollBottom.emit(event);
879
- });
880
- }
881
- };
882
- /**
883
- * @hidden
884
- */
885
- ListViewComponent.prototype.itemPosInSet = function (index) {
886
- // adds 1 as the aria-posinset is not zero-based and the counting starts from 1
887
- return this.skip + index + 1;
888
- };
889
- ListViewComponent.prototype.scrollToContainerTop = function () {
890
- var container = this.contentContainer.nativeElement;
891
- container.scrollTop = 0;
892
- container.scrollLeft = 0;
893
- };
894
- ListViewComponent.prototype.addNavigationListeners = function () {
895
- var _this = this;
896
- this.ngZone.runOutsideAngular(function () {
897
- var removeKeydownListener = _this.renderer.listen(_this.contentContainer.nativeElement, 'keydown', function (event) { return _this.navigationService.handleKeyDown(event, _this.listViewItems.length); });
898
- var removeFocusInListener = _this.renderer.listen(_this.contentContainer.nativeElement, 'focusin', function (event) { return _this.navigationService.handleFocusIn(event); });
899
- var removeFocusOutListener = _this.renderer.listen(_this.contentContainer.nativeElement, 'focusout', function (event) { return _this.navigationService.handleFocusOut(event); });
900
- _this.removeNavigationListeners = function () {
901
- removeKeydownListener();
902
- removeFocusInListener();
903
- removeFocusOutListener();
904
- };
905
- });
906
- };
907
- ListViewComponent.prototype.attachEditHandlers = function () {
908
- if (!isPresent(this.editService)) {
909
- return;
910
- }
911
- this.editServiceSubscription = this.editService
912
- .changes.subscribe(this.emitCRUDEvent.bind(this));
913
- };
914
- ListViewComponent.prototype.emitCRUDEvent = function (args) {
915
- var action = args.action, itemIndex = args.itemIndex, formGroup = args.formGroup;
916
- var dataItem = this.items[itemIndex];
917
- if (action !== 'add' && formGroup) {
918
- dataItem = formGroup.value;
919
- }
920
- Object.assign(args, {
921
- dataItem: dataItem,
922
- sender: this
923
- });
924
- this[action].emit(args);
925
- };
926
- __decorate([
927
- HostBinding('class.k-widget'),
928
- HostBinding('class.k-listview'),
929
- HostBinding('class.k-listview-bordered'),
930
- HostBinding('class.k-d-flex'),
931
- __metadata("design:type", Boolean)
932
- ], ListViewComponent.prototype, "className", void 0);
933
- __decorate([
934
- ContentChild(ItemTemplateDirective, { static: false }),
935
- __metadata("design:type", ItemTemplateDirective)
936
- ], ListViewComponent.prototype, "itemTemplate", void 0);
937
- __decorate([
938
- ContentChild(HeaderTemplateDirective, { static: false }),
939
- __metadata("design:type", HeaderTemplateDirective)
940
- ], ListViewComponent.prototype, "headerTemplate", void 0);
941
- __decorate([
942
- ContentChild(FooterTemplateDirective, { static: false }),
943
- __metadata("design:type", FooterTemplateDirective)
944
- ], ListViewComponent.prototype, "footerTemplate", void 0);
945
- __decorate([
946
- ContentChild(LoaderTemplateDirective, { static: false }),
947
- __metadata("design:type", LoaderTemplateDirective)
948
- ], ListViewComponent.prototype, "loaderTemplate", void 0);
949
- __decorate([
950
- ViewChild('contentContainer', { static: true }),
951
- __metadata("design:type", ElementRef)
952
- ], ListViewComponent.prototype, "contentContainer", void 0);
953
- __decorate([
954
- ContentChild(EditTemplateDirective, { static: false }),
955
- __metadata("design:type", EditTemplateDirective)
956
- ], ListViewComponent.prototype, "editTemplate", void 0);
957
- __decorate([
958
- ViewChildren(ListViewNavigableItemDirective),
959
- __metadata("design:type", QueryList)
960
- ], ListViewComponent.prototype, "listViewItems", void 0);
961
- __decorate([
962
- Input(),
963
- __metadata("design:type", Object)
964
- ], ListViewComponent.prototype, "data", void 0);
965
- __decorate([
966
- Input(),
967
- __metadata("design:type", Boolean)
968
- ], ListViewComponent.prototype, "loading", void 0);
969
- __decorate([
970
- Input(),
971
- __metadata("design:type", Object)
972
- ], ListViewComponent.prototype, "containerStyle", void 0);
973
- __decorate([
974
- Input(),
975
- __metadata("design:type", Object)
976
- ], ListViewComponent.prototype, "itemStyle", void 0);
977
- __decorate([
978
- Input(),
979
- __metadata("design:type", Object)
980
- ], ListViewComponent.prototype, "containerClass", void 0);
981
- __decorate([
982
- Input(),
983
- __metadata("design:type", Object)
984
- ], ListViewComponent.prototype, "itemClass", void 0);
985
- __decorate([
986
- Input(),
987
- __metadata("design:type", String)
988
- ], ListViewComponent.prototype, "containerLabel", void 0);
989
- __decorate([
990
- Input(),
991
- __metadata("design:type", String)
992
- ], ListViewComponent.prototype, "containerRole", void 0);
993
- __decorate([
994
- Input(),
995
- __metadata("design:type", String)
996
- ], ListViewComponent.prototype, "listItemRole", void 0);
997
- __decorate([
998
- Input(),
999
- __metadata("design:type", Boolean),
1000
- __metadata("design:paramtypes", [Boolean])
1001
- ], ListViewComponent.prototype, "navigable", null);
1002
- __decorate([
1003
- Input(),
1004
- __metadata("design:type", Number)
1005
- ], ListViewComponent.prototype, "pageSize", void 0);
1006
- __decorate([
1007
- Input(),
1008
- __metadata("design:type", Number),
1009
- __metadata("design:paramtypes", [Number])
1010
- ], ListViewComponent.prototype, "skip", null);
1011
- __decorate([
1012
- Input(),
1013
- __metadata("design:type", Object),
1014
- __metadata("design:paramtypes", [Object])
1015
- ], ListViewComponent.prototype, "pageable", null);
1016
- __decorate([
1017
- Input(),
1018
- __metadata("design:type", Number)
1019
- ], ListViewComponent.prototype, "height", void 0);
1020
- __decorate([
1021
- Output(),
1022
- __metadata("design:type", EventEmitter)
1023
- ], ListViewComponent.prototype, "scrollBottom", void 0);
1024
- __decorate([
1025
- Output(),
1026
- __metadata("design:type", EventEmitter)
1027
- ], ListViewComponent.prototype, "pageChange", void 0);
1028
- __decorate([
1029
- Output(),
1030
- __metadata("design:type", EventEmitter)
1031
- ], ListViewComponent.prototype, "pageSizeChange", void 0);
1032
- __decorate([
1033
- Output(),
1034
- __metadata("design:type", EventEmitter)
1035
- ], ListViewComponent.prototype, "edit", void 0);
1036
- __decorate([
1037
- Output(),
1038
- __metadata("design:type", EventEmitter)
1039
- ], ListViewComponent.prototype, "cancel", void 0);
1040
- __decorate([
1041
- Output(),
1042
- __metadata("design:type", EventEmitter)
1043
- ], ListViewComponent.prototype, "save", void 0);
1044
- __decorate([
1045
- Output(),
1046
- __metadata("design:type", EventEmitter)
1047
- ], ListViewComponent.prototype, "remove", void 0);
1048
- __decorate([
1049
- Output(),
1050
- __metadata("design:type", EventEmitter)
1051
- ], ListViewComponent.prototype, "add", void 0);
1052
- ListViewComponent = __decorate([
1053
- Component({
1054
- changeDetection: ChangeDetectionStrategy.OnPush,
1055
- exportAs: 'kendoListView',
1056
- selector: 'kendo-listview',
1057
- providers: [
1058
- EditService,
1059
- NavigationService,
1060
- LocalizationService,
1061
- {
1062
- provide: L10N_PREFIX,
1063
- useValue: 'kendo.listview'
1064
- }
1065
- ],
1066
- template: "\n <!-- top pager -->\n <ng-template\n *ngIf=\"pagerSettings?.position !== 'bottom'\"\n [ngTemplateOutlet]=\"pagerTemplate\"\n [ngTemplateOutletContext]=\"{ pagerClass: 'k-listview-pager k-listview-pager-top' }\"\n >\n </ng-template>\n\n <!-- header -->\n <div\n *ngIf=\"headerTemplate\"\n class=\"k-listview-header\"\n >\n <ng-template\n [ngTemplateOutlet]=\"headerTemplate?.templateRef\"\n >\n </ng-template>\n </div>\n\n <!-- content -->\n <div\n #contentContainer\n [attr.tabindex]=\"containerTabindex\"\n class=\"k-listview-content\"\n [ngClass]=\"containerClass\"\n [ngStyle]=\"containerStyle\"\n [kendoEventsOutsideAngular]=\"{\n scroll: handleContentScroll\n }\"\n [scope]=\"this\"\n [attr.role]=\"containerRole\"\n [attr.aria-label]=\"containerLabel\"\n >\n <!-- new item edit template -->\n <div\n *ngIf=\"editService.hasNewItem\"\n class=\"k-listview-item\"\n [attr.role]=\"listItemRole\"\n kendoListViewNavigableItem\n [index]=\"-1\"\n [attr.data-kendo-listview-item-index]=\"-1\"\n [ngClass]=\"itemClass\"\n [ngStyle]=\"itemStyle\"\n >\n <ng-template\n *ngIf=\"editTemplate\"\n [ngTemplateOutlet]=\"editTemplate?.templateRef\"\n [ngTemplateOutletContext]=\"editTemplateContext(-1)\"\n >\n </ng-template>\n </div>\n\n <!-- items -->\n <div\n *ngFor=\"let dataItem of items; let index = index; let first = first; let last = last;\"\n class=\"k-listview-item\"\n [attr.role]=\"listItemRole\"\n [attr.aria-posinset]=\"itemPosInSet(index)\"\n [attr.aria-setsize]=\"total\"\n kendoListViewNavigableItem\n [index]=\"index\"\n [attr.data-kendo-listview-item-index]=\"index\"\n [ngClass]=\"itemClass\"\n [ngStyle]=\"itemStyle\"\n >\n <ng-template\n [ngTemplateOutlet]=\"isEdited(index) ? editTemplate?.templateRef : itemTemplate?.templateRef\"\n [ngTemplateOutletContext]=\"isEdited(index) ? editTemplateContext(index) : templateContext(index)\"\n >\n </ng-template>\n </div>\n\n <!-- loading indicator -->\n <div\n *ngIf=\"loading && !loaderTemplate\"\n class=\"k-loading-mask\"\n >\n <!-- TODO: the k-loading-text is hidden with css but read by readers - review when implementing accessibility + possible localization case -->\n <span class=\"k-loading-text\">Loading</span>\n <div class=\"k-loading-image\"></div>\n <div class=\"k-loading-color\"></div>\n </div>\n <ng-template\n *ngIf=\"loading && loaderTemplate\"\n [ngTemplateOutlet]=\"loaderTemplate.templateRef\"\n >\n </ng-template>\n </div>\n\n <!-- footer -->\n <div\n *ngIf=\"footerTemplate\"\n class=\"k-listview-footer\"\n >\n <ng-template\n [ngTemplateOutlet]=\"footerTemplate?.templateRef\"\n >\n </ng-template>\n </div>\n\n <!-- bottom pager -->\n <ng-template\n *ngIf=\"pagerSettings?.position !== 'top'\"\n [ngTemplateOutlet]=\"pagerTemplate\"\n [ngTemplateOutletContext]=\"{ pagerClass: 'k-listview-pager' }\"\n >\n </ng-template>\n\n <!-- pager template -->\n <ng-template #pagerTemplate let-pagerClass=\"pagerClass\">\n <kendo-datapager\n *ngIf=\"pageable\"\n [class]=\"pagerClass\"\n [total]=\"total\"\n [pageSize]=\"pageSize\"\n [skip]=\"skip\"\n [buttonCount]=\"pagerSettings.buttonCount\"\n [info]=\"pagerSettings.info\"\n [previousNext]=\"pagerSettings.previousNext\"\n [type]=\"pagerSettings.type\"\n [pageSizeValues]=\"pagerSettings.pageSizeValues\"\n (pageChange)=\"handlePageChange($event)\"\n (pageSizeChange)=\"pageSizeChange.emit($event)\"\n >\n </kendo-datapager>\n </ng-template>\n "
1067
- }),
1068
- __metadata("design:paramtypes", [NgZone,
1069
- ElementRef,
1070
- Renderer2,
1071
- EditService,
1072
- NavigationService])
1073
- ], ListViewComponent);
1074
- return ListViewComponent;
1075
- }());
1076
-
1077
- /**
1078
- * A directive that encapsulates the in-memory handling of paging
1079
- * ([see example]({% slug paging_listview %}#toc-binding-directive)).
1080
- */
1081
- var DataBindingDirective = /** @class */ (function () {
1082
- function DataBindingDirective(listView) {
1083
- this.listView = listView;
1084
- this.subscriptions = new Subscription();
1085
- }
1086
- Object.defineProperty(DataBindingDirective.prototype, "data", {
1087
- get: function () {
1088
- return this._data;
1089
- },
1090
- /**
1091
- * The array of data which will be used to populate the ListView.
1092
- */
1093
- set: function (data) {
1094
- this._data = data || [];
1095
- this.updateListViewData();
1096
- },
1097
- enumerable: true,
1098
- configurable: true
1099
- });
1100
- DataBindingDirective.prototype.ngOnInit = function () {
1101
- this.subscriptions.add(this.listView.pageChange.subscribe(this.handlePageChange.bind(this)));
1102
- this.subscriptions.add(this.listView.pageSizeChange.subscribe(this.handlePageSizeChange.bind(this)));
1103
- this.updateListViewData();
1104
- };
1105
- DataBindingDirective.prototype.ngOnDestroy = function () {
1106
- this.subscriptions.unsubscribe();
1107
- };
1108
- DataBindingDirective.prototype.handlePageChange = function (event) {
1109
- this.listView.skip = event.skip;
1110
- this.listView.pageSize = event.take;
1111
- this.updateListViewData();
1112
- };
1113
- DataBindingDirective.prototype.handlePageSizeChange = function (event) {
1114
- this.listView.pageSize = Number(event.newPageSize);
1115
- };
1116
- DataBindingDirective.prototype.updateListViewData = function () {
1117
- var from = this.listView.skip || 0;
1118
- var to = from + (this.listView.pageSize || this.data.length);
1119
- this.listView.data = {
1120
- data: this.data.slice(from, to),
1121
- total: this.data.length
1122
- };
1123
- };
1124
- __decorate([
1125
- Input('kendoListViewBinding'),
1126
- __metadata("design:type", Array),
1127
- __metadata("design:paramtypes", [Array])
1128
- ], DataBindingDirective.prototype, "data", null);
1129
- DataBindingDirective = __decorate([
1130
- Directive({
1131
- selector: '[kendoListViewBinding]'
1132
- }),
1133
- __metadata("design:paramtypes", [ListViewComponent])
1134
- ], DataBindingDirective);
1135
- return DataBindingDirective;
1136
- }());
1137
-
1138
- /**
1139
- * The arguments of the [`pageSizeChange`]({% slug api_listview_listviewcomponent %}#toc-pagesizechange) event of the ListView
1140
- * ([more details]({% slug paging_listview %}).
1141
- */
1142
- var PageSizeChangeEvent$1 = /** @class */ (function (_super) {
1143
- __extends(PageSizeChangeEvent$$1, _super);
1144
- function PageSizeChangeEvent$$1() {
1145
- return _super !== null && _super.apply(this, arguments) || this;
1146
- }
1147
- return PageSizeChangeEvent$$1;
1148
- }(PageSizeChangeEvent));
1149
-
1150
- /**
1151
- * @hidden
1152
- */
1153
- var TemplateContextDirective = /** @class */ (function () {
1154
- function TemplateContextDirective(viewContainerRef) {
1155
- this.viewContainerRef = viewContainerRef;
1156
- }
1157
- Object.defineProperty(TemplateContextDirective.prototype, "templateContext", {
1158
- set: function (context) {
1159
- if (this.insertedViewRef) {
1160
- this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef));
1161
- this.insertedViewRef = undefined;
1162
- }
1163
- if (context.templateRef) {
1164
- this.insertedViewRef = this.viewContainerRef.createEmbeddedView(context.templateRef, context);
1165
- }
1166
- },
1167
- enumerable: true,
1168
- configurable: true
1169
- });
1170
- __decorate([
1171
- Input(),
1172
- __metadata("design:type", Object),
1173
- __metadata("design:paramtypes", [Object])
1174
- ], TemplateContextDirective.prototype, "templateContext", null);
1175
- TemplateContextDirective = __decorate([
1176
- Directive({
1177
- selector: '[templateContext]' // tslint:disable-line
1178
- }),
1179
- __metadata("design:paramtypes", [ViewContainerRef])
1180
- ], TemplateContextDirective);
1181
- return TemplateContextDirective;
1182
- }());
1183
-
1184
- /**
1185
- * Represents the `edit` command of the ListView. You can apply this directive to any `button`
1186
- * element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
1187
- * When an associated button with the directive is clicked, the
1188
- * [`edit`]({% slug api_listview_listviewcomponent %}#toc-edit) event
1189
- * is triggered ([see example]({% slug editing_listview %})).
1190
- *
1191
- * @example
1192
- * ```html-no-run
1193
- * <kendo-listview>
1194
- * <ng-template kendoListViewEditTemplate>
1195
- * <button kendoListViewEditCommand class="k-primary">Edit</button>
1196
- * </ng-template>
1197
- * </kendo-listview>
1198
- * ```
1199
- *
1200
- */
1201
- var EditCommandDirective = /** @class */ (function (_super) {
1202
- __extends(EditCommandDirective, _super);
1203
- function EditCommandDirective(editService, element, renderer, localization, ngZone) {
1204
- var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;
1205
- _this.editService = editService;
1206
- _this.elementRef = element;
1207
- return _this;
1208
- }
1209
- /**
1210
- * @hidden
1211
- */
1212
- EditCommandDirective.prototype.clickHandler = function (e) {
1213
- e.preventDefault();
1214
- var index = getClosestListItemIndex(this.elementRef.nativeElement);
1215
- this.editService.beginEdit(index);
1216
- };
1217
- __decorate([
1218
- HostListener('click', ['$event']),
1219
- __metadata("design:type", Function),
1220
- __metadata("design:paramtypes", [Object]),
1221
- __metadata("design:returntype", void 0)
1222
- ], EditCommandDirective.prototype, "clickHandler", null);
1223
- EditCommandDirective = __decorate([
1224
- Directive({
1225
- selector: '[kendoListViewEditCommand]'
1226
- }),
1227
- __metadata("design:paramtypes", [EditService,
1228
- ElementRef,
1229
- Renderer2,
1230
- LocalizationService,
1231
- NgZone])
1232
- ], EditCommandDirective);
1233
- return EditCommandDirective;
1234
- }(Button));
1235
-
1236
- /**
1237
- * Represents the `cancel` command of the ListView. You can apply this directive to any `button`
1238
- * element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
1239
- * When an associated button with the directive is clicked, the
1240
- * [`cancel`]({% slug api_listview_listviewcomponent %}#toc-cancel) event
1241
- * is triggered ([see example]({% slug editing_listview %})).
1242
- *
1243
- * @example
1244
- * ```html-no-run
1245
- * <kendo-listview>
1246
- * <ng-template kendoListViewEditTemplate>
1247
- * <button kendoListViewCancelCommand>Cancel changes</button>
1248
- * </ng-template>
1249
- * </kendo-listview>
1250
- * ```
1251
- *
1252
- * You can control the content of the button based on the state of the item.
1253
- *
1254
- * @example
1255
- * ```html-no-run
1256
- * <kendo-listview>
1257
- * <ng-template kendoListViewEditTemplate let-isNew="isNew">
1258
- * <button kendoListViewCancelCommand>{{isNew ? 'Discard' : 'Cancel changes'}}</button>
1259
- * </ng-template>
1260
- * </kendo-listview>
1261
- * ```
1262
- */
1263
- var CancelCommandDirective = /** @class */ (function (_super) {
1264
- __extends(CancelCommandDirective, _super);
1265
- function CancelCommandDirective(editService, element, renderer, localization, ngZone) {
1266
- var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;
1267
- _this.editService = editService;
1268
- _this.elementRef = element;
1269
- return _this;
1270
- }
1271
- /**
1272
- * @hidden
1273
- */
1274
- CancelCommandDirective.prototype.clickHandler = function (e) {
1275
- e.preventDefault();
1276
- var index = getClosestListItemIndex(this.elementRef.nativeElement);
1277
- if (this.editService.isEdited(index)) {
1278
- this.editService.endEdit(index);
1279
- }
1280
- };
1281
- __decorate([
1282
- HostListener('click', ['$event']),
1283
- __metadata("design:type", Function),
1284
- __metadata("design:paramtypes", [Object]),
1285
- __metadata("design:returntype", void 0)
1286
- ], CancelCommandDirective.prototype, "clickHandler", null);
1287
- CancelCommandDirective = __decorate([
1288
- Directive({
1289
- selector: '[kendoListViewCancelCommand]'
1290
- }),
1291
- __metadata("design:paramtypes", [EditService,
1292
- ElementRef,
1293
- Renderer2,
1294
- LocalizationService,
1295
- NgZone])
1296
- ], CancelCommandDirective);
1297
- return CancelCommandDirective;
1298
- }(Button));
1299
-
1300
- /**
1301
- * Represents the `save` command of the ListView. You can apply this directive to any `button`
1302
- * element inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
1303
- * When an associated button with the directive is clicked, the
1304
- * [`save`]({% slug api_listview_listviewcomponent %}#toc-save) event
1305
- * is triggered ([see example]({% slug editing_listview %})).
1306
- *
1307
- * @example
1308
- * ```html-no-run
1309
- * <kendo-listview>
1310
- * <ng-template kendoListViewEditTemplate>
1311
- * <button kendoListViewSaveCommand>Save changes</button>
1312
- * </ng-template>
1313
- * </kendo-listview>
1314
- * ```
1315
- *
1316
- * You can control the content of the button based on the state of the item.
1317
- *
1318
- * @example
1319
- * ```html-no-run
1320
- * <kendo-listview>
1321
- * <ng-template kendoListViewEditTemplate let-isNew="isNew">
1322
- * <button kendoListViewSaveCommand>{{isNew ? 'Add' : 'Update'}}</button>
1323
- * </ng-template>
1324
- * </kendo-listview>
1325
- * ```
1326
- */
1327
- var SaveCommandDirective = /** @class */ (function (_super) {
1328
- __extends(SaveCommandDirective, _super);
1329
- function SaveCommandDirective(editService, element, renderer, localization, ngZone) {
1330
- var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;
1331
- _this.editService = editService;
1332
- _this.elementRef = element;
1333
- return _this;
1334
- }
1335
- /**
1336
- * @hidden
1337
- */
1338
- SaveCommandDirective.prototype.clickHandler = function (e) {
1339
- e.preventDefault();
1340
- var index = getClosestListItemIndex(this.elementRef.nativeElement);
1341
- if (this.editService.isEdited(index)) {
1342
- this.editService.save(index);
1343
- }
1344
- };
1345
- __decorate([
1346
- HostListener('click', ['$event']),
1347
- __metadata("design:type", Function),
1348
- __metadata("design:paramtypes", [Object]),
1349
- __metadata("design:returntype", void 0)
1350
- ], SaveCommandDirective.prototype, "clickHandler", null);
1351
- SaveCommandDirective = __decorate([
1352
- Directive({
1353
- selector: '[kendoListViewSaveCommand]'
1354
- }),
1355
- __metadata("design:paramtypes", [EditService,
1356
- ElementRef,
1357
- Renderer2,
1358
- LocalizationService,
1359
- NgZone])
1360
- ], SaveCommandDirective);
1361
- return SaveCommandDirective;
1362
- }(Button));
1363
-
1364
- /**
1365
- * Represents the `remove` command of the ListView. You can apply this directive to any `button` element
1366
- * inside a [`EditTemplateDirective`]({% slug api_listview_edittemplatedirective %}) template.
1367
- * When an associated button with the directive is clicked, the
1368
- * [`remove` event]({% slug api_listview_listviewcomponent %}#toc-remove)
1369
- * is triggered ([see example]({% slug editing_listview %})).
1370
- *
1371
- * @example
1372
- * ```html-no-run
1373
- * <kendo-listview>
1374
- * <ng-template kendoListViewEditTemplate>
1375
- * <button kendoListViewRemoveCommand>Remove item</button>
1376
- * </ng-template>
1377
- * </kendo-listview>
1378
- * ```
1379
- */
1380
- var RemoveCommandDirective = /** @class */ (function (_super) {
1381
- __extends(RemoveCommandDirective, _super);
1382
- function RemoveCommandDirective(editService, element, renderer, localization, ngZone) {
1383
- var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;
1384
- _this.editService = editService;
1385
- _this.elementRef = element;
1386
- return _this;
1387
- }
1388
- /**
1389
- * @hidden
1390
- */
1391
- RemoveCommandDirective.prototype.clickHandler = function (e) {
1392
- e.preventDefault();
1393
- var index = getClosestListItemIndex(this.elementRef.nativeElement);
1394
- this.editService.remove(index);
1395
- };
1396
- __decorate([
1397
- HostListener('click', ['$event']),
1398
- __metadata("design:type", Function),
1399
- __metadata("design:paramtypes", [Object]),
1400
- __metadata("design:returntype", void 0)
1401
- ], RemoveCommandDirective.prototype, "clickHandler", null);
1402
- RemoveCommandDirective = __decorate([
1403
- Directive({
1404
- selector: '[kendoListViewRemoveCommand]'
1405
- }),
1406
- __metadata("design:paramtypes", [EditService,
1407
- ElementRef,
1408
- Renderer2,
1409
- LocalizationService,
1410
- NgZone])
1411
- ], RemoveCommandDirective);
1412
- return RemoveCommandDirective;
1413
- }(Button));
1414
-
1415
- /**
1416
- * Represents the command for adding a new item to the ListView. You can apply this directive to any
1417
- * `button` element inside a [`HeaderTemplate`]({% slug api_listview_headertemplatedirective %}).
1418
- * When an associated button with the directive is clicked, the
1419
- * [`add`]({% slug api_listview_listviewcomponent %}#toc-add) event is triggered
1420
- * ([see example]({% slug editing_listview %})).
1421
- *
1422
- * @example
1423
- * ```html-no-run
1424
- * <kendo-listview>
1425
- * <ng-template kendoListViewHeaderTemplate>
1426
- * <button kendoListViewAddCommand>Add new</button>
1427
- * </ng-template>
1428
- * </kendo-listview>
1429
- * ```
1430
- */
1431
- var AddCommandDirective = /** @class */ (function (_super) {
1432
- __extends(AddCommandDirective, _super);
1433
- function AddCommandDirective(editService, element, renderer, localization, ngZone) {
1434
- var _this = _super.call(this, element, renderer, null, localization, ngZone) || this;
1435
- _this.editService = editService;
1436
- return _this;
1437
- }
1438
- /**
1439
- * @hidden
1440
- */
1441
- AddCommandDirective.prototype.clickHandler = function (e) {
1442
- e.preventDefault();
1443
- this.editService.beginAdd();
1444
- };
1445
- __decorate([
1446
- HostListener('click', ['$event']),
1447
- __metadata("design:type", Function),
1448
- __metadata("design:paramtypes", [Object]),
1449
- __metadata("design:returntype", void 0)
1450
- ], AddCommandDirective.prototype, "clickHandler", null);
1451
- AddCommandDirective = __decorate([
1452
- Directive({
1453
- selector: '[kendoListViewAddCommand]'
1454
- }),
1455
- __metadata("design:paramtypes", [EditService,
1456
- ElementRef,
1457
- Renderer2,
1458
- LocalizationService,
1459
- NgZone])
1460
- ], AddCommandDirective);
1461
- return AddCommandDirective;
1462
- }(Button));
1463
-
1464
- var TEMPLATE_DIRECTIVES = [
1465
- ItemTemplateDirective,
1466
- HeaderTemplateDirective,
1467
- FooterTemplateDirective,
1468
- LoaderTemplateDirective
1469
- ];
1470
- var BINDING_DIRECTIVES = [
1471
- DataBindingDirective
1472
- ];
1473
- var EDITING_DIRECTIVES = [
1474
- EditTemplateDirective,
1475
- EditCommandDirective,
1476
- CancelCommandDirective,
1477
- SaveCommandDirective,
1478
- RemoveCommandDirective,
1479
- AddCommandDirective
1480
- ];
1481
- /**
1482
- * The exported package module.
1483
- *
1484
- * The package exports:
1485
- * - [`ListViewComponent`]({% slug api_listview_listviewcomponent %})&mdash;The ListView component class.
1486
- * - [`ItemTemplateDirective`]({% slug api_listview_itemtemplatedirective %})&mdash;The item template directive.
1487
- * - [`HeaderTemplateDirective`]({% slug api_listview_headertemplatedirective %})&mdash;The header template directive.
1488
- * - [`FooterTemplateDirective`]({% slug api_listview_footertemplatedirective %})&mdash;The footer template directive.
1489
- * - [`LoaderTemplateDirective`]({% slug api_listview_loadertemplatedirective %})&mdash;The loeader template directive.
1490
- * - [`DataBindingDirective`]({% slug api_listview_databindingdirective %})&mdash;The data binding directive.
1491
- * - [`EditTemplateDirective`]({% slug api_listview_editingdirective %}&mdash;The editing template directive.
1492
- */
1493
- var ListViewModule = /** @class */ (function () {
1494
- function ListViewModule() {
1495
- }
1496
- ListViewModule = __decorate([
1497
- NgModule({
1498
- declarations: [
1499
- TEMPLATE_DIRECTIVES,
1500
- BINDING_DIRECTIVES,
1501
- EDITING_DIRECTIVES,
1502
- ListViewComponent,
1503
- TemplateContextDirective,
1504
- ListViewNavigableItemDirective
1505
- ],
1506
- exports: [
1507
- TEMPLATE_DIRECTIVES,
1508
- BINDING_DIRECTIVES,
1509
- EDITING_DIRECTIVES,
1510
- ListViewComponent,
1511
- CommonModule,
1512
- EventsModule
1513
- ],
1514
- imports: [
1515
- CommonModule,
1516
- PagerModule,
1517
- EventsModule
1518
- ]
1519
- })
1520
- ], ListViewModule);
1521
- return ListViewModule;
1522
- }());
1523
-
1524
- /**
1525
- * Generated bundle index. Do not edit.
1526
- */
1527
-
1528
- export { AddCommandDirective, CancelCommandDirective, EditCommandDirective, RemoveCommandDirective, SaveCommandDirective, EditService, ListViewNavigableItemDirective, NavigationService, TemplateContextDirective, ListViewComponent, ItemTemplateDirective, HeaderTemplateDirective, FooterTemplateDirective, LoaderTemplateDirective, DataBindingDirective, EditTemplateDirective, PageSizeChangeEvent$1 as PageSizeChangeEvent, ListViewModule };