@progress/kendo-angular-dropdowns 7.0.3-dev.202207081325 → 7.1.0-dev.202208301349

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.
@@ -29,7 +29,7 @@ const packageMetadata = {
29
29
  name: '@progress/kendo-angular-dropdowns',
30
30
  productName: 'Kendo UI for Angular',
31
31
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
32
- publishDate: 1657286636,
32
+ publishDate: 1661867343,
33
33
  version: '',
34
34
  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'
35
35
  };
@@ -461,7 +461,7 @@ class SearchBarComponent {
461
461
  handleKeydown(event) {
462
462
  const keyCode = event.keyCode;
463
463
  const keys = [Keys.ArrowUp, Keys.ArrowDown, Keys.ArrowLeft, Keys.ArrowRight, Keys.Enter,
464
- Keys.Escape, Keys.Delete, Keys.Backspace, Keys.Home, Keys.End];
464
+ Keys.Escape, Keys.Delete, Keys.Backspace, Keys.Home, Keys.End, Keys.PageDown, Keys.PageUp];
465
465
  if (keys.indexOf(keyCode) > -1) {
466
466
  this.onNavigate.emit(event);
467
467
  }
@@ -925,6 +925,8 @@ var NavigationAction;
925
925
  NavigationAction[NavigationAction["Down"] = 11] = "Down";
926
926
  NavigationAction[NavigationAction["Left"] = 12] = "Left";
927
927
  NavigationAction[NavigationAction["Right"] = 13] = "Right";
928
+ NavigationAction[NavigationAction["PageDown"] = 14] = "PageDown";
929
+ NavigationAction[NavigationAction["PageUp"] = 15] = "PageUp";
928
930
  })(NavigationAction || (NavigationAction = {}));
929
931
 
930
932
  /**
@@ -1228,6 +1230,8 @@ class NavigationService {
1228
1230
  this.backspace = new EventEmitter();
1229
1231
  this.home = new EventEmitter();
1230
1232
  this.end = new EventEmitter();
1233
+ this.pagedown = new EventEmitter();
1234
+ this.pageup = new EventEmitter();
1231
1235
  }
1232
1236
  process(args) {
1233
1237
  const keyCode = args.originalEvent.keyCode;
@@ -1279,6 +1283,12 @@ class NavigationService {
1279
1283
  else if (keyCode === Keys.Backspace) {
1280
1284
  action = NavigationAction.Backspace;
1281
1285
  }
1286
+ else if (keyCode === Keys.PageDown) {
1287
+ action = NavigationAction.PageDown;
1288
+ }
1289
+ else if (keyCode === Keys.PageUp) {
1290
+ action = NavigationAction.PageUp;
1291
+ }
1282
1292
  const eventData = new NavigationEvent(index, args.originalEvent);
1283
1293
  if (action !== NavigationAction.Undefined) {
1284
1294
  this[NavigationAction[action].toLowerCase()].emit(eventData);
@@ -1802,6 +1812,16 @@ class ListComponent {
1802
1812
  this.scroll(items[flatIndex].element);
1803
1813
  }
1804
1814
  }
1815
+ scrollWithOnePage(action) {
1816
+ let content = this.content.nativeElement;
1817
+ const contentOffsetHeight = content.clientHeight;
1818
+ if (action === NavigationAction.PageDown) {
1819
+ content.scrollTop += contentOffsetHeight;
1820
+ }
1821
+ else if (action === NavigationAction.PageUp) {
1822
+ content.scrollTop -= contentOffsetHeight;
1823
+ }
1824
+ }
1805
1825
  scrollToIndex(index) {
1806
1826
  let content = this.content.nativeElement;
1807
1827
  let contentScrollTop = content.scrollTop;
@@ -2824,6 +2844,8 @@ class AutoCompleteComponent {
2824
2844
  action !== NavigationAction.End &&
2825
2845
  action !== NavigationAction.Left &&
2826
2846
  action !== NavigationAction.Right &&
2847
+ action !== NavigationAction.PageDown &&
2848
+ action !== NavigationAction.PageUp &&
2827
2849
  ((action === NavigationAction.Enter && this.isOpen) || action !== NavigationAction.Enter)) {
2828
2850
  event.preventDefault();
2829
2851
  }
@@ -2850,7 +2872,12 @@ class AutoCompleteComponent {
2850
2872
  this.change(value);
2851
2873
  }
2852
2874
  handleEscape() {
2853
- this.togglePopup(false);
2875
+ if (this.isOpen) {
2876
+ this.togglePopup(false);
2877
+ }
2878
+ else {
2879
+ this.value = '';
2880
+ }
2854
2881
  this.selectionService.focused = -1;
2855
2882
  this.suggestedText = null;
2856
2883
  }
@@ -2949,8 +2976,14 @@ class AutoCompleteComponent {
2949
2976
  this.focusSubscription = this.selectionService.onFocus.subscribe(this.handleItemFocus.bind(this));
2950
2977
  this.navigationSubscription = merge(this.navigationService.up, this.navigationService.down).subscribe((event) => this.navigate(event.index));
2951
2978
  this.closeSubscription = this.navigationService.close.subscribe(() => this.togglePopup(false));
2979
+ this.openSubscription = this.navigationService.open.subscribe(() => this.togglePopup(true));
2952
2980
  this.enterSubscription = this.navigationService.enter.subscribe(this.handleEnter.bind(this));
2953
2981
  this.escSubscription = this.navigationService.esc.subscribe(this.handleEscape.bind(this));
2982
+ this.scrollSubscription = merge(this.navigationService.pagedown, this.navigationService.pageup).subscribe((event) => {
2983
+ if (this.isOpen) {
2984
+ this.optionsList.scrollWithOnePage(NavigationAction[event.originalEvent.code]);
2985
+ }
2986
+ });
2954
2987
  }
2955
2988
  subscribeTouchEvents() {
2956
2989
  if (!isDocumentAvailable() || !this.touchEnabled) {
@@ -2972,8 +3005,10 @@ class AutoCompleteComponent {
2972
3005
  this.changeSubscription.unsubscribe();
2973
3006
  this.navigationSubscription.unsubscribe();
2974
3007
  this.closeSubscription.unsubscribe();
3008
+ this.openSubscription.unsubscribe();
2975
3009
  this.enterSubscription.unsubscribe();
2976
3010
  this.escSubscription.unsubscribe();
3011
+ this.scrollSubscription.unsubscribe();
2977
3012
  this.valueChangeSubscription.unsubscribe();
2978
3013
  this.focusSubscription.unsubscribe();
2979
3014
  if (this.touchstartDisposeHandler) {
@@ -4063,6 +4098,11 @@ class ComboBoxComponent {
4063
4098
  .subscribe((event) => this.navigate(event.index)));
4064
4099
  this.subs.add(this.navigationService.open.subscribe(this.handleNavigationOpen.bind(this)));
4065
4100
  this.subs.add(this.navigationService.close.subscribe(() => this.togglePopup(false)));
4101
+ this.subs.add(merge(this.navigationService.pagedown, this.navigationService.pageup).subscribe((event) => {
4102
+ if (this.isOpen) {
4103
+ this.optionsList.scrollWithOnePage(NavigationAction[event.originalEvent.code]);
4104
+ }
4105
+ }));
4066
4106
  this.subs.add(this.navigationService.esc.subscribe(this.handleEscape.bind(this)));
4067
4107
  this.subs.add(this.navigationService.enter.pipe(tap((event) => {
4068
4108
  if (this.isOpen) {
@@ -4195,9 +4235,10 @@ class ComboBoxComponent {
4195
4235
  * @hidden
4196
4236
  */
4197
4237
  clearValue(event) {
4198
- event.stopImmediatePropagation();
4199
- this.focus();
4200
- this._filtering = true;
4238
+ event === null || event === void 0 ? void 0 : event.stopImmediatePropagation();
4239
+ if (event) {
4240
+ this.focus();
4241
+ }
4201
4242
  this._previousDataItem = undefined;
4202
4243
  this.selectionService.resetSelection([]);
4203
4244
  this.clearValueSubject.next();
@@ -4231,7 +4272,7 @@ class ComboBoxComponent {
4231
4272
  * @hidden
4232
4273
  */
4233
4274
  get buttonClasses() {
4234
- return this.loading ? 'k-i-loading k-input-loading-icon' : this.iconClass || 'k-i-arrow-s';
4275
+ return this.loading ? 'k-i-loading k-input-loading-icon' : this.iconClass || 'k-i-caret-alt-down';
4235
4276
  }
4236
4277
  /**
4237
4278
  * @hidden
@@ -4424,6 +4465,8 @@ class ComboBoxComponent {
4424
4465
  action !== NavigationAction.Right &&
4425
4466
  action !== NavigationAction.Backspace &&
4426
4467
  action !== NavigationAction.Delete &&
4468
+ action !== NavigationAction.PageDown &&
4469
+ action !== NavigationAction.PageUp &&
4427
4470
  ((action === NavigationAction.Enter && this.isOpen) || action !== NavigationAction.Enter)) {
4428
4471
  event.preventDefault();
4429
4472
  }
@@ -4490,7 +4533,7 @@ class ComboBoxComponent {
4490
4533
  * @hidden
4491
4534
  */
4492
4535
  handleEscape() {
4493
- this.togglePopup(false);
4536
+ this.isOpen ? this.togglePopup(false) : this.clearValue();
4494
4537
  // clear the focus only if the focused item is not selected
4495
4538
  const hasSelected = this.selectionService.selected.length > 0;
4496
4539
  if (!hasSelected) {
@@ -5287,6 +5330,7 @@ class DropDownListComponent {
5287
5330
  this.listBoxId = guid();
5288
5331
  this.optionPrefix = guid();
5289
5332
  this.filterText = "";
5333
+ this.subs = new Subscription();
5290
5334
  this._isFocused = false;
5291
5335
  this.onTouchedCallback = (_) => { };
5292
5336
  this.onChangeCallback = (_) => { };
@@ -5296,7 +5340,6 @@ class DropDownListComponent {
5296
5340
  this.filterBlurred = new EventEmitter();
5297
5341
  this.hostElementFocused = new EventEmitter();
5298
5342
  this.hostElementBlurred = new EventEmitter();
5299
- this.selectionSubscription = new Subscription();
5300
5343
  this._open = false;
5301
5344
  this._popupSettings = { animate: true };
5302
5345
  this._size = 'medium';
@@ -5628,6 +5671,8 @@ class DropDownListComponent {
5628
5671
  action !== NavigationAction.Tab &&
5629
5672
  action !== NavigationAction.Backspace &&
5630
5673
  action !== NavigationAction.Delete &&
5674
+ action !== NavigationAction.PageDown &&
5675
+ action !== NavigationAction.PageUp &&
5631
5676
  !(leftRightKeys && this.filterable) &&
5632
5677
  action !== NavigationAction.Enter //enter when popup is opened is handled before `handleEnter`
5633
5678
  ) {
@@ -5660,11 +5705,11 @@ class DropDownListComponent {
5660
5705
  }
5661
5706
  ngOnInit() {
5662
5707
  this.renderer.removeAttribute(this.wrapper.nativeElement, "tabindex");
5663
- this.localizationChangesSubscription = this.localization
5708
+ this.subs.add(this.localization
5664
5709
  .changes.subscribe(({ rtl }) => {
5665
5710
  this.direction = rtl ? 'rtl' : 'ltr';
5666
5711
  this.cdr.detectChanges();
5667
- });
5712
+ }));
5668
5713
  this.assignAriaDescribedBy();
5669
5714
  this.setComponentClasses();
5670
5715
  }
@@ -5687,9 +5732,10 @@ class DropDownListComponent {
5687
5732
  */
5688
5733
  ngOnDestroy() {
5689
5734
  this.destroyPopup();
5690
- this.unsubscribeEvents();
5691
- if (this.localizationChangesSubscription) {
5692
- this.localizationChangesSubscription.unsubscribe();
5735
+ this.subs.unsubscribe();
5736
+ this.unSubscribeFocusEvents();
5737
+ if (this.touchstartDisposeHandler) {
5738
+ this.touchstartDisposeHandler();
5693
5739
  }
5694
5740
  }
5695
5741
  /**
@@ -5842,7 +5888,7 @@ class DropDownListComponent {
5842
5888
  * @hidden
5843
5889
  */
5844
5890
  get buttonClasses() {
5845
- return this.loading ? 'k-i-loading k-input-loading-icon' : this.iconClass || 'k-i-arrow-s';
5891
+ return this.loading ? 'k-i-loading k-input-loading-icon' : this.iconClass || 'k-i-caret-alt-down';
5846
5892
  }
5847
5893
  /**
5848
5894
  * @hidden
@@ -5914,16 +5960,16 @@ class DropDownListComponent {
5914
5960
  popupWrapper.style.width = max;
5915
5961
  popupWrapper.style.height = this.height;
5916
5962
  popupWrapper.setAttribute("dir", this.direction);
5917
- this.popupRef.popupOpen.subscribe(() => {
5963
+ this.subs.add(this.popupRef.popupOpen.subscribe(() => {
5918
5964
  this.cdr.detectChanges();
5919
5965
  this.optionsList.scrollToItem(this.selectionService.focused);
5920
5966
  this.opened.emit();
5921
- });
5922
- this.popupRef.popupClose.subscribe(() => {
5967
+ }));
5968
+ this.subs.add(this.popupRef.popupClose.subscribe(() => {
5923
5969
  this.closed.emit();
5924
- });
5970
+ }));
5925
5971
  if (!this.filterable) {
5926
- this.popupRef.popupAnchorViewportLeave.subscribe(() => this.togglePopup(false));
5972
+ this.subs.add(this.popupRef.popupAnchorViewportLeave.subscribe(() => this.togglePopup(false)));
5927
5973
  }
5928
5974
  }
5929
5975
  destroyPopup() {
@@ -5962,10 +6008,10 @@ class DropDownListComponent {
5962
6008
  return;
5963
6009
  }
5964
6010
  // Item selection when the popup is open.
5965
- this.selectionSubscription.add(this.selectionService.onSelect.pipe(filter(_ => this.isOpen), map(this.itemFromEvent.bind(this)))
6011
+ this.subs.add(this.selectionService.onSelect.pipe(filter(_ => this.isOpen), map(this.itemFromEvent.bind(this)))
5966
6012
  .subscribe(this.onSelectionChange.bind(this)));
5967
6013
  // Item selection when the popup is closed | clicked | enter, and so on.
5968
- this.selectionSubscription.add(merge(this.selectionService.onSelect.pipe(filter(_ => !this.isOpen)), this.selectionService.onChange).pipe(map(this.itemFromEvent.bind(this)), tap(_ => this.togglePopup(false)))
6014
+ this.subs.add(merge(this.selectionService.onSelect.pipe(filter(_ => !this.isOpen)), this.selectionService.onChange).pipe(map(this.itemFromEvent.bind(this)), tap(_ => this.togglePopup(false)))
5969
6015
  .subscribe(({ dataItem, value: newValue, newSelection }) => {
5970
6016
  if (newSelection) {
5971
6017
  this.onSelectionChange({ dataItem });
@@ -5983,27 +6029,31 @@ class DropDownListComponent {
5983
6029
  }
5984
6030
  this.clearFilter();
5985
6031
  }));
5986
- this.navigationSubscription = merge(this.navigationService.up, this.navigationService.down, this.navigationService.left.pipe(skipWhile(() => this.filterable)), this.navigationService.right.pipe(skipWhile(() => this.filterable)), this.navigationService.home, this.navigationService.end)
6032
+ this.subs.add(merge(this.navigationService.up, this.navigationService.down, this.navigationService.left.pipe(skipWhile(() => this.filterable)), this.navigationService.right.pipe(skipWhile(() => this.filterable)), this.navigationService.home, this.navigationService.end)
5987
6033
  .pipe(filter((event) => !isNaN(event.index)))
5988
- .subscribe((event) => this.selectionService.select(event.index));
5989
- this.openSubscription = this.navigationService.open.subscribe(() => this.togglePopup(true));
5990
- this.closeSubscription = this.navigationService.close.subscribe(() => {
6034
+ .subscribe((event) => this.selectionService.select(event.index)));
6035
+ this.subs.add(merge(this.navigationService.pagedown, this.navigationService.pageup).subscribe((event) => {
6036
+ if (this.isOpen) {
6037
+ this.optionsList.scrollWithOnePage(NavigationAction[event.originalEvent.code]);
6038
+ }
6039
+ }));
6040
+ this.subs.add(this.navigationService.open.subscribe(() => this.togglePopup(true)));
6041
+ this.subs.add(this.navigationService.close.subscribe(() => {
5991
6042
  this.togglePopup(false);
5992
6043
  this.focus();
5993
- });
5994
- this.enterSubscription = this.navigationService.enter
6044
+ }));
6045
+ this.subs.add(this.navigationService.enter
5995
6046
  .pipe(tap((event) => event.originalEvent.preventDefault()))
5996
- .subscribe(this.handleEnter.bind(this));
5997
- this.escSubscription = this.navigationService.esc
5998
- .subscribe(this.handleEscape.bind(this));
5999
- this.filterBlurredSubscription = this.filterBlurred.pipe(concatMap(() => interval(10).pipe(take(1), takeUntil(this.hostElementFocused))))
6047
+ .subscribe(this.handleEnter.bind(this)));
6048
+ this.subs.add(this.navigationService.esc
6049
+ .subscribe(this.handleEscape.bind(this)));
6050
+ this.subs.add(this.filterBlurred.pipe(concatMap(() => interval(10).pipe(take(1), takeUntil(this.hostElementFocused))))
6000
6051
  .subscribe(() => {
6001
6052
  this.hostElementBlurred.emit();
6002
- });
6053
+ }));
6003
6054
  this._zone.runOutsideAngular(() => {
6004
- this.componentBlurredSubscription =
6005
- merge(this.hostElementBlurred.pipe(concatMap(() => interval(10).pipe(take(1), takeUntil(this.filterFocused)))), this.navigationService.tab).pipe(tap(event => event instanceof NavigationEvent && this.focus()), filter(() => this.isFocused))
6006
- .subscribe(() => this.componentBlur());
6055
+ this.subs.add(merge(this.hostElementBlurred.pipe(concatMap(() => interval(10).pipe(take(1), takeUntil(this.filterFocused)))), this.navigationService.tab).pipe(tap(event => event instanceof NavigationEvent && this.focus()), filter(() => this.isFocused))
6056
+ .subscribe(() => this.componentBlur()));
6007
6057
  });
6008
6058
  }
6009
6059
  subscribeTouchEvents() {
@@ -6043,25 +6093,6 @@ class DropDownListComponent {
6043
6093
  document.removeEventListener('blur', this.blurComponent, useCapture);
6044
6094
  }
6045
6095
  }
6046
- unsubscribeEvents() {
6047
- if (!isDocumentAvailable()) {
6048
- return;
6049
- }
6050
- this.navigationSubscription.unsubscribe();
6051
- this.openSubscription.unsubscribe();
6052
- this.closeSubscription.unsubscribe();
6053
- this.enterSubscription.unsubscribe();
6054
- this.escSubscription.unsubscribe();
6055
- this.componentBlurredSubscription.unsubscribe();
6056
- this.filterBlurredSubscription.unsubscribe();
6057
- this.unSubscribeFocusEvents();
6058
- if (this.touchstartDisposeHandler) {
6059
- this.touchstartDisposeHandler();
6060
- }
6061
- if (this.selectionSubscription) {
6062
- this.selectionSubscription.unsubscribe();
6063
- }
6064
- }
6065
6096
  itemFromEvent(event) {
6066
6097
  const index = event.indices[0];
6067
6098
  let dataItem = this.dataService.itemAt(index);
@@ -10425,7 +10456,7 @@ class DropDownTreeComponent {
10425
10456
  * @hidden
10426
10457
  */
10427
10458
  get buttonClasses() {
10428
- return this.loading ? 'k-i-loading k-input-loading-icon' : 'k-i-arrow-s';
10459
+ return this.loading ? 'k-i-loading k-input-loading-icon' : 'k-i-caret-alt-down';
10429
10460
  }
10430
10461
  /**
10431
10462
  * @hidden
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-dropdowns",
3
- "version": "7.0.3-dev.202207081325",
3
+ "version": "7.1.0-dev.202208301349",
4
4
  "description": "A wide variety of native Angular dropdown components including AutoComplete, ComboBox, DropDownList, DropDownTree, MultiColumnComboBox, MultiSelect, and MultiSelectTree ",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",