@progress/kendo-angular-listbox 11.4.1-develop.9 → 11.5.0-develop.2
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/esm2020/index.mjs +2 -0
- package/esm2020/listbox.component.mjs +107 -28
- package/esm2020/listbox.module.mjs +23 -3
- package/esm2020/localization/custom-messages.component.mjs +42 -0
- package/esm2020/localization/localized-messages.directive.mjs +37 -0
- package/esm2020/localization/messages.mjs +32 -0
- package/esm2020/package-metadata.mjs +2 -2
- package/fesm2015/progress-kendo-angular-listbox.mjs +218 -34
- package/fesm2020/progress-kendo-angular-listbox.mjs +218 -34
- package/index.d.ts +2 -0
- package/listbox.component.d.ts +8 -2
- package/listbox.module.d.ts +9 -7
- package/localization/custom-messages.component.d.ts +18 -0
- package/localization/localized-messages.directive.d.ts +16 -0
- package/localization/messages.d.ts +41 -0
- package/package.json +5 -5
- package/schematics/ngAdd/index.js +4 -4
|
@@ -3,16 +3,18 @@
|
|
|
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';
|
|
6
|
-
import { EventEmitter, Injectable, Directive, Input, HostBinding, HostListener, isDevMode, Component, ContentChild, ViewChild, ViewChildren, Output, NgModule } from '@angular/core';
|
|
6
|
+
import { EventEmitter, Injectable, Directive, Input, forwardRef, HostBinding, HostListener, isDevMode, Component, ContentChild, ViewChild, ViewChildren, Output, NgModule } from '@angular/core';
|
|
7
7
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
8
8
|
import { Subscription } from 'rxjs';
|
|
9
9
|
import { getter } from '@progress/kendo-common';
|
|
10
10
|
import { caretAltUpIcon, caretAltDownIcon, caretAltLeftIcon, caretAltRightIcon, caretDoubleAltRightIcon, caretDoubleAltLeftIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
11
11
|
import { Keys, isChanged } from '@progress/kendo-angular-common';
|
|
12
12
|
import { take } from 'rxjs/operators';
|
|
13
|
-
import * as
|
|
13
|
+
import * as i1 from '@progress/kendo-angular-l10n';
|
|
14
|
+
import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
15
|
+
import * as i4 from '@progress/kendo-angular-buttons';
|
|
14
16
|
import { ButtonsModule } from '@progress/kendo-angular-buttons';
|
|
15
|
-
import * as
|
|
17
|
+
import * as i6 from '@angular/common';
|
|
16
18
|
import { CommonModule } from '@angular/common';
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -22,8 +24,8 @@ const packageMetadata = {
|
|
|
22
24
|
name: '@progress/kendo-angular-listbox',
|
|
23
25
|
productName: 'Kendo UI for Angular',
|
|
24
26
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
25
|
-
publishDate:
|
|
26
|
-
version: '11.
|
|
27
|
+
publishDate: 1680079886,
|
|
28
|
+
version: '11.5.0-develop.2',
|
|
27
29
|
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'
|
|
28
30
|
};
|
|
29
31
|
|
|
@@ -441,6 +443,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
441
443
|
type: Injectable
|
|
442
444
|
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.NgZone }]; } });
|
|
443
445
|
|
|
446
|
+
/**
|
|
447
|
+
* @hidden
|
|
448
|
+
*/
|
|
449
|
+
class Messages extends ComponentMessages {
|
|
450
|
+
}
|
|
451
|
+
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
452
|
+
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Messages, inputs: { moveUp: "moveUp", moveDown: "moveDown", remove: "remove", transferTo: "transferTo", transferFrom: "transferFrom", transferAllTo: "transferAllTo", transferAllFrom: "transferAllFrom" }, usesInheritance: true, ngImport: i0 });
|
|
453
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, decorators: [{
|
|
454
|
+
type: Directive
|
|
455
|
+
}], propDecorators: { moveUp: [{
|
|
456
|
+
type: Input
|
|
457
|
+
}], moveDown: [{
|
|
458
|
+
type: Input
|
|
459
|
+
}], remove: [{
|
|
460
|
+
type: Input
|
|
461
|
+
}], transferTo: [{
|
|
462
|
+
type: Input
|
|
463
|
+
}], transferFrom: [{
|
|
464
|
+
type: Input
|
|
465
|
+
}], transferAllTo: [{
|
|
466
|
+
type: Input
|
|
467
|
+
}], transferAllFrom: [{
|
|
468
|
+
type: Input
|
|
469
|
+
}] } });
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* @hidden
|
|
473
|
+
*/
|
|
474
|
+
class LocalizedMessagesDirective extends Messages {
|
|
475
|
+
constructor(service) {
|
|
476
|
+
super();
|
|
477
|
+
this.service = service;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
LocalizedMessagesDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
481
|
+
LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: LocalizedMessagesDirective, selector: "[kendoListBoxLocalizedMessages]", providers: [
|
|
482
|
+
{
|
|
483
|
+
provide: Messages,
|
|
484
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
485
|
+
}
|
|
486
|
+
], usesInheritance: true, ngImport: i0 });
|
|
487
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
488
|
+
type: Directive,
|
|
489
|
+
args: [{
|
|
490
|
+
providers: [
|
|
491
|
+
{
|
|
492
|
+
provide: Messages,
|
|
493
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
494
|
+
}
|
|
495
|
+
],
|
|
496
|
+
selector: '[kendoListBoxLocalizedMessages]'
|
|
497
|
+
}]
|
|
498
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
|
|
499
|
+
|
|
444
500
|
/**
|
|
445
501
|
* @hidden
|
|
446
502
|
*/
|
|
@@ -480,12 +536,13 @@ let idx = 0;
|
|
|
480
536
|
* Represents the [Kendo UI ListBox component for Angular]({% slug overview_listbox %}).
|
|
481
537
|
*/
|
|
482
538
|
class ListBoxComponent {
|
|
483
|
-
constructor(keyboardNavigationService, selectionService, hostElement, renderer, zone) {
|
|
539
|
+
constructor(keyboardNavigationService, selectionService, hostElement, renderer, zone, localization) {
|
|
484
540
|
this.keyboardNavigationService = keyboardNavigationService;
|
|
485
541
|
this.selectionService = selectionService;
|
|
486
542
|
this.hostElement = hostElement;
|
|
487
543
|
this.renderer = renderer;
|
|
488
544
|
this.zone = zone;
|
|
545
|
+
this.localization = localization;
|
|
489
546
|
/**
|
|
490
547
|
* @hidden
|
|
491
548
|
*/
|
|
@@ -567,6 +624,12 @@ class ListBoxComponent {
|
|
|
567
624
|
get listClasses() {
|
|
568
625
|
return `k-list k-list-${sizeClassMap[this.size]}`;
|
|
569
626
|
}
|
|
627
|
+
/**
|
|
628
|
+
* @hidden
|
|
629
|
+
*/
|
|
630
|
+
messageFor(key) {
|
|
631
|
+
return this.localization.get(key);
|
|
632
|
+
}
|
|
570
633
|
ngOnInit() {
|
|
571
634
|
// This event emitter gives us the connectedWith value from the DataBinding directive
|
|
572
635
|
this.getChildListbox.emit();
|
|
@@ -634,13 +697,12 @@ class ListBoxComponent {
|
|
|
634
697
|
}
|
|
635
698
|
/**
|
|
636
699
|
* @hidden
|
|
637
|
-
|
|
700
|
+
*/
|
|
638
701
|
get getListboxId() {
|
|
639
702
|
const id = ++idx;
|
|
640
703
|
const listboxId = `k-listbox-${id}`;
|
|
641
704
|
return listboxId;
|
|
642
705
|
}
|
|
643
|
-
;
|
|
644
706
|
/**
|
|
645
707
|
* @hidden
|
|
646
708
|
*/
|
|
@@ -663,7 +725,10 @@ class ListBoxComponent {
|
|
|
663
725
|
*/
|
|
664
726
|
swapItems(firstItemIndex, secondItemIndex) {
|
|
665
727
|
const listboxItems = this.keyboardNavigationService.listboxItems;
|
|
666
|
-
[listboxItems[firstItemIndex], listboxItems[secondItemIndex]] = [
|
|
728
|
+
[listboxItems[firstItemIndex], listboxItems[secondItemIndex]] = [
|
|
729
|
+
listboxItems[secondItemIndex],
|
|
730
|
+
listboxItems[firstItemIndex],
|
|
731
|
+
];
|
|
667
732
|
}
|
|
668
733
|
onClickEvent(listboxItems, prevIndex, currentIndex, dir) {
|
|
669
734
|
this.selectionChange.next(currentIndex);
|
|
@@ -679,7 +744,7 @@ class ListBoxComponent {
|
|
|
679
744
|
}
|
|
680
745
|
initSubscriptions(navService, hostEl, toolsRef) {
|
|
681
746
|
this.subs.add(navService.onDeleteEvent.subscribe((index) => this.onDeleteEvent(index, navService)));
|
|
682
|
-
this.subs.add(this.renderer.listen(hostEl, 'keydown', event => navService.onKeyDown(event, toolsRef, this.selectedTools, this.childListbox, this.parentListbox)));
|
|
747
|
+
this.subs.add(this.renderer.listen(hostEl, 'keydown', (event) => navService.onKeyDown(event, toolsRef, this.selectedTools, this.childListbox, this.parentListbox)));
|
|
683
748
|
this.subs.add(this.renderer.listen(this.listboxElement.nativeElement, 'focusin', () => navService.onFocusIn()));
|
|
684
749
|
this.subs.add(navService.onShiftSelectedItem.subscribe((actionToPerform) => this.onShiftItems(actionToPerform)));
|
|
685
750
|
this.subs.add(navService.onTransferAllEvent.subscribe((actionToPerform) => this.onShiftItems(actionToPerform)));
|
|
@@ -736,8 +801,9 @@ class ListBoxComponent {
|
|
|
736
801
|
this.selectionService.selectedIndex = index;
|
|
737
802
|
this.performAction('remove');
|
|
738
803
|
this.updateListboxItems();
|
|
739
|
-
const setIndex = index + 1 === navService.listboxItems.length
|
|
740
|
-
{ index: index - 1, tabindex: index - 1 }
|
|
804
|
+
const setIndex = index + 1 === navService.listboxItems.length
|
|
805
|
+
? { index: index - 1, tabindex: index - 1 }
|
|
806
|
+
: { index, tabindex: index + 1 };
|
|
741
807
|
navService.changeTabindex(null, navService.listboxItems[setIndex['tabindex']]);
|
|
742
808
|
this.selectionChange.next({ index: setIndex['index'], prevIndex: null });
|
|
743
809
|
navService.selectedListboxItemIndex = setIndex['index'];
|
|
@@ -758,8 +824,39 @@ class ListBoxComponent {
|
|
|
758
824
|
this.renderer.addClass(this.hostElement.nativeElement, `k-listbox-${sizeClassMap[size]}`);
|
|
759
825
|
}
|
|
760
826
|
}
|
|
761
|
-
ListBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxComponent, deps: [{ token: KeyboardNavigationService }, { token: ListBoxSelectionService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
762
|
-
ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ListBoxComponent, selector: "kendo-listbox", inputs: { textField: "textField", data: "data", size: "size", toolbar: "toolbar", listboxLabel: "listboxLabel", listboxToolbarLabel: "listboxToolbarLabel", itemDisabled: "itemDisabled" }, outputs: { selectionChange: "selectionChange", actionClick: "actionClick", getChildListbox: "getChildListbox" }, host: { properties: { "class.k-listbox": "this.listboxClassName" } }, providers: [
|
|
827
|
+
ListBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxComponent, deps: [{ token: KeyboardNavigationService }, { token: ListBoxSelectionService }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
828
|
+
ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: ListBoxComponent, selector: "kendo-listbox", inputs: { textField: "textField", data: "data", size: "size", toolbar: "toolbar", listboxLabel: "listboxLabel", listboxToolbarLabel: "listboxToolbarLabel", itemDisabled: "itemDisabled" }, outputs: { selectionChange: "selectionChange", actionClick: "actionClick", getChildListbox: "getChildListbox" }, host: { properties: { "class.k-listbox": "this.listboxClassName" } }, providers: [
|
|
829
|
+
ListBoxSelectionService,
|
|
830
|
+
KeyboardNavigationService,
|
|
831
|
+
LocalizationService,
|
|
832
|
+
{
|
|
833
|
+
provide: L10N_PREFIX,
|
|
834
|
+
useValue: 'kendo.listbox'
|
|
835
|
+
},
|
|
836
|
+
], queries: [{ propertyName: "itemTemplate", first: true, predicate: ItemTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "listboxElement", first: true, predicate: ["listbox"], descendants: true }, { propertyName: "toolbarElement", first: true, predicate: ["toolbar"], descendants: true }, { propertyName: "tools", predicate: ["tools"], descendants: true }], ngImport: i0, template: `
|
|
837
|
+
<ng-container kendoListBoxLocalizedMessages
|
|
838
|
+
i18n-moveUp="kendo.listbox.moveUp|The title of the Move Up button"
|
|
839
|
+
moveUp="Move Up"
|
|
840
|
+
|
|
841
|
+
i18n-moveDown="kendo.listbox.moveDown|The title of the Move Down button"
|
|
842
|
+
moveDown="Move Down"
|
|
843
|
+
|
|
844
|
+
i18n-transferTo="kendo.listbox.transferTo|The title of the Transfer To button"
|
|
845
|
+
transferTo="Transfer To"
|
|
846
|
+
|
|
847
|
+
i18n-transferAllTo="kendo.listbox.transferAllTo|The title of the Transfer All To button"
|
|
848
|
+
transferAllTo="Transfer All To"
|
|
849
|
+
|
|
850
|
+
i18n-transferFrom="kendo.listbox.transferFrom|The title of the Transfer From button"
|
|
851
|
+
transferFrom="Transfer From"
|
|
852
|
+
|
|
853
|
+
i18n-transferAllFrom="kendo.listbox.transferAllFrom|The title of the Transfer All From button"
|
|
854
|
+
transferAllFrom="Transfer All From"
|
|
855
|
+
|
|
856
|
+
i18n-remove="kendo.listbox.remove|The title of the Remove button"
|
|
857
|
+
remove="Remove"
|
|
858
|
+
>
|
|
859
|
+
</ng-container>
|
|
763
860
|
<div
|
|
764
861
|
#toolbar
|
|
765
862
|
class="k-listbox-actions"
|
|
@@ -769,13 +866,13 @@ ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
769
866
|
>
|
|
770
867
|
<button
|
|
771
868
|
#tools
|
|
772
|
-
*ngFor="let tool of selectedTools; let i = index
|
|
869
|
+
*ngFor="let tool of selectedTools; let i = index"
|
|
773
870
|
kendoButton
|
|
774
871
|
[attr.tabindex]="i === 0 ? '0' : '-1'"
|
|
775
872
|
[size]="this.size"
|
|
776
873
|
[icon]="tool.icon"
|
|
777
874
|
[svgIcon]="tool.svgIcon"
|
|
778
|
-
[attr.title]="tool.
|
|
875
|
+
[attr.title]="messageFor(tool.name)"
|
|
779
876
|
(click)="performAction(tool.name)"
|
|
780
877
|
role="button"
|
|
781
878
|
></button>
|
|
@@ -783,7 +880,7 @@ ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
783
880
|
<div class="k-list-scroller k-selectable">
|
|
784
881
|
<div class="{{ listClasses }}">
|
|
785
882
|
<div class="k-list-content">
|
|
786
|
-
<ul
|
|
883
|
+
<ul
|
|
787
884
|
#listbox
|
|
788
885
|
class="k-list-ul"
|
|
789
886
|
role="listbox"
|
|
@@ -791,7 +888,7 @@ ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
791
888
|
[attr.aria-multiselectable]="false"
|
|
792
889
|
>
|
|
793
890
|
<li
|
|
794
|
-
*ngFor="let item of data; let i = index
|
|
891
|
+
*ngFor="let item of data; let i = index"
|
|
795
892
|
kendoListBoxItemSelectable
|
|
796
893
|
class="k-list-item"
|
|
797
894
|
[attr.tabindex]="i === 0 ? '0' : '-1'"
|
|
@@ -800,11 +897,13 @@ ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
800
897
|
[index]="i"
|
|
801
898
|
[class.k-disabled]="itemDisabled(item)"
|
|
802
899
|
>
|
|
803
|
-
<ng-template
|
|
900
|
+
<ng-template
|
|
901
|
+
*ngIf="itemTemplate; else defaultItemTemplate"
|
|
804
902
|
[templateContext]="{
|
|
805
903
|
templateRef: itemTemplate.templateRef,
|
|
806
904
|
$implicit: item
|
|
807
|
-
}"
|
|
905
|
+
}"
|
|
906
|
+
>
|
|
808
907
|
</ng-template>
|
|
809
908
|
<ng-template #defaultItemTemplate>
|
|
810
909
|
<span class="k-list-item-text">{{ getText(item) }}</span>
|
|
@@ -814,13 +913,44 @@ ListBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
814
913
|
</div>
|
|
815
914
|
</div>
|
|
816
915
|
</div>
|
|
817
|
-
`, isInline: true, components: [{ type:
|
|
916
|
+
`, isInline: true, components: [{ type: i4.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: LocalizedMessagesDirective, selector: "[kendoListBoxLocalizedMessages]" }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: ItemSelectableDirective, selector: "[kendoListBoxItemSelectable]", inputs: ["index"] }, { type: i4.TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }] });
|
|
818
917
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxComponent, decorators: [{
|
|
819
918
|
type: Component,
|
|
820
919
|
args: [{
|
|
821
920
|
selector: 'kendo-listbox',
|
|
822
|
-
providers: [
|
|
921
|
+
providers: [
|
|
922
|
+
ListBoxSelectionService,
|
|
923
|
+
KeyboardNavigationService,
|
|
924
|
+
LocalizationService,
|
|
925
|
+
{
|
|
926
|
+
provide: L10N_PREFIX,
|
|
927
|
+
useValue: 'kendo.listbox'
|
|
928
|
+
},
|
|
929
|
+
],
|
|
823
930
|
template: `
|
|
931
|
+
<ng-container kendoListBoxLocalizedMessages
|
|
932
|
+
i18n-moveUp="kendo.listbox.moveUp|The title of the Move Up button"
|
|
933
|
+
moveUp="Move Up"
|
|
934
|
+
|
|
935
|
+
i18n-moveDown="kendo.listbox.moveDown|The title of the Move Down button"
|
|
936
|
+
moveDown="Move Down"
|
|
937
|
+
|
|
938
|
+
i18n-transferTo="kendo.listbox.transferTo|The title of the Transfer To button"
|
|
939
|
+
transferTo="Transfer To"
|
|
940
|
+
|
|
941
|
+
i18n-transferAllTo="kendo.listbox.transferAllTo|The title of the Transfer All To button"
|
|
942
|
+
transferAllTo="Transfer All To"
|
|
943
|
+
|
|
944
|
+
i18n-transferFrom="kendo.listbox.transferFrom|The title of the Transfer From button"
|
|
945
|
+
transferFrom="Transfer From"
|
|
946
|
+
|
|
947
|
+
i18n-transferAllFrom="kendo.listbox.transferAllFrom|The title of the Transfer All From button"
|
|
948
|
+
transferAllFrom="Transfer All From"
|
|
949
|
+
|
|
950
|
+
i18n-remove="kendo.listbox.remove|The title of the Remove button"
|
|
951
|
+
remove="Remove"
|
|
952
|
+
>
|
|
953
|
+
</ng-container>
|
|
824
954
|
<div
|
|
825
955
|
#toolbar
|
|
826
956
|
class="k-listbox-actions"
|
|
@@ -830,13 +960,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
830
960
|
>
|
|
831
961
|
<button
|
|
832
962
|
#tools
|
|
833
|
-
*ngFor="let tool of selectedTools; let i = index
|
|
963
|
+
*ngFor="let tool of selectedTools; let i = index"
|
|
834
964
|
kendoButton
|
|
835
965
|
[attr.tabindex]="i === 0 ? '0' : '-1'"
|
|
836
966
|
[size]="this.size"
|
|
837
967
|
[icon]="tool.icon"
|
|
838
968
|
[svgIcon]="tool.svgIcon"
|
|
839
|
-
[attr.title]="tool.
|
|
969
|
+
[attr.title]="messageFor(tool.name)"
|
|
840
970
|
(click)="performAction(tool.name)"
|
|
841
971
|
role="button"
|
|
842
972
|
></button>
|
|
@@ -844,7 +974,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
844
974
|
<div class="k-list-scroller k-selectable">
|
|
845
975
|
<div class="{{ listClasses }}">
|
|
846
976
|
<div class="k-list-content">
|
|
847
|
-
<ul
|
|
977
|
+
<ul
|
|
848
978
|
#listbox
|
|
849
979
|
class="k-list-ul"
|
|
850
980
|
role="listbox"
|
|
@@ -852,7 +982,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
852
982
|
[attr.aria-multiselectable]="false"
|
|
853
983
|
>
|
|
854
984
|
<li
|
|
855
|
-
*ngFor="let item of data; let i = index
|
|
985
|
+
*ngFor="let item of data; let i = index"
|
|
856
986
|
kendoListBoxItemSelectable
|
|
857
987
|
class="k-list-item"
|
|
858
988
|
[attr.tabindex]="i === 0 ? '0' : '-1'"
|
|
@@ -861,11 +991,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
861
991
|
[index]="i"
|
|
862
992
|
[class.k-disabled]="itemDisabled(item)"
|
|
863
993
|
>
|
|
864
|
-
<ng-template
|
|
994
|
+
<ng-template
|
|
995
|
+
*ngIf="itemTemplate; else defaultItemTemplate"
|
|
865
996
|
[templateContext]="{
|
|
866
997
|
templateRef: itemTemplate.templateRef,
|
|
867
998
|
$implicit: item
|
|
868
|
-
}"
|
|
999
|
+
}"
|
|
1000
|
+
>
|
|
869
1001
|
</ng-template>
|
|
870
1002
|
<ng-template #defaultItemTemplate>
|
|
871
1003
|
<span class="k-list-item-text">{{ getText(item) }}</span>
|
|
@@ -875,9 +1007,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
875
1007
|
</div>
|
|
876
1008
|
</div>
|
|
877
1009
|
</div>
|
|
878
|
-
|
|
1010
|
+
`,
|
|
879
1011
|
}]
|
|
880
|
-
}], ctorParameters: function () { return [{ type: KeyboardNavigationService }, { type: ListBoxSelectionService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { listboxClassName: [{
|
|
1012
|
+
}], ctorParameters: function () { return [{ type: KeyboardNavigationService }, { type: ListBoxSelectionService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i1.LocalizationService }]; }, propDecorators: { listboxClassName: [{
|
|
881
1013
|
type: HostBinding,
|
|
882
1014
|
args: ['class.k-listbox']
|
|
883
1015
|
}], itemTemplate: [{
|
|
@@ -1049,20 +1181,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1049
1181
|
type: Input
|
|
1050
1182
|
}] } });
|
|
1051
1183
|
|
|
1184
|
+
/**
|
|
1185
|
+
* Custom component messages override default component messages
|
|
1186
|
+
* ([see example]({% slug globalization_listbox %}#toc-localization)).
|
|
1187
|
+
*/
|
|
1188
|
+
class CustomMessagesComponent extends Messages {
|
|
1189
|
+
constructor(service) {
|
|
1190
|
+
super();
|
|
1191
|
+
this.service = service;
|
|
1192
|
+
}
|
|
1193
|
+
get override() {
|
|
1194
|
+
return true;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
CustomMessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1198
|
+
CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: CustomMessagesComponent, selector: "kendo-listbox-messages", providers: [
|
|
1199
|
+
{
|
|
1200
|
+
provide: Messages,
|
|
1201
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
1202
|
+
}
|
|
1203
|
+
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
1204
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: CustomMessagesComponent, decorators: [{
|
|
1205
|
+
type: Component,
|
|
1206
|
+
args: [{
|
|
1207
|
+
providers: [
|
|
1208
|
+
{
|
|
1209
|
+
provide: Messages,
|
|
1210
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
1211
|
+
}
|
|
1212
|
+
],
|
|
1213
|
+
selector: 'kendo-listbox-messages',
|
|
1214
|
+
template: ``
|
|
1215
|
+
}]
|
|
1216
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
|
|
1217
|
+
|
|
1218
|
+
const declarationsExports = [
|
|
1219
|
+
LocalizedMessagesDirective,
|
|
1220
|
+
ListBoxComponent,
|
|
1221
|
+
ItemTemplateDirective,
|
|
1222
|
+
ItemSelectableDirective,
|
|
1223
|
+
DataBindingDirective,
|
|
1224
|
+
CustomMessagesComponent,
|
|
1225
|
+
];
|
|
1052
1226
|
/**
|
|
1053
1227
|
* Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the ListBox component.
|
|
1054
1228
|
*/
|
|
1055
1229
|
class ListBoxModule {
|
|
1056
1230
|
}
|
|
1057
1231
|
ListBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1058
|
-
ListBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxModule, declarations: [
|
|
1232
|
+
ListBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxModule, declarations: [LocalizedMessagesDirective,
|
|
1233
|
+
ListBoxComponent,
|
|
1234
|
+
ItemTemplateDirective,
|
|
1235
|
+
ItemSelectableDirective,
|
|
1236
|
+
DataBindingDirective,
|
|
1237
|
+
CustomMessagesComponent], imports: [ButtonsModule, CommonModule], exports: [LocalizedMessagesDirective,
|
|
1238
|
+
ListBoxComponent,
|
|
1239
|
+
ItemTemplateDirective,
|
|
1240
|
+
ItemSelectableDirective,
|
|
1241
|
+
DataBindingDirective,
|
|
1242
|
+
CustomMessagesComponent] });
|
|
1059
1243
|
ListBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxModule, imports: [[ButtonsModule, CommonModule]] });
|
|
1060
1244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: ListBoxModule, decorators: [{
|
|
1061
1245
|
type: NgModule,
|
|
1062
1246
|
args: [{
|
|
1063
1247
|
imports: [ButtonsModule, CommonModule],
|
|
1064
|
-
declarations: [
|
|
1065
|
-
exports: [
|
|
1248
|
+
declarations: [declarationsExports],
|
|
1249
|
+
exports: [declarationsExports]
|
|
1066
1250
|
}]
|
|
1067
1251
|
}] });
|
|
1068
1252
|
|
|
@@ -1070,5 +1254,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1070
1254
|
* Generated bundle index. Do not edit.
|
|
1071
1255
|
*/
|
|
1072
1256
|
|
|
1073
|
-
export { DataBindingDirective, ItemSelectableDirective, ItemTemplateDirective, ListBoxComponent, ListBoxModule };
|
|
1257
|
+
export { CustomMessagesComponent, DataBindingDirective, ItemSelectableDirective, ItemTemplateDirective, ListBoxComponent, ListBoxModule, LocalizedMessagesDirective };
|
|
1074
1258
|
|
package/index.d.ts
CHANGED
|
@@ -13,3 +13,5 @@ export { ListBoxToolbarPosition } from './toolbar';
|
|
|
13
13
|
export { Toolbar } from './toolbar';
|
|
14
14
|
export { ListBoxToolbarConfig } from './toolbar';
|
|
15
15
|
export { ListBoxSelectionEvent } from './selection.service';
|
|
16
|
+
export { CustomMessagesComponent } from './localization/custom-messages.component';
|
|
17
|
+
export { LocalizedMessagesDirective } from "./localization/localized-messages.directive";
|
package/listbox.component.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { ListBoxSize } from './size';
|
|
|
9
9
|
import { ActionName, ListBoxToolbarConfig, Tool } from './toolbar';
|
|
10
10
|
import { Button } from '@progress/kendo-angular-buttons';
|
|
11
11
|
import { KeyboardNavigationService } from './keyboard-navigation.service';
|
|
12
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
13
14
|
/**
|
|
14
15
|
* Represents the [Kendo UI ListBox component for Angular]({% slug overview_listbox %}).
|
|
@@ -19,6 +20,7 @@ export declare class ListBoxComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
19
20
|
private hostElement;
|
|
20
21
|
private renderer;
|
|
21
22
|
private zone;
|
|
23
|
+
private localization;
|
|
22
24
|
/**
|
|
23
25
|
* @hidden
|
|
24
26
|
*/
|
|
@@ -89,6 +91,10 @@ export declare class ListBoxComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
89
91
|
* @hidden
|
|
90
92
|
*/
|
|
91
93
|
get listClasses(): string;
|
|
94
|
+
/**
|
|
95
|
+
* @hidden
|
|
96
|
+
*/
|
|
97
|
+
messageFor(key: string): string;
|
|
92
98
|
/**
|
|
93
99
|
* @hidden
|
|
94
100
|
*/
|
|
@@ -111,7 +117,7 @@ export declare class ListBoxComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
111
117
|
parentListbox: ListBoxComponent;
|
|
112
118
|
private _size;
|
|
113
119
|
private subs;
|
|
114
|
-
constructor(keyboardNavigationService: KeyboardNavigationService, selectionService: ListBoxSelectionService, hostElement: ElementRef, renderer: Renderer2, zone: NgZone);
|
|
120
|
+
constructor(keyboardNavigationService: KeyboardNavigationService, selectionService: ListBoxSelectionService, hostElement: ElementRef, renderer: Renderer2, zone: NgZone, localization: LocalizationService);
|
|
115
121
|
ngOnInit(): void;
|
|
116
122
|
ngAfterViewInit(): void;
|
|
117
123
|
ngOnDestroy(): void;
|
|
@@ -133,7 +139,7 @@ export declare class ListBoxComponent implements OnInit, AfterViewInit, OnDestro
|
|
|
133
139
|
get selectedIndex(): number;
|
|
134
140
|
/**
|
|
135
141
|
* @hidden
|
|
136
|
-
|
|
142
|
+
*/
|
|
137
143
|
get getListboxId(): string;
|
|
138
144
|
/**
|
|
139
145
|
* @hidden
|
package/listbox.module.d.ts
CHANGED
|
@@ -3,17 +3,19 @@
|
|
|
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";
|
|
6
|
-
import * as i1 from "./
|
|
7
|
-
import * as i2 from "./
|
|
8
|
-
import * as i3 from "./item-
|
|
9
|
-
import * as i4 from "./
|
|
10
|
-
import * as i5 from "
|
|
11
|
-
import * as i6 from "
|
|
6
|
+
import * as i1 from "./localization/localized-messages.directive";
|
|
7
|
+
import * as i2 from "./listbox.component";
|
|
8
|
+
import * as i3 from "./item-template.directive";
|
|
9
|
+
import * as i4 from "./item-selectable.directive";
|
|
10
|
+
import * as i5 from "./data-binding.directive";
|
|
11
|
+
import * as i6 from "./localization/custom-messages.component";
|
|
12
|
+
import * as i7 from "@progress/kendo-angular-buttons";
|
|
13
|
+
import * as i8 from "@angular/common";
|
|
12
14
|
/**
|
|
13
15
|
* Represents the [NgModule](https://angular.io/api/core/NgModule) definition for the ListBox component.
|
|
14
16
|
*/
|
|
15
17
|
export declare class ListBoxModule {
|
|
16
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<ListBoxModule, never>;
|
|
17
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ListBoxModule, [typeof i1.
|
|
19
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ListBoxModule, [typeof i1.LocalizedMessagesDirective, typeof i2.ListBoxComponent, typeof i3.ItemTemplateDirective, typeof i4.ItemSelectableDirective, typeof i5.DataBindingDirective, typeof i6.CustomMessagesComponent], [typeof i7.ButtonsModule, typeof i8.CommonModule], [typeof i1.LocalizedMessagesDirective, typeof i2.ListBoxComponent, typeof i3.ItemTemplateDirective, typeof i4.ItemSelectableDirective, typeof i5.DataBindingDirective, typeof i6.CustomMessagesComponent]>;
|
|
18
20
|
static ɵinj: i0.ɵɵInjectorDeclaration<ListBoxModule>;
|
|
19
21
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
6
|
+
import { Messages } from './messages';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* Custom component messages override default component messages
|
|
10
|
+
* ([see example]({% slug globalization_listbox %}#toc-localization)).
|
|
11
|
+
*/
|
|
12
|
+
export declare class CustomMessagesComponent extends Messages {
|
|
13
|
+
protected service: LocalizationService;
|
|
14
|
+
constructor(service: LocalizationService);
|
|
15
|
+
protected get override(): boolean;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomMessagesComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomMessagesComponent, "kendo-listbox-messages", never, {}, {}, never, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
6
|
+
import { Messages } from './messages';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare class LocalizedMessagesDirective extends Messages {
|
|
12
|
+
protected service: LocalizationService;
|
|
13
|
+
constructor(service: LocalizationService);
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LocalizedMessagesDirective, never>;
|
|
15
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LocalizedMessagesDirective, "[kendoListBoxLocalizedMessages]", never, {}, {}, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export declare class Messages extends ComponentMessages {
|
|
11
|
+
/**
|
|
12
|
+
* The text of the `Move Up` button title.
|
|
13
|
+
*/
|
|
14
|
+
moveUp: string;
|
|
15
|
+
/**
|
|
16
|
+
* The text of the `Move Down` button title.
|
|
17
|
+
*/
|
|
18
|
+
moveDown: string;
|
|
19
|
+
/**
|
|
20
|
+
* The text of the `Remove` button tittle.
|
|
21
|
+
*/
|
|
22
|
+
remove: string;
|
|
23
|
+
/**
|
|
24
|
+
* The text of the `Transfer To` button title.
|
|
25
|
+
*/
|
|
26
|
+
transferTo: string;
|
|
27
|
+
/**
|
|
28
|
+
* The text of the `Transfer From` button title.
|
|
29
|
+
*/
|
|
30
|
+
transferFrom: string;
|
|
31
|
+
/**
|
|
32
|
+
* The text of the `Transfer All To` button title.
|
|
33
|
+
*/
|
|
34
|
+
transferAllTo: string;
|
|
35
|
+
/**
|
|
36
|
+
* The text of the `Transfer All From` button title.
|
|
37
|
+
*/
|
|
38
|
+
transferAllFrom: string;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Messages, never>;
|
|
40
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<Messages, never, never, { "moveUp": "moveUp"; "moveDown": "moveDown"; "remove": "remove"; "transferTo": "transferTo"; "transferFrom": "transferFrom"; "transferAllTo": "transferAllTo"; "transferAllFrom": "transferAllFrom"; }, {}, never>;
|
|
41
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-listbox",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.5.0-develop.2",
|
|
4
4
|
"description": "Kendo UI for Angular ListBox",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"@angular/core": "13 - 15",
|
|
24
24
|
"@angular/platform-browser": "13 - 15",
|
|
25
25
|
"@progress/kendo-licensing": "^1.0.2",
|
|
26
|
-
"@progress/kendo-angular-buttons": "11.
|
|
27
|
-
"@progress/kendo-angular-common": "11.
|
|
28
|
-
"@progress/kendo-angular-popup": "11.
|
|
26
|
+
"@progress/kendo-angular-buttons": "11.5.0-develop.2",
|
|
27
|
+
"@progress/kendo-angular-common": "11.5.0-develop.2",
|
|
28
|
+
"@progress/kendo-angular-popup": "11.5.0-develop.2",
|
|
29
29
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"tslib": "^2.3.1",
|
|
33
|
-
"@progress/kendo-angular-schematics": "11.
|
|
33
|
+
"@progress/kendo-angular-schematics": "11.5.0-develop.2",
|
|
34
34
|
"@progress/kendo-common": "^0.2.2"
|
|
35
35
|
},
|
|
36
36
|
"schematics": "./schematics/collection.json",
|