@progress/kendo-angular-listbox 1.0.5 → 11.0.0-develop.80

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 (33) hide show
  1. package/NOTICE.txt +3 -3
  2. package/constants.d.ts +2 -2
  3. package/data-binding.directive.d.ts +1 -1
  4. package/{esm2015/constants.js → esm2020/constants.mjs} +6 -6
  5. package/{esm2015/data-binding.directive.js → esm2020/data-binding.directive.mjs} +6 -5
  6. package/{esm2015/main.js → esm2020/index.mjs} +1 -1
  7. package/{esm2015/item-selectable.directive.js → esm2020/item-selectable.directive.mjs} +5 -4
  8. package/{esm2015/item-template.directive.js → esm2020/item-template.directive.mjs} +5 -5
  9. package/{esm2015/listbox.component.js → esm2020/listbox.component.mjs} +53 -37
  10. package/{esm2015/listbox.module.js → esm2020/listbox.module.mjs} +5 -5
  11. package/{esm2015/package-metadata.js → esm2020/package-metadata.mjs} +2 -2
  12. package/{esm2015/kendo-angular-listbox.js → esm2020/progress-kendo-angular-listbox.mjs} +2 -2
  13. package/{esm2015/selection.service.js → esm2020/selection.service.mjs} +4 -4
  14. package/{esm2015/size.js → esm2020/size.mjs} +1 -1
  15. package/{esm2015/toolbar.js → esm2020/toolbar.mjs} +1 -1
  16. package/{esm2015/util.js → esm2020/util.mjs} +1 -1
  17. package/fesm2015/{kendo-angular-listbox.js → progress-kendo-angular-listbox.mjs} +75 -59
  18. package/fesm2020/progress-kendo-angular-listbox.mjs +603 -0
  19. package/{main.d.ts → index.d.ts} +2 -1
  20. package/item-selectable.directive.d.ts +1 -1
  21. package/item-template.directive.d.ts +1 -1
  22. package/listbox.component.d.ts +5 -2
  23. package/listbox.module.d.ts +1 -1
  24. package/package-metadata.d.ts +1 -1
  25. package/package.json +31 -57
  26. package/{kendo-angular-listbox.d.ts → progress-kendo-angular-listbox.d.ts} +2 -2
  27. package/schematics/ngAdd/index.js +1 -5
  28. package/selection.service.d.ts +1 -1
  29. package/size.d.ts +1 -1
  30. package/toolbar.d.ts +1 -1
  31. package/util.d.ts +1 -1
  32. package/bundles/kendo-angular-listbox.umd.js +0 -5
  33. package/schematics/ngAdd/index.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
2
+ * Copyright © 2022 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
5
  import * as i0 from '@angular/core';
@@ -7,10 +7,10 @@ import { EventEmitter, Injectable, Directive, Input, HostBinding, HostListener,
7
7
  import { validatePackage } from '@progress/kendo-licensing';
8
8
  import { Subscription } from 'rxjs';
9
9
  import { getter } from '@progress/kendo-common';
10
- import * as i2 from '@angular/common';
11
- import { CommonModule } from '@angular/common';
12
- import * as i3 from '@progress/kendo-angular-buttons';
10
+ import * as i2 from '@progress/kendo-angular-buttons';
13
11
  import { ButtonsModule } from '@progress/kendo-angular-buttons';
12
+ import * as i3 from '@angular/common';
13
+ import { CommonModule } from '@angular/common';
14
14
  import { isChanged } from '@progress/kendo-angular-common';
15
15
 
16
16
  /**
@@ -20,7 +20,7 @@ const packageMetadata = {
20
20
  name: '@progress/kendo-angular-listbox',
21
21
  productName: 'Kendo UI for Angular',
22
22
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
23
- publishDate: 1668698772,
23
+ publishDate: 1672394553,
24
24
  version: '',
25
25
  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'
26
26
  };
@@ -44,9 +44,9 @@ class ListBoxSelectionService {
44
44
  this.selectedIndex = null;
45
45
  }
46
46
  }
47
- ListBoxSelectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxSelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
48
- ListBoxSelectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxSelectionService });
49
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxSelectionService, decorators: [{
47
+ ListBoxSelectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ListBoxSelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
48
+ ListBoxSelectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ListBoxSelectionService });
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ListBoxSelectionService, decorators: [{
50
50
  type: Injectable
51
51
  }] });
52
52
 
@@ -74,9 +74,9 @@ class ItemTemplateDirective {
74
74
  this.templateRef = templateRef;
75
75
  }
76
76
  }
77
- ItemTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
78
- ItemTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ItemTemplateDirective, selector: "[kendoListBoxItemTemplate]", ngImport: i0 });
79
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemTemplateDirective, decorators: [{
77
+ ItemTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
78
+ ItemTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ItemTemplateDirective, selector: "[kendoListBoxItemTemplate]", ngImport: i0 });
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemTemplateDirective, decorators: [{
80
80
  type: Directive,
81
81
  args: [{
82
82
  selector: '[kendoListBoxItemTemplate]'
@@ -138,11 +138,11 @@ const sizeClassMap = {
138
138
  /**
139
139
  * @hidden
140
140
  */
141
- const toolbarClasses = {
142
- left: 'k-listbox-toolbar-left',
143
- right: 'k-listbox-toolbar-right',
144
- top: 'k-listbox-toolbar-top',
145
- bottom: 'k-listbox-toolbar-bottom'
141
+ const actionsClasses = {
142
+ left: 'k-listbox-actions-left',
143
+ right: 'k-listbox-actions-right',
144
+ top: 'k-listbox-actions-top',
145
+ bottom: 'k-listbox-actions-bottom'
146
146
  };
147
147
 
148
148
  /**
@@ -193,9 +193,9 @@ class ItemSelectableDirective {
193
193
  this.selectionService.select(this.index);
194
194
  }
195
195
  }
196
- ItemSelectableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemSelectableDirective, deps: [{ token: ListBoxSelectionService }], target: i0.ɵɵFactoryTarget.Directive });
197
- 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 });
198
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ItemSelectableDirective, decorators: [{
196
+ ItemSelectableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemSelectableDirective, deps: [{ token: ListBoxSelectionService }], target: i0.ɵɵFactoryTarget.Directive });
197
+ ItemSelectableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ItemSelectableDirective, selector: "[kendoListBoxItemSelectable]", inputs: { index: "index" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.k-selected": "this.selectedClassName" } }, ngImport: i0 });
198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ItemSelectableDirective, decorators: [{
199
199
  type: Directive,
200
200
  args: [{
201
201
  selector: '[kendoListBoxItemSelectable]'
@@ -210,6 +210,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
210
210
  args: ['click', ['$event']]
211
211
  }] } });
212
212
 
213
+ const DEFAULT_SIZE = 'medium';
213
214
  /**
214
215
  * Represents the [Kendo UI ListBox component for Angular]({% slug overview_listbox %}).
215
216
  */
@@ -226,15 +227,6 @@ class ListBoxComponent {
226
227
  * The data which will be displayed by the ListBox.
227
228
  */
228
229
  this.data = [];
229
- /**
230
- * Sets the size of the component.
231
- *
232
- * The possible values are:
233
- * - `'small'`
234
- * - `'medium'` (default)
235
- * - `'large'`
236
- */
237
- this.size = 'medium';
238
230
  /**
239
231
  * A function which determines if a specific item is disabled.
240
232
  */
@@ -251,13 +243,32 @@ class ListBoxComponent {
251
243
  * @hidden
252
244
  */
253
245
  this.selectedTools = allTools;
246
+ this._size = DEFAULT_SIZE;
254
247
  this.sub = new Subscription();
255
248
  validatePackage(packageMetadata);
256
249
  this.setToolbarClass(DEFAULT_TOOLBAR_POSITION);
250
+ this.setSizingClass(this.size);
257
251
  this.sub.add(this.selectionService.onSelect.subscribe((e) => {
258
252
  this.selectionChange.next(e);
259
253
  }));
260
254
  }
255
+ /**
256
+ * Sets the size of the component.
257
+ *
258
+ * The possible values are:
259
+ * - `'small'`
260
+ * - `'medium'` (default)
261
+ * - `'large'`
262
+ */
263
+ set size(size) {
264
+ const newSize = size ? size : DEFAULT_SIZE;
265
+ this.renderer.removeClass(this.hostElement.nativeElement, `k-listbox-${sizeClassMap[this.size]}`);
266
+ this.setSizingClass(newSize);
267
+ this._size = size;
268
+ }
269
+ get size() {
270
+ return this._size;
271
+ }
261
272
  /**
262
273
  * Sets whether a toolbar should be displayed with the ListBox, as well as what tools and position should be used.
263
274
  */
@@ -320,26 +331,30 @@ class ListBoxComponent {
320
331
  return fieldAccessor(dataItem, this.textField);
321
332
  }
322
333
  setToolbarClass(pos) {
323
- Object.keys(toolbarClasses).forEach((className) => {
334
+ Object.keys(actionsClasses).forEach((className) => {
324
335
  if (pos === className) {
325
- this.renderer.addClass(this.hostElement.nativeElement, toolbarClasses[className]);
336
+ this.renderer.addClass(this.hostElement.nativeElement, actionsClasses[className]);
326
337
  }
327
338
  else {
328
- this.renderer.removeClass(this.hostElement.nativeElement, toolbarClasses[className]);
339
+ this.renderer.removeClass(this.hostElement.nativeElement, actionsClasses[className]);
329
340
  }
330
341
  });
331
342
  }
343
+ setSizingClass(size) {
344
+ this.renderer.addClass(this.hostElement.nativeElement, `k-listbox-${sizeClassMap[size]}`);
345
+ }
332
346
  }
333
- ListBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxComponent, deps: [{ token: ListBoxSelectionService }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
334
- 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: `
335
- <div class="k-listbox-toolbar" *ngIf="selectedTools.length > 0">
336
- <ul class="k-reset">
337
- <li *ngFor="let tool of selectedTools">
338
- <button kendoButton [icon]="tool.icon" (click)="performAction(tool.name)" role="button"></button>
339
- </li>
340
-
341
- <!-- react moving items has a smoother removal of the style: https://www.telerik.com/kendo-react-ui/components/listbox/ -->
342
- </ul>
347
+ ListBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ListBoxComponent, deps: [{ token: ListBoxSelectionService }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
348
+ ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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: `
349
+ <div class="k-listbox-actions" *ngIf="selectedTools.length > 0">
350
+ <button
351
+ *ngFor="let tool of selectedTools"
352
+ kendoButton
353
+ [size]="this.size"
354
+ [icon]="tool.icon"
355
+ (click)="performAction(tool.name)"
356
+ role="button"
357
+ ></button>
343
358
  </div>
344
359
  <div class="k-list-scroller k-selectable">
345
360
  <div class="{{ listClasses }}">
@@ -366,21 +381,22 @@ ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
366
381
  </div>
367
382
  </div>
368
383
  </div>
369
- `, 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: ItemSelectableDirective, selector: "[kendoListBoxItemSelectable]", inputs: ["index"] }, { type: i3.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }] });
370
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxComponent, decorators: [{
384
+ `, isInline: true, components: [{ type: i2.Button, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: ItemSelectableDirective, selector: "[kendoListBoxItemSelectable]", inputs: ["index"] }, { type: i2.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }] });
385
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ListBoxComponent, decorators: [{
371
386
  type: Component,
372
387
  args: [{
373
388
  selector: 'kendo-listbox',
374
389
  providers: [ListBoxSelectionService],
375
390
  template: `
376
- <div class="k-listbox-toolbar" *ngIf="selectedTools.length > 0">
377
- <ul class="k-reset">
378
- <li *ngFor="let tool of selectedTools">
379
- <button kendoButton [icon]="tool.icon" (click)="performAction(tool.name)" role="button"></button>
380
- </li>
381
-
382
- <!-- react moving items has a smoother removal of the style: https://www.telerik.com/kendo-react-ui/components/listbox/ -->
383
- </ul>
391
+ <div class="k-listbox-actions" *ngIf="selectedTools.length > 0">
392
+ <button
393
+ *ngFor="let tool of selectedTools"
394
+ kendoButton
395
+ [size]="this.size"
396
+ [icon]="tool.icon"
397
+ (click)="performAction(tool.name)"
398
+ role="button"
399
+ ></button>
384
400
  </div>
385
401
  <div class="k-list-scroller k-selectable">
386
402
  <div class="{{ listClasses }}">
@@ -481,7 +497,7 @@ class DataBindingDirective {
481
497
  */
482
498
  ngOnChanges(changes) {
483
499
  if (isChanged('connectedWith', changes, false)) {
484
- if (!changes.connectedWith.firstChange) {
500
+ if (!changes['connectedWith'].firstChange) {
485
501
  this.selectedBoxSub.unsubscribe();
486
502
  this.selectedBoxSub = new Subscription();
487
503
  }
@@ -551,9 +567,9 @@ class DataBindingDirective {
551
567
  this.selectedBox = target;
552
568
  }
553
569
  }
554
- DataBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DataBindingDirective, deps: [{ token: ListBoxComponent }], target: i0.ɵɵFactoryTarget.Directive });
555
- DataBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: DataBindingDirective, selector: "[kendoListBoxDataBinding]", inputs: { connectedWith: "connectedWith" }, usesOnChanges: true, ngImport: i0 });
556
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: DataBindingDirective, decorators: [{
570
+ DataBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataBindingDirective, deps: [{ token: ListBoxComponent }], target: i0.ɵɵFactoryTarget.Directive });
571
+ DataBindingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: DataBindingDirective, selector: "[kendoListBoxDataBinding]", inputs: { connectedWith: "connectedWith" }, usesOnChanges: true, ngImport: i0 });
572
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataBindingDirective, decorators: [{
557
573
  type: Directive,
558
574
  args: [{
559
575
  selector: '[kendoListBoxDataBinding]'
@@ -567,10 +583,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
567
583
  */
568
584
  class ListBoxModule {
569
585
  }
570
- ListBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
571
- 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] });
572
- ListBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxModule, imports: [[ButtonsModule, CommonModule]] });
573
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ListBoxModule, decorators: [{
586
+ ListBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ListBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
587
+ ListBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ListBoxModule, declarations: [ListBoxComponent, ItemTemplateDirective, ItemSelectableDirective, DataBindingDirective], imports: [ButtonsModule, CommonModule], exports: [ListBoxComponent, ItemTemplateDirective, ItemSelectableDirective, DataBindingDirective] });
588
+ ListBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ListBoxModule, imports: [[ButtonsModule, CommonModule]] });
589
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ListBoxModule, decorators: [{
574
590
  type: NgModule,
575
591
  args: [{
576
592
  imports: [ButtonsModule, CommonModule],