@progress/kendo-angular-listbox 0.1.0
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/LICENSE.md +11 -0
- package/NOTICE.txt +654 -0
- package/README.md +31 -0
- package/dist/cdn/js/kendo-angular-listbox.js +20 -0
- package/dist/cdn/main.js +5 -0
- package/dist/es/constants.js +65 -0
- package/dist/es/data-binding.directive.js +145 -0
- package/dist/es/index.js +11 -0
- package/dist/es/item-selectable.directive.js +49 -0
- package/dist/es/item-template.directive.js +38 -0
- package/dist/es/listbox.component.js +196 -0
- package/dist/es/listbox.module.js +28 -0
- package/dist/es/main.js +7 -0
- package/dist/es/package-metadata.js +15 -0
- package/dist/es/selection.service.js +30 -0
- package/dist/es/size.js +4 -0
- package/dist/es/toolbar.js +4 -0
- package/dist/es/util.js +38 -0
- package/dist/es2015/constants.d.ts +25 -0
- package/dist/es2015/constants.js +65 -0
- package/dist/es2015/data-binding.directive.d.ts +36 -0
- package/dist/es2015/data-binding.directive.js +140 -0
- package/dist/es2015/index.d.ts +11 -0
- package/dist/es2015/index.js +11 -0
- package/dist/es2015/index.metadata.json +1 -0
- package/dist/es2015/item-selectable.directive.d.ts +15 -0
- package/dist/es2015/item-selectable.directive.js +44 -0
- package/dist/es2015/item-template.directive.d.ts +28 -0
- package/dist/es2015/item-template.directive.js +37 -0
- package/dist/es2015/listbox.component.d.ts +93 -0
- package/dist/es2015/listbox.component.js +216 -0
- package/dist/es2015/listbox.module.d.ts +9 -0
- package/dist/es2015/listbox.module.js +25 -0
- package/dist/es2015/main.d.ts +12 -0
- package/dist/es2015/main.js +7 -0
- package/dist/es2015/package-metadata.d.ts +9 -0
- package/dist/es2015/package-metadata.js +15 -0
- package/dist/es2015/selection.service.d.ts +21 -0
- package/dist/es2015/selection.service.js +32 -0
- package/dist/es2015/size.d.ts +13 -0
- package/dist/es2015/size.js +4 -0
- package/dist/es2015/toolbar.d.ts +42 -0
- package/dist/es2015/toolbar.js +4 -0
- package/dist/es2015/util.d.ts +31 -0
- package/dist/es2015/util.js +38 -0
- package/dist/fesm2015/index.js +565 -0
- package/dist/fesm5/index.js +557 -0
- package/dist/npm/constants.js +67 -0
- package/dist/npm/data-binding.directive.js +147 -0
- package/dist/npm/index.js +17 -0
- package/dist/npm/item-selectable.directive.js +51 -0
- package/dist/npm/item-template.directive.js +40 -0
- package/dist/npm/listbox.component.js +198 -0
- package/dist/npm/listbox.module.js +30 -0
- package/dist/npm/main.js +12 -0
- package/dist/npm/package-metadata.js +17 -0
- package/dist/npm/selection.service.js +32 -0
- package/dist/npm/size.js +6 -0
- package/dist/npm/toolbar.js +6 -0
- package/dist/npm/util.js +40 -0
- package/dist/systemjs/kendo-angular-listbox.js +5 -0
- package/package.json +153 -0
- package/schematics/collection.json +12 -0
- package/schematics/ngAdd/index.js +18 -0
- package/schematics/ngAdd/index.js.map +1 -0
- package/schematics/ngAdd/schema.json +28 -0
|
@@ -0,0 +1,28 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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';
|
|
@@ -0,0 +1,15 @@
|
|
|
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: 1649835747,
|
|
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
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
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/size.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
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
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -0,0 +1,4 @@
|
|
|
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/es/util.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { ListBoxToolbarPosition, Tool } from "./toolbar";
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_TOOLBAR_POSITION: ListBoxToolbarPosition;
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export declare const allTools: Tool[];
|
|
14
|
+
/**
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
export declare const sizeClassMap: {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export declare const toolbarClasses: {
|
|
24
|
+
[key: string]: string;
|
|
25
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
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 const DEFAULT_TOOLBAR_POSITION = 'right';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export const allTools = [
|
|
13
|
+
{
|
|
14
|
+
name: 'moveUp',
|
|
15
|
+
label: 'Move Up',
|
|
16
|
+
icon: 'arrow-n'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'moveDown',
|
|
20
|
+
label: 'Move Down',
|
|
21
|
+
icon: 'arrow-s'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'transferTo',
|
|
25
|
+
label: 'Transfer From',
|
|
26
|
+
icon: 'arrow-w'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'transferFrom',
|
|
30
|
+
label: 'Transfer To',
|
|
31
|
+
icon: 'arrow-e'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'transferAllTo',
|
|
35
|
+
label: 'Transfer All To',
|
|
36
|
+
icon: 'arrow-double-60-right'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'transferAllFrom',
|
|
40
|
+
label: 'Transfer All From',
|
|
41
|
+
icon: 'arrow-double-60-left'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'remove',
|
|
45
|
+
label: 'Remove',
|
|
46
|
+
icon: 'x'
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
export const sizeClassMap = {
|
|
53
|
+
small: 'sm',
|
|
54
|
+
medium: 'md',
|
|
55
|
+
large: 'lg'
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* @hidden
|
|
59
|
+
*/
|
|
60
|
+
export const toolbarClasses = {
|
|
61
|
+
left: 'k-listbox-toolbar-left',
|
|
62
|
+
right: 'k-listbox-toolbar-right',
|
|
63
|
+
top: 'k-listbox-toolbar-top',
|
|
64
|
+
bottom: 'k-listbox-toolbar-bottom'
|
|
65
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
6
|
+
import { ListBoxComponent } from './listbox.component';
|
|
7
|
+
/**
|
|
8
|
+
* A directive which manages the functoinality of the ListBox tools out of the box, and modifies the provided data accordingly.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DataBindingDirective implements OnChanges, OnDestroy {
|
|
11
|
+
private listbox;
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
data: any[];
|
|
16
|
+
/**
|
|
17
|
+
* Specifies the ListBoxComponent instance with which the current ListBox should be connected.
|
|
18
|
+
* When two listboxes are linked via this input, one can transfer items between them.
|
|
19
|
+
*/
|
|
20
|
+
connectedWith: ListBoxComponent;
|
|
21
|
+
private sub;
|
|
22
|
+
private selectedBox;
|
|
23
|
+
constructor(listbox: ListBoxComponent);
|
|
24
|
+
/**
|
|
25
|
+
* @hidden
|
|
26
|
+
*/
|
|
27
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
28
|
+
/**
|
|
29
|
+
* @hidden
|
|
30
|
+
*/
|
|
31
|
+
ngOnDestroy(): void;
|
|
32
|
+
private moveVertically;
|
|
33
|
+
private removeItem;
|
|
34
|
+
private transferItem;
|
|
35
|
+
private transferAll;
|
|
36
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
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 } from '@angular/core';
|
|
7
|
+
import { isChanged } from '@progress/kendo-angular-common';
|
|
8
|
+
import { Subscription } from 'rxjs';
|
|
9
|
+
import { ListBoxComponent } from './listbox.component';
|
|
10
|
+
import { isPresent } from './util';
|
|
11
|
+
/**
|
|
12
|
+
* A directive which manages the functoinality of the ListBox tools out of the box, and modifies the provided data accordingly.
|
|
13
|
+
*/
|
|
14
|
+
let DataBindingDirective = class DataBindingDirective {
|
|
15
|
+
constructor(listbox) {
|
|
16
|
+
this.listbox = listbox;
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
this.data = [];
|
|
21
|
+
this.sub = new Subscription();
|
|
22
|
+
this.selectedBox = this.listbox;
|
|
23
|
+
this.sub.add(this.listbox.actionClick.subscribe((actionName) => {
|
|
24
|
+
switch (actionName) {
|
|
25
|
+
case 'moveUp': {
|
|
26
|
+
this.moveVertically('up');
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
case 'moveDown': {
|
|
30
|
+
this.moveVertically('down');
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
case 'transferTo': {
|
|
34
|
+
this.transferItem(this.connectedWith, this.listbox);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
case 'transferFrom': {
|
|
38
|
+
this.transferItem(this.listbox, this.connectedWith);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
case 'transferAllTo': {
|
|
42
|
+
this.transferAll(this.listbox, this.connectedWith);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
case 'transferAllFrom': {
|
|
46
|
+
this.transferAll(this.connectedWith, this.listbox);
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
case 'remove': {
|
|
50
|
+
this.removeItem();
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
default: {
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @hidden
|
|
61
|
+
*/
|
|
62
|
+
ngOnChanges(changes) {
|
|
63
|
+
if (isChanged('connectedWith', changes, false)) {
|
|
64
|
+
this.sub.add(this.listbox.selectionChange.subscribe(() => {
|
|
65
|
+
this.selectedBox = this.listbox;
|
|
66
|
+
this.connectedWith.clearSelection();
|
|
67
|
+
}));
|
|
68
|
+
this.sub.add(this.connectedWith.selectionChange.subscribe(() => {
|
|
69
|
+
this.selectedBox = this.connectedWith;
|
|
70
|
+
this.listbox.clearSelection();
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
if (isChanged('data', changes, true)) {
|
|
74
|
+
this.listbox.data = changes.data.currentValue;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* @hidden
|
|
79
|
+
*/
|
|
80
|
+
ngOnDestroy() {
|
|
81
|
+
this.sub.unsubscribe();
|
|
82
|
+
}
|
|
83
|
+
moveVertically(dir) {
|
|
84
|
+
const index = this.selectedBox.selectedIndex;
|
|
85
|
+
if (!isPresent(index)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const topReached = dir === 'up' && index <= 0;
|
|
89
|
+
const bottomReached = dir === 'down' && index >= this.selectedBox.data.length - 1;
|
|
90
|
+
if (topReached || bottomReached) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const newIndex = dir === 'up' ? index - 1 : index + 1;
|
|
94
|
+
// ES6 Destructuring swap
|
|
95
|
+
[this.selectedBox.data[newIndex], this.selectedBox.data[index]] = [this.selectedBox.data[index], this.selectedBox.data[newIndex]];
|
|
96
|
+
this.selectedBox.selectionService.select(newIndex);
|
|
97
|
+
}
|
|
98
|
+
removeItem() {
|
|
99
|
+
const index = this.selectedBox.selectedIndex;
|
|
100
|
+
if (!isPresent(index)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.selectedBox.data.splice(index, 1);
|
|
104
|
+
this.selectedBox.selectionService.clearSelection();
|
|
105
|
+
}
|
|
106
|
+
transferItem(source, target) {
|
|
107
|
+
const item = source && source.data[source.selectedIndex];
|
|
108
|
+
if (!item || !target || !source) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
target.data.push(item);
|
|
112
|
+
source.data.splice(source.selectedIndex, 1);
|
|
113
|
+
source.clearSelection();
|
|
114
|
+
target.selectItem(target.data.length - 1);
|
|
115
|
+
this.selectedBox = target;
|
|
116
|
+
}
|
|
117
|
+
transferAll(source, target) {
|
|
118
|
+
if (!target || !source) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
target.data.splice(target.data.length, 0, ...source.data.splice(0, source.data.length));
|
|
122
|
+
target.selectItem(target.data.length - 1);
|
|
123
|
+
this.selectedBox = target;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
tslib_1.__decorate([
|
|
127
|
+
Input('kendoListBoxDataBinding'),
|
|
128
|
+
tslib_1.__metadata("design:type", Array)
|
|
129
|
+
], DataBindingDirective.prototype, "data", void 0);
|
|
130
|
+
tslib_1.__decorate([
|
|
131
|
+
Input(),
|
|
132
|
+
tslib_1.__metadata("design:type", ListBoxComponent)
|
|
133
|
+
], DataBindingDirective.prototype, "connectedWith", void 0);
|
|
134
|
+
DataBindingDirective = tslib_1.__decorate([
|
|
135
|
+
Directive({
|
|
136
|
+
selector: '[kendoListBoxDataBinding]'
|
|
137
|
+
}),
|
|
138
|
+
tslib_1.__metadata("design:paramtypes", [ListBoxComponent])
|
|
139
|
+
], DataBindingDirective);
|
|
140
|
+
export { DataBindingDirective };
|
|
@@ -0,0 +1,11 @@
|
|
|
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';
|
|
@@ -0,0 +1,11 @@
|
|
|
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';
|
|
@@ -0,0 +1 @@
|
|
|
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-component-base"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { ListBoxSelectionService } from './selection.service';
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
export declare class ItemSelectableDirective {
|
|
10
|
+
private selectionService;
|
|
11
|
+
index: number;
|
|
12
|
+
constructor(selectionService: ListBoxSelectionService);
|
|
13
|
+
readonly selectedClassName: boolean;
|
|
14
|
+
onClick(event: any): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 };
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { TemplateRef } from '@angular/core';
|
|
6
|
+
/**
|
|
7
|
+
* Renders the ListBox item content. To define the item template, nest an `<ng-template>` tag
|
|
8
|
+
* with the `kendoListBoxItemTemplate` directive inside the `<kendo-listbox>` tag. The template context is
|
|
9
|
+
* set to the current data item.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* _@Component({
|
|
14
|
+
* selector: 'my-app',
|
|
15
|
+
* template: `
|
|
16
|
+
* <kendo-listbox [data]="listBoxItems">
|
|
17
|
+
* <ng-template kendoListBoxItemTemplate let-dataItem>
|
|
18
|
+
* <span>{{ dataItem }} item</span>
|
|
19
|
+
* </ng-template>
|
|
20
|
+
* </kendo-listbox>
|
|
21
|
+
* `
|
|
22
|
+
* })
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class ItemTemplateDirective {
|
|
26
|
+
templateRef: TemplateRef<any>;
|
|
27
|
+
constructor(templateRef: TemplateRef<any>);
|
|
28
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
let ItemTemplateDirective = class ItemTemplateDirective {
|
|
27
|
+
constructor(templateRef) {
|
|
28
|
+
this.templateRef = templateRef;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
ItemTemplateDirective = tslib_1.__decorate([
|
|
32
|
+
Directive({
|
|
33
|
+
selector: '[kendoListBoxItemTemplate]'
|
|
34
|
+
}),
|
|
35
|
+
tslib_1.__metadata("design:paramtypes", [TemplateRef])
|
|
36
|
+
], ItemTemplateDirective);
|
|
37
|
+
export { ItemTemplateDirective };
|