@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.
- package/bundles/kendo-angular-listview.umd.js +5 -0
- package/{dist/es2015/data-binding → data-binding}/data-binding.directive.d.ts +5 -1
- package/{dist/es2015/editing → editing}/commands/add-command.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/commands/cancel-command.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/commands/edit-command.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/commands/remove-command.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/commands/save-command.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/edit-template.directive.d.ts +3 -0
- package/{dist/es2015/editing → editing}/edit.service.d.ts +6 -3
- package/{dist/es2015/editing → editing}/events/add-event-args.interface.d.ts +0 -0
- package/{dist/es2015/editing → editing}/events/cancel-event-args.interface.d.ts +0 -0
- package/{dist/es2015/editing → editing}/events/edit-event-args.interface.d.ts +0 -0
- package/{dist/es2015/editing → editing}/events/remove-event-args.interface.d.ts +0 -0
- package/{dist/es2015/editing → editing}/events/save-event-args.interface.d.ts +0 -0
- package/{dist/es2015 → esm2015}/data-binding/data-binding.directive.js +15 -16
- package/esm2015/editing/commands/add-command.directive.js +49 -0
- package/{dist/es2015 → esm2015}/editing/commands/cancel-command.directive.js +17 -23
- package/{dist/es2015 → esm2015}/editing/commands/edit-command.directive.js +17 -23
- package/{dist/es2015 → esm2015}/editing/commands/remove-command.directive.js +17 -23
- package/{dist/es2015 → esm2015}/editing/commands/save-command.directive.js +17 -23
- package/{dist/es2015 → esm2015}/editing/edit-template.directive.js +14 -12
- package/{dist/es2015 → esm2015}/editing/edit.service.js +9 -13
- package/{dist/es → esm2015}/editing/events/add-event-args.interface.js +1 -0
- package/{dist/es2015 → esm2015}/editing/events/cancel-event-args.interface.js +1 -0
- package/{dist/es2015 → esm2015}/editing/events/edit-event-args.interface.js +1 -0
- package/{dist/es2015 → esm2015}/editing/events/remove-event-args.interface.js +1 -0
- package/{dist/es → esm2015}/editing/events/save-event-args.interface.js +1 -0
- package/{dist/es/editing/events/remove-event-args.interface.js → esm2015/kendo-angular-listview.js} +4 -0
- package/{dist/es2015 → esm2015}/listview.component.js +242 -155
- package/{dist/es2015 → esm2015}/listview.module.js +56 -26
- package/{dist/es → esm2015}/main.js +5 -0
- package/{dist/es → esm2015}/models/listview-data-result.js +1 -0
- package/{dist/es → esm2015}/models/page-change-event.js +1 -0
- package/{dist/es2015 → esm2015}/models/page-size-change-event.js +0 -0
- package/{dist/es → esm2015}/models/page-size-item.js +1 -0
- package/{dist/es → esm2015}/models/pager-position.js +1 -0
- package/{dist/es → esm2015}/models/pager-settings.js +1 -0
- package/{dist/es → esm2015}/models/pager-type.js +1 -0
- package/{dist/es → esm2015}/models/scroll-bottom-event.js +1 -0
- package/{dist/es2015 → esm2015}/navigation/listview-navigable-item.directive.js +15 -18
- package/{dist/es2015 → esm2015}/navigation/navigation.service.js +8 -13
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/esm2015/templates/footer-template.directive.js +24 -0
- package/esm2015/templates/header-template.directive.js +24 -0
- package/{dist/es2015 → esm2015}/templates/item-template.directive.js +12 -11
- package/esm2015/templates/loader-template.directive.js +24 -0
- package/esm2015/templates/template-context.directive.js +33 -0
- package/{dist/es2015 → esm2015}/utils.js +0 -0
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-listview.js} +521 -417
- package/{dist/es/editing/events/cancel-event-args.interface.js → kendo-angular-listview.d.ts} +5 -0
- package/{dist/es2015/listview.component.d.ts → listview.component.d.ts} +13 -7
- package/listview.module.d.ts +39 -0
- package/{dist/es2015/main.d.ts → main.d.ts} +5 -0
- package/{dist/es2015/models → models}/listview-data-result.d.ts +0 -0
- package/{dist/es2015/models → models}/page-change-event.d.ts +0 -0
- package/{dist/es2015/models → models}/page-size-change-event.d.ts +0 -0
- package/{dist/es2015/models → models}/page-size-item.d.ts +0 -0
- package/{dist/es2015/models → models}/pager-position.d.ts +0 -0
- package/{dist/es2015/models → models}/pager-settings.d.ts +0 -0
- package/{dist/es2015/models → models}/pager-type.d.ts +0 -0
- package/{dist/es2015/models → models}/scroll-bottom-event.d.ts +0 -0
- package/{dist/es2015/navigation → navigation}/listview-navigable-item.directive.d.ts +3 -0
- package/{dist/es2015/navigation → navigation}/navigation.service.d.ts +5 -1
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +36 -108
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/{dist/es2015/templates → templates}/footer-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/header-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/item-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/loader-template.directive.d.ts +3 -0
- package/{dist/es2015/templates → templates}/template-context.directive.d.ts +4 -1
- package/{dist/es2015/utils.d.ts → utils.d.ts} +0 -0
- package/dist/cdn/js/kendo-angular-listview.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/data-binding/data-binding.directive.js +0 -69
- package/dist/es/editing/commands/add-command.directive.js +0 -58
- package/dist/es/editing/commands/cancel-command.directive.js +0 -74
- package/dist/es/editing/commands/edit-command.directive.js +0 -62
- package/dist/es/editing/commands/remove-command.directive.js +0 -61
- package/dist/es/editing/commands/save-command.directive.js +0 -74
- package/dist/es/editing/edit-template.directive.js +0 -32
- package/dist/es/editing/edit.service.js +0 -136
- package/dist/es/editing/events/edit-event-args.interface.js +0 -4
- package/dist/es/index.js +0 -17
- package/dist/es/listview.component.js +0 -534
- package/dist/es/listview.module.js +0 -83
- package/dist/es/models/page-size-change-event.js +0 -18
- package/dist/es/navigation/listview-navigable-item.directive.js +0 -70
- package/dist/es/navigation/navigation.service.js +0 -162
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/templates/footer-template.directive.js +0 -24
- package/dist/es/templates/header-template.directive.js +0 -24
- package/dist/es/templates/item-template.directive.js +0 -30
- package/dist/es/templates/loader-template.directive.js +0 -24
- package/dist/es/templates/template-context.directive.js +0 -40
- package/dist/es/utils.js +0 -103
- package/dist/es2015/editing/commands/add-command.directive.js +0 -55
- package/dist/es2015/editing/events/add-event-args.interface.js +0 -4
- package/dist/es2015/editing/events/save-event-args.interface.js +0 -4
- package/dist/es2015/index.d.ts +0 -17
- package/dist/es2015/index.js +0 -17
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/listview.module.d.ts +0 -18
- package/dist/es2015/main.js +0 -13
- package/dist/es2015/models/listview-data-result.js +0 -4
- package/dist/es2015/models/page-change-event.js +0 -4
- package/dist/es2015/models/page-size-item.js +0 -4
- package/dist/es2015/models/pager-position.js +0 -4
- package/dist/es2015/models/pager-settings.js +0 -4
- package/dist/es2015/models/pager-type.js +0 -4
- package/dist/es2015/models/scroll-bottom-event.js +0 -4
- package/dist/es2015/templates/footer-template.directive.js +0 -23
- package/dist/es2015/templates/header-template.directive.js +0 -23
- package/dist/es2015/templates/loader-template.directive.js +0 -23
- package/dist/es2015/templates/template-context.directive.js +0 -35
- package/dist/fesm5/index.js +0 -1528
- package/dist/npm/data-binding/data-binding.directive.js +0 -71
- package/dist/npm/editing/commands/add-command.directive.js +0 -60
- package/dist/npm/editing/commands/cancel-command.directive.js +0 -76
- package/dist/npm/editing/commands/edit-command.directive.js +0 -64
- package/dist/npm/editing/commands/remove-command.directive.js +0 -63
- package/dist/npm/editing/commands/save-command.directive.js +0 -76
- package/dist/npm/editing/edit-template.directive.js +0 -34
- package/dist/npm/editing/edit.service.js +0 -140
- package/dist/npm/editing/events/add-event-args.interface.js +0 -6
- package/dist/npm/editing/events/cancel-event-args.interface.js +0 -6
- package/dist/npm/editing/events/edit-event-args.interface.js +0 -6
- package/dist/npm/editing/events/remove-event-args.interface.js +0 -6
- package/dist/npm/editing/events/save-event-args.interface.js +0 -6
- package/dist/npm/index.js +0 -29
- package/dist/npm/listview.component.js +0 -536
- package/dist/npm/listview.module.js +0 -85
- package/dist/npm/main.js +0 -24
- package/dist/npm/models/listview-data-result.js +0 -6
- package/dist/npm/models/page-change-event.js +0 -6
- package/dist/npm/models/page-size-change-event.js +0 -20
- package/dist/npm/models/page-size-item.js +0 -6
- package/dist/npm/models/pager-position.js +0 -6
- package/dist/npm/models/pager-settings.js +0 -6
- package/dist/npm/models/pager-type.js +0 -6
- package/dist/npm/models/scroll-bottom-event.js +0 -6
- package/dist/npm/navigation/listview-navigable-item.directive.js +0 -72
- package/dist/npm/navigation/navigation.service.js +0 -164
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/templates/footer-template.directive.js +0 -26
- package/dist/npm/templates/header-template.directive.js +0 -26
- package/dist/npm/templates/item-template.directive.js +0 -32
- package/dist/npm/templates/loader-template.directive.js +0 -26
- package/dist/npm/templates/template-context.directive.js +0 -42
- package/dist/npm/utils.js +0 -105
- package/dist/systemjs/kendo-angular-listview.js +0 -5
|
@@ -1,70 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, ElementRef, Renderer2, Input } from '@angular/core';
|
|
7
|
-
import { NavigationService } from './navigation.service';
|
|
8
|
-
import { isPresent } from '../utils';
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
var ListViewNavigableItemDirective = /** @class */ (function () {
|
|
13
|
-
function ListViewNavigableItemDirective(hostElement, renderer, navigationService) {
|
|
14
|
-
this.hostElement = hostElement;
|
|
15
|
-
this.renderer = renderer;
|
|
16
|
-
this.navigationService = navigationService;
|
|
17
|
-
}
|
|
18
|
-
ListViewNavigableItemDirective.prototype.ngOnChanges = function () {
|
|
19
|
-
this.updateNavigationState();
|
|
20
|
-
};
|
|
21
|
-
ListViewNavigableItemDirective.prototype.ngOnInit = function () {
|
|
22
|
-
this.navigationSubscription = this.navigationService.changes
|
|
23
|
-
.subscribe(this.updateNavigationState.bind(this));
|
|
24
|
-
};
|
|
25
|
-
ListViewNavigableItemDirective.prototype.ngOnDestroy = function () {
|
|
26
|
-
if (isPresent(this.navigationSubscription)) {
|
|
27
|
-
this.navigationSubscription.unsubscribe();
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
ListViewNavigableItemDirective.prototype.updateNavigationState = function () {
|
|
31
|
-
this.updateTabIndex();
|
|
32
|
-
this.updateFocusedState();
|
|
33
|
-
};
|
|
34
|
-
ListViewNavigableItemDirective.prototype.updateFocusedState = function () {
|
|
35
|
-
var shouldFocus = this.navigationService.isActive(this.index) && this.navigationService.isFocused;
|
|
36
|
-
var focusedCssClass = 'k-state-focused';
|
|
37
|
-
if (shouldFocus) {
|
|
38
|
-
this.renderer.addClass(this.hostElement.nativeElement, focusedCssClass);
|
|
39
|
-
this.hostElement.nativeElement.focus();
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.renderer.removeClass(this.hostElement.nativeElement, focusedCssClass);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
ListViewNavigableItemDirective.prototype.updateTabIndex = function () {
|
|
46
|
-
if (!this.navigationService.isEnabled) {
|
|
47
|
-
this.renderer.removeAttribute(this.hostElement.nativeElement, 'tabindex');
|
|
48
|
-
}
|
|
49
|
-
else if (this.navigationService.isActive(this.index)) {
|
|
50
|
-
this.renderer.setAttribute(this.hostElement.nativeElement, 'tabindex', '0');
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
this.renderer.setAttribute(this.hostElement.nativeElement, 'tabindex', '-1');
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
tslib_1.__decorate([
|
|
57
|
-
Input(),
|
|
58
|
-
tslib_1.__metadata("design:type", Number)
|
|
59
|
-
], ListViewNavigableItemDirective.prototype, "index", void 0);
|
|
60
|
-
ListViewNavigableItemDirective = tslib_1.__decorate([
|
|
61
|
-
Directive({
|
|
62
|
-
selector: '[kendoListViewNavigableItem]'
|
|
63
|
-
}),
|
|
64
|
-
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
65
|
-
Renderer2,
|
|
66
|
-
NavigationService])
|
|
67
|
-
], ListViewNavigableItemDirective);
|
|
68
|
-
return ListViewNavigableItemDirective;
|
|
69
|
-
}());
|
|
70
|
-
export { ListViewNavigableItemDirective };
|
|
@@ -1,162 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Injectable } from '@angular/core';
|
|
7
|
-
import { Subject } from 'rxjs';
|
|
8
|
-
import { Keys } from '@progress/kendo-angular-common';
|
|
9
|
-
import { closestWithMatch, fitIntoRange, getListItemIndex, isListViewItem, isPresent, relatedTarget } from '../utils';
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*
|
|
13
|
-
* Provided per ListView instance. Keeps the availability, active index and focused state of the current ListView.
|
|
14
|
-
* Emits `changes` when any of the aforementioned states changes.
|
|
15
|
-
*/
|
|
16
|
-
var NavigationService = /** @class */ (function () {
|
|
17
|
-
function NavigationService() {
|
|
18
|
-
/**
|
|
19
|
-
* Emits every time a change in active index/focus/blur/navigation availability occurs.
|
|
20
|
-
*/
|
|
21
|
-
this.changes = new Subject();
|
|
22
|
-
/**
|
|
23
|
-
* Specifies if a ListView item currently holds focus.
|
|
24
|
-
*/
|
|
25
|
-
this.isFocused = false;
|
|
26
|
-
/**
|
|
27
|
-
* Keeps track of the index of the items that should be the current focus target (tabindex="0").
|
|
28
|
-
* When set to `null`/`undefined`, the navigation is disabled and the items should not render a tabindex.
|
|
29
|
-
*/
|
|
30
|
-
this.activeIndex = null;
|
|
31
|
-
}
|
|
32
|
-
Object.defineProperty(NavigationService.prototype, "isEnabled", {
|
|
33
|
-
/**
|
|
34
|
-
* Sets or gets if the navigation is enabled.
|
|
35
|
-
* When no activeIndex is present, the navigation is inferred as disabled.
|
|
36
|
-
* Toggling the service availability clears the current active index or activates the first one.
|
|
37
|
-
*/
|
|
38
|
-
get: function () {
|
|
39
|
-
return isPresent(this.activeIndex);
|
|
40
|
-
},
|
|
41
|
-
set: function (enabled) {
|
|
42
|
-
if (enabled) {
|
|
43
|
-
this.activeIndex = 0;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
this.activeIndex = null;
|
|
47
|
-
}
|
|
48
|
-
this.changes.next();
|
|
49
|
-
},
|
|
50
|
-
enumerable: true,
|
|
51
|
-
configurable: true
|
|
52
|
-
});
|
|
53
|
-
/**
|
|
54
|
-
* Shows if the checked index should be the current available focus target (tabindex="0").
|
|
55
|
-
*/
|
|
56
|
-
NavigationService.prototype.isActive = function (index) {
|
|
57
|
-
return index === this.activeIndex;
|
|
58
|
-
};
|
|
59
|
-
NavigationService.prototype.handleKeyDown = function (event, totalItemsCount) {
|
|
60
|
-
var keyCode = event.keyCode;
|
|
61
|
-
switch (keyCode) {
|
|
62
|
-
case Keys.ArrowLeft:
|
|
63
|
-
case Keys.ArrowUp:
|
|
64
|
-
this.navigateToPrevious();
|
|
65
|
-
break;
|
|
66
|
-
case Keys.ArrowRight:
|
|
67
|
-
case Keys.ArrowDown:
|
|
68
|
-
this.navigateToNext(totalItemsCount);
|
|
69
|
-
break;
|
|
70
|
-
case Keys.Home:
|
|
71
|
-
var firstIndex = 0;
|
|
72
|
-
this.navigateTo(firstIndex);
|
|
73
|
-
break;
|
|
74
|
-
case Keys.End:
|
|
75
|
-
var lastIndex = totalItemsCount - 1;
|
|
76
|
-
this.navigateTo(lastIndex);
|
|
77
|
-
break;
|
|
78
|
-
default: return;
|
|
79
|
-
}
|
|
80
|
-
// the following line is executed only if the pressed key matches one of the listview hotkeys -
|
|
81
|
-
// they `break`, while the `default` case `return`s
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
};
|
|
84
|
-
NavigationService.prototype.handleFocusIn = function (event) {
|
|
85
|
-
var target = event.target;
|
|
86
|
-
if (!isListViewItem(target)) {
|
|
87
|
-
var listViewItemSelector = '.k-listview-item';
|
|
88
|
-
var closestListViewItem = closestWithMatch(target, listViewItemSelector);
|
|
89
|
-
var isListViewItemChild = isPresent(closestListViewItem);
|
|
90
|
-
if (isListViewItemChild) {
|
|
91
|
-
var itemIndex = getListItemIndex(closestListViewItem);
|
|
92
|
-
this.setActiveIndex(itemIndex);
|
|
93
|
-
}
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
var targetIndex = getListItemIndex(target);
|
|
97
|
-
// don't emit if the no change in focused state has occurred and the targeted index is the same as the current activeIndex
|
|
98
|
-
if (this.isFocused && targetIndex === this.activeIndex) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
this.activeIndex = targetIndex;
|
|
102
|
-
this.isFocused = true;
|
|
103
|
-
this.changes.next();
|
|
104
|
-
};
|
|
105
|
-
NavigationService.prototype.handleFocusOut = function (event) {
|
|
106
|
-
// don't emit if the blurred item is not a listview item or if the new focus target is another listview item
|
|
107
|
-
if (!isListViewItem(event.target) || isListViewItem(relatedTarget(event))) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
this.isFocused = false;
|
|
111
|
-
this.changes.next();
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Sets the `activeIndex` and triggers changes without focusing the corresponding ListView item.
|
|
115
|
-
*/
|
|
116
|
-
NavigationService.prototype.setActiveIndex = function (index) {
|
|
117
|
-
if (!this.isEnabled) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (index === this.activeIndex) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
this.activeIndex = index;
|
|
124
|
-
this.changes.next();
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* Focuses item at the targeted index. If no index is passed, the current `activeIndex` is used.
|
|
128
|
-
* The passed target index is normalized to fit the min/max available indices bounds.
|
|
129
|
-
*/
|
|
130
|
-
NavigationService.prototype.focusIndex = function (index, totalItemsCount) {
|
|
131
|
-
if (!this.isEnabled) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
var parsed = parseInt(index, 10);
|
|
135
|
-
var firstIndex = 0;
|
|
136
|
-
var lastIndex = totalItemsCount - 1;
|
|
137
|
-
var targetIndex = isNaN(parsed) ? this.activeIndex : fitIntoRange(parsed, firstIndex, lastIndex);
|
|
138
|
-
this.navigateTo(targetIndex);
|
|
139
|
-
};
|
|
140
|
-
NavigationService.prototype.navigateTo = function (index) {
|
|
141
|
-
if (this.isFocused && this.activeIndex === index) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
this.isFocused = true;
|
|
145
|
-
this.activeIndex = index;
|
|
146
|
-
this.changes.next();
|
|
147
|
-
};
|
|
148
|
-
NavigationService.prototype.navigateToPrevious = function () {
|
|
149
|
-
var previousIndex = Math.max(this.activeIndex - 1, 0);
|
|
150
|
-
this.navigateTo(previousIndex);
|
|
151
|
-
};
|
|
152
|
-
NavigationService.prototype.navigateToNext = function (totalItemsCount) {
|
|
153
|
-
var lastAvailableIndex = totalItemsCount - 1;
|
|
154
|
-
var nextIndex = Math.min(this.activeIndex + 1, lastAvailableIndex);
|
|
155
|
-
this.navigateTo(nextIndex);
|
|
156
|
-
};
|
|
157
|
-
NavigationService = tslib_1.__decorate([
|
|
158
|
-
Injectable()
|
|
159
|
-
], NavigationService);
|
|
160
|
-
return NavigationService;
|
|
161
|
-
}());
|
|
162
|
-
export { NavigationService };
|
|
@@ -1,15 +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
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export var packageMetadata = {
|
|
9
|
-
name: '@progress/kendo-angular-listview',
|
|
10
|
-
productName: 'Kendo UI for Angular',
|
|
11
|
-
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate: 1646219074,
|
|
13
|
-
version: '',
|
|
14
|
-
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'
|
|
15
|
-
};
|
|
@@ -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
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, TemplateRef } from '@angular/core';
|
|
7
|
-
/**
|
|
8
|
-
* Renders the footer content of the ListView. To define a footer template, nest an `<ng-template>` tag
|
|
9
|
-
* with the `kendoListViewFooterTemplate` directive inside the `<kendo-listview>` tag
|
|
10
|
-
* [see example]({% slug templates_listview %}#toc-footer-template).
|
|
11
|
-
*/
|
|
12
|
-
var FooterTemplateDirective = /** @class */ (function () {
|
|
13
|
-
function FooterTemplateDirective(templateRef) {
|
|
14
|
-
this.templateRef = templateRef;
|
|
15
|
-
}
|
|
16
|
-
FooterTemplateDirective = tslib_1.__decorate([
|
|
17
|
-
Directive({
|
|
18
|
-
selector: '[kendoListViewFooterTemplate]'
|
|
19
|
-
}),
|
|
20
|
-
tslib_1.__metadata("design:paramtypes", [TemplateRef])
|
|
21
|
-
], FooterTemplateDirective);
|
|
22
|
-
return FooterTemplateDirective;
|
|
23
|
-
}());
|
|
24
|
-
export { FooterTemplateDirective };
|
|
@@ -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
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, TemplateRef } from '@angular/core';
|
|
7
|
-
/**
|
|
8
|
-
* Renders the header content of the ListView. To define a header template, nest an `<ng-template>` tag
|
|
9
|
-
* with the `kendoListViewHeaderTemplate` directive inside the `<kendo-listview>` tag
|
|
10
|
-
* [see example]({% slug templates_listview %}#toc-header-template).
|
|
11
|
-
*/
|
|
12
|
-
var HeaderTemplateDirective = /** @class */ (function () {
|
|
13
|
-
function HeaderTemplateDirective(templateRef) {
|
|
14
|
-
this.templateRef = templateRef;
|
|
15
|
-
}
|
|
16
|
-
HeaderTemplateDirective = tslib_1.__decorate([
|
|
17
|
-
Directive({
|
|
18
|
-
selector: '[kendoListViewHeaderTemplate]'
|
|
19
|
-
}),
|
|
20
|
-
tslib_1.__metadata("design:paramtypes", [TemplateRef])
|
|
21
|
-
], HeaderTemplateDirective);
|
|
22
|
-
return HeaderTemplateDirective;
|
|
23
|
-
}());
|
|
24
|
-
export { HeaderTemplateDirective };
|
|
@@ -1,30 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, TemplateRef } from '@angular/core';
|
|
7
|
-
/**
|
|
8
|
-
* Renders the list item content. To define an item template, nest an `<ng-template>` tag
|
|
9
|
-
* with the `kendoListViewItemTemplate` directive inside the `<kendo-listview>` tag
|
|
10
|
-
* [see example]({% slug templates_listview %}#toc-item-template).
|
|
11
|
-
*
|
|
12
|
-
* The following values are available as context variables:
|
|
13
|
-
* - `let-dataItem="dataItem"` (`any`) - The current data item. Also available as implicit context variable.
|
|
14
|
-
* - `let-index="index"` (`number`) - The current item index.
|
|
15
|
-
* - `let-isFirst="isFirst"` (`boolean`) - Indicates whether the current data item will be rendered as the first item on the list.
|
|
16
|
-
* - `let-isLast="isLast"` (`boolean`)- Indicates whether the current data item will be rendered as the last item on the list.
|
|
17
|
-
*/
|
|
18
|
-
var ItemTemplateDirective = /** @class */ (function () {
|
|
19
|
-
function ItemTemplateDirective(templateRef) {
|
|
20
|
-
this.templateRef = templateRef;
|
|
21
|
-
}
|
|
22
|
-
ItemTemplateDirective = tslib_1.__decorate([
|
|
23
|
-
Directive({
|
|
24
|
-
selector: '[kendoListViewItemTemplate]'
|
|
25
|
-
}),
|
|
26
|
-
tslib_1.__metadata("design:paramtypes", [TemplateRef])
|
|
27
|
-
], ItemTemplateDirective);
|
|
28
|
-
return ItemTemplateDirective;
|
|
29
|
-
}());
|
|
30
|
-
export { ItemTemplateDirective };
|
|
@@ -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
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, TemplateRef } from '@angular/core';
|
|
7
|
-
/**
|
|
8
|
-
* Overrides the default loader content of the ListView. To define a loader template, nest an `<ng-template>` tag
|
|
9
|
-
* with the `kendoListViewLoaderTemplate` directive inside the `<kendo-listview>` tag
|
|
10
|
-
* [see example]({% slug templates_listview %}#toc-loader-template).
|
|
11
|
-
*/
|
|
12
|
-
var LoaderTemplateDirective = /** @class */ (function () {
|
|
13
|
-
function LoaderTemplateDirective(templateRef) {
|
|
14
|
-
this.templateRef = templateRef;
|
|
15
|
-
}
|
|
16
|
-
LoaderTemplateDirective = tslib_1.__decorate([
|
|
17
|
-
Directive({
|
|
18
|
-
selector: '[kendoListViewLoaderTemplate]'
|
|
19
|
-
}),
|
|
20
|
-
tslib_1.__metadata("design:paramtypes", [TemplateRef])
|
|
21
|
-
], LoaderTemplateDirective);
|
|
22
|
-
return LoaderTemplateDirective;
|
|
23
|
-
}());
|
|
24
|
-
export { LoaderTemplateDirective };
|
|
@@ -1,40 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, ViewContainerRef, Input } from '@angular/core';
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
var TemplateContextDirective = /** @class */ (function () {
|
|
11
|
-
function TemplateContextDirective(viewContainerRef) {
|
|
12
|
-
this.viewContainerRef = viewContainerRef;
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(TemplateContextDirective.prototype, "templateContext", {
|
|
15
|
-
set: function (context) {
|
|
16
|
-
if (this.insertedViewRef) {
|
|
17
|
-
this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef));
|
|
18
|
-
this.insertedViewRef = undefined;
|
|
19
|
-
}
|
|
20
|
-
if (context.templateRef) {
|
|
21
|
-
this.insertedViewRef = this.viewContainerRef.createEmbeddedView(context.templateRef, context);
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true
|
|
26
|
-
});
|
|
27
|
-
tslib_1.__decorate([
|
|
28
|
-
Input(),
|
|
29
|
-
tslib_1.__metadata("design:type", Object),
|
|
30
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
31
|
-
], TemplateContextDirective.prototype, "templateContext", null);
|
|
32
|
-
TemplateContextDirective = tslib_1.__decorate([
|
|
33
|
-
Directive({
|
|
34
|
-
selector: '[templateContext]' // tslint:disable-line
|
|
35
|
-
}),
|
|
36
|
-
tslib_1.__metadata("design:paramtypes", [ViewContainerRef])
|
|
37
|
-
], TemplateContextDirective);
|
|
38
|
-
return TemplateContextDirective;
|
|
39
|
-
}());
|
|
40
|
-
export { TemplateContextDirective };
|
package/dist/es/utils.js
DELETED
|
@@ -1,103 +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 { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
6
|
-
var LISTVIEW_ITEM_SELECTOR = '.k-listview-item';
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
export var isPresent = function (item) { return item !== null && item !== undefined; };
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
export var isObject = function (item) { return isPresent(item) && typeof item === 'object'; };
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*
|
|
18
|
-
* Polyfill for `Element.matches`.
|
|
19
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
|
|
20
|
-
*/
|
|
21
|
-
export var match = function (element, selector) {
|
|
22
|
-
var matcher = element.matches || element.msMatchesSelector || element.webkitMatchesSelector;
|
|
23
|
-
if (!isPresent(matcher)) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
return matcher.call(element, selector);
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* @hidden
|
|
30
|
-
*
|
|
31
|
-
* Checks if a target element has the `.k-listview-item` CSS class.
|
|
32
|
-
*/
|
|
33
|
-
export var isListViewItem = function (element) {
|
|
34
|
-
if (!isPresent(element)) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return match(element, LISTVIEW_ITEM_SELECTOR);
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* @hidden
|
|
41
|
-
*
|
|
42
|
-
* Extracts and parses to a number the `data-kendo-listview-item-index` attribute value from the targeted element.
|
|
43
|
-
*/
|
|
44
|
-
export var getListItemIndex = function (item) {
|
|
45
|
-
if (!isPresent(item)) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
return Number(item.getAttribute('data-kendo-listview-item-index'));
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* @hidden
|
|
52
|
-
*
|
|
53
|
-
* Gets the new focus target from a blur event.
|
|
54
|
-
* Queries both event.relatedTarget and document.activeElement for compatibility with IE.
|
|
55
|
-
*/
|
|
56
|
-
export var relatedTarget = function (event) {
|
|
57
|
-
if (!isPresent(event.relatedTarget) || !isDocumentAvailable()) {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
return event.relatedTarget || document.activeElement;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* @hidden
|
|
64
|
-
*
|
|
65
|
-
* If the given contender number is not defined or lower than the specified min - returns min, if its above the specified max - returns max.
|
|
66
|
-
* If the number is in the given bounds, it is returned.
|
|
67
|
-
*/
|
|
68
|
-
export var fitIntoRange = function (contender, min, max) {
|
|
69
|
-
if (!isPresent(contender) || contender <= min) {
|
|
70
|
-
return min;
|
|
71
|
-
}
|
|
72
|
-
else if (contender >= max) {
|
|
73
|
-
return max;
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
return contender;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* @hidden
|
|
81
|
-
*/
|
|
82
|
-
export var closestWithMatch = function (element, selector) {
|
|
83
|
-
var parent = element;
|
|
84
|
-
while (parent !== null && parent.nodeType === 1) {
|
|
85
|
-
if (match(parent, selector)) {
|
|
86
|
-
return parent;
|
|
87
|
-
}
|
|
88
|
-
parent = parent.parentElement || parent.parentNode;
|
|
89
|
-
}
|
|
90
|
-
return null;
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* @hidden
|
|
94
|
-
*
|
|
95
|
-
* Extracts and parses to a number the `data-kendo-listview-item-index` attribute value from the targeted element.
|
|
96
|
-
*/
|
|
97
|
-
export var getClosestListItemIndex = function (element) {
|
|
98
|
-
if (!isPresent(element)) {
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
var closestListViewItem = closestWithMatch(element, LISTVIEW_ITEM_SELECTOR);
|
|
102
|
-
return getListItemIndex(closestListViewItem);
|
|
103
|
-
};
|
|
@@ -1,55 +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 * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, HostListener, ElementRef, Renderer2 as Renderer, NgZone } from '@angular/core';
|
|
7
|
-
import { Button } from '@progress/kendo-angular-buttons';
|
|
8
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
-
import { EditService } from '../edit.service';
|
|
10
|
-
/**
|
|
11
|
-
* Represents the command for adding a new item to the ListView. You can apply this directive to any
|
|
12
|
-
* `button` element inside a [`HeaderTemplate`]({% slug api_listview_headertemplatedirective %}).
|
|
13
|
-
* When an associated button with the directive is clicked, the
|
|
14
|
-
* [`add`]({% slug api_listview_listviewcomponent %}#toc-add) event is triggered
|
|
15
|
-
* ([see example]({% slug editing_listview %})).
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```html-no-run
|
|
19
|
-
* <kendo-listview>
|
|
20
|
-
* <ng-template kendoListViewHeaderTemplate>
|
|
21
|
-
* <button kendoListViewAddCommand>Add new</button>
|
|
22
|
-
* </ng-template>
|
|
23
|
-
* </kendo-listview>
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
let AddCommandDirective = class AddCommandDirective extends Button {
|
|
27
|
-
constructor(editService, element, renderer, localization, ngZone) {
|
|
28
|
-
super(element, renderer, null, localization, ngZone);
|
|
29
|
-
this.editService = editService;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
clickHandler(e) {
|
|
35
|
-
e.preventDefault();
|
|
36
|
-
this.editService.beginAdd();
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
tslib_1.__decorate([
|
|
40
|
-
HostListener('click', ['$event']),
|
|
41
|
-
tslib_1.__metadata("design:type", Function),
|
|
42
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
43
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
44
|
-
], AddCommandDirective.prototype, "clickHandler", null);
|
|
45
|
-
AddCommandDirective = tslib_1.__decorate([
|
|
46
|
-
Directive({
|
|
47
|
-
selector: '[kendoListViewAddCommand]'
|
|
48
|
-
}),
|
|
49
|
-
tslib_1.__metadata("design:paramtypes", [EditService,
|
|
50
|
-
ElementRef,
|
|
51
|
-
Renderer,
|
|
52
|
-
LocalizationService,
|
|
53
|
-
NgZone])
|
|
54
|
-
], AddCommandDirective);
|
|
55
|
-
export { AddCommandDirective };
|
|
@@ -1,4 +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
|
-
*-------------------------------------------------------------------------------------------*/
|
|
@@ -1,4 +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
|
-
*-------------------------------------------------------------------------------------------*/
|
package/dist/es2015/index.d.ts
DELETED
|
@@ -1,17 +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
|
-
/**
|
|
6
|
-
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
8
|
-
export * from './main';
|
|
9
|
-
export { AddCommandDirective } from './editing/commands/add-command.directive';
|
|
10
|
-
export { CancelCommandDirective } from './editing/commands/cancel-command.directive';
|
|
11
|
-
export { EditCommandDirective } from './editing/commands/edit-command.directive';
|
|
12
|
-
export { RemoveCommandDirective } from './editing/commands/remove-command.directive';
|
|
13
|
-
export { SaveCommandDirective } from './editing/commands/save-command.directive';
|
|
14
|
-
export { EditService } from './editing/edit.service';
|
|
15
|
-
export { ListViewNavigableItemDirective } from './navigation/listview-navigable-item.directive';
|
|
16
|
-
export { NavigationService } from './navigation/navigation.service';
|
|
17
|
-
export { TemplateContextDirective } from './templates/template-context.directive';
|
package/dist/es2015/index.js
DELETED
|
@@ -1,17 +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
|
-
/**
|
|
6
|
-
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
8
|
-
export * from './main';
|
|
9
|
-
export { AddCommandDirective } from './editing/commands/add-command.directive';
|
|
10
|
-
export { CancelCommandDirective } from './editing/commands/cancel-command.directive';
|
|
11
|
-
export { EditCommandDirective } from './editing/commands/edit-command.directive';
|
|
12
|
-
export { RemoveCommandDirective } from './editing/commands/remove-command.directive';
|
|
13
|
-
export { SaveCommandDirective } from './editing/commands/save-command.directive';
|
|
14
|
-
export { EditService } from './editing/edit.service';
|
|
15
|
-
export { ListViewNavigableItemDirective } from './navigation/listview-navigable-item.directive';
|
|
16
|
-
export { NavigationService } from './navigation/navigation.service';
|
|
17
|
-
export { TemplateContextDirective } from './templates/template-context.directive';
|