@progress/kendo-angular-listbox 0.1.1 → 1.0.0-dev.202204201039
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-listbox.umd.js +5 -0
- package/{dist/es2015/constants.d.ts → constants.d.ts} +0 -0
- package/{dist/es2015/data-binding.directive.d.ts → data-binding.directive.d.ts} +3 -0
- package/{dist/es2015 → esm2015}/constants.js +0 -0
- package/{dist/es2015 → esm2015}/data-binding.directive.js +17 -19
- package/esm2015/item-selectable.directive.js +38 -0
- package/{dist/es2015 → esm2015}/item-template.directive.js +12 -11
- package/{dist/es/size.js → esm2015/kendo-angular-listbox.js} +4 -0
- package/{dist/es2015 → esm2015}/listbox.component.js +73 -52
- package/esm2015/listbox.module.js +28 -0
- package/{dist/es2015 → esm2015}/main.js +3 -1
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/{dist/es2015 → esm2015}/selection.service.js +8 -10
- package/{dist/es2015 → esm2015}/size.js +1 -0
- package/{dist/es2015 → esm2015}/toolbar.js +1 -0
- package/{dist/es2015 → esm2015}/util.js +0 -0
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-listbox.js} +153 -133
- package/{dist/es2015/item-selectable.directive.d.ts → item-selectable.directive.d.ts} +4 -1
- package/{dist/es2015/item-template.directive.d.ts → item-template.directive.d.ts} +3 -0
- package/{dist/es/toolbar.js → kendo-angular-listbox.d.ts} +5 -0
- package/{dist/es2015/listbox.component.d.ts → listbox.component.d.ts} +6 -3
- package/listbox.module.d.ts +19 -0
- package/{dist/es2015/main.d.ts → main.d.ts} +3 -1
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +33 -102
- package/schematics/ngAdd/index.js +10 -7
- package/schematics/ngAdd/index.js.map +1 -1
- package/schematics/ngAdd/schema.json +2 -2
- package/{dist/es2015/selection.service.d.ts → selection.service.d.ts} +3 -0
- package/{dist/es2015/size.d.ts → size.d.ts} +0 -0
- package/{dist/es2015/toolbar.d.ts → toolbar.d.ts} +0 -0
- package/{dist/es2015/util.d.ts → util.d.ts} +0 -0
- package/dist/cdn/js/kendo-angular-listbox.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/constants.js +0 -65
- package/dist/es/data-binding.directive.js +0 -145
- package/dist/es/index.js +0 -11
- package/dist/es/item-selectable.directive.js +0 -49
- package/dist/es/item-template.directive.js +0 -38
- package/dist/es/listbox.component.js +0 -196
- package/dist/es/listbox.module.js +0 -28
- package/dist/es/main.js +0 -7
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/selection.service.js +0 -30
- package/dist/es/util.js +0 -38
- package/dist/es2015/index.d.ts +0 -11
- package/dist/es2015/index.js +0 -11
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/item-selectable.directive.js +0 -44
- package/dist/es2015/listbox.module.d.ts +0 -9
- package/dist/es2015/listbox.module.js +0 -25
- package/dist/fesm5/index.js +0 -557
- package/dist/npm/constants.js +0 -67
- package/dist/npm/data-binding.directive.js +0 -147
- package/dist/npm/index.js +0 -17
- package/dist/npm/item-selectable.directive.js +0 -51
- package/dist/npm/item-template.directive.js +0 -40
- package/dist/npm/listbox.component.js +0 -198
- package/dist/npm/listbox.module.js +0 -30
- package/dist/npm/main.js +0 -12
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/selection.service.js +0 -32
- package/dist/npm/size.js +0 -6
- package/dist/npm/toolbar.js +0 -6
- package/dist/npm/util.js +0 -40
- package/dist/systemjs/kendo-angular-listbox.js +0 -5
|
@@ -1,38 +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 ListBox item content. To define the item template, nest an `<ng-template>` tag
|
|
9
|
-
* with the `kendoListBoxItemTemplate` directive inside the `<kendo-listbox>` tag. The template context is
|
|
10
|
-
* set to the current data item.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* _@Component({
|
|
15
|
-
* selector: 'my-app',
|
|
16
|
-
* template: `
|
|
17
|
-
* <kendo-listbox [data]="listBoxItems">
|
|
18
|
-
* <ng-template kendoListBoxItemTemplate let-dataItem>
|
|
19
|
-
* <span>{{ dataItem }} item</span>
|
|
20
|
-
* </ng-template>
|
|
21
|
-
* </kendo-listbox>
|
|
22
|
-
* `
|
|
23
|
-
* })
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
var ItemTemplateDirective = /** @class */ (function () {
|
|
27
|
-
function ItemTemplateDirective(templateRef) {
|
|
28
|
-
this.templateRef = templateRef;
|
|
29
|
-
}
|
|
30
|
-
ItemTemplateDirective = tslib_1.__decorate([
|
|
31
|
-
Directive({
|
|
32
|
-
selector: '[kendoListBoxItemTemplate]'
|
|
33
|
-
}),
|
|
34
|
-
tslib_1.__metadata("design:paramtypes", [TemplateRef])
|
|
35
|
-
], ItemTemplateDirective);
|
|
36
|
-
return ItemTemplateDirective;
|
|
37
|
-
}());
|
|
38
|
-
export { ItemTemplateDirective };
|
|
@@ -1,196 +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 { Component, ContentChild, ElementRef, EventEmitter, HostBinding, Input, isDevMode, Output, Renderer2 } from '@angular/core';
|
|
7
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
8
|
-
import { Subscription } from 'rxjs';
|
|
9
|
-
import { packageMetadata } from './package-metadata';
|
|
10
|
-
import { ListBoxSelectionService } from './selection.service';
|
|
11
|
-
import { ItemTemplateDirective } from './item-template.directive';
|
|
12
|
-
import { defaultItemDisabled, fieldAccessor, getTools } from './util';
|
|
13
|
-
import { allTools, DEFAULT_TOOLBAR_POSITION, sizeClassMap, toolbarClasses } from './constants';
|
|
14
|
-
/**
|
|
15
|
-
* Represents the [Kendo UI ListBox component for Angular]({% slug overview_listbox %}).
|
|
16
|
-
*/
|
|
17
|
-
var ListBoxComponent = /** @class */ (function () {
|
|
18
|
-
function ListBoxComponent(selectionService, renderer, hostElement) {
|
|
19
|
-
var _this = this;
|
|
20
|
-
this.selectionService = selectionService;
|
|
21
|
-
this.renderer = renderer;
|
|
22
|
-
this.hostElement = hostElement;
|
|
23
|
-
/**
|
|
24
|
-
* @hidden
|
|
25
|
-
*/
|
|
26
|
-
this.listboxClassName = true;
|
|
27
|
-
/**
|
|
28
|
-
* The data which will be displayed by the ListBox.
|
|
29
|
-
*/
|
|
30
|
-
this.data = [];
|
|
31
|
-
/**
|
|
32
|
-
* Sets the size of the component.
|
|
33
|
-
*
|
|
34
|
-
* The possible values are:
|
|
35
|
-
* - `'small'`
|
|
36
|
-
* - `'medium'` (default)
|
|
37
|
-
* - `'large'`
|
|
38
|
-
*/
|
|
39
|
-
this.size = 'medium';
|
|
40
|
-
/**
|
|
41
|
-
* A function which determines if a specific item is disabled.
|
|
42
|
-
*/
|
|
43
|
-
this.itemDisabled = defaultItemDisabled;
|
|
44
|
-
/**
|
|
45
|
-
* Fires when the user selects a different ListBox item. Also fires when a node is moved, since that also changes its index.
|
|
46
|
-
*/
|
|
47
|
-
this.selectionChange = new EventEmitter();
|
|
48
|
-
/**
|
|
49
|
-
* Fires when the user clicks a ListBox item.
|
|
50
|
-
*/
|
|
51
|
-
this.actionClick = new EventEmitter();
|
|
52
|
-
/**
|
|
53
|
-
* @hidden
|
|
54
|
-
*/
|
|
55
|
-
this.selectedTools = allTools;
|
|
56
|
-
this.sub = new Subscription();
|
|
57
|
-
validatePackage(packageMetadata);
|
|
58
|
-
this.setToolbarClass(DEFAULT_TOOLBAR_POSITION);
|
|
59
|
-
this.sub.add(this.selectionService.onSelect.subscribe(function (e) {
|
|
60
|
-
_this.selectionChange.next(e);
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
|
-
Object.defineProperty(ListBoxComponent.prototype, "toolbar", {
|
|
64
|
-
/**
|
|
65
|
-
* Sets whether a toolbar should be displayed with the ListBox, as well as what tools and position should be used.
|
|
66
|
-
*/
|
|
67
|
-
set: function (config) {
|
|
68
|
-
var position = DEFAULT_TOOLBAR_POSITION;
|
|
69
|
-
if (typeof config === 'boolean') {
|
|
70
|
-
this.selectedTools = config ? allTools : [];
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
this.selectedTools = config.tools ? getTools(config.tools) : allTools;
|
|
74
|
-
if (config.position) {
|
|
75
|
-
position = config.position;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
this.setToolbarClass(position);
|
|
79
|
-
},
|
|
80
|
-
enumerable: true,
|
|
81
|
-
configurable: true
|
|
82
|
-
});
|
|
83
|
-
Object.defineProperty(ListBoxComponent.prototype, "listClasses", {
|
|
84
|
-
/**
|
|
85
|
-
* @hidden
|
|
86
|
-
*/
|
|
87
|
-
get: function () {
|
|
88
|
-
return "k-list k-list-" + sizeClassMap[this.size];
|
|
89
|
-
},
|
|
90
|
-
enumerable: true,
|
|
91
|
-
configurable: true
|
|
92
|
-
});
|
|
93
|
-
/**
|
|
94
|
-
* @hidden
|
|
95
|
-
*/
|
|
96
|
-
ListBoxComponent.prototype.ngOnDestroy = function () {
|
|
97
|
-
this.sub.unsubscribe();
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* @hidden
|
|
101
|
-
*/
|
|
102
|
-
ListBoxComponent.prototype.performAction = function (actionName) {
|
|
103
|
-
this.actionClick.next(actionName);
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Programmatically selects a ListBox node.
|
|
107
|
-
*/
|
|
108
|
-
ListBoxComponent.prototype.selectItem = function (index) {
|
|
109
|
-
this.selectionService.selectedIndex = index;
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Programmatically clears the ListBox selection.
|
|
113
|
-
*/
|
|
114
|
-
ListBoxComponent.prototype.clearSelection = function () {
|
|
115
|
-
this.selectionService.clearSelection();
|
|
116
|
-
};
|
|
117
|
-
Object.defineProperty(ListBoxComponent.prototype, "selectedIndex", {
|
|
118
|
-
/**
|
|
119
|
-
* The index of the currently selected item in the ListBox.
|
|
120
|
-
*/
|
|
121
|
-
get: function () {
|
|
122
|
-
return this.selectionService.selectedIndex;
|
|
123
|
-
},
|
|
124
|
-
enumerable: true,
|
|
125
|
-
configurable: true
|
|
126
|
-
});
|
|
127
|
-
/**
|
|
128
|
-
* @hidden
|
|
129
|
-
*/
|
|
130
|
-
ListBoxComponent.prototype.getText = function (dataItem) {
|
|
131
|
-
if (typeof dataItem !== 'string' && !this.textField && isDevMode()) {
|
|
132
|
-
throw new Error('Missing textField input. When passing an array of objects as data, please set the textField input of the ListBox accordingly.');
|
|
133
|
-
}
|
|
134
|
-
return fieldAccessor(dataItem, this.textField);
|
|
135
|
-
};
|
|
136
|
-
ListBoxComponent.prototype.setToolbarClass = function (pos) {
|
|
137
|
-
var _this = this;
|
|
138
|
-
Object.keys(toolbarClasses).forEach(function (className) {
|
|
139
|
-
if (pos === className) {
|
|
140
|
-
_this.renderer.addClass(_this.hostElement.nativeElement, toolbarClasses[className]);
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
_this.renderer.removeClass(_this.hostElement.nativeElement, toolbarClasses[className]);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
|
-
tslib_1.__decorate([
|
|
148
|
-
HostBinding('class.k-listbox'),
|
|
149
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
150
|
-
], ListBoxComponent.prototype, "listboxClassName", void 0);
|
|
151
|
-
tslib_1.__decorate([
|
|
152
|
-
ContentChild(ItemTemplateDirective, { static: false }),
|
|
153
|
-
tslib_1.__metadata("design:type", ItemTemplateDirective)
|
|
154
|
-
], ListBoxComponent.prototype, "itemTemplate", void 0);
|
|
155
|
-
tslib_1.__decorate([
|
|
156
|
-
Input(),
|
|
157
|
-
tslib_1.__metadata("design:type", String)
|
|
158
|
-
], ListBoxComponent.prototype, "textField", void 0);
|
|
159
|
-
tslib_1.__decorate([
|
|
160
|
-
Input(),
|
|
161
|
-
tslib_1.__metadata("design:type", Array)
|
|
162
|
-
], ListBoxComponent.prototype, "data", void 0);
|
|
163
|
-
tslib_1.__decorate([
|
|
164
|
-
Input(),
|
|
165
|
-
tslib_1.__metadata("design:type", String)
|
|
166
|
-
], ListBoxComponent.prototype, "size", void 0);
|
|
167
|
-
tslib_1.__decorate([
|
|
168
|
-
Input(),
|
|
169
|
-
tslib_1.__metadata("design:type", Object),
|
|
170
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
171
|
-
], ListBoxComponent.prototype, "toolbar", null);
|
|
172
|
-
tslib_1.__decorate([
|
|
173
|
-
Input(),
|
|
174
|
-
tslib_1.__metadata("design:type", Function)
|
|
175
|
-
], ListBoxComponent.prototype, "itemDisabled", void 0);
|
|
176
|
-
tslib_1.__decorate([
|
|
177
|
-
Output(),
|
|
178
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
179
|
-
], ListBoxComponent.prototype, "selectionChange", void 0);
|
|
180
|
-
tslib_1.__decorate([
|
|
181
|
-
Output(),
|
|
182
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
183
|
-
], ListBoxComponent.prototype, "actionClick", void 0);
|
|
184
|
-
ListBoxComponent = tslib_1.__decorate([
|
|
185
|
-
Component({
|
|
186
|
-
selector: 'kendo-listbox',
|
|
187
|
-
providers: [ListBoxSelectionService],
|
|
188
|
-
template: "\n <div class=\"k-listbox-toolbar\" *ngIf=\"selectedTools.length > 0\">\n <ul class=\"k-reset\">\n <li *ngFor=\"let tool of selectedTools\">\n <button kendoButton [icon]=\"tool.icon\" (click)=\"performAction(tool.name)\"></button>\n </li>\n\n <!-- react moving items has a smoother removal of the style: https://www.telerik.com/kendo-react-ui/components/listbox/ -->\n </ul>\n </div>\n <div class=\"k-list-scroller k-selectable\">\n <div class=\"{{ listClasses }}\">\n <div class=\"k-list-content\">\n <ul class=\"k-list-ul\">\n <li\n class=\"k-list-item\"\n *ngFor=\"let item of data; let i = index;\"\n kendoListBoxItemSelectable\n [index]=\"i\"\n [class.k-disabled]=\"itemDisabled(item)\"\n >\n <ng-template *ngIf=\"itemTemplate; else defaultItemTemplate\"\n [templateContext]=\"{\n templateRef: itemTemplate.templateRef,\n $implicit: item\n }\">\n </ng-template>\n <ng-template #defaultItemTemplate>\n <span class=\"k-list-item-text\">{{ getText(item) }}</span>\n </ng-template>\n </li>\n </ul>\n </div>\n </div>\n </div>\n "
|
|
189
|
-
}),
|
|
190
|
-
tslib_1.__metadata("design:paramtypes", [ListBoxSelectionService,
|
|
191
|
-
Renderer2,
|
|
192
|
-
ElementRef])
|
|
193
|
-
], ListBoxComponent);
|
|
194
|
-
return ListBoxComponent;
|
|
195
|
-
}());
|
|
196
|
-
export { ListBoxComponent };
|
|
@@ -1,28 +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 { NgModule } from '@angular/core';
|
|
7
|
-
import { ListBoxComponent } from './listbox.component';
|
|
8
|
-
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
9
|
-
import { CommonModule } from '@angular/common';
|
|
10
|
-
import { ItemTemplateDirective } from './item-template.directive';
|
|
11
|
-
import { ItemSelectableDirective } from './item-selectable.directive';
|
|
12
|
-
import { DataBindingDirective } from './data-binding.directive';
|
|
13
|
-
/**
|
|
14
|
-
* Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the ListBox component.
|
|
15
|
-
*/
|
|
16
|
-
var ListBoxModule = /** @class */ (function () {
|
|
17
|
-
function ListBoxModule() {
|
|
18
|
-
}
|
|
19
|
-
ListBoxModule = tslib_1.__decorate([
|
|
20
|
-
NgModule({
|
|
21
|
-
imports: [ButtonsModule, CommonModule],
|
|
22
|
-
declarations: [ListBoxComponent, ItemTemplateDirective, ItemSelectableDirective, DataBindingDirective],
|
|
23
|
-
exports: [ListBoxComponent, ItemTemplateDirective, ItemSelectableDirective, DataBindingDirective]
|
|
24
|
-
})
|
|
25
|
-
], ListBoxModule);
|
|
26
|
-
return ListBoxModule;
|
|
27
|
-
}());
|
|
28
|
-
export { ListBoxModule };
|
package/dist/es/main.js
DELETED
|
@@ -1,7 +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
|
-
export { ListBoxComponent } from './listbox.component';
|
|
6
|
-
export { DataBindingDirective } from './data-binding.directive';
|
|
7
|
-
export { ListBoxModule } from './listbox.module';
|
|
@@ -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-listbox',
|
|
10
|
-
productName: 'Kendo UI for Angular',
|
|
11
|
-
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate: 1649861138,
|
|
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,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 { EventEmitter, Injectable } from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
var ListBoxSelectionService = /** @class */ (function () {
|
|
11
|
-
function ListBoxSelectionService() {
|
|
12
|
-
this.onSelect = new EventEmitter();
|
|
13
|
-
this.selectedIndex = null;
|
|
14
|
-
}
|
|
15
|
-
ListBoxSelectionService.prototype.select = function (index) {
|
|
16
|
-
this.selectedIndex = index;
|
|
17
|
-
this.onSelect.next({ index: this.selectedIndex });
|
|
18
|
-
};
|
|
19
|
-
ListBoxSelectionService.prototype.isSelected = function (index) {
|
|
20
|
-
return index === this.selectedIndex;
|
|
21
|
-
};
|
|
22
|
-
ListBoxSelectionService.prototype.clearSelection = function () {
|
|
23
|
-
this.selectedIndex = null;
|
|
24
|
-
};
|
|
25
|
-
ListBoxSelectionService = tslib_1.__decorate([
|
|
26
|
-
Injectable()
|
|
27
|
-
], ListBoxSelectionService);
|
|
28
|
-
return ListBoxSelectionService;
|
|
29
|
-
}());
|
|
30
|
-
export { ListBoxSelectionService };
|
package/dist/es/util.js
DELETED
|
@@ -1,38 +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 { getter } from '@progress/kendo-common';
|
|
6
|
-
import { allTools } from './constants';
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
export var isPresent = function (value) { return value !== null && value !== undefined; };
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
export var isObject = function (value) { return isPresent(value) && typeof value === 'object'; };
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
export var fieldAccessor = function (dataItem, field) {
|
|
19
|
-
if (!isPresent(dataItem)) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
if (!isPresent(field) || !isObject(dataItem)) {
|
|
23
|
-
return dataItem;
|
|
24
|
-
}
|
|
25
|
-
// creates a field accessor supporting nested fields processing
|
|
26
|
-
var valueFrom = getter(field);
|
|
27
|
-
return valueFrom(dataItem);
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* @hidden
|
|
31
|
-
*/
|
|
32
|
-
export var defaultItemDisabled = function () { return false; };
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
export var getTools = function (names) {
|
|
37
|
-
return names.map(function (tool) { return allTools.find(function (meta) { return meta.name === tool; }); });
|
|
38
|
-
};
|
package/dist/es2015/index.d.ts
DELETED
|
@@ -1,11 +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 { ItemSelectableDirective } from './item-selectable.directive';
|
|
10
|
-
export { ItemTemplateDirective } from './item-template.directive';
|
|
11
|
-
export { ListBoxSelectionService } from './selection.service';
|
package/dist/es2015/index.js
DELETED
|
@@ -1,11 +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 { ItemSelectableDirective } from './item-selectable.directive';
|
|
10
|
-
export { ItemTemplateDirective } from './item-template.directive';
|
|
11
|
-
export { ListBoxSelectionService } from './selection.service';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"ListBoxComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":26,"character":1},"arguments":[{"selector":"kendo-listbox","providers":[{"__symbolic":"reference","name":"ListBoxSelectionService"}],"template":"\n <div class=\"k-listbox-toolbar\" *ngIf=\"selectedTools.length > 0\">\n <ul class=\"k-reset\">\n <li *ngFor=\"let tool of selectedTools\">\n <button kendoButton [icon]=\"tool.icon\" (click)=\"performAction(tool.name)\"></button>\n </li>\n\n <!-- react moving items has a smoother removal of the style: https://www.telerik.com/kendo-react-ui/components/listbox/ -->\n </ul>\n </div>\n <div class=\"k-list-scroller k-selectable\">\n <div class=\"{{ listClasses }}\">\n <div class=\"k-list-content\">\n <ul class=\"k-list-ul\">\n <li\n class=\"k-list-item\"\n *ngFor=\"let item of data; let i = index;\"\n kendoListBoxItemSelectable\n [index]=\"i\"\n [class.k-disabled]=\"itemDisabled(item)\"\n >\n <ng-template *ngIf=\"itemTemplate; else defaultItemTemplate\"\n [templateContext]=\"{\n templateRef: itemTemplate.templateRef,\n $implicit: item\n }\">\n </ng-template>\n <ng-template #defaultItemTemplate>\n <span class=\"k-list-item-text\">{{ getText(item) }}</span>\n </ng-template>\n </li>\n </ul>\n </div>\n </div>\n </div>\n "}]}],"members":{"listboxClassName":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":70,"character":5},"arguments":["class.k-listbox"]}]}],"itemTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":76,"character":5},"arguments":[{"__symbolic":"reference","name":"ItemTemplateDirective"},{"static":false}]}]}],"textField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":82,"character":5}}]}],"data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":87,"character":5}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":97,"character":5}}]}],"toolbar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":102,"character":5}}]}],"itemDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":123,"character":5}}]}],"selectionChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":129,"character":5}}]}],"actionClick":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":135,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ListBoxSelectionService"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":154,"character":26},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":155,"character":29}]}],"ngOnDestroy":[{"__symbolic":"method"}],"performAction":[{"__symbolic":"method"}],"selectItem":[{"__symbolic":"method"}],"clearSelection":[{"__symbolic":"method"}],"getText":[{"__symbolic":"method"}],"setToolbarClass":[{"__symbolic":"method"}]}},"DataBindingDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":12,"character":1},"arguments":[{"selector":"[kendoListBoxDataBinding]"}]}],"members":{"data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":5},"arguments":["kendoListBoxDataBinding"]}]}],"connectedWith":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ListBoxComponent"}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"moveVertically":[{"__symbolic":"method"}],"removeItem":[{"__symbolic":"method"}],"transferItem":[{"__symbolic":"method"}],"transferAll":[{"__symbolic":"method"}]}},"ListBoxModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@progress/kendo-angular-buttons","name":"ButtonsModule","line":12,"character":15},{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":12,"character":30}],"declarations":[{"__symbolic":"reference","name":"ListBoxComponent"},{"__symbolic":"reference","name":"ItemTemplateDirective"},{"__symbolic":"reference","name":"ItemSelectableDirective"},{"__symbolic":"reference","name":"DataBindingDirective"}],"exports":[{"__symbolic":"reference","name":"ListBoxComponent"},{"__symbolic":"reference","name":"ItemTemplateDirective"},{"__symbolic":"reference","name":"ItemSelectableDirective"},{"__symbolic":"reference","name":"DataBindingDirective"}]}]}],"members":{}},"ListBoxSize":{"__symbolic":"interface"},"ActionName":{"__symbolic":"interface"},"ListBoxToolbarPosition":{"__symbolic":"interface"},"Toolbar":{"__symbolic":"interface"},"ListBoxToolbarConfig":{"__symbolic":"interface"},"ListBoxSelectionService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":15,"character":1}}],"members":{"select":[{"__symbolic":"method"}],"isSelected":[{"__symbolic":"method"}],"clearSelection":[{"__symbolic":"method"}]}},"ItemTemplateDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":21,"character":1},"arguments":[{"selector":"[kendoListBoxItemTemplate]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"TemplateRef","module":"@angular/core","arguments":[{"__symbolic":"reference","name":"any"}]}]}]}},"ItemSelectableDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":11,"character":1},"arguments":[{"selector":"[kendoListBoxItemSelectable]"}]}],"members":{"index":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ListBoxSelectionService"}]}],"selectedClassName":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":19,"character":5},"arguments":["class.k-selected"]}]}],"onClick":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":25,"character":5},"arguments":["click",["$event"]]}]}]}}},"origins":{"ListBoxComponent":"./listbox.component","DataBindingDirective":"./data-binding.directive","ListBoxModule":"./listbox.module","ListBoxSize":"./size","ActionName":"./toolbar","ListBoxToolbarPosition":"./toolbar","Toolbar":"./toolbar","ListBoxToolbarConfig":"./toolbar","ListBoxSelectionService":"./selection.service","ItemTemplateDirective":"./item-template.directive","ItemSelectableDirective":"./item-selectable.directive"},"importAs":"@progress/kendo-angular-listbox"}
|
|
@@ -1,44 +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, Input, HostBinding, HostListener } from '@angular/core';
|
|
7
|
-
import { ListBoxSelectionService } from './selection.service';
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
let ItemSelectableDirective = class ItemSelectableDirective {
|
|
12
|
-
constructor(selectionService) {
|
|
13
|
-
this.selectionService = selectionService;
|
|
14
|
-
}
|
|
15
|
-
get selectedClassName() {
|
|
16
|
-
return this.selectionService.isSelected(this.index);
|
|
17
|
-
}
|
|
18
|
-
onClick(event) {
|
|
19
|
-
event.stopPropagation();
|
|
20
|
-
this.selectionService.select(this.index);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
tslib_1.__decorate([
|
|
24
|
-
Input(),
|
|
25
|
-
tslib_1.__metadata("design:type", Number)
|
|
26
|
-
], ItemSelectableDirective.prototype, "index", void 0);
|
|
27
|
-
tslib_1.__decorate([
|
|
28
|
-
HostBinding('class.k-selected'),
|
|
29
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
30
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
31
|
-
], ItemSelectableDirective.prototype, "selectedClassName", null);
|
|
32
|
-
tslib_1.__decorate([
|
|
33
|
-
HostListener('click', ['$event']),
|
|
34
|
-
tslib_1.__metadata("design:type", Function),
|
|
35
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
36
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
37
|
-
], ItemSelectableDirective.prototype, "onClick", null);
|
|
38
|
-
ItemSelectableDirective = tslib_1.__decorate([
|
|
39
|
-
Directive({
|
|
40
|
-
selector: '[kendoListBoxItemSelectable]'
|
|
41
|
-
}),
|
|
42
|
-
tslib_1.__metadata("design:paramtypes", [ListBoxSelectionService])
|
|
43
|
-
], ItemSelectableDirective);
|
|
44
|
-
export { ItemSelectableDirective };
|
|
@@ -1,9 +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
|
-
* Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the ListBox component.
|
|
7
|
-
*/
|
|
8
|
-
export declare class ListBoxModule {
|
|
9
|
-
}
|
|
@@ -1,25 +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 { NgModule } from '@angular/core';
|
|
7
|
-
import { ListBoxComponent } from './listbox.component';
|
|
8
|
-
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
9
|
-
import { CommonModule } from '@angular/common';
|
|
10
|
-
import { ItemTemplateDirective } from './item-template.directive';
|
|
11
|
-
import { ItemSelectableDirective } from './item-selectable.directive';
|
|
12
|
-
import { DataBindingDirective } from './data-binding.directive';
|
|
13
|
-
/**
|
|
14
|
-
* Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the ListBox component.
|
|
15
|
-
*/
|
|
16
|
-
let ListBoxModule = class ListBoxModule {
|
|
17
|
-
};
|
|
18
|
-
ListBoxModule = tslib_1.__decorate([
|
|
19
|
-
NgModule({
|
|
20
|
-
imports: [ButtonsModule, CommonModule],
|
|
21
|
-
declarations: [ListBoxComponent, ItemTemplateDirective, ItemSelectableDirective, DataBindingDirective],
|
|
22
|
-
exports: [ListBoxComponent, ItemTemplateDirective, ItemSelectableDirective, DataBindingDirective]
|
|
23
|
-
})
|
|
24
|
-
], ListBoxModule);
|
|
25
|
-
export { ListBoxModule };
|