@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,536 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
10
- var kendo_licensing_1 = require("@progress/kendo-licensing");
11
- var package_metadata_1 = require("./package-metadata");
12
- var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
13
- var navigation_service_1 = require("./navigation/navigation.service");
14
- var listview_navigable_item_directive_1 = require("./navigation/listview-navigable-item.directive");
15
- var item_template_directive_1 = require("./templates/item-template.directive");
16
- var header_template_directive_1 = require("./templates/header-template.directive");
17
- var footer_template_directive_1 = require("./templates/footer-template.directive");
18
- var loader_template_directive_1 = require("./templates/loader-template.directive");
19
- var edit_template_directive_1 = require("./editing/edit-template.directive");
20
- var edit_service_1 = require("./editing/edit.service");
21
- var utils_1 = require("./utils");
22
- var forms_1 = require("@angular/forms");
23
- var DEFAULT_PAGER_SETTINGS = {
24
- position: 'bottom',
25
- buttonCount: 5,
26
- info: true,
27
- previousNext: true,
28
- type: 'numeric',
29
- pageSizeValues: [5, 10, 20]
30
- };
31
- var createControl = function (source) { return function (acc, key) {
32
- acc[key] = new forms_1.FormControl(source[key]);
33
- return acc;
34
- }; };
35
- var ɵ0 = createControl;
36
- exports.ɵ0 = ɵ0;
37
- /**
38
- * Represents the Kendo UI ListView component for Angular.
39
- */
40
- var ListViewComponent = /** @class */ (function () {
41
- function ListViewComponent(ngZone, element, renderer, editService, navigationService) {
42
- this.ngZone = ngZone;
43
- this.element = element;
44
- this.renderer = renderer;
45
- this.editService = editService;
46
- this.navigationService = navigationService;
47
- /**
48
- * @hidden
49
- */
50
- this.className = true;
51
- /**
52
- * Specifies if the loading indicator of the ListView will be displayed
53
- * ([see example]({% slug paging_listview %}#toc-remote-binding)).
54
- */
55
- this.loading = false;
56
- /**
57
- * Specifies the content container `role` attribute
58
- * ([more details]({% slug accessibility_listview %}#toc-wai-aria-support)).
59
- * By default, the container `role` is set to `listbox`.
60
- */
61
- this.containerRole = 'listbox';
62
- /**
63
- * Specifies the list item `role` attribute
64
- * ([more details]({% slug accessibility_listview %}#toc-wai-aria-support)).
65
- * By default, the list item `role` is set to `option`.
66
- */
67
- this.listItemRole = 'option';
68
- /**
69
- * Fires when the user scrolls to the last record on the page
70
- * ([see endless scrolling example]({% slug scrollmodes_listview %}#toc-endless-scrolling)).
71
- */
72
- this.scrollBottom = new core_1.EventEmitter();
73
- /**
74
- * Fires when the page or the page size of the ListView is changed
75
- * ([see example]({% slug paging_listview %}#toc-remote-binding)).
76
- * You have to handle the event yourself and page the data.
77
- */
78
- this.pageChange = new core_1.EventEmitter();
79
- /**
80
- * Fires when the page size of the ListView is changed. This event can be prevented (`$event.preventDefault()`).
81
- * If not prevented, the `pageChange` event will be fired subsequently.
82
- */
83
- this.pageSizeChange = new core_1.EventEmitter();
84
- /**
85
- * Fires when the user clicks the **Edit** command button to edit an item
86
- * ([see example]({% slug editing_template_forms_listview %}#toc-editing-records)).
87
- */
88
- this.edit = new core_1.EventEmitter();
89
- /**
90
- * Fires when the user clicks the **Cancel** command button to close an item
91
- * ([see example]({% slug editing_template_forms_listview %}#toc-cancelling-editing)).
92
- */
93
- this.cancel = new core_1.EventEmitter();
94
- /**
95
- * Fires when the user clicks the **Save** command button to save changes in an item
96
- * ([see example]({% slug editing_template_forms_listview %}#toc-saving-records)).
97
- */
98
- this.save = new core_1.EventEmitter();
99
- /**
100
- * Fires when the user clicks the **Remove** command button to remove an item
101
- * ([see example]({% slug editing_template_forms_listview %}#toc-removing-records)).
102
- */
103
- this.remove = new core_1.EventEmitter();
104
- /**
105
- * Fires when the user clicks the **Add** command button to add a new item
106
- * ([see example]({% slug editing_template_forms_listview %}#toc-adding-records)).
107
- */
108
- this.add = new core_1.EventEmitter();
109
- this._skip = 0;
110
- this._navigable = false;
111
- kendo_licensing_1.validatePackage(package_metadata_1.packageMetadata);
112
- this.attachEditHandlers();
113
- }
114
- Object.defineProperty(ListViewComponent.prototype, "navigable", {
115
- get: function () {
116
- return this._navigable;
117
- },
118
- /**
119
- * Specifies whether the keyboard navigation is enabled
120
- * ([see example]({% slug keyboard_navigation_listview %})).
121
- * By default, the navigation is disabled.
122
- */
123
- set: function (navigable) {
124
- if (!navigable && utils_1.isPresent(this.removeNavigationListeners)) {
125
- this.removeNavigationListeners();
126
- this.removeNavigationListeners = null;
127
- this.navigationService.isEnabled = false;
128
- }
129
- else if (navigable && !utils_1.isPresent(this.removeNavigationListeners)) {
130
- this.addNavigationListeners();
131
- this.navigationService.isEnabled = true;
132
- }
133
- this._navigable = navigable;
134
- },
135
- enumerable: true,
136
- configurable: true
137
- });
138
- Object.defineProperty(ListViewComponent.prototype, "skip", {
139
- get: function () {
140
- return this._skip;
141
- },
142
- /**
143
- * Defines the number of records to be skipped by the pager
144
- * ([more details]({% slug paging_listview %})).
145
- */
146
- set: function (skip) {
147
- var parsed = parseInt(skip, 10);
148
- var defaultSkipValue = 0;
149
- this._skip = !isNaN(parsed) ? parsed : defaultSkipValue;
150
- },
151
- enumerable: true,
152
- configurable: true
153
- });
154
- Object.defineProperty(ListViewComponent.prototype, "pageable", {
155
- get: function () {
156
- return this._pageable;
157
- },
158
- /**
159
- * Configures whether the ListView will render a pager
160
- * ([more details]({% slug paging_listview %})).
161
- * Providing a boolean value will render a pager with the default settings.
162
- */
163
- set: function (pageable) {
164
- this._pageable = pageable;
165
- this.pagerSettings = pageable ? Object.assign({}, DEFAULT_PAGER_SETTINGS, pageable) : null;
166
- },
167
- enumerable: true,
168
- configurable: true
169
- });
170
- Object.defineProperty(ListViewComponent.prototype, "items", {
171
- /**
172
- * @hidden
173
- *
174
- * Gets the data items passed to the ListView.
175
- * If a ListViewDataResult is passed, the data value is used. If an array is passed - it's directly used.
176
- */
177
- get: function () {
178
- if (!utils_1.isPresent(this.data)) {
179
- return [];
180
- }
181
- return Array.isArray(this.data) ? this.data : this.data.data;
182
- },
183
- enumerable: true,
184
- configurable: true
185
- });
186
- Object.defineProperty(ListViewComponent.prototype, "total", {
187
- /**
188
- * @hidden
189
- *
190
- * Gets the total number of records passed to the ListView.
191
- * If a ListViewDataResult is passed, the total value is used. If an array is passed - its length is used.
192
- */
193
- get: function () {
194
- if (!utils_1.isPresent(this.data)) {
195
- return 0;
196
- }
197
- return Array.isArray(this.data) ? this.data.length : this.data.total;
198
- },
199
- enumerable: true,
200
- configurable: true
201
- });
202
- Object.defineProperty(ListViewComponent.prototype, "containerTabindex", {
203
- /**
204
- * @hidden
205
- */
206
- get: function () {
207
- // workaround for FF, where a scrollable container is focusable even without a tabindex and creates an unwanted tab stop
208
- // https://bugzilla.mozilla.org/show_bug.cgi?id=616594
209
- return this.navigable ? -1 : null;
210
- },
211
- enumerable: true,
212
- configurable: true
213
- });
214
- Object.defineProperty(ListViewComponent.prototype, "activeIndex", {
215
- /**
216
- * Gets the current active item index
217
- * ([see example]({% slug keyboard_navigation_listview %}#toc-controlling-the-focus)).
218
- * Returns `null` when the keyboard navigation is disabled.
219
- */
220
- get: function () {
221
- return this.navigationService.activeIndex;
222
- },
223
- enumerable: true,
224
- configurable: true
225
- });
226
- ListViewComponent.prototype.ngOnChanges = function (changes) {
227
- if (kendo_angular_common_1.isChanged('height', changes, false)) {
228
- this.renderer.setStyle(this.element.nativeElement, 'height', this.height + "px");
229
- }
230
- };
231
- ListViewComponent.prototype.ngOnDestroy = function () {
232
- if (utils_1.isPresent(this.editServiceSubscription)) {
233
- this.editServiceSubscription.unsubscribe();
234
- }
235
- };
236
- /**
237
- * @hidden
238
- */
239
- ListViewComponent.prototype.templateContext = function (index) {
240
- return {
241
- "$implicit": this.items[index],
242
- "isLast": index === this.items.length - 1,
243
- "isFirst": index === 0,
244
- "dataItem": this.items[index],
245
- "index": index
246
- };
247
- };
248
- /**
249
- * @hidden
250
- */
251
- ListViewComponent.prototype.editTemplateContext = function (index) {
252
- var isNew = index === -1;
253
- var group = isNew ? this.editService.newItemGroup : this.editService.editGroup(index);
254
- return {
255
- "$implicit": group,
256
- "formGroup": group,
257
- "dataItem": isNew ? this.editService.newDataItem : this.items[index],
258
- "isNew": isNew,
259
- "index": index
260
- };
261
- };
262
- /**
263
- * Focuses the item at the specified index ([see example]({% slug keyboard_navigation_listview %}#toc-controlling-the-focus)):
264
- * - If no index is specified, the current active index will be focused.
265
- * - If the passed value is below `0`, the first item receives focus.
266
- * - If the passed value is above the last available index, the last item receives focus.
267
- *
268
- * > The index param is based on the logical structure of the ListView and does not correspond to the data item index -
269
- * > i.e. the index `0` corresponds to the first rendered list item. Paging is not taken into account.
270
- * > Also, for the focusing to work, the `navigable` prop must first be set to `true`.
271
- */
272
- ListViewComponent.prototype.focus = function (index) {
273
- var totalRenderedItems = this.listViewItems.length;
274
- this.navigationService.focusIndex(index, totalRenderedItems);
275
- };
276
- /**
277
- * Creates a new item editor ([see example]({% slug editing_template_forms_listview %}#toc-adding-records)).
278
- *
279
- * @param {FormGroup} group - The [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }}) that describes
280
- * the edit form. If called with a data item, it will build the `FormGroup` from the data item fields.
281
- */
282
- ListViewComponent.prototype.addItem = function (group) {
283
- var isFormGroup = group instanceof forms_1.FormGroup;
284
- if (!isFormGroup) {
285
- var fields = Object.keys(group).reduce(createControl(group), {});
286
- group = new forms_1.FormGroup(fields);
287
- }
288
- this.editService.addItem(group);
289
- };
290
- /**
291
- * Switches the specified item to edit mode ([see example]({% slug editing_template_forms_listview %}#toc-editing-records)).
292
- *
293
- * @param index - The item index that will be switched to edit mode.
294
- * @param group - The [`FormGroup`]({{ site.data.urls.angular['formgroupapi'] }})
295
- * that describes the edit form.
296
- */
297
- ListViewComponent.prototype.editItem = function (index, group) {
298
- this.editService.editItem(index, group);
299
- };
300
- /**
301
- * Closes the editor for a given item ([see example]({% slug editing_template_forms_grid %}#toc-cancelling-editing)).
302
- *
303
- * @param {number} index - The item index that will be switched out of the edit mode. If no index is provided, it is assumed
304
- * that the new item editor will be closed.
305
- */
306
- ListViewComponent.prototype.closeItem = function (index) {
307
- this.editService.close(index);
308
- };
309
- /**
310
- * @hidden
311
- */
312
- ListViewComponent.prototype.isEdited = function (index) {
313
- return this.editService.isEdited(index);
314
- };
315
- /**
316
- * @hidden
317
- */
318
- ListViewComponent.prototype.handlePageChange = function (event) {
319
- this.scrollToContainerTop();
320
- var firstIndex = 0;
321
- this.navigationService.setActiveIndex(firstIndex);
322
- this.pageChange.emit(event);
323
- };
324
- /**
325
- * @hidden
326
- */
327
- ListViewComponent.prototype.handleContentScroll = function () {
328
- var _this = this;
329
- if (!kendo_angular_common_1.hasObservers(this.scrollBottom)) {
330
- return;
331
- }
332
- var THRESHOLD = 2;
333
- var _a = this.contentContainer.nativeElement, scrollHeight = _a.scrollHeight, scrollTop = _a.scrollTop, clientHeight = _a.clientHeight;
334
- var atBottom = scrollHeight - clientHeight - scrollTop <= THRESHOLD;
335
- if (atBottom) {
336
- this.ngZone.run(function () {
337
- var event = { sender: _this };
338
- _this.scrollBottom.emit(event);
339
- });
340
- }
341
- };
342
- /**
343
- * @hidden
344
- */
345
- ListViewComponent.prototype.itemPosInSet = function (index) {
346
- // adds 1 as the aria-posinset is not zero-based and the counting starts from 1
347
- return this.skip + index + 1;
348
- };
349
- ListViewComponent.prototype.scrollToContainerTop = function () {
350
- var container = this.contentContainer.nativeElement;
351
- container.scrollTop = 0;
352
- container.scrollLeft = 0;
353
- };
354
- ListViewComponent.prototype.addNavigationListeners = function () {
355
- var _this = this;
356
- this.ngZone.runOutsideAngular(function () {
357
- var removeKeydownListener = _this.renderer.listen(_this.contentContainer.nativeElement, 'keydown', function (event) { return _this.navigationService.handleKeyDown(event, _this.listViewItems.length); });
358
- var removeFocusInListener = _this.renderer.listen(_this.contentContainer.nativeElement, 'focusin', function (event) { return _this.navigationService.handleFocusIn(event); });
359
- var removeFocusOutListener = _this.renderer.listen(_this.contentContainer.nativeElement, 'focusout', function (event) { return _this.navigationService.handleFocusOut(event); });
360
- _this.removeNavigationListeners = function () {
361
- removeKeydownListener();
362
- removeFocusInListener();
363
- removeFocusOutListener();
364
- };
365
- });
366
- };
367
- ListViewComponent.prototype.attachEditHandlers = function () {
368
- if (!utils_1.isPresent(this.editService)) {
369
- return;
370
- }
371
- this.editServiceSubscription = this.editService
372
- .changes.subscribe(this.emitCRUDEvent.bind(this));
373
- };
374
- ListViewComponent.prototype.emitCRUDEvent = function (args) {
375
- var action = args.action, itemIndex = args.itemIndex, formGroup = args.formGroup;
376
- var dataItem = this.items[itemIndex];
377
- if (action !== 'add' && formGroup) {
378
- dataItem = formGroup.value;
379
- }
380
- Object.assign(args, {
381
- dataItem: dataItem,
382
- sender: this
383
- });
384
- this[action].emit(args);
385
- };
386
- tslib_1.__decorate([
387
- core_1.HostBinding('class.k-widget'),
388
- core_1.HostBinding('class.k-listview'),
389
- core_1.HostBinding('class.k-listview-bordered'),
390
- core_1.HostBinding('class.k-d-flex'),
391
- tslib_1.__metadata("design:type", Boolean)
392
- ], ListViewComponent.prototype, "className", void 0);
393
- tslib_1.__decorate([
394
- core_1.ContentChild(item_template_directive_1.ItemTemplateDirective, { static: false }),
395
- tslib_1.__metadata("design:type", item_template_directive_1.ItemTemplateDirective)
396
- ], ListViewComponent.prototype, "itemTemplate", void 0);
397
- tslib_1.__decorate([
398
- core_1.ContentChild(header_template_directive_1.HeaderTemplateDirective, { static: false }),
399
- tslib_1.__metadata("design:type", header_template_directive_1.HeaderTemplateDirective)
400
- ], ListViewComponent.prototype, "headerTemplate", void 0);
401
- tslib_1.__decorate([
402
- core_1.ContentChild(footer_template_directive_1.FooterTemplateDirective, { static: false }),
403
- tslib_1.__metadata("design:type", footer_template_directive_1.FooterTemplateDirective)
404
- ], ListViewComponent.prototype, "footerTemplate", void 0);
405
- tslib_1.__decorate([
406
- core_1.ContentChild(loader_template_directive_1.LoaderTemplateDirective, { static: false }),
407
- tslib_1.__metadata("design:type", loader_template_directive_1.LoaderTemplateDirective)
408
- ], ListViewComponent.prototype, "loaderTemplate", void 0);
409
- tslib_1.__decorate([
410
- core_1.ViewChild('contentContainer', { static: true }),
411
- tslib_1.__metadata("design:type", core_1.ElementRef)
412
- ], ListViewComponent.prototype, "contentContainer", void 0);
413
- tslib_1.__decorate([
414
- core_1.ContentChild(edit_template_directive_1.EditTemplateDirective, { static: false }),
415
- tslib_1.__metadata("design:type", edit_template_directive_1.EditTemplateDirective)
416
- ], ListViewComponent.prototype, "editTemplate", void 0);
417
- tslib_1.__decorate([
418
- core_1.ViewChildren(listview_navigable_item_directive_1.ListViewNavigableItemDirective),
419
- tslib_1.__metadata("design:type", core_1.QueryList)
420
- ], ListViewComponent.prototype, "listViewItems", void 0);
421
- tslib_1.__decorate([
422
- core_1.Input(),
423
- tslib_1.__metadata("design:type", Object)
424
- ], ListViewComponent.prototype, "data", void 0);
425
- tslib_1.__decorate([
426
- core_1.Input(),
427
- tslib_1.__metadata("design:type", Boolean)
428
- ], ListViewComponent.prototype, "loading", void 0);
429
- tslib_1.__decorate([
430
- core_1.Input(),
431
- tslib_1.__metadata("design:type", Object)
432
- ], ListViewComponent.prototype, "containerStyle", void 0);
433
- tslib_1.__decorate([
434
- core_1.Input(),
435
- tslib_1.__metadata("design:type", Object)
436
- ], ListViewComponent.prototype, "itemStyle", void 0);
437
- tslib_1.__decorate([
438
- core_1.Input(),
439
- tslib_1.__metadata("design:type", Object)
440
- ], ListViewComponent.prototype, "containerClass", void 0);
441
- tslib_1.__decorate([
442
- core_1.Input(),
443
- tslib_1.__metadata("design:type", Object)
444
- ], ListViewComponent.prototype, "itemClass", void 0);
445
- tslib_1.__decorate([
446
- core_1.Input(),
447
- tslib_1.__metadata("design:type", String)
448
- ], ListViewComponent.prototype, "containerLabel", void 0);
449
- tslib_1.__decorate([
450
- core_1.Input(),
451
- tslib_1.__metadata("design:type", String)
452
- ], ListViewComponent.prototype, "containerRole", void 0);
453
- tslib_1.__decorate([
454
- core_1.Input(),
455
- tslib_1.__metadata("design:type", String)
456
- ], ListViewComponent.prototype, "listItemRole", void 0);
457
- tslib_1.__decorate([
458
- core_1.Input(),
459
- tslib_1.__metadata("design:type", Boolean),
460
- tslib_1.__metadata("design:paramtypes", [Boolean])
461
- ], ListViewComponent.prototype, "navigable", null);
462
- tslib_1.__decorate([
463
- core_1.Input(),
464
- tslib_1.__metadata("design:type", Number)
465
- ], ListViewComponent.prototype, "pageSize", void 0);
466
- tslib_1.__decorate([
467
- core_1.Input(),
468
- tslib_1.__metadata("design:type", Number),
469
- tslib_1.__metadata("design:paramtypes", [Number])
470
- ], ListViewComponent.prototype, "skip", null);
471
- tslib_1.__decorate([
472
- core_1.Input(),
473
- tslib_1.__metadata("design:type", Object),
474
- tslib_1.__metadata("design:paramtypes", [Object])
475
- ], ListViewComponent.prototype, "pageable", null);
476
- tslib_1.__decorate([
477
- core_1.Input(),
478
- tslib_1.__metadata("design:type", Number)
479
- ], ListViewComponent.prototype, "height", void 0);
480
- tslib_1.__decorate([
481
- core_1.Output(),
482
- tslib_1.__metadata("design:type", core_1.EventEmitter)
483
- ], ListViewComponent.prototype, "scrollBottom", void 0);
484
- tslib_1.__decorate([
485
- core_1.Output(),
486
- tslib_1.__metadata("design:type", core_1.EventEmitter)
487
- ], ListViewComponent.prototype, "pageChange", void 0);
488
- tslib_1.__decorate([
489
- core_1.Output(),
490
- tslib_1.__metadata("design:type", core_1.EventEmitter)
491
- ], ListViewComponent.prototype, "pageSizeChange", void 0);
492
- tslib_1.__decorate([
493
- core_1.Output(),
494
- tslib_1.__metadata("design:type", core_1.EventEmitter)
495
- ], ListViewComponent.prototype, "edit", void 0);
496
- tslib_1.__decorate([
497
- core_1.Output(),
498
- tslib_1.__metadata("design:type", core_1.EventEmitter)
499
- ], ListViewComponent.prototype, "cancel", void 0);
500
- tslib_1.__decorate([
501
- core_1.Output(),
502
- tslib_1.__metadata("design:type", core_1.EventEmitter)
503
- ], ListViewComponent.prototype, "save", void 0);
504
- tslib_1.__decorate([
505
- core_1.Output(),
506
- tslib_1.__metadata("design:type", core_1.EventEmitter)
507
- ], ListViewComponent.prototype, "remove", void 0);
508
- tslib_1.__decorate([
509
- core_1.Output(),
510
- tslib_1.__metadata("design:type", core_1.EventEmitter)
511
- ], ListViewComponent.prototype, "add", void 0);
512
- ListViewComponent = tslib_1.__decorate([
513
- core_1.Component({
514
- changeDetection: core_1.ChangeDetectionStrategy.OnPush,
515
- exportAs: 'kendoListView',
516
- selector: 'kendo-listview',
517
- providers: [
518
- edit_service_1.EditService,
519
- navigation_service_1.NavigationService,
520
- kendo_angular_l10n_1.LocalizationService,
521
- {
522
- provide: kendo_angular_l10n_1.L10N_PREFIX,
523
- useValue: 'kendo.listview'
524
- }
525
- ],
526
- 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 "
527
- }),
528
- tslib_1.__metadata("design:paramtypes", [core_1.NgZone,
529
- core_1.ElementRef,
530
- core_1.Renderer2,
531
- edit_service_1.EditService,
532
- navigation_service_1.NavigationService])
533
- ], ListViewComponent);
534
- return ListViewComponent;
535
- }());
536
- exports.ListViewComponent = ListViewComponent;
@@ -1,85 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var tslib_1 = require("tslib");
8
- var core_1 = require("@angular/core");
9
- var common_1 = require("@angular/common");
10
- var kendo_angular_pager_1 = require("@progress/kendo-angular-pager");
11
- var kendo_angular_common_1 = require("@progress/kendo-angular-common");
12
- var listview_component_1 = require("./listview.component");
13
- var listview_navigable_item_directive_1 = require("./navigation/listview-navigable-item.directive");
14
- var item_template_directive_1 = require("./templates/item-template.directive");
15
- var header_template_directive_1 = require("./templates/header-template.directive");
16
- var footer_template_directive_1 = require("./templates/footer-template.directive");
17
- var template_context_directive_1 = require("./templates/template-context.directive");
18
- var loader_template_directive_1 = require("./templates/loader-template.directive");
19
- var data_binding_directive_1 = require("./data-binding/data-binding.directive");
20
- var edit_template_directive_1 = require("./editing/edit-template.directive");
21
- var edit_command_directive_1 = require("./editing/commands/edit-command.directive");
22
- var cancel_command_directive_1 = require("./editing/commands/cancel-command.directive");
23
- var save_command_directive_1 = require("./editing/commands/save-command.directive");
24
- var remove_command_directive_1 = require("./editing/commands/remove-command.directive");
25
- var add_command_directive_1 = require("./editing/commands/add-command.directive");
26
- var TEMPLATE_DIRECTIVES = [
27
- item_template_directive_1.ItemTemplateDirective,
28
- header_template_directive_1.HeaderTemplateDirective,
29
- footer_template_directive_1.FooterTemplateDirective,
30
- loader_template_directive_1.LoaderTemplateDirective
31
- ];
32
- var BINDING_DIRECTIVES = [
33
- data_binding_directive_1.DataBindingDirective
34
- ];
35
- var EDITING_DIRECTIVES = [
36
- edit_template_directive_1.EditTemplateDirective,
37
- edit_command_directive_1.EditCommandDirective,
38
- cancel_command_directive_1.CancelCommandDirective,
39
- save_command_directive_1.SaveCommandDirective,
40
- remove_command_directive_1.RemoveCommandDirective,
41
- add_command_directive_1.AddCommandDirective
42
- ];
43
- /**
44
- * The exported package module.
45
- *
46
- * The package exports:
47
- * - [`ListViewComponent`]({% slug api_listview_listviewcomponent %})&mdash;The ListView component class.
48
- * - [`ItemTemplateDirective`]({% slug api_listview_itemtemplatedirective %})&mdash;The item template directive.
49
- * - [`HeaderTemplateDirective`]({% slug api_listview_headertemplatedirective %})&mdash;The header template directive.
50
- * - [`FooterTemplateDirective`]({% slug api_listview_footertemplatedirective %})&mdash;The footer template directive.
51
- * - [`LoaderTemplateDirective`]({% slug api_listview_loadertemplatedirective %})&mdash;The loeader template directive.
52
- * - [`DataBindingDirective`]({% slug api_listview_databindingdirective %})&mdash;The data binding directive.
53
- * - [`EditTemplateDirective`]({% slug api_listview_editingdirective %}&mdash;The editing template directive.
54
- */
55
- var ListViewModule = /** @class */ (function () {
56
- function ListViewModule() {
57
- }
58
- ListViewModule = tslib_1.__decorate([
59
- core_1.NgModule({
60
- declarations: [
61
- TEMPLATE_DIRECTIVES,
62
- BINDING_DIRECTIVES,
63
- EDITING_DIRECTIVES,
64
- listview_component_1.ListViewComponent,
65
- template_context_directive_1.TemplateContextDirective,
66
- listview_navigable_item_directive_1.ListViewNavigableItemDirective
67
- ],
68
- exports: [
69
- TEMPLATE_DIRECTIVES,
70
- BINDING_DIRECTIVES,
71
- EDITING_DIRECTIVES,
72
- listview_component_1.ListViewComponent,
73
- common_1.CommonModule,
74
- kendo_angular_common_1.EventsModule
75
- ],
76
- imports: [
77
- common_1.CommonModule,
78
- kendo_angular_pager_1.PagerModule,
79
- kendo_angular_common_1.EventsModule
80
- ]
81
- })
82
- ], ListViewModule);
83
- return ListViewModule;
84
- }());
85
- exports.ListViewModule = ListViewModule;
package/dist/npm/main.js DELETED
@@ -1,24 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- var listview_component_1 = require("./listview.component");
8
- exports.ListViewComponent = listview_component_1.ListViewComponent;
9
- var item_template_directive_1 = require("./templates/item-template.directive");
10
- exports.ItemTemplateDirective = item_template_directive_1.ItemTemplateDirective;
11
- var header_template_directive_1 = require("./templates/header-template.directive");
12
- exports.HeaderTemplateDirective = header_template_directive_1.HeaderTemplateDirective;
13
- var footer_template_directive_1 = require("./templates/footer-template.directive");
14
- exports.FooterTemplateDirective = footer_template_directive_1.FooterTemplateDirective;
15
- var loader_template_directive_1 = require("./templates/loader-template.directive");
16
- exports.LoaderTemplateDirective = loader_template_directive_1.LoaderTemplateDirective;
17
- var data_binding_directive_1 = require("./data-binding/data-binding.directive");
18
- exports.DataBindingDirective = data_binding_directive_1.DataBindingDirective;
19
- var edit_template_directive_1 = require("./editing/edit-template.directive");
20
- exports.EditTemplateDirective = edit_template_directive_1.EditTemplateDirective;
21
- var page_size_change_event_1 = require("./models/page-size-change-event");
22
- exports.PageSizeChangeEvent = page_size_change_event_1.PageSizeChangeEvent;
23
- var listview_module_1 = require("./listview.module");
24
- exports.ListViewModule = listview_module_1.ListViewModule;
@@ -1,6 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +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
- "use strict";
6
- Object.defineProperty(exports, "__esModule", { value: true });