@progress/kendo-angular-toolbar 19.0.0-develop.9 → 19.0.0
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/codemods/template-transformer/index.js +94 -0
- package/codemods/utils.js +553 -0
- package/codemods/v19/toolbar-button-showicon.js +53 -0
- package/codemods/v19/toolbar-button-showtext.js +53 -0
- package/display-mode.d.ts +9 -3
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/renderer.component.mjs +53 -21
- package/esm2022/toolbar.component.mjs +52 -6
- package/esm2022/tools/toolbar-button.component.mjs +176 -16
- package/esm2022/tools/toolbar-buttongroup.component.mjs +17 -3
- package/esm2022/tools/toolbar-dropdownbutton.component.mjs +44 -13
- package/esm2022/tools/toolbar-splitbutton.component.mjs +42 -10
- package/esm2022/tools/toolbar-tool.component.mjs +4 -0
- package/esm2022/util.mjs +3 -1
- package/fesm2022/progress-kendo-angular-toolbar.mjs +384 -72
- package/package.json +29 -8
- package/renderer.component.d.ts +1 -0
- package/toolbar.component.d.ts +23 -2
- package/tools/toolbar-button.component.d.ts +22 -5
- package/tools/toolbar-buttongroup.component.d.ts +7 -1
- package/tools/toolbar-dropdownbutton.component.d.ts +14 -4
- package/tools/toolbar-splitbutton.component.d.ts +14 -4
- package/tools/toolbar-tool.component.d.ts +4 -0
|
@@ -8,18 +8,21 @@ 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
|
+
import { ToolBarComponent } from '../toolbar.component';
|
|
13
14
|
import * as i0 from "@angular/core";
|
|
15
|
+
import * as i1 from "../toolbar.component";
|
|
14
16
|
/**
|
|
15
17
|
* Represents the [Kendo UI ToolBar Button tool for Angular]({% slug controltypes_toolbar %}#toc-buttons).
|
|
16
18
|
*/
|
|
17
19
|
export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
18
20
|
element;
|
|
19
21
|
zone;
|
|
22
|
+
host;
|
|
20
23
|
// showText and showIcon showIcon should be declared first
|
|
21
24
|
/**
|
|
22
|
-
* Specifies
|
|
25
|
+
* Specifies the button text visibility.
|
|
23
26
|
*/
|
|
24
27
|
set showText(value) {
|
|
25
28
|
this._showText = value;
|
|
@@ -29,9 +32,15 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
29
32
|
return this._showText;
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
32
|
-
* Specifies
|
|
35
|
+
* Specifies the button icon visibility.
|
|
33
36
|
*/
|
|
34
|
-
showIcon
|
|
37
|
+
set showIcon(value) {
|
|
38
|
+
this._showIcon = value;
|
|
39
|
+
this.setTextDisplayMode();
|
|
40
|
+
}
|
|
41
|
+
get showIcon() {
|
|
42
|
+
return this._showIcon;
|
|
43
|
+
}
|
|
35
44
|
/**
|
|
36
45
|
* Specifies the text of the Button ([see example]({% slug controltypes_toolbar %}#toc-buttons)).
|
|
37
46
|
*/
|
|
@@ -42,6 +51,12 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
42
51
|
get text() {
|
|
43
52
|
return this._text;
|
|
44
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
get size() {
|
|
58
|
+
return this.host.size;
|
|
59
|
+
}
|
|
45
60
|
/**
|
|
46
61
|
* Specifies custom inline CSS styles of the Button.
|
|
47
62
|
*/
|
|
@@ -185,6 +200,10 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
185
200
|
svgIcon: null,
|
|
186
201
|
imageUrl: ''
|
|
187
202
|
};
|
|
203
|
+
/**
|
|
204
|
+
* @hidden
|
|
205
|
+
*/
|
|
206
|
+
hasBadgeContainer = false;
|
|
188
207
|
/**
|
|
189
208
|
* @hidden
|
|
190
209
|
*/
|
|
@@ -192,17 +211,29 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
192
211
|
toolbarButtonElement;
|
|
193
212
|
sectionButtonElement;
|
|
194
213
|
overflowButtonElement;
|
|
195
|
-
_showText
|
|
214
|
+
_showText;
|
|
215
|
+
_showIcon;
|
|
196
216
|
_text;
|
|
197
|
-
|
|
217
|
+
propertyChangeSub;
|
|
218
|
+
constructor(element, zone, host) {
|
|
198
219
|
super();
|
|
199
220
|
this.element = element;
|
|
200
221
|
this.zone = zone;
|
|
222
|
+
this.host = host;
|
|
201
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
|
+
});
|
|
202
229
|
}
|
|
203
230
|
ngOnInit() {
|
|
204
231
|
this.setTextDisplayMode();
|
|
205
232
|
}
|
|
233
|
+
ngOnDestroy() {
|
|
234
|
+
this.propertyChangeSub.unsubscribe();
|
|
235
|
+
this.propertyChangeSub = null;
|
|
236
|
+
}
|
|
206
237
|
/**
|
|
207
238
|
* @hidden
|
|
208
239
|
*/
|
|
@@ -249,25 +280,60 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
249
280
|
this.selected = state;
|
|
250
281
|
this.selectedChange.emit(state);
|
|
251
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* @hidden
|
|
285
|
+
*/
|
|
252
286
|
getButton() {
|
|
253
287
|
return this[`${this.location}ButtonElement`]?.nativeElement;
|
|
254
288
|
}
|
|
255
289
|
setTextDisplayMode() {
|
|
256
|
-
this.toolbarOptions.text = this.showText === '
|
|
290
|
+
this.toolbarOptions.text = this.showText === 'menu' || this.showText === 'never' ? undefined : this.text;
|
|
257
291
|
this.zone.onStable.pipe(take(1)).subscribe(() => {
|
|
258
|
-
this.overflowOptions.text = this.showText === 'toolbar' ? undefined : this.text;
|
|
292
|
+
this.overflowOptions.text = this.showText === 'toolbar' || this.showText === 'never' ? undefined : this.text;
|
|
259
293
|
});
|
|
260
294
|
}
|
|
261
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolBarButtonComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
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 });
|
|
262
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: `
|
|
263
297
|
<ng-template #toolbarTemplate>
|
|
264
|
-
<
|
|
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"
|
|
265
330
|
#toolbarButton
|
|
266
331
|
[class.k-toolbar-button]="!toggleable"
|
|
267
332
|
[class.k-toolbar-toggle-button]="toggleable"
|
|
268
333
|
[tabindex]="tabIndex"
|
|
269
334
|
type="button"
|
|
270
335
|
kendoButton
|
|
336
|
+
[size]="size"
|
|
271
337
|
[ngStyle]="style"
|
|
272
338
|
[ngClass]="className"
|
|
273
339
|
[attr.title]="title"
|
|
@@ -286,7 +352,6 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
286
352
|
(blur)="onBlur()"
|
|
287
353
|
>
|
|
288
354
|
{{ toolbarOptions.text }}
|
|
289
|
-
<kendo-badge *ngIf="showBadge"></kendo-badge>
|
|
290
355
|
</button>
|
|
291
356
|
</ng-template>
|
|
292
357
|
<ng-template #popupTemplate>
|
|
@@ -314,13 +379,45 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
314
379
|
</div>
|
|
315
380
|
</ng-template>
|
|
316
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>
|
|
317
412
|
<button
|
|
413
|
+
*ngIf="!hasBadgeContainer"
|
|
318
414
|
#sectionButton
|
|
319
415
|
[class.k-toolbar-button]="!toggleable"
|
|
320
416
|
[class.k-toolbar-toggle-button]="toggleable"
|
|
321
417
|
[tabindex]="tabIndex"
|
|
322
418
|
type="button"
|
|
323
419
|
kendoButton
|
|
420
|
+
[size]="size"
|
|
324
421
|
[ngStyle]="style"
|
|
325
422
|
[ngClass]="className"
|
|
326
423
|
[attr.title]="title"
|
|
@@ -341,7 +438,7 @@ export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
|
341
438
|
{{ toolbarOptions.text }}
|
|
342
439
|
</button>
|
|
343
440
|
</ng-template>
|
|
344
|
-
`, 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" }] });
|
|
345
442
|
}
|
|
346
443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolBarButtonComponent, decorators: [{
|
|
347
444
|
type: Component,
|
|
@@ -351,13 +448,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
351
448
|
selector: 'kendo-toolbar-button',
|
|
352
449
|
template: `
|
|
353
450
|
<ng-template #toolbarTemplate>
|
|
354
|
-
<
|
|
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"
|
|
355
483
|
#toolbarButton
|
|
356
484
|
[class.k-toolbar-button]="!toggleable"
|
|
357
485
|
[class.k-toolbar-toggle-button]="toggleable"
|
|
358
486
|
[tabindex]="tabIndex"
|
|
359
487
|
type="button"
|
|
360
488
|
kendoButton
|
|
489
|
+
[size]="size"
|
|
361
490
|
[ngStyle]="style"
|
|
362
491
|
[ngClass]="className"
|
|
363
492
|
[attr.title]="title"
|
|
@@ -376,7 +505,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
376
505
|
(blur)="onBlur()"
|
|
377
506
|
>
|
|
378
507
|
{{ toolbarOptions.text }}
|
|
379
|
-
<kendo-badge *ngIf="showBadge"></kendo-badge>
|
|
380
508
|
</button>
|
|
381
509
|
</ng-template>
|
|
382
510
|
<ng-template #popupTemplate>
|
|
@@ -404,13 +532,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
404
532
|
</div>
|
|
405
533
|
</ng-template>
|
|
406
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>
|
|
407
565
|
<button
|
|
566
|
+
*ngIf="!hasBadgeContainer"
|
|
408
567
|
#sectionButton
|
|
409
568
|
[class.k-toolbar-button]="!toggleable"
|
|
410
569
|
[class.k-toolbar-toggle-button]="toggleable"
|
|
411
570
|
[tabindex]="tabIndex"
|
|
412
571
|
type="button"
|
|
413
572
|
kendoButton
|
|
573
|
+
[size]="size"
|
|
414
574
|
[ngStyle]="style"
|
|
415
575
|
[ngClass]="className"
|
|
416
576
|
[attr.title]="title"
|
|
@@ -433,9 +593,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
433
593
|
</ng-template>
|
|
434
594
|
`,
|
|
435
595
|
standalone: true,
|
|
436
|
-
imports: [ButtonComponent, NgStyle, NgClass, NgIf, IconWrapperComponent, BadgeComponent],
|
|
596
|
+
imports: [ButtonComponent, NgStyle, NgClass, NgIf, IconWrapperComponent, BadgeComponent, BadgeContainerComponent],
|
|
437
597
|
}]
|
|
438
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { showText: [{
|
|
598
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.ToolBarComponent }]; }, propDecorators: { showText: [{
|
|
439
599
|
type: Input
|
|
440
600
|
}], showIcon: [{
|
|
441
601
|
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
|
|
@@ -9,13 +9,16 @@ import { getValueForLocation, makePeeker, getIndexOfFocused, getPrevKey, getNext
|
|
|
9
9
|
import { IconWrapperComponent } from '@progress/kendo-angular-icons';
|
|
10
10
|
import { NgClass, NgIf, NgFor } from '@angular/common';
|
|
11
11
|
import { take } from 'rxjs/operators';
|
|
12
|
+
import { ToolBarComponent } from '../toolbar.component';
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "../toolbar.component";
|
|
13
15
|
/**
|
|
14
16
|
* Represents the [Kendo UI ToolBar DropDownButton for Angular](slug:controltypes_toolbar#drop-down-buttons).
|
|
15
17
|
*/
|
|
16
18
|
export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
17
19
|
zone;
|
|
18
20
|
renderer;
|
|
21
|
+
host;
|
|
19
22
|
/**
|
|
20
23
|
* Allows showing the default arrow icon or providing alternative one instead.
|
|
21
24
|
* @default false
|
|
@@ -28,7 +31,7 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
28
31
|
title = '';
|
|
29
32
|
// showText and showIcon showIcon should be declared first
|
|
30
33
|
/**
|
|
31
|
-
*
|
|
34
|
+
* Specifies the button text visibility.
|
|
32
35
|
*/
|
|
33
36
|
set showText(value) {
|
|
34
37
|
this._showText = value;
|
|
@@ -38,9 +41,14 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
38
41
|
return this._showText;
|
|
39
42
|
}
|
|
40
43
|
/**
|
|
41
|
-
*
|
|
44
|
+
* Specifies the button icon visibility.
|
|
42
45
|
*/
|
|
43
|
-
showIcon
|
|
46
|
+
set showIcon(value) {
|
|
47
|
+
this._showIcon = value;
|
|
48
|
+
}
|
|
49
|
+
get showIcon() {
|
|
50
|
+
return this._showIcon;
|
|
51
|
+
}
|
|
44
52
|
/**
|
|
45
53
|
* Sets the text of the DropDownButton
|
|
46
54
|
* ([see example](slug:controltypes_toolbar#toc-drop-down-buttons)).
|
|
@@ -215,26 +223,40 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
215
223
|
_data;
|
|
216
224
|
_popupSettings = { animate: true, popupClass: '' };
|
|
217
225
|
focusedIndex = -1;
|
|
218
|
-
_showText
|
|
226
|
+
_showText;
|
|
227
|
+
_showIcon;
|
|
219
228
|
_text;
|
|
229
|
+
propertyChangeSub;
|
|
220
230
|
getNextKey;
|
|
221
231
|
getPrevKey;
|
|
222
|
-
constructor(zone, renderer) {
|
|
232
|
+
constructor(zone, renderer, host) {
|
|
223
233
|
super();
|
|
224
234
|
this.zone = zone;
|
|
225
235
|
this.renderer = renderer;
|
|
236
|
+
this.host = host;
|
|
226
237
|
this.getNextKey = getNextKey();
|
|
227
238
|
this.getPrevKey = getPrevKey();
|
|
228
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
|
+
});
|
|
229
245
|
}
|
|
230
246
|
ngOnInit() {
|
|
231
247
|
this.setTextDisplayMode();
|
|
232
248
|
}
|
|
249
|
+
ngOnDestroy() {
|
|
250
|
+
if (this.propertyChangeSub) {
|
|
251
|
+
this.propertyChangeSub.unsubscribe();
|
|
252
|
+
this.propertyChangeSub = null;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
233
255
|
ngAfterViewInit() {
|
|
234
256
|
this.zone.onStable.pipe(take(1)).subscribe(() => {
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
237
|
-
this.renderer.addClass(
|
|
257
|
+
const dropdownButton = this[`${this.location}DropDownButton`];
|
|
258
|
+
if (dropdownButton?.button) {
|
|
259
|
+
this.renderer.addClass(dropdownButton.button.nativeElement, 'k-toolbar-menu-button');
|
|
238
260
|
}
|
|
239
261
|
});
|
|
240
262
|
}
|
|
@@ -246,6 +268,12 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
246
268
|
.toArray()
|
|
247
269
|
.findIndex(b => b.nativeElement.contains(ev.target));
|
|
248
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* @hidden
|
|
273
|
+
*/
|
|
274
|
+
get size() {
|
|
275
|
+
return this.host.size;
|
|
276
|
+
}
|
|
249
277
|
/**
|
|
250
278
|
* @hidden
|
|
251
279
|
*/
|
|
@@ -288,7 +316,6 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
288
316
|
if (dataItem) {
|
|
289
317
|
return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
|
|
290
318
|
}
|
|
291
|
-
return undefined;
|
|
292
319
|
}
|
|
293
320
|
/**
|
|
294
321
|
* @hidden
|
|
@@ -307,10 +334,10 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
307
334
|
}
|
|
308
335
|
}
|
|
309
336
|
setTextDisplayMode() {
|
|
310
|
-
this.toolbarOptions.text = this.showText === '
|
|
311
|
-
this.overflowOptions.text = this.showText === 'toolbar' ? undefined : this.text;
|
|
337
|
+
this.toolbarOptions.text = this.showText === 'menu' || this.showText === 'never' ? undefined : this.text;
|
|
338
|
+
this.overflowOptions.text = this.showText === 'toolbar' || this.showText === 'never' ? undefined : this.text;
|
|
312
339
|
}
|
|
313
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolBarDropDownButtonComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
340
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolBarDropDownButtonComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
314
341
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ToolBarDropDownButtonComponent, isStandalone: true, selector: "kendo-toolbar-dropdownbutton", inputs: { arrowIcon: "arrowIcon", title: "title", showText: "showText", showIcon: "showIcon", text: "text", icon: "icon", svgIcon: "svgIcon", 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: "dropdownButton", first: true, predicate: ["dropdownButton"], descendants: true, read: ElementRef, static: true }, { propertyName: "toolbarDropDownButton", first: true, predicate: ["toolbarDropDownButton"], descendants: true }, { propertyName: "sectionDropDownButton", first: true, predicate: ["sectionDropDownButton"], descendants: true }, { propertyName: "overflowListItems", predicate: ["listItem"], descendants: true }], exportAs: ["kendoToolBarDropDownButton"], usesInheritance: true, ngImport: i0, template: `
|
|
315
342
|
<ng-template #toolbarTemplate>
|
|
316
343
|
<kendo-dropdownbutton #toolbarDropDownButton
|
|
@@ -321,6 +348,7 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
321
348
|
[arrowIcon]="arrowIcon"
|
|
322
349
|
[buttonClass]="buttonClass"
|
|
323
350
|
[disabled]="disabled"
|
|
351
|
+
[size]="size"
|
|
324
352
|
[tabIndex]="-1"
|
|
325
353
|
[data]="data"
|
|
326
354
|
[buttonAttributes]="{'title': title}"
|
|
@@ -386,6 +414,7 @@ export class ToolBarDropDownButtonComponent extends ToolBarToolComponent {
|
|
|
386
414
|
[arrowIcon]="arrowIcon"
|
|
387
415
|
[buttonClass]="buttonClass"
|
|
388
416
|
[disabled]="disabled"
|
|
417
|
+
[size]="size"
|
|
389
418
|
[tabIndex]="-1"
|
|
390
419
|
[data]="data"
|
|
391
420
|
[buttonAttributes]="{'title': title}"
|
|
@@ -418,6 +447,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
418
447
|
[arrowIcon]="arrowIcon"
|
|
419
448
|
[buttonClass]="buttonClass"
|
|
420
449
|
[disabled]="disabled"
|
|
450
|
+
[size]="size"
|
|
421
451
|
[tabIndex]="-1"
|
|
422
452
|
[data]="data"
|
|
423
453
|
[buttonAttributes]="{'title': title}"
|
|
@@ -483,6 +513,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
483
513
|
[arrowIcon]="arrowIcon"
|
|
484
514
|
[buttonClass]="buttonClass"
|
|
485
515
|
[disabled]="disabled"
|
|
516
|
+
[size]="size"
|
|
486
517
|
[tabIndex]="-1"
|
|
487
518
|
[data]="data"
|
|
488
519
|
[buttonAttributes]="{'title': title}"
|
|
@@ -501,7 +532,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
501
532
|
standalone: true,
|
|
502
533
|
imports: [DropDownButtonComponent, NgClass, NgIf, IconWrapperComponent, NgFor]
|
|
503
534
|
}]
|
|
504
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }]; }, propDecorators: { arrowIcon: [{
|
|
535
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.ToolBarComponent }]; }, propDecorators: { arrowIcon: [{
|
|
505
536
|
type: Input
|
|
506
537
|
}], title: [{
|
|
507
538
|
type: Input
|