@progress/kendo-angular-toolbar 11.0.0-develop.99 → 11.0.1-develop.1

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.
@@ -2,14 +2,13 @@
2
2
  * Copyright © 2023 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 { Component, ElementRef, TemplateRef, forwardRef, ViewChild, Input, EventEmitter, Output } from '@angular/core';
5
+ import { Component, ElementRef, TemplateRef, forwardRef, ViewChild, Input, EventEmitter, Output, QueryList, ViewChildren } from '@angular/core';
6
6
  import { ToolBarToolComponent } from './toolbar-tool.component';
7
7
  import { DropDownButtonComponent } from '@progress/kendo-angular-buttons';
8
- import { ToolBarButtonListComponent } from './toolbar-buttonlist.component';
9
8
  import { getValueForLocation, makePeeker, getIndexOfFocused, getPrevKey, getNextKey, seekFocusedIndex, areEqual } from '../util';
10
9
  import * as i0 from "@angular/core";
11
10
  import * as i1 from "@progress/kendo-angular-buttons";
12
- import * as i2 from "./toolbar-buttonlist.component";
11
+ import * as i2 from "@progress/kendo-angular-icons";
13
12
  import * as i3 from "@angular/common";
14
13
  /**
15
14
  * Represents the [Kendo UI ToolBar DropDownButton for Angular]({% slug controltypes_toolbar %}#toc-dropdownbuttons).
@@ -71,12 +70,14 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
71
70
  text: '',
72
71
  icon: '',
73
72
  iconClass: '',
73
+ svgIcon: null,
74
74
  imageUrl: ''
75
75
  };
76
76
  this.overflowOptions = {
77
77
  text: '',
78
78
  icon: '',
79
79
  iconClass: '',
80
+ svgIcon: null,
80
81
  imageUrl: ''
81
82
  };
82
83
  this._popupSettings = { animate: true, popupClass: '' };
@@ -164,13 +165,13 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
164
165
  this.setTextDisplayMode();
165
166
  }
166
167
  get overflowButtons() {
167
- return [...this.overflowDropDownButtonButtonList.buttons.toArray().filter(b => !b.nativeElement.disabled)];
168
+ return [...this.overflowListItems.toArray().filter(el => !el.nativeElement.classList.contains('k-disabled'))];
168
169
  }
169
170
  /**
170
171
  * @hidden
171
172
  */
172
173
  onButtonListClick(ev) {
173
- this.focusedIndex = this.overflowDropDownButtonButtonList.buttons
174
+ this.focusedIndex = this.overflowListItems
174
175
  .toArray()
175
176
  .findIndex(b => b.nativeElement.contains(ev.target));
176
177
  }
@@ -209,6 +210,26 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
209
210
  return !isUnmodified(this.focusedIndex);
210
211
  }
211
212
  }
213
+ /**
214
+ * @hidden
215
+ */
216
+ getText(dataItem) {
217
+ if (dataItem) {
218
+ return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
219
+ }
220
+ return undefined;
221
+ }
222
+ /**
223
+ * @hidden
224
+ */
225
+ handleClick(ev, item, index) {
226
+ this.onButtonListClick(ev);
227
+ const dataItem = this.data[index];
228
+ if (item.click) {
229
+ item.click(dataItem);
230
+ }
231
+ this.itemClick.emit(dataItem);
232
+ }
212
233
  focusButton(index, ev) {
213
234
  if (!ev.type || ev.type === 'focus' || ev.type === 'keydown') {
214
235
  this.overflowButtons[index].nativeElement.focus();
@@ -220,12 +241,14 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
220
241
  }
221
242
  }
222
243
  ToolBarDropDownButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarDropDownButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
223
- ToolBarDropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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: `
244
+ ToolBarDropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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: "overflowListItems", predicate: ["listItem"], descendants: true }], exportAs: ["kendoToolBarDropDownButton"], usesInheritance: true, ngImport: i0, template: `
224
245
  <ng-template #toolbarTemplate>
225
246
  <kendo-dropdownbutton
226
247
  #toolbarDropDownButton
248
+ class="k-toolbar-menu-button"
227
249
  [icon]="toolbarOptions.icon"
228
250
  [iconClass]="toolbarOptions.iconClass"
251
+ [svgIcon]="toolbarOptions.svgIcon"
229
252
  [imageUrl]="toolbarOptions.imageUrl"
230
253
  [buttonClass]="buttonClass"
231
254
  [disabled]="disabled"
@@ -243,31 +266,45 @@ ToolBarDropDownButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
243
266
  </kendo-dropdownbutton>
244
267
  </ng-template>
245
268
  <ng-template #popupTemplate>
246
- <button
247
- type="button"
269
+ <div
248
270
  tabindex="-1"
249
- kendoButton
250
- class="k-overflow-button"
251
- [disabled]="true"
252
- [icon]="overflowOptions.icon"
253
- [iconClass]="overflowOptions.iconClass"
254
- [imageUrl]="overflowOptions.imageUrl"
255
- [ngClass]="buttonClass"
256
- (click)="itemClick.emit($event)"
257
- >
258
- {{ overflowOptions.text }}
259
- </button>
260
- <kendo-toolbar-buttonlist
261
- #overflowDropDownButtonButtonList
262
- [data]="data"
263
- [disabled]="disabled"
264
- [textField]="textField"
265
- (itemClick)="itemClick.emit($event)"
266
- (click)="onButtonListClick($event)"
267
- >
268
- </kendo-toolbar-buttonlist>
271
+ role="menuitem"
272
+ class="k-item k-menu-item k-disabled"
273
+ [ngClass]="buttonClass">
274
+ <span
275
+ [ngClass]="{'k-link': true, 'k-menu-link': true}"
276
+ >
277
+ <kendo-icon-wrapper
278
+ *ngIf="overflowOptions.icon || overflowOptions.iconClass || overflowOptions.svgIcon"
279
+ [name]="overflowOptions.icon"
280
+ [customFontClass]="overflowOptions.iconClass"
281
+ [svgIcon]="overflowOptions.svgIcon"
282
+ ></kendo-icon-wrapper>
283
+ <span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
284
+ </span>
285
+ </div>
286
+ <ng-container *ngFor="let item of data; let i = index">
287
+ <div #listItem
288
+ tabindex="-1"
289
+ role="menuitem"
290
+ class="k-item k-menu-item"
291
+ [class.k-disabled]="disabled || item.disabled"
292
+ (click)="handleClick($event, item, i)">
293
+ <span
294
+ class="k-link k-menu-link"
295
+ >
296
+ <kendo-icon-wrapper
297
+ *ngIf="item.icon || item.iconClass || item.svgIcon"
298
+ [name]="item.icon"
299
+ [customFontClass]="item.iconClass"
300
+ [svgIcon]="item.svgIcon"
301
+ ></kendo-icon-wrapper>
302
+ <span *ngIf="getText(item)" class="k-menu-link-text">{{ getText(item) }}</span>
303
+ </span>
304
+ </div>
305
+ </ng-container>
269
306
  </ng-template>
270
- `, isInline: true, components: [{ type: i1.DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: ["icon", "svgIcon", "iconClass", "imageUrl", "textField", "data", "size", "rounded", "fillMode", "themeColor"], outputs: ["itemClick", "focus", "blur"], exportAs: ["kendoDropDownButton"] }, { type: i1.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"] }, { type: i2.ToolBarButtonListComponent, selector: "kendo-toolbar-buttonlist", inputs: ["data", "textField", "disabled", "fillMode", "themeColor"], outputs: ["itemClick"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
307
+ `, isInline: true, components: [{ type: i1.DropDownButtonComponent, selector: "kendo-dropdownbutton", inputs: ["icon", "svgIcon", "iconClass", "imageUrl", "textField", "data", "size", "rounded", "fillMode", "themeColor"], outputs: ["itemClick", "focus", "blur"], exportAs: ["kendoDropDownButton"] }, { type: i2.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
271
308
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarDropDownButtonComponent, decorators: [{
272
309
  type: Component,
273
310
  args: [{
@@ -278,8 +315,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
278
315
  <ng-template #toolbarTemplate>
279
316
  <kendo-dropdownbutton
280
317
  #toolbarDropDownButton
318
+ class="k-toolbar-menu-button"
281
319
  [icon]="toolbarOptions.icon"
282
320
  [iconClass]="toolbarOptions.iconClass"
321
+ [svgIcon]="toolbarOptions.svgIcon"
283
322
  [imageUrl]="toolbarOptions.imageUrl"
284
323
  [buttonClass]="buttonClass"
285
324
  [disabled]="disabled"
@@ -297,29 +336,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
297
336
  </kendo-dropdownbutton>
298
337
  </ng-template>
299
338
  <ng-template #popupTemplate>
300
- <button
301
- type="button"
339
+ <div
302
340
  tabindex="-1"
303
- kendoButton
304
- class="k-overflow-button"
305
- [disabled]="true"
306
- [icon]="overflowOptions.icon"
307
- [iconClass]="overflowOptions.iconClass"
308
- [imageUrl]="overflowOptions.imageUrl"
309
- [ngClass]="buttonClass"
310
- (click)="itemClick.emit($event)"
311
- >
312
- {{ overflowOptions.text }}
313
- </button>
314
- <kendo-toolbar-buttonlist
315
- #overflowDropDownButtonButtonList
316
- [data]="data"
317
- [disabled]="disabled"
318
- [textField]="textField"
319
- (itemClick)="itemClick.emit($event)"
320
- (click)="onButtonListClick($event)"
321
- >
322
- </kendo-toolbar-buttonlist>
341
+ role="menuitem"
342
+ class="k-item k-menu-item k-disabled"
343
+ [ngClass]="buttonClass">
344
+ <span
345
+ [ngClass]="{'k-link': true, 'k-menu-link': true}"
346
+ >
347
+ <kendo-icon-wrapper
348
+ *ngIf="overflowOptions.icon || overflowOptions.iconClass || overflowOptions.svgIcon"
349
+ [name]="overflowOptions.icon"
350
+ [customFontClass]="overflowOptions.iconClass"
351
+ [svgIcon]="overflowOptions.svgIcon"
352
+ ></kendo-icon-wrapper>
353
+ <span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
354
+ </span>
355
+ </div>
356
+ <ng-container *ngFor="let item of data; let i = index">
357
+ <div #listItem
358
+ tabindex="-1"
359
+ role="menuitem"
360
+ class="k-item k-menu-item"
361
+ [class.k-disabled]="disabled || item.disabled"
362
+ (click)="handleClick($event, item, i)">
363
+ <span
364
+ class="k-link k-menu-link"
365
+ >
366
+ <kendo-icon-wrapper
367
+ *ngIf="item.icon || item.iconClass || item.svgIcon"
368
+ [name]="item.icon"
369
+ [customFontClass]="item.iconClass"
370
+ [svgIcon]="item.svgIcon"
371
+ ></kendo-icon-wrapper>
372
+ <span *ngIf="getText(item)" class="k-menu-link-text">{{ getText(item) }}</span>
373
+ </span>
374
+ </div>
375
+ </ng-container>
323
376
  </ng-template>
324
377
  `
325
378
  }]
@@ -371,10 +424,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
371
424
  }], dropDownButtonComponent: [{
372
425
  type: ViewChild,
373
426
  args: [DropDownButtonComponent, { static: false }]
427
+ }], overflowListItems: [{
428
+ type: ViewChildren,
429
+ args: ['listItem']
374
430
  }], toolbarDropDownButton: [{
375
431
  type: ViewChild,
376
432
  args: ['toolbarDropDownButton', { static: false }]
377
- }], overflowDropDownButtonButtonList: [{
378
- type: ViewChild,
379
- args: ['overflowDropDownButtonButtonList', { static: false }]
380
433
  }] } });
@@ -43,6 +43,12 @@ ToolBarSeparatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
43
43
  <ng-template #toolbarTemplate>
44
44
  <div class="k-separator"></div>
45
45
  </ng-template>
46
+
47
+ <ng-template #popupTemplate>
48
+ <div class="k-item k-menu-item">
49
+ <div class="k-separator k-separator-horizontal"></div>
50
+ </div>
51
+ </ng-template>
46
52
  `, isInline: true });
47
53
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarSeparatorComponent, decorators: [{
48
54
  type: Component,
@@ -54,6 +60,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
54
60
  <ng-template #toolbarTemplate>
55
61
  <div class="k-separator"></div>
56
62
  </ng-template>
63
+
64
+ <ng-template #popupTemplate>
65
+ <div class="k-item k-menu-item">
66
+ <div class="k-separator k-separator-horizontal"></div>
67
+ </div>
68
+ </ng-template>
57
69
  `
58
70
  }]
59
71
  }], ctorParameters: function () { return []; }, propDecorators: { toolbarTemplate: [{
@@ -2,14 +2,13 @@
2
2
  * Copyright © 2023 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 { Component, TemplateRef, forwardRef, ViewChild, Input, ElementRef, Output, EventEmitter } from '@angular/core';
5
+ import { Component, TemplateRef, forwardRef, ViewChild, Input, ElementRef, Output, EventEmitter, ViewChildren, QueryList } from '@angular/core';
6
6
  import { SplitButtonComponent } from '@progress/kendo-angular-buttons';
7
7
  import { ToolBarToolComponent } from './toolbar-tool.component';
8
- import { ToolBarButtonListComponent } from './toolbar-buttonlist.component';
9
8
  import { getValueForLocation, makePeeker, getIndexOfFocused, getPrevKey, getNextKey, seekFocusedIndex, areEqual } from '../util';
10
9
  import * as i0 from "@angular/core";
11
10
  import * as i1 from "@progress/kendo-angular-buttons";
12
- import * as i2 from "./toolbar-buttonlist.component";
11
+ import * as i2 from "@progress/kendo-angular-icons";
13
12
  import * as i3 from "@angular/common";
14
13
  /**
15
14
  * Represents the [Kendo UI ToolBar SplitButton for Angular]({% slug controltypes_toolbar %}#toc-splitbuttons).
@@ -83,12 +82,14 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
83
82
  text: '',
84
83
  icon: '',
85
84
  iconClass: '',
85
+ svgIcon: null,
86
86
  imageUrl: ''
87
87
  };
88
88
  this.overflowOptions = {
89
89
  text: '',
90
90
  icon: '',
91
91
  iconClass: '',
92
+ svgIcon: null,
92
93
  imageUrl: ''
93
94
  };
94
95
  this._popupSettings = { animate: true, popupClass: '' };
@@ -173,7 +174,7 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
173
174
  this.setTextDisplayMode();
174
175
  }
175
176
  get overflowButtons() {
176
- return [this.overflowSplitButton, ...this.overflowSplitButtonButtonList.buttons.toArray().filter(b => !b.nativeElement.disabled)];
177
+ return [this.overflowMainButton, ...this.overflowListItems.toArray().filter(el => !el.nativeElement.classList.contains('k-disabled'))];
177
178
  }
178
179
  /**
179
180
  * @hidden
@@ -223,6 +224,26 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
223
224
  return !isUnmodified(this.focusedIndex);
224
225
  }
225
226
  }
227
+ /**
228
+ * @hidden
229
+ */
230
+ getText(dataItem) {
231
+ if (dataItem) {
232
+ return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
233
+ }
234
+ return undefined;
235
+ }
236
+ /**
237
+ * @hidden
238
+ */
239
+ handleClick(ev, item, index) {
240
+ this.onButtonListClick(ev);
241
+ const dataItem = this.data[index];
242
+ if (item.click) {
243
+ item.click(dataItem);
244
+ }
245
+ this.itemClick.emit(dataItem);
246
+ }
226
247
  focusButton(index, ev) {
227
248
  if (!ev.type || ev.type === 'focus' || ev.type === 'keydown' || ev.type === 'click') {
228
249
  this.overflowButtons[index].nativeElement.focus();
@@ -234,14 +255,16 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
234
255
  }
235
256
  }
236
257
  ToolBarSplitButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarSplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
237
- ToolBarSplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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: `
258
+ ToolBarSplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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: "overflowMainButton", first: true, predicate: ["overflowMainButton"], descendants: true, read: ElementRef }, { propertyName: "overflowListItems", predicate: ["listItem"], descendants: true }], exportAs: ["kendoToolBarSplitButton"], usesInheritance: true, ngImport: i0, template: `
238
259
  <ng-template #toolbarTemplate>
239
260
  <kendo-splitbutton
240
261
  #toolbarSplitButton
262
+ class="k-toolbar-split-button"
241
263
  [data]="data"
242
264
  [text]="toolbarOptions.text"
243
265
  [icon]="toolbarOptions.icon"
244
266
  [iconClass]="toolbarOptions.iconClass"
267
+ [svgIcon]="toolbarOptions.svgIcon"
245
268
  [imageUrl]="toolbarOptions.imageUrl"
246
269
  [buttonClass]="buttonClass"
247
270
  [arrowButtonClass]="arrowButtonClass"
@@ -260,36 +283,49 @@ ToolBarSplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
260
283
  </kendo-splitbutton>
261
284
  </ng-template>
262
285
  <ng-template #popupTemplate>
263
- <button
264
- #overflowSplitButton
265
- type="button"
286
+ <div #overflowMainButton
266
287
  tabindex="-1"
267
- [fillMode]="fillMode"
268
- [themeColor]="fillMode ? themeColor : null"
269
- kendoButton
270
- class="k-overflow-button"
271
- [disabled]="disabled"
272
- [icon]="overflowOptions.icon"
273
- [iconClass]="overflowOptions.iconClass"
274
- [imageUrl]="overflowOptions.imageUrl"
288
+ role="menuitem"
289
+ class="k-item k-menu-item"
290
+ [class.k-disabled]="disabled"
275
291
  [ngClass]="buttonClass"
276
- (click)="onMainButtonClick($event)"
277
- >
278
- {{ overflowOptions.text }}
279
- </button>
280
- <kendo-toolbar-buttonlist
281
- #overflowSplitButtonButtonList
282
- [data]="data"
283
- [disabled]="disabled"
284
- [fillMode]="fillMode"
285
- [themeColor]="fillMode ? themeColor : null"
286
- [textField]="textField"
287
- (itemClick)="itemClick.emit($event)"
288
- (click)="onButtonListClick($event)"
289
- >
290
- </kendo-toolbar-buttonlist>
292
+ (click)="onMainButtonClick($event)">
293
+ <span
294
+ [ngClass]="{'k-link': true, 'k-menu-link': true}"
295
+ >
296
+ <kendo-icon-wrapper
297
+ *ngIf="overflowOptions.icon || overflowOptions.iconClass || overflowOptions.svgIcon"
298
+ [name]="overflowOptions.icon"
299
+ [customFontClass]="overflowOptions.iconClass"
300
+ [svgIcon]="overflowOptions.svgIcon"
301
+ >
302
+ </kendo-icon-wrapper>
303
+ <span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
304
+ </span>
305
+ </div>
306
+ <ng-container *ngFor="let item of data; let i = index">
307
+ <div #listItem
308
+ tabindex="-1"
309
+ role="menuitem"
310
+ class="k-item k-menu-item"
311
+ [class.k-disabled]="disabled || item.disabled"
312
+ (click)="handleClick($event, item, i)">
313
+ <span
314
+ class="k-link k-menu-link"
315
+ >
316
+ <kendo-icon-wrapper
317
+ *ngIf="item.icon || item.iconClass || item.svgIcon"
318
+ [name]="item.icon"
319
+ [customFontClass]="item.iconClass"
320
+ [svgIcon]="item.svgIcon"
321
+ >
322
+ </kendo-icon-wrapper>
323
+ <span *ngIf="getText(item)" class="k-menu-link-text">{{ getText(item) }}</span>
324
+ </span>
325
+ </div>
326
+ </ng-container>
291
327
  </ng-template>
292
- `, isInline: true, components: [{ type: i1.SplitButtonComponent, selector: "kendo-splitbutton", inputs: ["text", "icon", "svgIcon", "iconClass", "type", "imageUrl", "size", "rounded", "fillMode", "themeColor", "disabled", "popupSettings", "tabIndex", "textField", "data", "buttonClass", "arrowButtonClass", "arrowButtonIcon", "arrowButtonSvgIcon"], outputs: ["buttonClick", "itemClick", "focus", "blur", "open", "close"], exportAs: ["kendoSplitButton"] }, { type: i1.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"] }, { type: i2.ToolBarButtonListComponent, selector: "kendo-toolbar-buttonlist", inputs: ["data", "textField", "disabled", "fillMode", "themeColor"], outputs: ["itemClick"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
328
+ `, isInline: true, components: [{ type: i1.SplitButtonComponent, selector: "kendo-splitbutton", inputs: ["text", "icon", "svgIcon", "iconClass", "type", "imageUrl", "size", "rounded", "fillMode", "themeColor", "disabled", "popupSettings", "tabIndex", "textField", "data", "buttonClass", "arrowButtonClass", "arrowButtonIcon", "arrowButtonSvgIcon"], outputs: ["buttonClick", "itemClick", "focus", "blur", "open", "close"], exportAs: ["kendoSplitButton"] }, { type: i2.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
293
329
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarSplitButtonComponent, decorators: [{
294
330
  type: Component,
295
331
  args: [{
@@ -300,10 +336,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
300
336
  <ng-template #toolbarTemplate>
301
337
  <kendo-splitbutton
302
338
  #toolbarSplitButton
339
+ class="k-toolbar-split-button"
303
340
  [data]="data"
304
341
  [text]="toolbarOptions.text"
305
342
  [icon]="toolbarOptions.icon"
306
343
  [iconClass]="toolbarOptions.iconClass"
344
+ [svgIcon]="toolbarOptions.svgIcon"
307
345
  [imageUrl]="toolbarOptions.imageUrl"
308
346
  [buttonClass]="buttonClass"
309
347
  [arrowButtonClass]="arrowButtonClass"
@@ -322,34 +360,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
322
360
  </kendo-splitbutton>
323
361
  </ng-template>
324
362
  <ng-template #popupTemplate>
325
- <button
326
- #overflowSplitButton
327
- type="button"
363
+ <div #overflowMainButton
328
364
  tabindex="-1"
329
- [fillMode]="fillMode"
330
- [themeColor]="fillMode ? themeColor : null"
331
- kendoButton
332
- class="k-overflow-button"
333
- [disabled]="disabled"
334
- [icon]="overflowOptions.icon"
335
- [iconClass]="overflowOptions.iconClass"
336
- [imageUrl]="overflowOptions.imageUrl"
365
+ role="menuitem"
366
+ class="k-item k-menu-item"
367
+ [class.k-disabled]="disabled"
337
368
  [ngClass]="buttonClass"
338
- (click)="onMainButtonClick($event)"
339
- >
340
- {{ overflowOptions.text }}
341
- </button>
342
- <kendo-toolbar-buttonlist
343
- #overflowSplitButtonButtonList
344
- [data]="data"
345
- [disabled]="disabled"
346
- [fillMode]="fillMode"
347
- [themeColor]="fillMode ? themeColor : null"
348
- [textField]="textField"
349
- (itemClick)="itemClick.emit($event)"
350
- (click)="onButtonListClick($event)"
351
- >
352
- </kendo-toolbar-buttonlist>
369
+ (click)="onMainButtonClick($event)">
370
+ <span
371
+ [ngClass]="{'k-link': true, 'k-menu-link': true}"
372
+ >
373
+ <kendo-icon-wrapper
374
+ *ngIf="overflowOptions.icon || overflowOptions.iconClass || overflowOptions.svgIcon"
375
+ [name]="overflowOptions.icon"
376
+ [customFontClass]="overflowOptions.iconClass"
377
+ [svgIcon]="overflowOptions.svgIcon"
378
+ >
379
+ </kendo-icon-wrapper>
380
+ <span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
381
+ </span>
382
+ </div>
383
+ <ng-container *ngFor="let item of data; let i = index">
384
+ <div #listItem
385
+ tabindex="-1"
386
+ role="menuitem"
387
+ class="k-item k-menu-item"
388
+ [class.k-disabled]="disabled || item.disabled"
389
+ (click)="handleClick($event, item, i)">
390
+ <span
391
+ class="k-link k-menu-link"
392
+ >
393
+ <kendo-icon-wrapper
394
+ *ngIf="item.icon || item.iconClass || item.svgIcon"
395
+ [name]="item.icon"
396
+ [customFontClass]="item.iconClass"
397
+ [svgIcon]="item.svgIcon"
398
+ >
399
+ </kendo-icon-wrapper>
400
+ <span *ngIf="getText(item)" class="k-menu-link-text">{{ getText(item) }}</span>
401
+ </span>
402
+ </div>
403
+ </ng-container>
353
404
  </ng-template>
354
405
  `
355
406
  }]
@@ -402,10 +453,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
402
453
  }], toolbarSplitButton: [{
403
454
  type: ViewChild,
404
455
  args: ['toolbarSplitButton', { static: false }]
405
- }], overflowSplitButton: [{
406
- type: ViewChild,
407
- args: ['overflowSplitButton', { read: ElementRef, static: false }]
408
- }], overflowSplitButtonButtonList: [{
456
+ }], overflowMainButton: [{
409
457
  type: ViewChild,
410
- args: ['overflowSplitButtonButtonList', { static: false }]
458
+ args: ['overflowMainButton', { read: ElementRef }]
459
+ }], overflowListItems: [{
460
+ type: ViewChildren,
461
+ args: ['listItem']
411
462
  }] } });
package/esm2020/util.mjs CHANGED
@@ -185,3 +185,27 @@ export const getValueForLocation = (property, displayMode, overflows) => {
185
185
  return property;
186
186
  }
187
187
  };
188
+ /**
189
+ * @hidden
190
+ */
191
+ export const SIZES = {
192
+ small: 'sm',
193
+ medium: 'md',
194
+ large: 'lg'
195
+ };
196
+ /**
197
+ * @hidden
198
+ *
199
+ * Returns the styling classes to be added and removed
200
+ */
201
+ export const getStylingClasses = (componentType, stylingOption, previousValue, newValue) => {
202
+ switch (stylingOption) {
203
+ case 'size':
204
+ return {
205
+ toRemove: `k-${componentType}-${SIZES[previousValue]}`,
206
+ toAdd: newValue !== 'none' ? `k-${componentType}-${SIZES[newValue]}` : ''
207
+ };
208
+ default:
209
+ break;
210
+ }
211
+ };