@progress/kendo-angular-toolbar 19.0.0-develop.30 → 19.0.0-develop.32
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/esm2022/package-metadata.mjs +2 -2
- package/esm2022/renderer.component.mjs +15 -12
- package/esm2022/toolbar.component.mjs +32 -18
- package/esm2022/tools/toolbar-button.component.mjs +155 -9
- package/esm2022/tools/toolbar-buttongroup.component.mjs +17 -3
- package/esm2022/tools/toolbar-dropdownbutton.component.mjs +24 -2
- package/esm2022/tools/toolbar-splitbutton.component.mjs +26 -15
- package/fesm2022/progress-kendo-angular-toolbar.mjs +268 -59
- package/package.json +9 -9
- package/toolbar.component.d.ts +12 -10
- package/tools/toolbar-button.component.d.ts +10 -0
- package/tools/toolbar-buttongroup.component.d.ts +7 -1
- package/tools/toolbar-dropdownbutton.component.d.ts +6 -0
- package/tools/toolbar-splitbutton.component.d.ts +6 -0
|
@@ -10,7 +10,7 @@ export const packageMetadata = {
|
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCode: 'KENDOUIANGULAR',
|
|
12
12
|
productCodes: ['KENDOUIANGULAR'],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: '19.0.0-develop.
|
|
13
|
+
publishDate: 1748002104,
|
|
14
|
+
version: '19.0.0-develop.32',
|
|
15
15
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
16
16
|
};
|
|
@@ -42,14 +42,8 @@ export class ToolBarRendererComponent {
|
|
|
42
42
|
this.viewContainer = viewContainer;
|
|
43
43
|
}
|
|
44
44
|
ngOnInit() {
|
|
45
|
-
const viewContainerRootNodes = this.viewContainer.get(0)?.rootNodes?.filter(isElementOrTextNode);
|
|
46
|
-
if (!viewContainerRootNodes || viewContainerRootNodes.length === 0) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
45
|
this.tool.location = this.location;
|
|
50
|
-
this.internalComponentRef = viewContainerRootNodes[0];
|
|
51
46
|
this.element = this.tool.element;
|
|
52
|
-
this.internalComponentRef.addEventListener('click', this.onClick);
|
|
53
47
|
this.rendererService.element = this.element;
|
|
54
48
|
this.rendererService.renderer = this;
|
|
55
49
|
this.refreshSubscription = this.refreshService.onRefresh.subscribe((tool) => {
|
|
@@ -57,6 +51,18 @@ export class ToolBarRendererComponent {
|
|
|
57
51
|
this.refresh();
|
|
58
52
|
}
|
|
59
53
|
});
|
|
54
|
+
}
|
|
55
|
+
ngOnDestroy() {
|
|
56
|
+
this.refreshSubscription?.unsubscribe();
|
|
57
|
+
this.internalComponentRef?.removeEventListener('click', this.onClick);
|
|
58
|
+
}
|
|
59
|
+
ngAfterViewInit() {
|
|
60
|
+
const viewContainerRootNodes = this.viewContainer.get(0)?.rootNodes?.filter(isElementOrTextNode);
|
|
61
|
+
if (!viewContainerRootNodes || viewContainerRootNodes.length === 0) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
this.internalComponentRef = viewContainerRootNodes[0];
|
|
65
|
+
this.internalComponentRef.addEventListener('click', this.onClick);
|
|
60
66
|
if (this.resizable) {
|
|
61
67
|
if (this.location === 'toolbar') {
|
|
62
68
|
this.template = this.tool.toolbarTemplate;
|
|
@@ -93,12 +99,6 @@ export class ToolBarRendererComponent {
|
|
|
93
99
|
this.renderer.setStyle(this.internalComponentRef, 'display', 'inline-flex');
|
|
94
100
|
}
|
|
95
101
|
}
|
|
96
|
-
}
|
|
97
|
-
ngOnDestroy() {
|
|
98
|
-
this.refreshSubscription && this.refreshSubscription.unsubscribe();
|
|
99
|
-
this.internalComponentRef && this.internalComponentRef.removeEventListener('click', this.onClick);
|
|
100
|
-
}
|
|
101
|
-
ngAfterViewInit() {
|
|
102
102
|
if (this.resizable) {
|
|
103
103
|
this.refresh();
|
|
104
104
|
}
|
|
@@ -111,6 +111,9 @@ export class ToolBarRendererComponent {
|
|
|
111
111
|
if (this.isSpacer) {
|
|
112
112
|
return MIN_SPACER_WIDTH;
|
|
113
113
|
}
|
|
114
|
+
if (!this.internalComponentRef) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
114
117
|
return this.tool.overflows ? 0 : outerWidth(this.internalComponentRef);
|
|
115
118
|
}
|
|
116
119
|
isDisplayed() {
|
|
@@ -21,7 +21,7 @@ import { take, takeUntil } from 'rxjs/operators';
|
|
|
21
21
|
import { filter } from 'rxjs/operators';
|
|
22
22
|
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
23
23
|
import { caretAltLeftIcon, caretAltRightIcon, moreHorizontalIcon, moreVerticalIcon } from '@progress/kendo-svg-icons';
|
|
24
|
-
import { ButtonComponent
|
|
24
|
+
import { ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
25
25
|
import { NgFor, NgIf, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
26
26
|
import { LocalizedToolbarMessagesDirective } from './localization/localized-toolbar-messages.directive';
|
|
27
27
|
import { ToolbarToolsService } from './tools/tools.service';
|
|
@@ -182,29 +182,31 @@ export class ToolBarComponent {
|
|
|
182
182
|
* Specifies the icons visibility for all tools in the ToolBar.
|
|
183
183
|
* This can be overridden by the `showIcon` property of each tool.
|
|
184
184
|
*/
|
|
185
|
-
showIcon
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
*/
|
|
189
|
-
get normalizedShowIcon() {
|
|
190
|
-
if (typeof this.showIcon === 'boolean') {
|
|
191
|
-
return this.showIcon ? 'always' : 'never';
|
|
185
|
+
set showIcon(value) {
|
|
186
|
+
if (this._showIcon === value) {
|
|
187
|
+
return;
|
|
192
188
|
}
|
|
193
|
-
|
|
189
|
+
const normalizedValue = this.normalizeDisplayValue(value);
|
|
190
|
+
this._showIcon = value;
|
|
191
|
+
this.propertyChange.emit({
|
|
192
|
+
property: 'showIcon',
|
|
193
|
+
value: normalizedValue
|
|
194
|
+
});
|
|
194
195
|
}
|
|
195
196
|
/**
|
|
196
197
|
* Specifies the text visibility for all tools in the ToolBar.
|
|
197
198
|
* This can be overridden by the `showText` property of each tool.
|
|
198
199
|
*/
|
|
199
|
-
showText
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
*/
|
|
203
|
-
get normalizedShowText() {
|
|
204
|
-
if (typeof this.showText === 'boolean') {
|
|
205
|
-
return this.showText ? 'always' : 'never';
|
|
200
|
+
set showText(value) {
|
|
201
|
+
if (this._showText === value) {
|
|
202
|
+
return;
|
|
206
203
|
}
|
|
207
|
-
|
|
204
|
+
const normalizedValue = this.normalizeDisplayValue(value);
|
|
205
|
+
this._showText = value;
|
|
206
|
+
this.propertyChange.emit({
|
|
207
|
+
property: 'showText',
|
|
208
|
+
value: normalizedValue
|
|
209
|
+
});
|
|
208
210
|
}
|
|
209
211
|
/**
|
|
210
212
|
* Fires when the overflow popup of the ToolBar is opened.
|
|
@@ -262,6 +264,10 @@ export class ToolBarComponent {
|
|
|
262
264
|
* @hidden
|
|
263
265
|
*/
|
|
264
266
|
nextButtonIcon = caretAltRightIcon;
|
|
267
|
+
/**
|
|
268
|
+
* @hidden
|
|
269
|
+
*/
|
|
270
|
+
propertyChange = new EventEmitter();
|
|
265
271
|
hostClass = true;
|
|
266
272
|
get scrollableClass() {
|
|
267
273
|
return this.isScrollMode;
|
|
@@ -280,6 +286,8 @@ export class ToolBarComponent {
|
|
|
280
286
|
cachedGap;
|
|
281
287
|
_size = DEFAULT_SIZE;
|
|
282
288
|
_fillMode = DEFAULT_FILL_MODE;
|
|
289
|
+
_showText = 'always';
|
|
290
|
+
_showIcon = 'always';
|
|
283
291
|
overflowButtonClickedTime = null;
|
|
284
292
|
showAutoButtons = false;
|
|
285
293
|
scrollButtonStateChangeSub;
|
|
@@ -981,6 +989,12 @@ export class ToolBarComponent {
|
|
|
981
989
|
}
|
|
982
990
|
});
|
|
983
991
|
}
|
|
992
|
+
normalizeDisplayValue(value) {
|
|
993
|
+
if (typeof value === 'boolean') {
|
|
994
|
+
return value ? 'always' : 'never';
|
|
995
|
+
}
|
|
996
|
+
return value;
|
|
997
|
+
}
|
|
984
998
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", 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 }, { token: i5.ToolbarToolsService }, { token: i6.ScrollService }], target: i0.ɵɵFactoryTarget.Component });
|
|
985
999
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ToolBarComponent, isStandalone: true, selector: "kendo-toolbar", inputs: { overflow: "overflow", resizable: "resizable", popupSettings: "popupSettings", fillMode: "fillMode", tabindex: "tabindex", size: "size", tabIndex: "tabIndex", showIcon: "showIcon", showText: "showText" }, outputs: { open: "open", close: "close" }, host: { listeners: { "focus": "onFocus($event)", "focusout": "onFocusOut($event)" }, properties: { "class.k-toolbar": "this.hostClass", "class.k-toolbar-scrollable": "this.scrollableClass", "class.k-toolbar-section": "this.sectionClass", "attr.role": "this.role", "attr.dir": "this.getDir", "class.k-toolbar-resizable": "this.resizableClass" } }, providers: [
|
|
986
1000
|
RefreshService,
|
|
@@ -1408,7 +1422,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1408
1422
|
<kendo-resize-sensor *ngIf="overflowEnabled" #resizeSensor></kendo-resize-sensor>
|
|
1409
1423
|
`,
|
|
1410
1424
|
standalone: true,
|
|
1411
|
-
imports: [NgTemplateOutlet, LocalizedToolbarMessagesDirective, NgFor, ToolBarRendererComponent, NgIf, ButtonComponent, NgClass, ResizeSensorComponent,
|
|
1425
|
+
imports: [NgTemplateOutlet, LocalizedToolbarMessagesDirective, NgFor, ToolBarRendererComponent, NgIf, ButtonComponent, NgClass, ResizeSensorComponent, ToolbarScrollableButtonComponent]
|
|
1412
1426
|
}]
|
|
1413
1427
|
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.PopupService }, { type: i3.RefreshService }, { type: i4.NavigationService }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i5.ToolbarToolsService }, { type: i6.ScrollService }]; }, propDecorators: { overflow: [{
|
|
1414
1428
|
type: Input
|
|
@@ -8,7 +8,7 @@ import { getValueForLocation } from '../util';
|
|
|
8
8
|
import { ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
9
9
|
import { take } from 'rxjs/operators';
|
|
10
10
|
import { IconWrapperComponent } from '@progress/kendo-angular-icons';
|
|
11
|
-
import { BadgeComponent } from '@progress/kendo-angular-indicators';
|
|
11
|
+
import { BadgeComponent, BadgeContainerComponent } from '@progress/kendo-angular-indicators';
|
|
12
12
|
import { NgStyle, NgClass, NgIf } from '@angular/common';
|
|
13
13
|
import { ToolBarComponent } from '../toolbar.component';
|
|
14
14
|
import * as i0 from "@angular/core";
|
|
@@ -29,7 +29,7 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
29
29
|
this.setTextDisplayMode();
|
|
30
30
|
}
|
|
31
31
|
get showText() {
|
|
32
|
-
return this._showText
|
|
32
|
+
return this._showText;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Specifies the button icon visibility.
|
|
@@ -39,7 +39,7 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
39
39
|
this.setTextDisplayMode();
|
|
40
40
|
}
|
|
41
41
|
get showIcon() {
|
|
42
|
-
return this._showIcon
|
|
42
|
+
return this._showIcon;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Specifies the text of the Button ([see example]({% slug controltypes_toolbar %}#toc-buttons)).
|
|
@@ -51,6 +51,12 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
51
51
|
get text() {
|
|
52
52
|
return this._text;
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
get size() {
|
|
58
|
+
return this.host.size;
|
|
59
|
+
}
|
|
54
60
|
/**
|
|
55
61
|
* Specifies custom inline CSS styles of the Button.
|
|
56
62
|
*/
|
|
@@ -194,6 +200,10 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
194
200
|
svgIcon: null,
|
|
195
201
|
imageUrl: ''
|
|
196
202
|
};
|
|
203
|
+
/**
|
|
204
|
+
* @hidden
|
|
205
|
+
*/
|
|
206
|
+
hasBadgeContainer = false;
|
|
197
207
|
/**
|
|
198
208
|
* @hidden
|
|
199
209
|
*/
|
|
@@ -204,16 +214,26 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
204
214
|
_showText;
|
|
205
215
|
_showIcon;
|
|
206
216
|
_text;
|
|
217
|
+
propertyChangeSub;
|
|
207
218
|
constructor(element, zone, host) {
|
|
208
219
|
super();
|
|
209
220
|
this.element = element;
|
|
210
221
|
this.zone = zone;
|
|
211
222
|
this.host = host;
|
|
212
223
|
this.isBuiltInTool = true;
|
|
224
|
+
this.propertyChangeSub = this.host.propertyChange.subscribe(change => {
|
|
225
|
+
if (change.property === 'showText' || change.property === 'showIcon') {
|
|
226
|
+
this[change.property] = change.value;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
213
229
|
}
|
|
214
230
|
ngOnInit() {
|
|
215
231
|
this.setTextDisplayMode();
|
|
216
232
|
}
|
|
233
|
+
ngOnDestroy() {
|
|
234
|
+
this.propertyChangeSub.unsubscribe();
|
|
235
|
+
this.propertyChangeSub = null;
|
|
236
|
+
}
|
|
217
237
|
/**
|
|
218
238
|
* @hidden
|
|
219
239
|
*/
|
|
@@ -275,13 +295,45 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
275
295
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolBarButtonComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
276
296
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ToolBarButtonComponent, isStandalone: true, 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", svgIcon: "svgIcon", imageUrl: "imageUrl" }, outputs: { click: "click", pointerdown: "pointerdown", selectedChange: "selectedChange" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarButtonComponent) }], viewQueries: [{ propertyName: "toolbarButtonElement", first: true, predicate: ["toolbarButton"], descendants: true, read: ElementRef }, { propertyName: "sectionButtonElement", first: true, predicate: ["sectionButton"], descendants: true, read: ElementRef }, { propertyName: "overflowButtonElement", first: true, predicate: ["overflowButton"], descendants: true, read: ElementRef }], exportAs: ["kendoToolBarButton"], usesInheritance: true, ngImport: i0, template: `
|
|
277
297
|
<ng-template #toolbarTemplate>
|
|
278
|
-
<
|
|
298
|
+
<kendo-badge-container *ngIf="hasBadgeContainer">
|
|
299
|
+
<button
|
|
300
|
+
#toolbarButton
|
|
301
|
+
[class.k-toolbar-button]="!toggleable"
|
|
302
|
+
[class.k-toolbar-toggle-button]="toggleable"
|
|
303
|
+
[tabindex]="tabIndex"
|
|
304
|
+
type="button"
|
|
305
|
+
kendoButton
|
|
306
|
+
[size]="size"
|
|
307
|
+
[ngStyle]="style"
|
|
308
|
+
[ngClass]="className"
|
|
309
|
+
[attr.title]="title"
|
|
310
|
+
[disabled]="disabled"
|
|
311
|
+
[toggleable]="toggleable"
|
|
312
|
+
[fillMode]="fillMode"
|
|
313
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
314
|
+
[selected]="selected"
|
|
315
|
+
[icon]="toolbarOptions.icon"
|
|
316
|
+
[iconClass]="toolbarOptions.iconClass"
|
|
317
|
+
[svgIcon]="toolbarOptions.svgIcon"
|
|
318
|
+
[imageUrl]="toolbarOptions.imageUrl"
|
|
319
|
+
(click)="click.emit($event)"
|
|
320
|
+
(pointerdown)="pointerdown.emit($event)"
|
|
321
|
+
(selectedChange)="selectedChangeHandler($event)"
|
|
322
|
+
(blur)="onBlur()"
|
|
323
|
+
>
|
|
324
|
+
{{ toolbarOptions.text }}
|
|
325
|
+
</button>
|
|
326
|
+
<kendo-badge *ngIf="showBadge" [cutoutBorder]="true" rounded="full"></kendo-badge>
|
|
327
|
+
</kendo-badge-container>
|
|
328
|
+
|
|
329
|
+
<button *ngIf="!hasBadgeContainer"
|
|
279
330
|
#toolbarButton
|
|
280
331
|
[class.k-toolbar-button]="!toggleable"
|
|
281
332
|
[class.k-toolbar-toggle-button]="toggleable"
|
|
282
333
|
[tabindex]="tabIndex"
|
|
283
334
|
type="button"
|
|
284
335
|
kendoButton
|
|
336
|
+
[size]="size"
|
|
285
337
|
[ngStyle]="style"
|
|
286
338
|
[ngClass]="className"
|
|
287
339
|
[attr.title]="title"
|
|
@@ -300,7 +352,6 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
300
352
|
(blur)="onBlur()"
|
|
301
353
|
>
|
|
302
354
|
{{ toolbarOptions.text }}
|
|
303
|
-
<kendo-badge *ngIf="showBadge"></kendo-badge>
|
|
304
355
|
</button>
|
|
305
356
|
</ng-template>
|
|
306
357
|
<ng-template #popupTemplate>
|
|
@@ -328,13 +379,45 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
328
379
|
</div>
|
|
329
380
|
</ng-template>
|
|
330
381
|
<ng-template #sectionTemplate>
|
|
382
|
+
<kendo-badge-container *ngIf="hasBadgeContainer">
|
|
383
|
+
<button
|
|
384
|
+
#sectionButton
|
|
385
|
+
[class.k-toolbar-button]="!toggleable"
|
|
386
|
+
[class.k-toolbar-toggle-button]="toggleable"
|
|
387
|
+
[tabindex]="tabIndex"
|
|
388
|
+
type="button"
|
|
389
|
+
kendoButton
|
|
390
|
+
[size]="size"
|
|
391
|
+
[ngStyle]="style"
|
|
392
|
+
[ngClass]="className"
|
|
393
|
+
[attr.title]="title"
|
|
394
|
+
[disabled]="disabled"
|
|
395
|
+
[toggleable]="toggleable"
|
|
396
|
+
[fillMode]="fillMode"
|
|
397
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
398
|
+
[selected]="selected"
|
|
399
|
+
[icon]="toolbarOptions.icon"
|
|
400
|
+
[iconClass]="toolbarOptions.iconClass"
|
|
401
|
+
[svgIcon]="toolbarOptions.svgIcon"
|
|
402
|
+
[imageUrl]="toolbarOptions.imageUrl"
|
|
403
|
+
(click)="click.emit($event)"
|
|
404
|
+
(pointerdown)="pointerdown.emit($event)"
|
|
405
|
+
(selectedChange)="selectedChangeHandler($event)"
|
|
406
|
+
(blur)="onBlur()"
|
|
407
|
+
>
|
|
408
|
+
{{ toolbarOptions.text }}
|
|
409
|
+
</button>
|
|
410
|
+
<kendo-badge *ngIf="showBadge" [cutoutBorder]="true" rounded="full"></kendo-badge>
|
|
411
|
+
</kendo-badge-container>
|
|
331
412
|
<button
|
|
413
|
+
*ngIf="!hasBadgeContainer"
|
|
332
414
|
#sectionButton
|
|
333
415
|
[class.k-toolbar-button]="!toggleable"
|
|
334
416
|
[class.k-toolbar-toggle-button]="toggleable"
|
|
335
417
|
[tabindex]="tabIndex"
|
|
336
418
|
type="button"
|
|
337
419
|
kendoButton
|
|
420
|
+
[size]="size"
|
|
338
421
|
[ngStyle]="style"
|
|
339
422
|
[ngClass]="className"
|
|
340
423
|
[attr.title]="title"
|
|
@@ -355,7 +438,7 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
355
438
|
{{ toolbarOptions.text }}
|
|
356
439
|
</button>
|
|
357
440
|
</ng-template>
|
|
358
|
-
`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: BadgeComponent, selector: "kendo-badge", inputs: ["align", "size", "fill", "themeColor", "rounded", "position", "cutoutBorder"] }] });
|
|
441
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "component", type: BadgeComponent, selector: "kendo-badge", inputs: ["align", "size", "fill", "themeColor", "rounded", "position", "cutoutBorder"] }, { kind: "component", type: BadgeContainerComponent, selector: "kendo-badge-container" }] });
|
|
359
442
|
}
|
|
360
443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolBarButtonComponent, decorators: [{
|
|
361
444
|
type: Component,
|
|
@@ -365,13 +448,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
365
448
|
selector: 'kendo-toolbar-button',
|
|
366
449
|
template: `
|
|
367
450
|
<ng-template #toolbarTemplate>
|
|
368
|
-
<
|
|
451
|
+
<kendo-badge-container *ngIf="hasBadgeContainer">
|
|
452
|
+
<button
|
|
453
|
+
#toolbarButton
|
|
454
|
+
[class.k-toolbar-button]="!toggleable"
|
|
455
|
+
[class.k-toolbar-toggle-button]="toggleable"
|
|
456
|
+
[tabindex]="tabIndex"
|
|
457
|
+
type="button"
|
|
458
|
+
kendoButton
|
|
459
|
+
[size]="size"
|
|
460
|
+
[ngStyle]="style"
|
|
461
|
+
[ngClass]="className"
|
|
462
|
+
[attr.title]="title"
|
|
463
|
+
[disabled]="disabled"
|
|
464
|
+
[toggleable]="toggleable"
|
|
465
|
+
[fillMode]="fillMode"
|
|
466
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
467
|
+
[selected]="selected"
|
|
468
|
+
[icon]="toolbarOptions.icon"
|
|
469
|
+
[iconClass]="toolbarOptions.iconClass"
|
|
470
|
+
[svgIcon]="toolbarOptions.svgIcon"
|
|
471
|
+
[imageUrl]="toolbarOptions.imageUrl"
|
|
472
|
+
(click)="click.emit($event)"
|
|
473
|
+
(pointerdown)="pointerdown.emit($event)"
|
|
474
|
+
(selectedChange)="selectedChangeHandler($event)"
|
|
475
|
+
(blur)="onBlur()"
|
|
476
|
+
>
|
|
477
|
+
{{ toolbarOptions.text }}
|
|
478
|
+
</button>
|
|
479
|
+
<kendo-badge *ngIf="showBadge" [cutoutBorder]="true" rounded="full"></kendo-badge>
|
|
480
|
+
</kendo-badge-container>
|
|
481
|
+
|
|
482
|
+
<button *ngIf="!hasBadgeContainer"
|
|
369
483
|
#toolbarButton
|
|
370
484
|
[class.k-toolbar-button]="!toggleable"
|
|
371
485
|
[class.k-toolbar-toggle-button]="toggleable"
|
|
372
486
|
[tabindex]="tabIndex"
|
|
373
487
|
type="button"
|
|
374
488
|
kendoButton
|
|
489
|
+
[size]="size"
|
|
375
490
|
[ngStyle]="style"
|
|
376
491
|
[ngClass]="className"
|
|
377
492
|
[attr.title]="title"
|
|
@@ -390,7 +505,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
390
505
|
(blur)="onBlur()"
|
|
391
506
|
>
|
|
392
507
|
{{ toolbarOptions.text }}
|
|
393
|
-
<kendo-badge *ngIf="showBadge"></kendo-badge>
|
|
394
508
|
</button>
|
|
395
509
|
</ng-template>
|
|
396
510
|
<ng-template #popupTemplate>
|
|
@@ -418,13 +532,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
418
532
|
</div>
|
|
419
533
|
</ng-template>
|
|
420
534
|
<ng-template #sectionTemplate>
|
|
535
|
+
<kendo-badge-container *ngIf="hasBadgeContainer">
|
|
536
|
+
<button
|
|
537
|
+
#sectionButton
|
|
538
|
+
[class.k-toolbar-button]="!toggleable"
|
|
539
|
+
[class.k-toolbar-toggle-button]="toggleable"
|
|
540
|
+
[tabindex]="tabIndex"
|
|
541
|
+
type="button"
|
|
542
|
+
kendoButton
|
|
543
|
+
[size]="size"
|
|
544
|
+
[ngStyle]="style"
|
|
545
|
+
[ngClass]="className"
|
|
546
|
+
[attr.title]="title"
|
|
547
|
+
[disabled]="disabled"
|
|
548
|
+
[toggleable]="toggleable"
|
|
549
|
+
[fillMode]="fillMode"
|
|
550
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
551
|
+
[selected]="selected"
|
|
552
|
+
[icon]="toolbarOptions.icon"
|
|
553
|
+
[iconClass]="toolbarOptions.iconClass"
|
|
554
|
+
[svgIcon]="toolbarOptions.svgIcon"
|
|
555
|
+
[imageUrl]="toolbarOptions.imageUrl"
|
|
556
|
+
(click)="click.emit($event)"
|
|
557
|
+
(pointerdown)="pointerdown.emit($event)"
|
|
558
|
+
(selectedChange)="selectedChangeHandler($event)"
|
|
559
|
+
(blur)="onBlur()"
|
|
560
|
+
>
|
|
561
|
+
{{ toolbarOptions.text }}
|
|
562
|
+
</button>
|
|
563
|
+
<kendo-badge *ngIf="showBadge" [cutoutBorder]="true" rounded="full"></kendo-badge>
|
|
564
|
+
</kendo-badge-container>
|
|
421
565
|
<button
|
|
566
|
+
*ngIf="!hasBadgeContainer"
|
|
422
567
|
#sectionButton
|
|
423
568
|
[class.k-toolbar-button]="!toggleable"
|
|
424
569
|
[class.k-toolbar-toggle-button]="toggleable"
|
|
425
570
|
[tabindex]="tabIndex"
|
|
426
571
|
type="button"
|
|
427
572
|
kendoButton
|
|
573
|
+
[size]="size"
|
|
428
574
|
[ngStyle]="style"
|
|
429
575
|
[ngClass]="className"
|
|
430
576
|
[attr.title]="title"
|
|
@@ -447,7 +593,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
447
593
|
</ng-template>
|
|
448
594
|
`,
|
|
449
595
|
standalone: true,
|
|
450
|
-
imports: [ButtonComponent, NgStyle, NgClass, NgIf, IconWrapperComponent, BadgeComponent],
|
|
596
|
+
imports: [ButtonComponent, NgStyle, NgClass, NgIf, IconWrapperComponent, BadgeComponent, BadgeContainerComponent],
|
|
451
597
|
}]
|
|
452
598
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.ToolBarComponent }]; }, propDecorators: { showText: [{
|
|
453
599
|
type: Input
|
|
@@ -10,13 +10,16 @@ import { makePeeker, getIndexOfFocused, seekFocusedIndex, getNextKey, getPrevKey
|
|
|
10
10
|
import { ButtonGroupComponent, ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
11
11
|
import { IconWrapperComponent } from '@progress/kendo-angular-icons';
|
|
12
12
|
import { NgFor, NgStyle, NgClass, NgIf } from '@angular/common';
|
|
13
|
+
import { ToolBarComponent } from '../toolbar.component';
|
|
13
14
|
import * as i0 from "@angular/core";
|
|
14
15
|
import * as i1 from "@progress/kendo-angular-l10n";
|
|
16
|
+
import * as i2 from "../toolbar.component";
|
|
15
17
|
/**
|
|
16
18
|
* Represents the Kendo UI Toolbar ButtonGroup for Angular.
|
|
17
19
|
*/
|
|
18
20
|
export class ToolBarButtonGroupComponent extends ToolBarToolComponent {
|
|
19
21
|
localization;
|
|
22
|
+
host;
|
|
20
23
|
/**
|
|
21
24
|
* By default, the ButtonGroup is enabled. To disable the whole group of buttons, set its `disabled`
|
|
22
25
|
* attribute to `true`. To disable a specific button, set the `disabled` attribute of the button to
|
|
@@ -73,9 +76,10 @@ export class ToolBarButtonGroupComponent extends ToolBarToolComponent {
|
|
|
73
76
|
focusedIndex = -1;
|
|
74
77
|
getNextKey;
|
|
75
78
|
getPrevKey;
|
|
76
|
-
constructor(localization) {
|
|
79
|
+
constructor(localization, host) {
|
|
77
80
|
super();
|
|
78
81
|
this.localization = localization;
|
|
82
|
+
this.host = host;
|
|
79
83
|
this.getNextKey = getNextKey(this.localization.rtl);
|
|
80
84
|
this.getPrevKey = getPrevKey(this.localization.rtl);
|
|
81
85
|
this.isBuiltInTool = true;
|
|
@@ -170,13 +174,19 @@ export class ToolBarButtonGroupComponent extends ToolBarToolComponent {
|
|
|
170
174
|
return button.overflowOptions.svgIcon;
|
|
171
175
|
}
|
|
172
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* @hidden
|
|
179
|
+
*/
|
|
180
|
+
get size() {
|
|
181
|
+
return this.host.size;
|
|
182
|
+
}
|
|
173
183
|
focusButton(index, ev) {
|
|
174
184
|
// Guard against focusing twice on mousedown.
|
|
175
185
|
if (!ev.type || ev.type === 'focus' || ev.type === 'keydown') {
|
|
176
186
|
this.buttonElements[index]?.focus();
|
|
177
187
|
}
|
|
178
188
|
}
|
|
179
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolBarButtonGroupComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
189
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolBarButtonGroupComponent, deps: [{ token: i1.LocalizationService }, { token: i2.ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
180
190
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ToolBarButtonGroupComponent, isStandalone: true, selector: "kendo-toolbar-buttongroup", inputs: { disabled: "disabled", fillMode: "fillMode", selection: "selection", width: "width", look: "look" }, providers: [LocalizationService, { provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarButtonGroupComponent) }], queries: [{ propertyName: "buttonComponents", predicate: i0.forwardRef(function () { return ToolBarButtonComponent; }) }], viewQueries: [{ propertyName: "toolbarButtonGroup", first: true, predicate: ["toolbarButtonGroup"], descendants: true }, { propertyName: "sectionButtonGroup", first: true, predicate: ["sectionButtonGroup"], descendants: true }, { propertyName: "overflowListItems", predicate: ["listItem"], descendants: true }], exportAs: ["kendoToolBarButtonGroup"], usesInheritance: true, ngImport: i0, template: `
|
|
181
191
|
<ng-template #toolbarTemplate>
|
|
182
192
|
<kendo-buttongroup
|
|
@@ -197,6 +207,7 @@ export class ToolBarButtonGroupComponent extends ToolBarToolComponent {
|
|
|
197
207
|
[ngClass]="button.className"
|
|
198
208
|
[attr.title]="button.title"
|
|
199
209
|
[disabled]="button.disabled"
|
|
210
|
+
[size]="size"
|
|
200
211
|
[togglable]="button.togglable"
|
|
201
212
|
[selected]="button.selected"
|
|
202
213
|
[attr.aria-pressed]="button.selected ? true : false"
|
|
@@ -258,6 +269,7 @@ export class ToolBarButtonGroupComponent extends ToolBarToolComponent {
|
|
|
258
269
|
[ngClass]="button.className"
|
|
259
270
|
[attr.title]="button.title"
|
|
260
271
|
[disabled]="button.disabled"
|
|
272
|
+
[size]="size"
|
|
261
273
|
[togglable]="button.togglable"
|
|
262
274
|
[selected]="button.selected"
|
|
263
275
|
[attr.aria-pressed]="button.selected ? true : false"
|
|
@@ -303,6 +315,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
303
315
|
[ngClass]="button.className"
|
|
304
316
|
[attr.title]="button.title"
|
|
305
317
|
[disabled]="button.disabled"
|
|
318
|
+
[size]="size"
|
|
306
319
|
[togglable]="button.togglable"
|
|
307
320
|
[selected]="button.selected"
|
|
308
321
|
[attr.aria-pressed]="button.selected ? true : false"
|
|
@@ -364,6 +377,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
364
377
|
[ngClass]="button.className"
|
|
365
378
|
[attr.title]="button.title"
|
|
366
379
|
[disabled]="button.disabled"
|
|
380
|
+
[size]="size"
|
|
367
381
|
[togglable]="button.togglable"
|
|
368
382
|
[selected]="button.selected"
|
|
369
383
|
[attr.aria-pressed]="button.selected ? true : false"
|
|
@@ -385,7 +399,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
385
399
|
standalone: true,
|
|
386
400
|
imports: [ButtonGroupComponent, NgFor, ButtonComponent, NgStyle, NgClass, NgIf, IconWrapperComponent]
|
|
387
401
|
}]
|
|
388
|
-
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { disabled: [{
|
|
402
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.ToolBarComponent }]; }, propDecorators: { disabled: [{
|
|
389
403
|
type: Input
|
|
390
404
|
}], fillMode: [{
|
|
391
405
|
type: Input
|
|
@@ -38,7 +38,7 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
38
38
|
this.setTextDisplayMode();
|
|
39
39
|
}
|
|
40
40
|
get showText() {
|
|
41
|
-
return this._showText
|
|
41
|
+
return this._showText;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Specifies the button icon visibility.
|
|
@@ -47,7 +47,7 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
47
47
|
this._showIcon = value;
|
|
48
48
|
}
|
|
49
49
|
get showIcon() {
|
|
50
|
-
return this._showIcon
|
|
50
|
+
return this._showIcon;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* Sets the text of the DropDownButton
|
|
@@ -226,6 +226,7 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
226
226
|
_showText;
|
|
227
227
|
_showIcon;
|
|
228
228
|
_text;
|
|
229
|
+
propertyChangeSub;
|
|
229
230
|
getNextKey;
|
|
230
231
|
getPrevKey;
|
|
231
232
|
constructor(zone, renderer, host) {
|
|
@@ -236,10 +237,21 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
236
237
|
this.getNextKey = getNextKey();
|
|
237
238
|
this.getPrevKey = getPrevKey();
|
|
238
239
|
this.isBuiltInTool = true;
|
|
240
|
+
this.propertyChangeSub = this.host.propertyChange.subscribe(change => {
|
|
241
|
+
if (change.property === 'showText' || change.property === 'showIcon') {
|
|
242
|
+
this[change.property] = change.value;
|
|
243
|
+
}
|
|
244
|
+
});
|
|
239
245
|
}
|
|
240
246
|
ngOnInit() {
|
|
241
247
|
this.setTextDisplayMode();
|
|
242
248
|
}
|
|
249
|
+
ngOnDestroy() {
|
|
250
|
+
if (this.propertyChangeSub) {
|
|
251
|
+
this.propertyChangeSub.unsubscribe();
|
|
252
|
+
this.propertyChangeSub = null;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
243
255
|
ngAfterViewInit() {
|
|
244
256
|
this.zone.onStable.pipe(take(1)).subscribe(() => {
|
|
245
257
|
const dropdownButton = this[`${this.location}DropDownButton`];
|
|
@@ -256,6 +268,12 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
256
268
|
.toArray()
|
|
257
269
|
.findIndex(b => b.nativeElement.contains(ev.target));
|
|
258
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* @hidden
|
|
273
|
+
*/
|
|
274
|
+
get size() {
|
|
275
|
+
return this.host.size;
|
|
276
|
+
}
|
|
259
277
|
/**
|
|
260
278
|
* @hidden
|
|
261
279
|
*/
|
|
@@ -330,6 +348,7 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
330
348
|
[arrowIcon]="arrowIcon"
|
|
331
349
|
[buttonClass]="buttonClass"
|
|
332
350
|
[disabled]="disabled"
|
|
351
|
+
[size]="size"
|
|
333
352
|
[tabIndex]="-1"
|
|
334
353
|
[data]="data"
|
|
335
354
|
[buttonAttributes]="{'title': title}"
|
|
@@ -395,6 +414,7 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
395
414
|
[arrowIcon]="arrowIcon"
|
|
396
415
|
[buttonClass]="buttonClass"
|
|
397
416
|
[disabled]="disabled"
|
|
417
|
+
[size]="size"
|
|
398
418
|
[tabIndex]="-1"
|
|
399
419
|
[data]="data"
|
|
400
420
|
[buttonAttributes]="{'title': title}"
|
|
@@ -427,6 +447,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
427
447
|
[arrowIcon]="arrowIcon"
|
|
428
448
|
[buttonClass]="buttonClass"
|
|
429
449
|
[disabled]="disabled"
|
|
450
|
+
[size]="size"
|
|
430
451
|
[tabIndex]="-1"
|
|
431
452
|
[data]="data"
|
|
432
453
|
[buttonAttributes]="{'title': title}"
|
|
@@ -492,6 +513,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
492
513
|
[arrowIcon]="arrowIcon"
|
|
493
514
|
[buttonClass]="buttonClass"
|
|
494
515
|
[disabled]="disabled"
|
|
516
|
+
[size]="size"
|
|
495
517
|
[tabIndex]="-1"
|
|
496
518
|
[data]="data"
|
|
497
519
|
[buttonAttributes]="{'title': title}"
|