@progress/kendo-angular-listbox 0.1.1-dev.202204131442 → 1.0.0-dev.202204141101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/bundles/kendo-angular-listbox.umd.js +5 -0
  2. package/{dist/es2015/constants.d.ts → constants.d.ts} +0 -0
  3. package/{dist/es2015/data-binding.directive.d.ts → data-binding.directive.d.ts} +3 -0
  4. package/{dist/es2015 → esm2015}/constants.js +0 -0
  5. package/{dist/es2015 → esm2015}/data-binding.directive.js +17 -19
  6. package/esm2015/item-selectable.directive.js +38 -0
  7. package/{dist/es2015 → esm2015}/item-template.directive.js +12 -11
  8. package/{dist/es/size.js → esm2015/kendo-angular-listbox.js} +4 -0
  9. package/{dist/es2015 → esm2015}/listbox.component.js +73 -52
  10. package/esm2015/listbox.module.js +28 -0
  11. package/{dist/es2015 → esm2015}/main.js +3 -1
  12. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  13. package/{dist/es2015 → esm2015}/selection.service.js +8 -10
  14. package/{dist/es2015 → esm2015}/size.js +1 -0
  15. package/{dist/es2015 → esm2015}/toolbar.js +1 -0
  16. package/{dist/es2015 → esm2015}/util.js +0 -0
  17. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-listbox.js} +153 -133
  18. package/{dist/es2015/item-selectable.directive.d.ts → item-selectable.directive.d.ts} +4 -1
  19. package/{dist/es2015/item-template.directive.d.ts → item-template.directive.d.ts} +3 -0
  20. package/{dist/es/toolbar.js → kendo-angular-listbox.d.ts} +5 -0
  21. package/{dist/es2015/listbox.component.d.ts → listbox.component.d.ts} +6 -3
  22. package/listbox.module.d.ts +19 -0
  23. package/{dist/es2015/main.d.ts → main.d.ts} +3 -1
  24. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  25. package/package.json +37 -104
  26. package/schematics/ngAdd/index.js +10 -7
  27. package/schematics/ngAdd/index.js.map +1 -1
  28. package/schematics/ngAdd/schema.json +2 -2
  29. package/{dist/es2015/selection.service.d.ts → selection.service.d.ts} +3 -0
  30. package/{dist/es2015/size.d.ts → size.d.ts} +0 -0
  31. package/{dist/es2015/toolbar.d.ts → toolbar.d.ts} +0 -0
  32. package/{dist/es2015/util.d.ts → util.d.ts} +0 -0
  33. package/dist/cdn/js/kendo-angular-listbox.js +0 -20
  34. package/dist/cdn/main.js +0 -5
  35. package/dist/es/constants.js +0 -65
  36. package/dist/es/data-binding.directive.js +0 -145
  37. package/dist/es/index.js +0 -11
  38. package/dist/es/item-selectable.directive.js +0 -49
  39. package/dist/es/item-template.directive.js +0 -38
  40. package/dist/es/listbox.component.js +0 -196
  41. package/dist/es/listbox.module.js +0 -28
  42. package/dist/es/main.js +0 -7
  43. package/dist/es/package-metadata.js +0 -15
  44. package/dist/es/selection.service.js +0 -30
  45. package/dist/es/util.js +0 -38
  46. package/dist/es2015/index.d.ts +0 -11
  47. package/dist/es2015/index.js +0 -11
  48. package/dist/es2015/index.metadata.json +0 -1
  49. package/dist/es2015/item-selectable.directive.js +0 -44
  50. package/dist/es2015/listbox.module.d.ts +0 -9
  51. package/dist/es2015/listbox.module.js +0 -25
  52. package/dist/fesm5/index.js +0 -557
  53. package/dist/npm/constants.js +0 -67
  54. package/dist/npm/data-binding.directive.js +0 -147
  55. package/dist/npm/index.js +0 -17
  56. package/dist/npm/item-selectable.directive.js +0 -51
  57. package/dist/npm/item-template.directive.js +0 -40
  58. package/dist/npm/listbox.component.js +0 -198
  59. package/dist/npm/listbox.module.js +0 -30
  60. package/dist/npm/main.js +0 -12
  61. package/dist/npm/package-metadata.js +0 -17
  62. package/dist/npm/selection.service.js +0 -32
  63. package/dist/npm/size.js +0 -6
  64. package/dist/npm/toolbar.js +0 -6
  65. package/dist/npm/util.js +0 -40
  66. package/dist/systemjs/kendo-angular-listbox.js +0 -5
@@ -0,0 +1,5 @@
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
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@progress/kendo-licensing"),require("rxjs"),require("@progress/kendo-common"),require("@angular/common"),require("@progress/kendo-angular-buttons"),require("@progress/kendo-angular-common")):"function"==typeof define&&define.amd?define("KendoAngularListbox",["exports","@angular/core","@progress/kendo-licensing","rxjs","@progress/kendo-common","@angular/common","@progress/kendo-angular-buttons","@progress/kendo-angular-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoAngularListbox={},e.ng.core,e.KendoLicensing,e.rxjs,e.KendoCommon,e.ng.common,e.KendoAngularButtons,e.KendoAngularCommon)}(this,function(e,i,s,r,o,t,n,l){"use strict";function a(n){if(n&&n.__esModule)return n;var o=Object.create(null);return n&&Object.keys(n).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(n,e),Object.defineProperty(o,e,t.get?t:{enumerable:!0,get:function(){return n[e]}}))}),o.default=n,Object.freeze(o)}var c=a(i),d=a(t),p=a(n),m={name:"@progress/kendo-angular-listbox",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1649934053,version:"",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"},u=(g.prototype.select=function(e){this.selectedIndex=e,this.onSelect.next({index:this.selectedIndex})},g.prototype.isSelected=function(e){return e===this.selectedIndex},g.prototype.clearSelection=function(){this.selectedIndex=null},g);function g(){this.onSelect=new i.EventEmitter,this.selectedIndex=null}u.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:u,deps:[],target:c.ɵɵFactoryTarget.Injectable}),u.ɵprov=c.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:u}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:u,decorators:[{type:i.Injectable}]});function f(e,t){return I(e)?I(t)&&I(n=e)&&"object"==typeof n?o.getter(t)(e):e:null;var n}function b(){return!1}var h=function(e){this.templateRef=e},y=(h.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:h,deps:[{token:c.TemplateRef}],target:c.ɵɵFactoryTarget.Directive}),h.ɵdir=c.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:h,selector:"[kendoListBoxItemTemplate]",ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:h,decorators:[{type:i.Directive,args:[{selector:"[kendoListBoxItemTemplate]"}]}],ctorParameters:function(){return[{type:c.TemplateRef}]}}),"right"),v=[{name:"moveUp",label:"Move Up",icon:"arrow-n"},{name:"moveDown",label:"Move Down",icon:"arrow-s"},{name:"transferTo",label:"Transfer From",icon:"arrow-w"},{name:"transferFrom",label:"Transfer To",icon:"arrow-e"},{name:"transferAllTo",label:"Transfer All To",icon:"arrow-double-60-right"},{name:"transferAllFrom",label:"Transfer All From",icon:"arrow-double-60-left"},{name:"remove",label:"Remove",icon:"x"}],x={small:"sm",medium:"md",large:"lg"},k={left:"k-listbox-toolbar-left",right:"k-listbox-toolbar-right",top:"k-listbox-toolbar-top",bottom:"k-listbox-toolbar-bottom"},I=function(e){return null!=e},C=(Object.defineProperty(D.prototype,"selectedClassName",{get:function(){return this.selectionService.isSelected(this.index)},enumerable:!1,configurable:!0}),D.prototype.onClick=function(e){e.stopPropagation(),this.selectionService.select(this.index)},D);function D(e){this.selectionService=e}C.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:C,deps:[{token:u}],target:c.ɵɵFactoryTarget.Directive}),C.ɵdir=c.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:C,selector:"[kendoListBoxItemSelectable]",inputs:{index:"index"},host:{listeners:{click:"onClick($event)"},properties:{"class.k-selected":"this.selectedClassName"}},ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:C,decorators:[{type:i.Directive,args:[{selector:"[kendoListBoxItemSelectable]"}]}],ctorParameters:function(){return[{type:u}]},propDecorators:{index:[{type:i.Input}],selectedClassName:[{type:i.HostBinding,args:["class.k-selected"]}],onClick:[{type:i.HostListener,args:["click",["$event"]]}]}});Object.defineProperty(B.prototype,"toolbar",{set:function(e){var t=y;"boolean"==typeof e?this.selectedTools=e?v:[]:(this.selectedTools=e.tools?e.tools.map(function(t){return v.find(function(e){return e.name===t})}):v,e.position&&(t=e.position)),this.setToolbarClass(t)},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"listClasses",{get:function(){return"k-list k-list-"+x[this.size]},enumerable:!1,configurable:!0}),B.prototype.ngOnDestroy=function(){this.sub.unsubscribe()},B.prototype.performAction=function(e){this.actionClick.next(e)},B.prototype.selectItem=function(e){this.selectionService.selectedIndex=e},B.prototype.clearSelection=function(){this.selectionService.clearSelection()},Object.defineProperty(B.prototype,"selectedIndex",{get:function(){return this.selectionService.selectedIndex},enumerable:!1,configurable:!0}),B.prototype.getText=function(e){if("string"!=typeof e&&!this.textField&&i.isDevMode())throw new Error("Missing textField input. When passing an array of objects as data, please set the textField input of the ListBox accordingly.");return f(e,this.textField)},B.prototype.setToolbarClass=function(t){var n=this;Object.keys(k).forEach(function(e){t===e?n.renderer.addClass(n.hostElement.nativeElement,k[e]):n.renderer.removeClass(n.hostElement.nativeElement,k[e])})};var T=B;function B(e,t,n){var o=this;this.selectionService=e,this.renderer=t,this.hostElement=n,this.listboxClassName=!0,this.data=[],this.size="medium",this.itemDisabled=b,this.selectionChange=new i.EventEmitter,this.actionClick=new i.EventEmitter,this.selectedTools=v,this.sub=new r.Subscription,s.validatePackage(m),this.setToolbarClass(y),this.sub.add(this.selectionService.onSelect.subscribe(function(e){o.selectionChange.next(e)}))}T.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:T,deps:[{token:u},{token:c.Renderer2},{token:c.ElementRef}],target:c.ɵɵFactoryTarget.Component}),T.ɵcmp=c.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:T,selector:"kendo-listbox",inputs:{textField:"textField",data:"data",size:"size",toolbar:"toolbar",itemDisabled:"itemDisabled"},outputs:{selectionChange:"selectionChange",actionClick:"actionClick"},host:{properties:{"class.k-listbox":"this.listboxClassName"}},providers:[u],queries:[{propertyName:"itemTemplate",first:!0,predicate:h,descendants:!0}],ngImport:c,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 \x3c!-- react moving items has a smoother removal of the style: https://www.telerik.com/kendo-react-ui/components/listbox/ --\x3e\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 ',isInline:!0,directives:[{type:d.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]},{type:d.NgForOf,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{type:p.ButtonDirective,selector:"button[kendoButton], span[kendoButton]",inputs:["toggleable","togglable","selected","tabIndex","icon","iconClass","imageUrl","disabled","size","rounded","fillMode","themeColor","role","primary","look"],outputs:["selectedChange","click"],exportAs:["kendoButton"]},{type:C,selector:"[kendoListBoxItemSelectable]",inputs:["index"]},{type:p.TemplateContextDirective,selector:"[templateContext]",inputs:["templateContext"]}]}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:T,decorators:[{type:i.Component,args:[{selector:"kendo-listbox",providers:[u],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 \x3c!-- react moving items has a smoother removal of the style: https://www.telerik.com/kendo-react-ui/components/listbox/ --\x3e\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 '}]}],ctorParameters:function(){return[{type:u},{type:c.Renderer2},{type:c.ElementRef}]},propDecorators:{listboxClassName:[{type:i.HostBinding,args:["class.k-listbox"]}],itemTemplate:[{type:i.ContentChild,args:[h,{static:!1}]}],textField:[{type:i.Input}],data:[{type:i.Input}],size:[{type:i.Input}],toolbar:[{type:i.Input}],itemDisabled:[{type:i.Input}],selectionChange:[{type:i.Output}],actionClick:[{type:i.Output}]}});Object.create;function F(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,s=n.call(e),r=[];try{for(;(void 0===t||0<t--)&&!(o=s.next()).done;)r.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return r}Object.create;w.prototype.ngOnChanges=function(e){var t=this;l.isChanged("connectedWith",e,!1)&&(this.sub.add(this.listbox.selectionChange.subscribe(function(){t.selectedBox=t.listbox,t.connectedWith.clearSelection()})),this.sub.add(this.connectedWith.selectionChange.subscribe(function(){t.selectedBox=t.connectedWith,t.listbox.clearSelection()}))),l.isChanged("data",e,!0)&&(this.listbox.data=e.data.currentValue)},w.prototype.ngOnDestroy=function(){this.sub.unsubscribe()},w.prototype.moveVertically=function(e){var t,n=this.selectedBox.selectedIndex;I(n)&&(t="down"===e&&n>=this.selectedBox.data.length-1,"up"===e&&n<=0||t||(e=F([this.selectedBox.data[n],this.selectedBox.data[t="up"===e?n-1:n+1]],2),this.selectedBox.data[t]=e[0],this.selectedBox.data[n]=e[1],this.selectedBox.selectionService.select(t)))},w.prototype.removeItem=function(){var e=this.selectedBox.selectedIndex;I(e)&&(this.selectedBox.data.splice(e,1),this.selectedBox.selectionService.clearSelection())},w.prototype.transferItem=function(e,t){var n=e&&e.data[e.selectedIndex];n&&t&&e&&(t.data.push(n),e.data.splice(e.selectedIndex,1),e.clearSelection(),t.selectItem(t.data.length-1),this.selectedBox=t)},w.prototype.transferAll=function(e,t){var n;t&&e&&((n=t.data).splice.apply(n,function(e,t,n){if(n||2===arguments.length)for(var o,i=0,s=t.length;i<s;i++)!o&&i in t||((o=o||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}([t.data.length,0],F(e.data.splice(0,e.data.length)))),t.selectItem(t.data.length-1),this.selectedBox=t)};d=w;function w(e){var t=this;this.listbox=e,this.data=[],this.sub=new r.Subscription,this.selectedBox=this.listbox,this.sub.add(this.listbox.actionClick.subscribe(function(e){switch(e){case"moveUp":t.moveVertically("up");break;case"moveDown":t.moveVertically("down");break;case"transferTo":t.transferItem(t.connectedWith,t.listbox);break;case"transferFrom":t.transferItem(t.listbox,t.connectedWith);break;case"transferAllTo":t.transferAll(t.listbox,t.connectedWith);break;case"transferAllFrom":t.transferAll(t.connectedWith,t.listbox);break;case"remove":t.removeItem()}}))}d.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:d,deps:[{token:T}],target:c.ɵɵFactoryTarget.Directive}),d.ɵdir=c.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:d,selector:"[kendoListBoxDataBinding]",inputs:{data:["kendoListBoxDataBinding","data"],connectedWith:"connectedWith"},usesOnChanges:!0,ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:d,decorators:[{type:i.Directive,args:[{selector:"[kendoListBoxDataBinding]"}]}],ctorParameters:function(){return[{type:T}]},propDecorators:{data:[{type:i.Input,args:["kendoListBoxDataBinding"]}],connectedWith:[{type:i.Input}]}});p=function(){};p.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:p,deps:[],target:c.ɵɵFactoryTarget.NgModule}),p.ɵmod=c.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:p,declarations:[T,h,C,d],imports:[n.ButtonsModule,t.CommonModule],exports:[T,h,C,d]}),p.ɵinj=c.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:p,imports:[[n.ButtonsModule,t.CommonModule]]}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:p,decorators:[{type:i.NgModule,args:[{imports:[n.ButtonsModule,t.CommonModule],declarations:[T,h,C,d],exports:[T,h,C,d]}]}]}),e.DataBindingDirective=d,e.ItemSelectableDirective=C,e.ItemTemplateDirective=h,e.ListBoxComponent=T,e.ListBoxModule=p,Object.defineProperty(e,"__esModule",{value:!0})});
File without changes
@@ -4,6 +4,7 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import { OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
6
6
  import { ListBoxComponent } from './listbox.component';
7
+ import * as i0 from "@angular/core";
7
8
  /**
8
9
  * A directive which manages the functoinality of the ListBox tools out of the box, and modifies the provided data accordingly.
9
10
  */
@@ -33,4 +34,6 @@ export declare class DataBindingDirective implements OnChanges, OnDestroy {
33
34
  private removeItem;
34
35
  private transferItem;
35
36
  private transferAll;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataBindingDirective, never>;
38
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DataBindingDirective, "[kendoListBoxDataBinding]", never, { "data": "kendoListBoxDataBinding"; "connectedWith": "connectedWith"; }, {}, never>;
36
39
  }
File without changes
@@ -2,16 +2,16 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
5
  import { Directive, Input } from '@angular/core';
7
6
  import { isChanged } from '@progress/kendo-angular-common';
8
7
  import { Subscription } from 'rxjs';
9
- import { ListBoxComponent } from './listbox.component';
10
8
  import { isPresent } from './util';
9
+ import * as i0 from "@angular/core";
10
+ import * as i1 from "./listbox.component";
11
11
  /**
12
12
  * A directive which manages the functoinality of the ListBox tools out of the box, and modifies the provided data accordingly.
13
13
  */
14
- let DataBindingDirective = class DataBindingDirective {
14
+ export class DataBindingDirective {
15
15
  constructor(listbox) {
16
16
  this.listbox = listbox;
17
17
  /**
@@ -122,19 +122,17 @@ let DataBindingDirective = class DataBindingDirective {
122
122
  target.selectItem(target.data.length - 1);
123
123
  this.selectedBox = target;
124
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 };
125
+ }
126
+ DataBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DataBindingDirective, deps: [{ token: i1.ListBoxComponent }], target: i0.ɵɵFactoryTarget.Directive });
127
+ DataBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DataBindingDirective, selector: "[kendoListBoxDataBinding]", inputs: { data: ["kendoListBoxDataBinding", "data"], connectedWith: "connectedWith" }, usesOnChanges: true, ngImport: i0 });
128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DataBindingDirective, decorators: [{
129
+ type: Directive,
130
+ args: [{
131
+ selector: '[kendoListBoxDataBinding]'
132
+ }]
133
+ }], ctorParameters: function () { return [{ type: i1.ListBoxComponent }]; }, propDecorators: { data: [{
134
+ type: Input,
135
+ args: ['kendoListBoxDataBinding']
136
+ }], connectedWith: [{
137
+ type: Input
138
+ }] } });
@@ -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 { Directive, Input, HostBinding, HostListener } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "./selection.service";
8
+ /**
9
+ * @hidden
10
+ */
11
+ export 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
+ ItemSelectableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemSelectableDirective, deps: [{ token: i1.ListBoxSelectionService }], target: i0.ɵɵFactoryTarget.Directive });
24
+ ItemSelectableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ItemSelectableDirective, selector: "[kendoListBoxItemSelectable]", inputs: { index: "index" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.k-selected": "this.selectedClassName" } }, ngImport: i0 });
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemSelectableDirective, decorators: [{
26
+ type: Directive,
27
+ args: [{
28
+ selector: '[kendoListBoxItemSelectable]'
29
+ }]
30
+ }], ctorParameters: function () { return [{ type: i1.ListBoxSelectionService }]; }, propDecorators: { index: [{
31
+ type: Input
32
+ }], selectedClassName: [{
33
+ type: HostBinding,
34
+ args: ['class.k-selected']
35
+ }], onClick: [{
36
+ type: HostListener,
37
+ args: ['click', ['$event']]
38
+ }] } });
@@ -2,8 +2,8 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Directive, TemplateRef } from '@angular/core';
5
+ import { Directive } from '@angular/core';
6
+ import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Renders the ListBox item content. To define the item template, nest an `<ng-template>` tag
9
9
  * with the `kendoListBoxItemTemplate` directive inside the `<kendo-listbox>` tag. The template context is
@@ -23,15 +23,16 @@ import { Directive, TemplateRef } from '@angular/core';
23
23
  * })
24
24
  * ```
25
25
  */
26
- let ItemTemplateDirective = class ItemTemplateDirective {
26
+ export class ItemTemplateDirective {
27
27
  constructor(templateRef) {
28
28
  this.templateRef = templateRef;
29
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 };
30
+ }
31
+ ItemTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
32
+ ItemTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ItemTemplateDirective, selector: "[kendoListBoxItemTemplate]", ngImport: i0 });
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemTemplateDirective, decorators: [{
34
+ type: Directive,
35
+ args: [{
36
+ selector: '[kendoListBoxItemTemplate]'
37
+ }]
38
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
@@ -2,3 +2,7 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * Generated bundle index. Do not edit.
7
+ */
8
+ export * from './main';
@@ -2,8 +2,7 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Component, ContentChild, ElementRef, EventEmitter, HostBinding, Input, isDevMode, Output, Renderer2 } from '@angular/core';
5
+ import { Component, ContentChild, EventEmitter, HostBinding, Input, isDevMode, Output } from '@angular/core';
7
6
  import { validatePackage } from '@progress/kendo-licensing';
8
7
  import { Subscription } from 'rxjs';
9
8
  import { packageMetadata } from './package-metadata';
@@ -11,10 +10,15 @@ import { ListBoxSelectionService } from './selection.service';
11
10
  import { ItemTemplateDirective } from './item-template.directive';
12
11
  import { defaultItemDisabled, fieldAccessor, getTools } from './util';
13
12
  import { allTools, DEFAULT_TOOLBAR_POSITION, sizeClassMap, toolbarClasses } from './constants';
13
+ import * as i0 from "@angular/core";
14
+ import * as i1 from "./selection.service";
15
+ import * as i2 from "@angular/common";
16
+ import * as i3 from "@progress/kendo-angular-buttons";
17
+ import * as i4 from "./item-selectable.directive";
14
18
  /**
15
19
  * Represents the [Kendo UI ListBox component for Angular]({% slug overview_listbox %}).
16
20
  */
17
- let ListBoxComponent = class ListBoxComponent {
21
+ export class ListBoxComponent {
18
22
  constructor(selectionService, renderer, hostElement) {
19
23
  this.selectionService = selectionService;
20
24
  this.renderer = renderer;
@@ -130,49 +134,50 @@ let ListBoxComponent = class ListBoxComponent {
130
134
  }
131
135
  });
132
136
  }
133
- };
134
- tslib_1.__decorate([
135
- HostBinding('class.k-listbox'),
136
- tslib_1.__metadata("design:type", Boolean)
137
- ], ListBoxComponent.prototype, "listboxClassName", void 0);
138
- tslib_1.__decorate([
139
- ContentChild(ItemTemplateDirective, { static: false }),
140
- tslib_1.__metadata("design:type", ItemTemplateDirective)
141
- ], ListBoxComponent.prototype, "itemTemplate", void 0);
142
- tslib_1.__decorate([
143
- Input(),
144
- tslib_1.__metadata("design:type", String)
145
- ], ListBoxComponent.prototype, "textField", void 0);
146
- tslib_1.__decorate([
147
- Input(),
148
- tslib_1.__metadata("design:type", Array)
149
- ], ListBoxComponent.prototype, "data", void 0);
150
- tslib_1.__decorate([
151
- Input(),
152
- tslib_1.__metadata("design:type", String)
153
- ], ListBoxComponent.prototype, "size", void 0);
154
- tslib_1.__decorate([
155
- Input(),
156
- tslib_1.__metadata("design:type", Object),
157
- tslib_1.__metadata("design:paramtypes", [Object])
158
- ], ListBoxComponent.prototype, "toolbar", null);
159
- tslib_1.__decorate([
160
- Input(),
161
- tslib_1.__metadata("design:type", Function)
162
- ], ListBoxComponent.prototype, "itemDisabled", void 0);
163
- tslib_1.__decorate([
164
- Output(),
165
- tslib_1.__metadata("design:type", EventEmitter)
166
- ], ListBoxComponent.prototype, "selectionChange", void 0);
167
- tslib_1.__decorate([
168
- Output(),
169
- tslib_1.__metadata("design:type", EventEmitter)
170
- ], ListBoxComponent.prototype, "actionClick", void 0);
171
- ListBoxComponent = tslib_1.__decorate([
172
- Component({
173
- selector: 'kendo-listbox',
174
- providers: [ListBoxSelectionService],
175
- template: `
137
+ }
138
+ ListBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxComponent, deps: [{ token: i1.ListBoxSelectionService }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
139
+ ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ListBoxComponent, selector: "kendo-listbox", inputs: { textField: "textField", data: "data", size: "size", toolbar: "toolbar", itemDisabled: "itemDisabled" }, outputs: { selectionChange: "selectionChange", actionClick: "actionClick" }, host: { properties: { "class.k-listbox": "this.listboxClassName" } }, providers: [ListBoxSelectionService], queries: [{ propertyName: "itemTemplate", first: true, predicate: ItemTemplateDirective, descendants: true }], ngImport: i0, template: `
140
+ <div class="k-listbox-toolbar" *ngIf="selectedTools.length > 0">
141
+ <ul class="k-reset">
142
+ <li *ngFor="let tool of selectedTools">
143
+ <button kendoButton [icon]="tool.icon" (click)="performAction(tool.name)"></button>
144
+ </li>
145
+
146
+ <!-- react moving items has a smoother removal of the style: https://www.telerik.com/kendo-react-ui/components/listbox/ -->
147
+ </ul>
148
+ </div>
149
+ <div class="k-list-scroller k-selectable">
150
+ <div class="{{ listClasses }}">
151
+ <div class="k-list-content">
152
+ <ul class="k-list-ul">
153
+ <li
154
+ class="k-list-item"
155
+ *ngFor="let item of data; let i = index;"
156
+ kendoListBoxItemSelectable
157
+ [index]="i"
158
+ [class.k-disabled]="itemDisabled(item)"
159
+ >
160
+ <ng-template *ngIf="itemTemplate; else defaultItemTemplate"
161
+ [templateContext]="{
162
+ templateRef: itemTemplate.templateRef,
163
+ $implicit: item
164
+ }">
165
+ </ng-template>
166
+ <ng-template #defaultItemTemplate>
167
+ <span class="k-list-item-text">{{ getText(item) }}</span>
168
+ </ng-template>
169
+ </li>
170
+ </ul>
171
+ </div>
172
+ </div>
173
+ </div>
174
+ `, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i4.ItemSelectableDirective, selector: "[kendoListBoxItemSelectable]", inputs: ["index"] }, { type: i3.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }] });
175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxComponent, decorators: [{
176
+ type: Component,
177
+ args: [{
178
+ selector: 'kendo-listbox',
179
+ providers: [ListBoxSelectionService],
180
+ template: `
176
181
  <div class="k-listbox-toolbar" *ngIf="selectedTools.length > 0">
177
182
  <ul class="k-reset">
178
183
  <li *ngFor="let tool of selectedTools">
@@ -208,9 +213,25 @@ ListBoxComponent = tslib_1.__decorate([
208
213
  </div>
209
214
  </div>
210
215
  `
211
- }),
212
- tslib_1.__metadata("design:paramtypes", [ListBoxSelectionService,
213
- Renderer2,
214
- ElementRef])
215
- ], ListBoxComponent);
216
- export { ListBoxComponent };
216
+ }]
217
+ }], ctorParameters: function () { return [{ type: i1.ListBoxSelectionService }, { type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { listboxClassName: [{
218
+ type: HostBinding,
219
+ args: ['class.k-listbox']
220
+ }], itemTemplate: [{
221
+ type: ContentChild,
222
+ args: [ItemTemplateDirective, { static: false }]
223
+ }], textField: [{
224
+ type: Input
225
+ }], data: [{
226
+ type: Input
227
+ }], size: [{
228
+ type: Input
229
+ }], toolbar: [{
230
+ type: Input
231
+ }], itemDisabled: [{
232
+ type: Input
233
+ }], selectionChange: [{
234
+ type: Output
235
+ }], actionClick: [{
236
+ type: Output
237
+ }] } });
@@ -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 { NgModule } from '@angular/core';
6
+ import { ListBoxComponent } from './listbox.component';
7
+ import { ButtonsModule } from '@progress/kendo-angular-buttons';
8
+ import { CommonModule } from '@angular/common';
9
+ import { ItemTemplateDirective } from './item-template.directive';
10
+ import { ItemSelectableDirective } from './item-selectable.directive';
11
+ import { DataBindingDirective } from './data-binding.directive';
12
+ import * as i0 from "@angular/core";
13
+ /**
14
+ * Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the ListBox component.
15
+ */
16
+ export class ListBoxModule {
17
+ }
18
+ ListBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
19
+ ListBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxModule, declarations: [ListBoxComponent, ItemTemplateDirective, ItemSelectableDirective, DataBindingDirective], imports: [ButtonsModule, CommonModule], exports: [ListBoxComponent, ItemTemplateDirective, ItemSelectableDirective, DataBindingDirective] });
20
+ ListBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxModule, imports: [[ButtonsModule, CommonModule]] });
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxModule, decorators: [{
22
+ type: NgModule,
23
+ args: [{
24
+ imports: [ButtonsModule, CommonModule],
25
+ declarations: [ListBoxComponent, ItemTemplateDirective, ItemSelectableDirective, DataBindingDirective],
26
+ exports: [ListBoxComponent, ItemTemplateDirective, ItemSelectableDirective, DataBindingDirective]
27
+ }]
28
+ }] });
@@ -3,5 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  export { ListBoxComponent } from './listbox.component';
6
- export { DataBindingDirective } from './data-binding.directive';
7
6
  export { ListBoxModule } from './listbox.module';
7
+ export { DataBindingDirective } from './data-binding.directive';
8
+ export { ItemTemplateDirective } from './item-template.directive';
9
+ export { ItemSelectableDirective } from './item-selectable.directive';
@@ -9,7 +9,7 @@ export const packageMetadata = {
9
9
  name: '@progress/kendo-angular-listbox',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1649860877,
12
+ publishDate: 1649934053,
13
13
  version: '',
14
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
15
  };
@@ -2,15 +2,12 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
5
  import { EventEmitter, Injectable } from "@angular/core";
6
+ import * as i0 from "@angular/core";
7
7
  /**
8
8
  * @hidden
9
9
  */
10
- let ListBoxSelectionService = class ListBoxSelectionService {
11
- /**
12
- * @hidden
13
- */
10
+ export class ListBoxSelectionService {
14
11
  constructor() {
15
12
  this.onSelect = new EventEmitter();
16
13
  this.selectedIndex = null;
@@ -25,8 +22,9 @@ let ListBoxSelectionService = class ListBoxSelectionService {
25
22
  clearSelection() {
26
23
  this.selectedIndex = null;
27
24
  }
28
- };
29
- ListBoxSelectionService = tslib_1.__decorate([
30
- Injectable()
31
- ], ListBoxSelectionService);
32
- export { ListBoxSelectionService };
25
+ }
26
+ ListBoxSelectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxSelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
27
+ ListBoxSelectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxSelectionService });
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxSelectionService, decorators: [{
29
+ type: Injectable
30
+ }] });
@@ -2,3 +2,4 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
+ export {};
@@ -2,3 +2,4 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
+ export {};
File without changes