@progress/kendo-angular-toolbar 11.0.0-develop.102 → 11.0.0-develop.103
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/common/{constants.d.ts → size.d.ts} +3 -2
- package/esm2020/common/{constants.mjs → size.mjs} +1 -4
- package/esm2020/package-metadata.mjs +1 -1
- package/esm2020/renderer.component.mjs +5 -1
- package/esm2020/toolbar.component.mjs +88 -27
- package/esm2020/tools/toolbar-button.component.mjs +69 -44
- package/esm2020/tools/toolbar-buttongroup.component.mjs +82 -69
- package/esm2020/tools/toolbar-dropdownbutton.component.mjs +100 -55
- package/esm2020/tools/toolbar-separator.component.mjs +12 -0
- package/esm2020/tools/toolbar-splitbutton.component.mjs +103 -64
- package/esm2020/util.mjs +24 -0
- package/fesm2015/progress-kendo-angular-toolbar.mjs +569 -345
- package/fesm2020/progress-kendo-angular-toolbar.mjs +568 -345
- package/index.d.ts +1 -0
- package/package.json +6 -6
- package/renderer.component.d.ts +1 -0
- package/toolbar.component.d.ts +18 -2
- package/tools/toolbar-button.component.d.ts +18 -1
- package/tools/toolbar-buttongroup.component.d.ts +15 -4
- package/tools/toolbar-dropdownbutton.component.d.ts +14 -2
- package/tools/toolbar-splitbutton.component.d.ts +15 -3
- package/util.d.ts +21 -0
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Represents the possible size options of the Toolbar.
|
|
7
|
+
* @default `medium`
|
|
7
8
|
*/
|
|
8
|
-
export declare
|
|
9
|
+
export declare type ToolbarSize = 'small' | 'medium' | 'large' | 'none';
|
|
@@ -2,7 +2,4 @@
|
|
|
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
|
-
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export const defaultPopupWidth = '150px';
|
|
5
|
+
export {};
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-toolbar',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1673523460,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
15
15
|
};
|
|
@@ -22,6 +22,7 @@ export class ToolBarRendererComponent {
|
|
|
22
22
|
this.rendererService = rendererService;
|
|
23
23
|
this.refreshService = refreshService;
|
|
24
24
|
this.rendererClick = new EventEmitter();
|
|
25
|
+
this.hostClass = true;
|
|
25
26
|
this.rendererService.element = element;
|
|
26
27
|
this.rendererService.renderer = this;
|
|
27
28
|
this.refreshSubscription = this.refreshService.onRefresh.subscribe((tool) => {
|
|
@@ -103,7 +104,7 @@ export class ToolBarRendererComponent {
|
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
ToolBarRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarRendererComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.RendererService }, { token: i2.RefreshService }], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
-
ToolBarRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ToolBarRendererComponent, selector: "kendo-toolbar-renderer", inputs: { tool: "tool", location: "location", resizable: "resizable" }, outputs: { rendererClick: "rendererClick" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.k-spacer": "this.spacerClass" } }, providers: [RendererService], exportAs: ["kendoToolBarRenderer"], ngImport: i0, template: `
|
|
107
|
+
ToolBarRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ToolBarRendererComponent, selector: "kendo-toolbar-renderer", inputs: { tool: "tool", location: "location", resizable: "resizable" }, outputs: { rendererClick: "rendererClick" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.k-spacer": "this.spacerClass", "class.k-toolbar-renderer": "this.hostClass" } }, providers: [RendererService], exportAs: ["kendoToolBarRenderer"], ngImport: i0, template: `
|
|
107
108
|
<ng-container *ngIf="location === 'toolbar'">
|
|
108
109
|
<ng-template [ngTemplateOutlet]="template"></ng-template>
|
|
109
110
|
</ng-container>
|
|
@@ -137,6 +138,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
137
138
|
}], spacerClass: [{
|
|
138
139
|
type: HostBinding,
|
|
139
140
|
args: ['class.k-spacer']
|
|
141
|
+
}], hostClass: [{
|
|
142
|
+
type: HostBinding,
|
|
143
|
+
args: ['class.k-toolbar-renderer']
|
|
140
144
|
}], onClick: [{
|
|
141
145
|
type: HostListener,
|
|
142
146
|
args: ['click', ['$event']]
|
|
@@ -11,14 +11,13 @@ import { packageMetadata } from './package-metadata';
|
|
|
11
11
|
import { RefreshService } from './refresh.service';
|
|
12
12
|
import { NavigationService } from './navigation.service';
|
|
13
13
|
import { ToolBarToolComponent } from './tools/toolbar-tool.component';
|
|
14
|
-
import { innerWidth, closest, isPresent } from './util';
|
|
14
|
+
import { innerWidth, closest, isPresent, getStylingClasses, SIZES } from './util';
|
|
15
15
|
import { Keys } from '@progress/kendo-angular-common';
|
|
16
16
|
import { PreventableEvent } from './common/preventable-event';
|
|
17
17
|
import { Subscription, fromEvent, Subject, merge } from 'rxjs';
|
|
18
18
|
import { takeUntil } from 'rxjs/operators';
|
|
19
19
|
import { filter } from 'rxjs/operators';
|
|
20
20
|
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
21
|
-
import { defaultPopupWidth } from './common/constants';
|
|
22
21
|
import * as i0 from "@angular/core";
|
|
23
22
|
import * as i1 from "@progress/kendo-angular-l10n";
|
|
24
23
|
import * as i2 from "@progress/kendo-angular-popup";
|
|
@@ -28,6 +27,7 @@ import * as i5 from "./renderer.component";
|
|
|
28
27
|
import * as i6 from "@progress/kendo-angular-common";
|
|
29
28
|
import * as i7 from "./localization/localized-toolbar-messages.directive";
|
|
30
29
|
import * as i8 from "@angular/common";
|
|
30
|
+
const DEFAULT_SIZE = 'medium';
|
|
31
31
|
const getInitialPopupSettings = (isRtl) => ({
|
|
32
32
|
animate: true,
|
|
33
33
|
anchorAlign: { horizontal: isRtl ? 'left' : 'right', vertical: 'bottom' },
|
|
@@ -62,8 +62,9 @@ export class ToolBarComponent {
|
|
|
62
62
|
* Fires when the overflow popup of the ToolBar is closed.
|
|
63
63
|
*/
|
|
64
64
|
this.close = new EventEmitter();
|
|
65
|
-
this.
|
|
65
|
+
this.hostClass = true;
|
|
66
66
|
this.cancelRenderedToolsSubscription$ = new Subject();
|
|
67
|
+
this._size = DEFAULT_SIZE;
|
|
67
68
|
this.subscriptions = new Subscription();
|
|
68
69
|
this.popupSubs = new Subscription();
|
|
69
70
|
this.role = 'toolbar';
|
|
@@ -78,6 +79,9 @@ export class ToolBarComponent {
|
|
|
78
79
|
validatePackage(packageMetadata);
|
|
79
80
|
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
80
81
|
}
|
|
82
|
+
get overflowClass() {
|
|
83
|
+
return `k-button-${SIZES[this.size]}`;
|
|
84
|
+
}
|
|
81
85
|
/**
|
|
82
86
|
* @hidden
|
|
83
87
|
*/
|
|
@@ -100,6 +104,23 @@ export class ToolBarComponent {
|
|
|
100
104
|
get popupSettings() {
|
|
101
105
|
return this._popupSettings || getInitialPopupSettings(this.localization.rtl);
|
|
102
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Specifies the padding of all Toolbar elements.
|
|
109
|
+
*
|
|
110
|
+
* The possible values are:
|
|
111
|
+
* * `small`
|
|
112
|
+
* * `medium` (default)
|
|
113
|
+
* * `large`
|
|
114
|
+
* * `none`
|
|
115
|
+
*/
|
|
116
|
+
set size(size) {
|
|
117
|
+
const newSize = size ? size : DEFAULT_SIZE;
|
|
118
|
+
this.handleClasses(newSize, 'size');
|
|
119
|
+
this._size = newSize;
|
|
120
|
+
}
|
|
121
|
+
get size() {
|
|
122
|
+
return this._size;
|
|
123
|
+
}
|
|
103
124
|
/**
|
|
104
125
|
* @hidden
|
|
105
126
|
*/
|
|
@@ -221,6 +242,7 @@ export class ToolBarComponent {
|
|
|
221
242
|
}
|
|
222
243
|
this.navigationService.setRenderedTools(this.renderedTools.toArray());
|
|
223
244
|
this.subscriptions.add(this.renderedTools.changes.subscribe((rts) => this.navigationService.setRenderedTools(rts.toArray())));
|
|
245
|
+
this.handleClasses(this.size, 'size');
|
|
224
246
|
}
|
|
225
247
|
ngOnInit() {
|
|
226
248
|
this.subscriptions.add(this.localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr')));
|
|
@@ -291,7 +313,7 @@ export class ToolBarComponent {
|
|
|
291
313
|
content: this.popupTemplate,
|
|
292
314
|
appendTo: this.appendTo,
|
|
293
315
|
animate: this.popupSettings.animate,
|
|
294
|
-
popupClass: this.popupSettings.popupClass,
|
|
316
|
+
popupClass: this.normalizePopupClasses(this.popupSettings.popupClass),
|
|
295
317
|
positionMode: 'absolute'
|
|
296
318
|
});
|
|
297
319
|
this.setPopupContentDimensions();
|
|
@@ -308,7 +330,10 @@ export class ToolBarComponent {
|
|
|
308
330
|
this.shrink(containerWidth, this.childrenWidth);
|
|
309
331
|
this.stretch(containerWidth, this.childrenWidth);
|
|
310
332
|
this.displayAnchor();
|
|
311
|
-
this.resizeSensor
|
|
333
|
+
this.resizeSensor?.acceptSize();
|
|
334
|
+
if (this.popupOpen) {
|
|
335
|
+
this.toggle();
|
|
336
|
+
}
|
|
312
337
|
}
|
|
313
338
|
}
|
|
314
339
|
/**
|
|
@@ -317,6 +342,7 @@ export class ToolBarComponent {
|
|
|
317
342
|
onPopupOpen() {
|
|
318
343
|
this.zone.runOutsideAngular(() => {
|
|
319
344
|
this.overflowKeydownListener = this.renderer.listen(this.popupRef.popupElement, 'keydown', (ev) => {
|
|
345
|
+
const currentTool = this.overflowRenderedTools.toArray().find(tool => closest(ev.target, (el) => el === tool.element.nativeElement));
|
|
320
346
|
switch (ev.keyCode) {
|
|
321
347
|
case Keys.ArrowUp:
|
|
322
348
|
this.zone.run(() => {
|
|
@@ -339,6 +365,16 @@ export class ToolBarComponent {
|
|
|
339
365
|
this.navigationService.resetNavigation();
|
|
340
366
|
});
|
|
341
367
|
break;
|
|
368
|
+
case Keys.Enter:
|
|
369
|
+
case Keys.Space:
|
|
370
|
+
this.zone.run(() => {
|
|
371
|
+
if (currentTool) {
|
|
372
|
+
ev.preventDefault();
|
|
373
|
+
ev.target.click();
|
|
374
|
+
ev.target.focus();
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
break;
|
|
342
378
|
default:
|
|
343
379
|
break;
|
|
344
380
|
}
|
|
@@ -369,11 +405,11 @@ export class ToolBarComponent {
|
|
|
369
405
|
}
|
|
370
406
|
displayAnchor() {
|
|
371
407
|
const visibility = this.allTools.filter(t => t.overflows && t.responsive).length > 0 ? 'visible' : 'hidden';
|
|
372
|
-
this.renderer.setStyle(this.overflowButton.nativeElement, 'visibility', visibility);
|
|
408
|
+
this.overflowButton && this.renderer.setStyle(this.overflowButton.nativeElement, 'visibility', visibility);
|
|
373
409
|
}
|
|
374
410
|
get popupWidth() {
|
|
375
411
|
if (!this.popupSettings || !this.popupSettings.width) {
|
|
376
|
-
return
|
|
412
|
+
return 'auto';
|
|
377
413
|
}
|
|
378
414
|
return isNaN(this.popupSettings.width) ? this.popupSettings.width : `${this.popupSettings.width}px`;
|
|
379
415
|
}
|
|
@@ -481,9 +517,37 @@ export class ToolBarComponent {
|
|
|
481
517
|
this.popupRef = null;
|
|
482
518
|
}
|
|
483
519
|
}
|
|
520
|
+
handleClasses(value, input) {
|
|
521
|
+
const elem = this.element.nativeElement;
|
|
522
|
+
const classes = getStylingClasses('toolbar', input, this[input], value);
|
|
523
|
+
if (classes.toRemove) {
|
|
524
|
+
this.renderer.removeClass(elem, classes.toRemove);
|
|
525
|
+
}
|
|
526
|
+
if (classes.toAdd) {
|
|
527
|
+
this.renderer.addClass(elem, classes.toAdd);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
normalizePopupClasses(classList) {
|
|
531
|
+
let classes = ['k-menu-popup', 'k-toolbar-popup'];
|
|
532
|
+
if (!classList) {
|
|
533
|
+
return classes;
|
|
534
|
+
}
|
|
535
|
+
if (typeof classList === 'string') {
|
|
536
|
+
classes.push(...classList.split(' '));
|
|
537
|
+
}
|
|
538
|
+
else if (Array.isArray(classList)) {
|
|
539
|
+
classes = [...classes, ...classList];
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
for (const cl in classList) {
|
|
543
|
+
classes.push(classList[cl]);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
return classes;
|
|
547
|
+
}
|
|
484
548
|
}
|
|
485
549
|
ToolBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarComponent, deps: [{ token: i1.LocalizationService }, { token: i2.PopupService }, { token: i3.RefreshService }, { token: i4.NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
486
|
-
ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", 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-
|
|
550
|
+
ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ToolBarComponent, selector: "kendo-toolbar", inputs: { overflow: "overflow", resizable: "resizable", popupSettings: "popupSettings", tabindex: "tabindex", size: "size", tabIndex: "tabIndex" }, outputs: { open: "open", close: "close" }, host: { listeners: { "focus": "onFocus($event)", "focusout": "onFocusOut($event)" }, properties: { "class.k-toolbar": "this.hostClass", "attr.role": "this.role", "attr.dir": "this.getDir", "class.k-toolbar-resizable": "this.resizableClass" } }, providers: [
|
|
487
551
|
RefreshService,
|
|
488
552
|
NavigationService,
|
|
489
553
|
LocalizationService,
|
|
@@ -519,19 +583,19 @@ ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
519
583
|
[style.visibility]="'hidden'"
|
|
520
584
|
[style.position]="'relative'"
|
|
521
585
|
[style.margin-inline-start]="'auto'"
|
|
522
|
-
class="k-overflow-
|
|
586
|
+
class="k-toolbar-overflow-button k-button k-button-flat k-button-flat-base k-icon-button"
|
|
587
|
+
[ngClass]="overflowClass"
|
|
523
588
|
(click)="showPopup()"
|
|
524
589
|
>
|
|
525
|
-
<span class="k-icon k-i-more-vertical"></span>
|
|
590
|
+
<span class="k-button-icon k-icon k-i-more-vertical"></span>
|
|
526
591
|
</button>
|
|
527
592
|
<ng-template #popupTemplate>
|
|
528
|
-
<
|
|
529
|
-
class="k-
|
|
593
|
+
<div
|
|
594
|
+
class="k-menu-group k-menu-group-md"
|
|
530
595
|
role="menu"
|
|
531
596
|
[id]="popupId"
|
|
532
597
|
[attr.aria-labelledby]="overflowBtnId">
|
|
533
598
|
<ng-container *ngFor="let tool of allTools; let index = index">
|
|
534
|
-
<li class="k-item" role="menuitem">
|
|
535
599
|
<kendo-toolbar-renderer
|
|
536
600
|
#overflowRenderer
|
|
537
601
|
(rendererClick)="onRendererClick($event)"
|
|
@@ -539,13 +603,12 @@ ToolBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
539
603
|
[resizable]="overflow"
|
|
540
604
|
[tool]="tool"
|
|
541
605
|
></kendo-toolbar-renderer>
|
|
542
|
-
</li>
|
|
543
606
|
</ng-container>
|
|
544
|
-
</
|
|
607
|
+
</div>
|
|
545
608
|
</ng-template>
|
|
546
609
|
<ng-container #container></ng-container>
|
|
547
610
|
<kendo-resize-sensor *ngIf="overflow" #resizeSensor></kendo-resize-sensor>
|
|
548
|
-
`, isInline: true, components: [{ type: i5.ToolBarRendererComponent, selector: "kendo-toolbar-renderer", inputs: ["tool", "location", "resizable"], outputs: ["rendererClick"], exportAs: ["kendoToolBarRenderer"] }, { type: i6.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }], directives: [{ type: i7.LocalizedToolbarMessagesDirective, selector: "[kendoToolbarLocalizedMessages]" }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
611
|
+
`, isInline: true, components: [{ type: i5.ToolBarRendererComponent, selector: "kendo-toolbar-renderer", inputs: ["tool", "location", "resizable"], outputs: ["rendererClick"], exportAs: ["kendoToolBarRenderer"] }, { type: i6.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }], directives: [{ type: i7.LocalizedToolbarMessagesDirective, selector: "[kendoToolbarLocalizedMessages]" }, { type: i8.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
549
612
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarComponent, decorators: [{
|
|
550
613
|
type: Component,
|
|
551
614
|
args: [{
|
|
@@ -588,19 +651,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
588
651
|
[style.visibility]="'hidden'"
|
|
589
652
|
[style.position]="'relative'"
|
|
590
653
|
[style.margin-inline-start]="'auto'"
|
|
591
|
-
class="k-overflow-
|
|
654
|
+
class="k-toolbar-overflow-button k-button k-button-flat k-button-flat-base k-icon-button"
|
|
655
|
+
[ngClass]="overflowClass"
|
|
592
656
|
(click)="showPopup()"
|
|
593
657
|
>
|
|
594
|
-
<span class="k-icon k-i-more-vertical"></span>
|
|
658
|
+
<span class="k-button-icon k-icon k-i-more-vertical"></span>
|
|
595
659
|
</button>
|
|
596
660
|
<ng-template #popupTemplate>
|
|
597
|
-
<
|
|
598
|
-
class="k-
|
|
661
|
+
<div
|
|
662
|
+
class="k-menu-group k-menu-group-md"
|
|
599
663
|
role="menu"
|
|
600
664
|
[id]="popupId"
|
|
601
665
|
[attr.aria-labelledby]="overflowBtnId">
|
|
602
666
|
<ng-container *ngFor="let tool of allTools; let index = index">
|
|
603
|
-
<li class="k-item" role="menuitem">
|
|
604
667
|
<kendo-toolbar-renderer
|
|
605
668
|
#overflowRenderer
|
|
606
669
|
(rendererClick)="onRendererClick($event)"
|
|
@@ -608,9 +671,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
608
671
|
[resizable]="overflow"
|
|
609
672
|
[tool]="tool"
|
|
610
673
|
></kendo-toolbar-renderer>
|
|
611
|
-
</li>
|
|
612
674
|
</ng-container>
|
|
613
|
-
</
|
|
675
|
+
</div>
|
|
614
676
|
</ng-template>
|
|
615
677
|
<ng-container #container></ng-container>
|
|
616
678
|
<kendo-resize-sensor *ngIf="overflow" #resizeSensor></kendo-resize-sensor>
|
|
@@ -624,6 +686,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
624
686
|
type: Input
|
|
625
687
|
}], tabindex: [{
|
|
626
688
|
type: Input
|
|
689
|
+
}], size: [{
|
|
690
|
+
type: Input
|
|
627
691
|
}], tabIndex: [{
|
|
628
692
|
type: Input,
|
|
629
693
|
args: ['tabIndex']
|
|
@@ -652,10 +716,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
652
716
|
}], overflowRenderedTools: [{
|
|
653
717
|
type: ViewChildren,
|
|
654
718
|
args: ['overflowRenderer']
|
|
655
|
-
}],
|
|
656
|
-
type: HostBinding,
|
|
657
|
-
args: ['class.k-widget']
|
|
658
|
-
}, {
|
|
719
|
+
}], hostClass: [{
|
|
659
720
|
type: HostBinding,
|
|
660
721
|
args: ['class.k-toolbar']
|
|
661
722
|
}], onFocus: [{
|
|
@@ -12,8 +12,9 @@ import * as i2 from "@angular/common";
|
|
|
12
12
|
* Represents the [Kendo UI ToolBar Button tool for Angular]({% slug controltypes_toolbar %}#toc-buttons).
|
|
13
13
|
*/
|
|
14
14
|
export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
15
|
-
constructor() {
|
|
15
|
+
constructor(element) {
|
|
16
16
|
super();
|
|
17
|
+
this.element = element;
|
|
17
18
|
/**
|
|
18
19
|
* Specifies where button icon should be displayed
|
|
19
20
|
*/
|
|
@@ -172,6 +173,40 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
172
173
|
this.getButton().tabIndex = -1;
|
|
173
174
|
return false;
|
|
174
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* @hidden
|
|
178
|
+
*/
|
|
179
|
+
get toolbarButtonClass() {
|
|
180
|
+
return this.toggleable ? 'k-toolbar-toggle-button' : 'k-toolbar-button';
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* @hidden
|
|
184
|
+
*/
|
|
185
|
+
handleClick(ev) {
|
|
186
|
+
this.click.emit(ev);
|
|
187
|
+
if (this.toggleable) {
|
|
188
|
+
this.selected = !this.selected;
|
|
189
|
+
this.selectedChange.emit(this.selected);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* @hidden
|
|
194
|
+
*/
|
|
195
|
+
getIconClasses() {
|
|
196
|
+
if (this.overflowOptions.icon) {
|
|
197
|
+
return `k-icon k-i-${this.overflowOptions.icon}`;
|
|
198
|
+
}
|
|
199
|
+
else if (this.overflowOptions.iconClass) {
|
|
200
|
+
return this.overflowOptions.iconClass;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* @hidden
|
|
205
|
+
*/
|
|
206
|
+
selectedChangeHandler(state) {
|
|
207
|
+
this.selected = state;
|
|
208
|
+
this.selectedChange.emit(state);
|
|
209
|
+
}
|
|
175
210
|
getButton() {
|
|
176
211
|
return (this.overflows ? this.overflowButtonElement : this.toolbarButtonElement).nativeElement;
|
|
177
212
|
}
|
|
@@ -180,11 +215,12 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
180
215
|
this.overflowOptions.text = this.showText === 'toolbar' ? undefined : this.text;
|
|
181
216
|
}
|
|
182
217
|
}
|
|
183
|
-
ToolBarButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
218
|
+
ToolBarButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarButtonComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
184
219
|
ToolBarButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ToolBarButtonComponent, selector: "kendo-toolbar-button", inputs: { showText: "showText", showIcon: "showIcon", text: "text", style: "style", className: "className", title: "title", disabled: "disabled", toggleable: "toggleable", look: "look", togglable: "togglable", selected: "selected", fillMode: "fillMode", themeColor: "themeColor", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl" }, outputs: { click: "click", pointerdown: "pointerdown", selectedChange: "selectedChange" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarButtonComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "toolbarButtonElement", first: true, predicate: ["toolbarButton"], descendants: true, read: ElementRef }, { propertyName: "overflowButtonElement", first: true, predicate: ["overflowButton"], descendants: true, read: ElementRef }], exportAs: ["kendoToolBarButton"], usesInheritance: true, ngImport: i0, template: `
|
|
185
220
|
<ng-template #toolbarTemplate>
|
|
186
221
|
<button
|
|
187
222
|
#toolbarButton
|
|
223
|
+
[class]="toolbarButtonClass"
|
|
188
224
|
[tabindex]="tabIndex"
|
|
189
225
|
type="button"
|
|
190
226
|
kendoButton
|
|
@@ -201,37 +237,31 @@ ToolBarButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
201
237
|
[imageUrl]="toolbarOptions.imageUrl"
|
|
202
238
|
(click)="click.emit($event)"
|
|
203
239
|
(pointerdown)="pointerdown.emit($event)"
|
|
204
|
-
(selectedChange)="
|
|
240
|
+
(selectedChange)="selectedChangeHandler($event)"
|
|
205
241
|
(blur)="onBlur()"
|
|
206
242
|
>
|
|
207
243
|
{{ toolbarOptions.text }}
|
|
208
244
|
</button>
|
|
209
245
|
</ng-template>
|
|
210
246
|
<ng-template #popupTemplate>
|
|
211
|
-
<
|
|
247
|
+
<div
|
|
212
248
|
#overflowButton
|
|
213
249
|
tabindex="-1"
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
class
|
|
217
|
-
[ngStyle]="style"
|
|
250
|
+
role="menuitem"
|
|
251
|
+
class="k-item k-menu-item"
|
|
252
|
+
[class.k-disabled]="disabled"
|
|
218
253
|
[ngClass]="className"
|
|
219
|
-
[
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
(click)="click.emit($event)"
|
|
229
|
-
(selectedChange)="selectedChange.emit($event)"
|
|
230
|
-
>
|
|
231
|
-
{{ overflowOptions.text }}
|
|
232
|
-
</button>
|
|
254
|
+
[ngStyle]="style"
|
|
255
|
+
(click)="handleClick($event)">
|
|
256
|
+
<span
|
|
257
|
+
class="k-link k-menu-link"
|
|
258
|
+
[class.k-selected]="selected">
|
|
259
|
+
<span *ngIf="overflowOptions.icon || overflowOptions.iconClass" [ngClass]="getIconClasses()"></span>
|
|
260
|
+
<span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
|
|
261
|
+
</span>
|
|
262
|
+
</div>
|
|
233
263
|
</ng-template>
|
|
234
|
-
`, isInline: true, components: [{ 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"] }], directives: [{ type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
264
|
+
`, isInline: true, components: [{ 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"] }], directives: [{ type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
235
265
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarButtonComponent, decorators: [{
|
|
236
266
|
type: Component,
|
|
237
267
|
args: [{
|
|
@@ -242,6 +272,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
242
272
|
<ng-template #toolbarTemplate>
|
|
243
273
|
<button
|
|
244
274
|
#toolbarButton
|
|
275
|
+
[class]="toolbarButtonClass"
|
|
245
276
|
[tabindex]="tabIndex"
|
|
246
277
|
type="button"
|
|
247
278
|
kendoButton
|
|
@@ -258,39 +289,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
258
289
|
[imageUrl]="toolbarOptions.imageUrl"
|
|
259
290
|
(click)="click.emit($event)"
|
|
260
291
|
(pointerdown)="pointerdown.emit($event)"
|
|
261
|
-
(selectedChange)="
|
|
292
|
+
(selectedChange)="selectedChangeHandler($event)"
|
|
262
293
|
(blur)="onBlur()"
|
|
263
294
|
>
|
|
264
295
|
{{ toolbarOptions.text }}
|
|
265
296
|
</button>
|
|
266
297
|
</ng-template>
|
|
267
298
|
<ng-template #popupTemplate>
|
|
268
|
-
<
|
|
299
|
+
<div
|
|
269
300
|
#overflowButton
|
|
270
301
|
tabindex="-1"
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
class
|
|
274
|
-
[ngStyle]="style"
|
|
302
|
+
role="menuitem"
|
|
303
|
+
class="k-item k-menu-item"
|
|
304
|
+
[class.k-disabled]="disabled"
|
|
275
305
|
[ngClass]="className"
|
|
276
|
-
[
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
(click)="click.emit($event)"
|
|
286
|
-
(selectedChange)="selectedChange.emit($event)"
|
|
287
|
-
>
|
|
288
|
-
{{ overflowOptions.text }}
|
|
289
|
-
</button>
|
|
306
|
+
[ngStyle]="style"
|
|
307
|
+
(click)="handleClick($event)">
|
|
308
|
+
<span
|
|
309
|
+
class="k-link k-menu-link"
|
|
310
|
+
[class.k-selected]="selected">
|
|
311
|
+
<span *ngIf="overflowOptions.icon || overflowOptions.iconClass" [ngClass]="getIconClasses()"></span>
|
|
312
|
+
<span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
|
|
313
|
+
</span>
|
|
314
|
+
</div>
|
|
290
315
|
</ng-template>
|
|
291
316
|
`
|
|
292
317
|
}]
|
|
293
|
-
}], ctorParameters: function () { return []; }, propDecorators: { showText: [{
|
|
318
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { showText: [{
|
|
294
319
|
type: Input
|
|
295
320
|
}], showIcon: [{
|
|
296
321
|
type: Input
|