@progress/kendo-angular-toolbar 6.1.0 → 6.1.1-dev.202210270918

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.
@@ -4,12 +4,12 @@
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as i0 from '@angular/core';
6
6
  import { EventEmitter, Injectable, Component, Input, Output, HostBinding, HostListener, Directive, forwardRef, ViewContainerRef, ContentChildren, ViewChild, ViewChildren, ElementRef, NgModule } from '@angular/core';
7
+ import * as i6 from '@progress/kendo-angular-common';
8
+ import { Keys, guid, isDocumentAvailable, ResizeSensorModule } from '@progress/kendo-angular-common';
7
9
  import * as i1 from '@progress/kendo-angular-l10n';
8
10
  import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
9
11
  import { validatePackage } from '@progress/kendo-licensing';
10
12
  import { take, filter, takeUntil } from 'rxjs/operators';
11
- import * as i6 from '@progress/kendo-angular-common';
12
- import { Keys, isDocumentAvailable, ResizeSensorModule } from '@progress/kendo-angular-common';
13
13
  import { Subject, Subscription, merge, fromEvent } from 'rxjs';
14
14
  import * as i2 from '@progress/kendo-angular-popup';
15
15
  import { PopupModule } from '@progress/kendo-angular-popup';
@@ -25,7 +25,7 @@ const packageMetadata = {
25
25
  name: '@progress/kendo-angular-toolbar',
26
26
  productName: 'Kendo UI for Angular',
27
27
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
28
- publishDate: 1662551369,
28
+ publishDate: 1666862261,
29
29
  version: '',
30
30
  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'
31
31
  };
@@ -259,7 +259,11 @@ class NavigationService {
259
259
  this.focus();
260
260
  }
261
261
  focusNext(ev) {
262
- if (!this.isOverflowButtonFocused && this.focused.renderedTool && !this.focused.renderedTool.tool.handleKey(ev)) {
262
+ if (this.isOverflowButtonFocused) {
263
+ const firstFocusableRT = this.getFocusableTools()[0];
264
+ this.focus(firstFocusableRT, ev);
265
+ }
266
+ else if (!this.isOverflowButtonFocused && this.focused.renderedTool && !this.focused.renderedTool.tool.handleKey(ev)) {
263
267
  const nextRT = this.getFocusableTools().slice(this.focused.index + 1)[0];
264
268
  if (nextRT) {
265
269
  this.focus(nextRT, ev);
@@ -268,6 +272,10 @@ class NavigationService {
268
272
  if (this.isOverflowButtonVisible() && !this.isPopupFocused) {
269
273
  this.focusOverflowButton();
270
274
  }
275
+ else {
276
+ const firstRT = this.getFocusableTools()[0];
277
+ this.focus(firstRT, ev);
278
+ }
271
279
  }
272
280
  }
273
281
  }
@@ -276,13 +284,22 @@ class NavigationService {
276
284
  const lastFocusableRT = this.getFocusableTools().reverse()[0];
277
285
  this.focus(lastFocusableRT, ev);
278
286
  }
279
- else if (this.focused.renderedTool && !this.focused.renderedTool.tool.handleKey(ev)) {
287
+ else if (!this.isOverflowButtonFocused && this.focused.renderedTool && !this.focused.renderedTool.tool.handleKey(ev)) {
280
288
  const prevRT = this.getFocusableTools()
281
289
  .slice(0, this.focused.index)
282
290
  .reverse()[0];
283
291
  if (prevRT) {
284
292
  this.focus(prevRT, ev);
285
293
  }
294
+ else {
295
+ if (this.isOverflowButtonVisible() && !this.isPopupFocused) {
296
+ this.focusOverflowButton();
297
+ }
298
+ else {
299
+ const lastRT = this.getFocusableTools().reverse()[0];
300
+ this.focus(lastRT, ev);
301
+ }
302
+ }
286
303
  }
287
304
  }
288
305
  resetNavigation() {
@@ -302,6 +319,18 @@ class NavigationService {
302
319
  overFlowButton.nativeElement.focus();
303
320
  }
304
321
  }
322
+ focusLast(ev) {
323
+ const lastTool = this.getFocusableTools().reverse()[0];
324
+ const overFlowButton = this.overflowButton;
325
+ if (lastTool) {
326
+ this.focused.renderedTool = lastTool;
327
+ this.focused.index = this.getFocusableTools().findIndex(rt => rt === lastTool);
328
+ this.focus(lastTool, ev);
329
+ }
330
+ else if (overFlowButton) {
331
+ overFlowButton.nativeElement.focus();
332
+ }
333
+ }
305
334
  getFocusableTools() {
306
335
  return this.renderedTools.filter(rt => rt.tool.overflows === this.isPopupFocused && rt.tool.canFocus());
307
336
  }
@@ -699,6 +728,15 @@ class ToolBarComponent {
699
728
  this.cancelRenderedToolsSubscription$ = new Subject();
700
729
  this.subscriptions = new Subscription();
701
730
  this.popupSubs = new Subscription();
731
+ this.role = 'toolbar';
732
+ /**
733
+ * @hidden
734
+ */
735
+ this.overflowBtnId = guid();
736
+ /**
737
+ * @hidden
738
+ */
739
+ this.popupId = guid();
702
740
  validatePackage(packageMetadata);
703
741
  this.direction = localization.rtl ? 'rtl' : 'ltr';
704
742
  }
@@ -779,9 +817,6 @@ class ToolBarComponent {
779
817
  }
780
818
  this.element.nativeElement.setAttribute('tabindex', this.tabindex.toString());
781
819
  }
782
- get getRole() {
783
- return 'toolbar';
784
- }
785
820
  get getDir() {
786
821
  return this.direction;
787
822
  }
@@ -828,6 +863,12 @@ class ToolBarComponent {
828
863
  case Keys.Escape:
829
864
  this.zone.run(() => this.toggle(false));
830
865
  break;
866
+ case Keys.Home:
867
+ this.zone.run(() => this.navigationService.focusFirst(ev));
868
+ break;
869
+ case Keys.End:
870
+ this.zone.run(() => this.navigationService.focusLast(ev));
871
+ break;
831
872
  default:
832
873
  break;
833
874
  }
@@ -971,6 +1012,7 @@ class ToolBarComponent {
971
1012
  this.overflowRenderedTools.changes
972
1013
  .pipe(takeUntil(this.cancelRenderedToolsSubscription$))
973
1014
  .subscribe((rts) => this.navigationService.setRenderedTools(rts.toArray()));
1015
+ this.renderer.setAttribute(this.overflowButton.nativeElement, 'aria-controls', this.popupId);
974
1016
  }
975
1017
  /**
976
1018
  * @hidden
@@ -985,6 +1027,7 @@ class ToolBarComponent {
985
1027
  if (this.overflowKeydownListener) {
986
1028
  this.overflowKeydownListener();
987
1029
  }
1030
+ this.renderer.removeAttribute(this.overflowButton.nativeElement, 'aria-controls');
988
1031
  }
989
1032
  displayAnchor() {
990
1033
  const visibility = this.allTools.filter(t => t.overflows && t.responsive).length > 0 ? 'visible' : 'hidden';
@@ -1102,7 +1145,7 @@ class ToolBarComponent {
1102
1145
  }
1103
1146
  }
1104
1147
  ToolBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarComponent, deps: [{ token: i1.LocalizationService }, { token: i2.PopupService }, { token: RefreshService }, { token: NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1105
- ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarComponent, selector: "kendo-toolbar", inputs: { overflow: "overflow", resizable: "resizable", popupSettings: "popupSettings", tabindex: "tabindex", tabIndex: "tabIndex" }, outputs: { open: "open", close: "close" }, host: { listeners: { "focus": "onFocus($event)", "focusout": "onFocusOut($event)" }, properties: { "class.k-widget": "this.hostClasses", "class.k-toolbar": "this.hostClasses", "attr.role": "this.getRole", "attr.dir": "this.getDir", "class.k-toolbar-resizable": "this.resizableClass" } }, providers: [
1148
+ ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarComponent, selector: "kendo-toolbar", inputs: { overflow: "overflow", resizable: "resizable", popupSettings: "popupSettings", tabindex: "tabindex", tabIndex: "tabIndex" }, outputs: { open: "open", close: "close" }, host: { listeners: { "focus": "onFocus($event)", "focusout": "onFocusOut($event)" }, properties: { "class.k-widget": "this.hostClasses", "class.k-toolbar": "this.hostClasses", "attr.role": "this.role", "attr.dir": "this.getDir", "class.k-toolbar-resizable": "this.resizableClass" } }, providers: [
1106
1149
  RefreshService,
1107
1150
  NavigationService,
1108
1151
  LocalizationService,
@@ -1131,19 +1174,26 @@ ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
1131
1174
  tabindex="-1"
1132
1175
  [title]="moreToolsTitle"
1133
1176
  [attr.aria-label]="moreToolsTitle"
1177
+ [attr.aria-expanded]="popupOpen"
1178
+ [id]="overflowBtnId"
1179
+ aria-haspopup="menu"
1134
1180
  *ngIf="overflow"
1135
1181
  [style.visibility]="'hidden'"
1136
1182
  [style.position]="'relative'"
1137
1183
  [style.margin-inline-start]="'auto'"
1138
- class="k-overflow-anchor k-button"
1184
+ class="k-overflow-anchor k-button k-button-flat"
1139
1185
  (click)="showPopup()"
1140
1186
  >
1141
1187
  <span class="k-icon k-i-more-vertical"></span>
1142
1188
  </button>
1143
1189
  <ng-template #popupTemplate>
1144
- <ul class="k-overflow-container k-list-container k-reset">
1190
+ <ul
1191
+ class="k-overflow-container k-list-container k-reset"
1192
+ role="menu"
1193
+ [id]="popupId"
1194
+ [attr.aria-labelledby]="overflowBtnId">
1145
1195
  <ng-container *ngFor="let tool of allTools; let index = index">
1146
- <li class="k-item">
1196
+ <li class="k-item" role="menuitem">
1147
1197
  <kendo-toolbar-renderer
1148
1198
  #overflowRenderer
1149
1199
  (rendererClick)="onRendererClick($event)"
@@ -1193,19 +1243,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1193
1243
  tabindex="-1"
1194
1244
  [title]="moreToolsTitle"
1195
1245
  [attr.aria-label]="moreToolsTitle"
1246
+ [attr.aria-expanded]="popupOpen"
1247
+ [id]="overflowBtnId"
1248
+ aria-haspopup="menu"
1196
1249
  *ngIf="overflow"
1197
1250
  [style.visibility]="'hidden'"
1198
1251
  [style.position]="'relative'"
1199
1252
  [style.margin-inline-start]="'auto'"
1200
- class="k-overflow-anchor k-button"
1253
+ class="k-overflow-anchor k-button k-button-flat"
1201
1254
  (click)="showPopup()"
1202
1255
  >
1203
1256
  <span class="k-icon k-i-more-vertical"></span>
1204
1257
  </button>
1205
1258
  <ng-template #popupTemplate>
1206
- <ul class="k-overflow-container k-list-container k-reset">
1259
+ <ul
1260
+ class="k-overflow-container k-list-container k-reset"
1261
+ role="menu"
1262
+ [id]="popupId"
1263
+ [attr.aria-labelledby]="overflowBtnId">
1207
1264
  <ng-container *ngFor="let tool of allTools; let index = index">
1208
- <li class="k-item">
1265
+ <li class="k-item" role="menuitem">
1209
1266
  <kendo-toolbar-renderer
1210
1267
  #overflowRenderer
1211
1268
  (rendererClick)="onRendererClick($event)"
@@ -1269,7 +1326,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1269
1326
  }], onFocusOut: [{
1270
1327
  type: HostListener,
1271
1328
  args: ['focusout', ['$event']]
1272
- }], getRole: [{
1329
+ }], role: [{
1273
1330
  type: HostBinding,
1274
1331
  args: ['attr.role']
1275
1332
  }], getDir: [{
@@ -1700,9 +1757,10 @@ class ToolBarButtonGroupComponent extends ToolBarToolComponent {
1700
1757
  return this.overflows ? this.overflowButtonGroup : this.toolbarButtonGroup;
1701
1758
  }
1702
1759
  focusButton(index, ev) {
1760
+ var _a;
1703
1761
  // Guard against focusing twice on mousedown.
1704
1762
  if (!ev.type || ev.type === 'focus' || ev.type === 'keydown') {
1705
- this.buttonElements[index].focus();
1763
+ (_a = this.buttonElements[index]) === null || _a === void 0 ? void 0 : _a.focus();
1706
1764
  }
1707
1765
  }
1708
1766
  }
@@ -1771,7 +1829,7 @@ ToolBarButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
1771
1829
  </span>
1772
1830
  </kendo-buttongroup>
1773
1831
  </ng-template>
1774
- `, isInline: true, components: [{ type: i1$1.ButtonGroupComponent, selector: "kendo-buttongroup", inputs: ["disabled", "selection", "width", "tabIndex"], outputs: ["navigate"], exportAs: ["kendoButtonGroup"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.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: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1832
+ `, isInline: true, components: [{ type: i1$1.ButtonGroupComponent, selector: "kendo-buttongroup", inputs: ["disabled", "selection", "width", "tabIndex", "navigable"], outputs: ["navigate"], exportAs: ["kendoButtonGroup"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.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: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1775
1833
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarButtonGroupComponent, decorators: [{
1776
1834
  type: Component,
1777
1835
  args: [{
@@ -1962,11 +2020,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
1962
2020
  class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
1963
2021
  constructor() {
1964
2022
  super();
1965
- // showText and showIcon showIcon should be declared first
1966
- /**
1967
- * Defines the location of the button text that will be displayed.
1968
- */
1969
- this.showText = 'both';
1970
2023
  /**
1971
2024
  * Defines the location of the button icon that will be displayed.
1972
2025
  */
@@ -2031,16 +2084,21 @@ class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
2031
2084
  };
2032
2085
  this._popupSettings = { animate: true, popupClass: '' };
2033
2086
  this.focusedIndex = -1;
2087
+ this._showText = 'both';
2034
2088
  this.getNextKey = getNextKey();
2035
2089
  this.getPrevKey = getPrevKey();
2036
2090
  }
2091
+ // showText and showIcon showIcon should be declared first
2037
2092
  /**
2038
- * Sets the text of the DropDownButton
2039
- * ([see example]({% slug controltypes_toolbar %}#toc-dropdownbuttons).
2093
+ * Defines the location of the button text that will be displayed.
2040
2094
  */
2041
- set text(text) {
2042
- this.toolbarOptions.text = getValueForLocation(text, this.showText, false);
2043
- this.overflowOptions.text = getValueForLocation(text, this.showText, true);
2095
+ set showText(value) {
2096
+ this._showText = value;
2097
+ this.setTextDisplayMode();
2098
+ }
2099
+ ;
2100
+ get showText() {
2101
+ return this._showText;
2044
2102
  }
2045
2103
  /**
2046
2104
  * Defines an icon that will be rendered next to the button text.
@@ -2105,6 +2163,9 @@ class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
2105
2163
  }
2106
2164
  return this._data;
2107
2165
  }
2166
+ ngOnInit() {
2167
+ this.setTextDisplayMode();
2168
+ }
2108
2169
  get overflowButtons() {
2109
2170
  return [...this.overflowDropDownButtonButtonList.buttons.toArray().filter(b => !b.nativeElement.disabled)];
2110
2171
  }
@@ -2156,6 +2217,10 @@ class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
2156
2217
  this.overflowButtons[index].nativeElement.focus();
2157
2218
  }
2158
2219
  }
2220
+ setTextDisplayMode() {
2221
+ this.toolbarOptions.text = this.showText === 'overflow' ? undefined : this.text;
2222
+ this.overflowOptions.text = this.showText === 'toolbar' ? undefined : this.text;
2223
+ }
2159
2224
  }
2160
2225
  ToolBarDropDownButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarDropDownButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2161
2226
  ToolBarDropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarDropDownButtonComponent, selector: "kendo-toolbar-dropdownbutton", inputs: { showText: "showText", showIcon: "showIcon", text: "text", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", popupSettings: "popupSettings", look: "look", primary: "primary", fillMode: "fillMode", themeColor: "themeColor", buttonClass: "buttonClass", textField: "textField", disabled: "disabled", data: "data" }, outputs: { itemClick: "itemClick", open: "open", close: "close" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarDropDownButtonComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "dropdownButton", first: true, predicate: ["dropdownButton"], descendants: true, read: ElementRef, static: true }, { propertyName: "dropDownButtonComponent", first: true, predicate: DropDownButtonComponent, descendants: true }, { propertyName: "toolbarDropDownButton", first: true, predicate: ["toolbarDropDownButton"], descendants: true }, { propertyName: "overflowDropDownButtonButtonList", first: true, predicate: ["overflowDropDownButtonButtonList"], descendants: true }], exportAs: ["kendoToolBarDropDownButton"], usesInheritance: true, ngImport: i0, template: `
@@ -2205,7 +2270,7 @@ ToolBarDropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
2205
2270
  >
2206
2271
  </kendo-toolbar-buttonlist>
2207
2272
  </ng-template>
2208
- `, isInline: true, components: [{ type: i1$1.DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: ["icon", "iconClass", "imageUrl", "popupSettings", "textField", "disabled", "data", "size", "rounded", "fillMode", "themeColor", "buttonClass", "tabIndex"], outputs: ["itemClick", "open", "close", "focus", "blur"], exportAs: ["kendoDropDownButton"] }, { type: ToolBarButtonListComponent, selector: "kendo-toolbar-buttonlist", inputs: ["data", "textField", "disabled", "fillMode", "themeColor"], outputs: ["itemClick"] }], directives: [{ type: i1$1.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: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2273
+ `, isInline: true, components: [{ type: i1$1.DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: ["icon", "iconClass", "imageUrl", "textField", "data", "size", "rounded", "fillMode", "themeColor"], outputs: ["itemClick", "focus", "blur"], exportAs: ["kendoDropDownButton"] }, { type: ToolBarButtonListComponent, selector: "kendo-toolbar-buttonlist", inputs: ["data", "textField", "disabled", "fillMode", "themeColor"], outputs: ["itemClick"] }], directives: [{ type: i1$1.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: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
2209
2274
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarDropDownButtonComponent, decorators: [{
2210
2275
  type: Component,
2211
2276
  args: [{
@@ -2323,11 +2388,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
2323
2388
  class ToolBarSplitButtonComponent extends ToolBarToolComponent {
2324
2389
  constructor() {
2325
2390
  super();
2326
- // showText and showIcon showIcon should be declared first
2327
- /**
2328
- * Specifies where button text should be displayed
2329
- */
2330
- this.showText = 'both';
2331
2391
  /**
2332
2392
  * Specifies where button icon should be displayed
2333
2393
  */
@@ -2404,15 +2464,21 @@ class ToolBarSplitButtonComponent extends ToolBarToolComponent {
2404
2464
  };
2405
2465
  this._popupSettings = { animate: true, popupClass: '' };
2406
2466
  this.focusedIndex = -1;
2467
+ this._showText = 'both';
2407
2468
  this.getNextKey = getNextKey();
2408
2469
  this.getPrevKey = getPrevKey();
2409
2470
  }
2471
+ // showText and showIcon showIcon should be declared first
2410
2472
  /**
2411
- * Sets the text of the SplitButton ([see example]({% slug controltypes_toolbar %}#toc-splitbuttons).
2473
+ * Specifies where button text should be displayed
2412
2474
  */
2413
- set text(text) {
2414
- this.toolbarOptions.text = getValueForLocation(text, this.showText, false);
2415
- this.overflowOptions.text = getValueForLocation(text, this.showText, true);
2475
+ set showText(value) {
2476
+ this._showText = value;
2477
+ this.setTextDisplayMode();
2478
+ }
2479
+ ;
2480
+ get showText() {
2481
+ return this._showText;
2416
2482
  }
2417
2483
  /**
2418
2484
  * Defines the icon that will be rendered next to the button text
@@ -2474,6 +2540,9 @@ class ToolBarSplitButtonComponent extends ToolBarToolComponent {
2474
2540
  }
2475
2541
  return this._data;
2476
2542
  }
2543
+ ngOnInit() {
2544
+ this.setTextDisplayMode();
2545
+ }
2477
2546
  get overflowButtons() {
2478
2547
  return [this.overflowSplitButton, ...this.overflowSplitButtonButtonList.buttons.toArray().filter(b => !b.nativeElement.disabled)];
2479
2548
  }
@@ -2530,6 +2599,10 @@ class ToolBarSplitButtonComponent extends ToolBarToolComponent {
2530
2599
  this.overflowButtons[index].nativeElement.focus();
2531
2600
  }
2532
2601
  }
2602
+ setTextDisplayMode() {
2603
+ this.toolbarOptions.text = this.showText === 'overflow' ? undefined : this.text;
2604
+ this.overflowOptions.text = this.showText === 'toolbar' ? undefined : this.text;
2605
+ }
2533
2606
  }
2534
2607
  ToolBarSplitButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarSplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2535
2608
  ToolBarSplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarSplitButtonComponent, selector: "kendo-toolbar-splitbutton", inputs: { showText: "showText", showIcon: "showIcon", text: "text", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", disabled: "disabled", popupSettings: "popupSettings", fillMode: "fillMode", themeColor: "themeColor", look: "look", buttonClass: "buttonClass", arrowButtonClass: "arrowButtonClass", arrowButtonIcon: "arrowButtonIcon", textField: "textField", data: "data" }, outputs: { buttonClick: "buttonClick", itemClick: "itemClick", open: "open", close: "close" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarSplitButtonComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "toolbarSplitButton", first: true, predicate: ["toolbarSplitButton"], descendants: true }, { propertyName: "overflowSplitButton", first: true, predicate: ["overflowSplitButton"], descendants: true, read: ElementRef }, { propertyName: "overflowSplitButtonButtonList", first: true, predicate: ["overflowSplitButtonButtonList"], descendants: true }], exportAs: ["kendoToolBarSplitButton"], usesInheritance: true, ngImport: i0, template: `
@@ -25,6 +25,7 @@ export declare class NavigationService {
25
25
  focusPrev(ev: KeyboardEvent): void;
26
26
  resetNavigation(): void;
27
27
  focusFirst(ev: Event): void;
28
+ focusLast(ev: Event): void;
28
29
  private getFocusableTools;
29
30
  private focus;
30
31
  private blurOverflowButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-toolbar",
3
- "version": "6.1.0",
3
+ "version": "6.1.1-dev.202210270918",
4
4
  "description": "Kendo UI Angular Toolbar component - a single UI element that organizes buttons and other navigation elements",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -92,7 +92,7 @@ export declare class ToolBarComponent {
92
92
  * @hidden
93
93
  */
94
94
  onFocusOut(event: any): void;
95
- get getRole(): string;
95
+ role: string;
96
96
  get getDir(): string;
97
97
  get resizableClass(): boolean;
98
98
  constructor(localization: LocalizationService, popupService: PopupService, refreshService: RefreshService, navigationService: NavigationService, element: ElementRef, zone: NgZone, renderer: Renderer2, _cdr: ChangeDetectorRef);
@@ -132,6 +132,14 @@ export declare class ToolBarComponent {
132
132
  * @hidden
133
133
  */
134
134
  onPopupClose(): void;
135
+ /**
136
+ * @hidden
137
+ */
138
+ overflowBtnId: string;
139
+ /**
140
+ * @hidden
141
+ */
142
+ popupId: string;
135
143
  private displayAnchor;
136
144
  private get popupWidth();
137
145
  private get popupHeight();
@@ -2,7 +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 { ElementRef, TemplateRef, EventEmitter } from '@angular/core';
5
+ import { ElementRef, TemplateRef, EventEmitter, OnInit } from '@angular/core';
6
6
  import { ToolBarToolComponent } from './toolbar-tool.component';
7
7
  import { PopupSettings } from '../popup-settings';
8
8
  import { ButtonFillMode, ButtonThemeColor, DropDownButtonComponent } from '@progress/kendo-angular-buttons';
@@ -13,11 +13,12 @@ import * as i0 from "@angular/core";
13
13
  /**
14
14
  * Represents the [Kendo UI ToolBar DropDownButton for Angular]({% slug controltypes_toolbar %}#toc-dropdownbuttons).
15
15
  */
16
- export declare class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
16
+ export declare class ToolBarDropDownButtonComponent extends ToolBarToolComponent implements OnInit {
17
17
  /**
18
18
  * Defines the location of the button text that will be displayed.
19
19
  */
20
- showText: DisplayMode;
20
+ set showText(value: DisplayMode);
21
+ get showText(): DisplayMode;
21
22
  /**
22
23
  * Defines the location of the button icon that will be displayed.
23
24
  */
@@ -26,7 +27,7 @@ export declare class ToolBarDropDownButtonComponent extends ToolBarToolComponent
26
27
  * Sets the text of the DropDownButton
27
28
  * ([see example]({% slug controltypes_toolbar %}#toc-dropdownbuttons).
28
29
  */
29
- set text(text: string);
30
+ text: string;
30
31
  /**
31
32
  * Defines an icon that will be rendered next to the button text.
32
33
  */
@@ -130,12 +131,14 @@ export declare class ToolBarDropDownButtonComponent extends ToolBarToolComponent
130
131
  dropDownButtonComponent: DropDownButtonComponent;
131
132
  toolbarOptions: ToolOptions;
132
133
  overflowOptions: ToolOptions;
134
+ ngOnInit(): void;
133
135
  private get overflowButtons();
134
136
  private toolbarDropDownButton;
135
137
  private overflowDropDownButtonButtonList;
136
138
  private _data;
137
139
  private _popupSettings;
138
140
  private focusedIndex;
141
+ private _showText;
139
142
  private getNextKey;
140
143
  private getPrevKey;
141
144
  constructor();
@@ -156,6 +159,7 @@ export declare class ToolBarDropDownButtonComponent extends ToolBarToolComponent
156
159
  */
157
160
  handleKey(ev: any): boolean;
158
161
  private focusButton;
162
+ private setTextDisplayMode;
159
163
  static ɵfac: i0.ɵɵFactoryDeclaration<ToolBarDropDownButtonComponent, never>;
160
164
  static ɵcmp: i0.ɵɵComponentDeclaration<ToolBarDropDownButtonComponent, "kendo-toolbar-dropdownbutton", ["kendoToolBarDropDownButton"], { "showText": "showText"; "showIcon": "showIcon"; "text": "text"; "icon": "icon"; "iconClass": "iconClass"; "imageUrl": "imageUrl"; "popupSettings": "popupSettings"; "look": "look"; "primary": "primary"; "fillMode": "fillMode"; "themeColor": "themeColor"; "buttonClass": "buttonClass"; "textField": "textField"; "disabled": "disabled"; "data": "data"; }, { "itemClick": "itemClick"; "open": "open"; "close": "close"; }, never, never>;
161
165
  }
@@ -2,7 +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 { TemplateRef, EventEmitter } from '@angular/core';
5
+ import { TemplateRef, EventEmitter, OnInit } from '@angular/core';
6
6
  import { ButtonFillMode, ButtonThemeColor } from '@progress/kendo-angular-buttons';
7
7
  import { ToolBarToolComponent } from './toolbar-tool.component';
8
8
  import { PopupSettings } from '../popup-settings';
@@ -13,11 +13,12 @@ import * as i0 from "@angular/core";
13
13
  /**
14
14
  * Represents the [Kendo UI ToolBar SplitButton for Angular]({% slug controltypes_toolbar %}#toc-splitbuttons).
15
15
  */
16
- export declare class ToolBarSplitButtonComponent extends ToolBarToolComponent {
16
+ export declare class ToolBarSplitButtonComponent extends ToolBarToolComponent implements OnInit {
17
17
  /**
18
18
  * Specifies where button text should be displayed
19
19
  */
20
- showText: DisplayMode;
20
+ set showText(value: DisplayMode);
21
+ get showText(): DisplayMode;
21
22
  /**
22
23
  * Specifies where button icon should be displayed
23
24
  */
@@ -25,7 +26,7 @@ export declare class ToolBarSplitButtonComponent extends ToolBarToolComponent {
25
26
  /**
26
27
  * Sets the text of the SplitButton ([see example]({% slug controltypes_toolbar %}#toc-splitbuttons).
27
28
  */
28
- set text(text: string);
29
+ text: string;
29
30
  /**
30
31
  * Defines the icon that will be rendered next to the button text
31
32
  * ([see example]({% slug controltypes_toolbar %}#toc-splitbuttons)).
@@ -135,10 +136,12 @@ export declare class ToolBarSplitButtonComponent extends ToolBarToolComponent {
135
136
  popupTemplate: TemplateRef<any>;
136
137
  toolbarOptions: ToolOptions;
137
138
  overflowOptions: ToolOptions;
139
+ ngOnInit(): void;
138
140
  private get overflowButtons();
139
141
  private _data;
140
142
  private _popupSettings;
141
143
  private focusedIndex;
144
+ private _showText;
142
145
  private getNextKey;
143
146
  private getPrevKey;
144
147
  private toolbarSplitButton;
@@ -166,6 +169,7 @@ export declare class ToolBarSplitButtonComponent extends ToolBarToolComponent {
166
169
  */
167
170
  handleKey(ev: any): boolean;
168
171
  private focusButton;
172
+ private setTextDisplayMode;
169
173
  static ɵfac: i0.ɵɵFactoryDeclaration<ToolBarSplitButtonComponent, never>;
170
174
  static ɵcmp: i0.ɵɵComponentDeclaration<ToolBarSplitButtonComponent, "kendo-toolbar-splitbutton", ["kendoToolBarSplitButton"], { "showText": "showText"; "showIcon": "showIcon"; "text": "text"; "icon": "icon"; "iconClass": "iconClass"; "imageUrl": "imageUrl"; "disabled": "disabled"; "popupSettings": "popupSettings"; "fillMode": "fillMode"; "themeColor": "themeColor"; "look": "look"; "buttonClass": "buttonClass"; "arrowButtonClass": "arrowButtonClass"; "arrowButtonIcon": "arrowButtonIcon"; "textField": "textField"; "data": "data"; }, { "buttonClick": "buttonClick"; "itemClick": "itemClick"; "open": "open"; "close": "close"; }, never, never>;
171
175
  }