@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.
@@ -9,14 +9,17 @@ import { getValueForLocation, makePeeker, getIndexOfFocused, getPrevKey, getNext
9
9
  import { caretAltDownIcon } from '@progress/kendo-svg-icons';
10
10
  import { IconWrapperComponent } from '@progress/kendo-angular-icons';
11
11
  import { NgClass, NgIf, NgFor } from '@angular/common';
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 SplitButton for Angular](slug:controltypes_toolbar#toc-split-buttons).
15
17
  */
16
18
  export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
19
+ host;
17
20
  // showText and showIcon showIcon should be declared first
18
21
  /**
19
- * Specifies where button text should be displayed
22
+ * Specifies the button text visibility.
20
23
  */
21
24
  set showText(value) {
22
25
  this._showText = value;
@@ -26,9 +29,15 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
26
29
  return this._showText;
27
30
  }
28
31
  /**
29
- * Specifies where button icon should be displayed
32
+ * Specifies the button icon visibility.
30
33
  */
31
- showIcon = 'both';
34
+ set showIcon(value) {
35
+ this._showIcon = value;
36
+ this.setTextDisplayMode();
37
+ }
38
+ get showIcon() {
39
+ return this._showIcon;
40
+ }
32
41
  /**
33
42
  * Sets the text of the SplitButton ([see example](slug:controltypes_toolbar#toc-split-buttons)).
34
43
  */
@@ -209,25 +218,39 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
209
218
  ngOnInit() {
210
219
  this.setTextDisplayMode();
211
220
  }
221
+ ngOnDestroy() {
222
+ if (this.propertyChangeSub) {
223
+ this.propertyChangeSub.unsubscribe();
224
+ this.propertyChangeSub = null;
225
+ }
226
+ }
212
227
  get overflowButtons() {
213
228
  return [this.overflowMainButton, ...this.overflowListItems.toArray().filter(el => !el.nativeElement.classList.contains('k-disabled'))];
214
229
  }
215
230
  _data;
216
231
  _popupSettings = { animate: true, popupClass: '' };
217
232
  focusedIndex = -1;
218
- _showText = 'both';
233
+ _showText;
234
+ _showIcon;
219
235
  _text;
236
+ propertyChangeSub;
220
237
  getNextKey;
221
238
  getPrevKey;
222
239
  toolbarSplitButton;
223
240
  sectionSplitButton;
224
241
  overflowMainButton;
225
242
  overflowListItems;
226
- constructor() {
243
+ constructor(host) {
227
244
  super();
245
+ this.host = host;
228
246
  this.getNextKey = getNextKey();
229
247
  this.getPrevKey = getPrevKey();
230
248
  this.isBuiltInTool = true;
249
+ this.propertyChangeSub = this.host.propertyChange.subscribe(change => {
250
+ if (change.property === 'showText' || change.property === 'showIcon') {
251
+ this[change.property] = change.value;
252
+ }
253
+ });
231
254
  }
232
255
  /**
233
256
  * @hidden
@@ -248,6 +271,12 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
248
271
  canFocus() {
249
272
  return !this.disabled;
250
273
  }
274
+ /**
275
+ * @hidden
276
+ */
277
+ get size() {
278
+ return this.host.size;
279
+ }
251
280
  /**
252
281
  * @hidden
253
282
  */
@@ -284,7 +313,6 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
284
313
  if (dataItem) {
285
314
  return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
286
315
  }
287
- return undefined;
288
316
  }
289
317
  /**
290
318
  * @hidden
@@ -303,10 +331,10 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
303
331
  }
304
332
  }
305
333
  setTextDisplayMode() {
306
- this.toolbarOptions.text = this.showText === 'overflow' ? undefined : this.text;
307
- this.overflowOptions.text = this.showText === 'toolbar' ? undefined : this.text;
334
+ this.toolbarOptions.text = this.showText === 'menu' || this.showText === 'never' ? undefined : this.text;
335
+ this.overflowOptions.text = this.showText === 'toolbar' || this.showText === 'never' ? undefined : this.text;
308
336
  }
309
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolBarSplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
337
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ToolBarSplitButtonComponent, deps: [{ token: i1.ToolBarComponent }], target: i0.ɵɵFactoryTarget.Component });
310
338
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ToolBarSplitButtonComponent, isStandalone: true, selector: "kendo-toolbar-splitbutton", inputs: { showText: "showText", showIcon: "showIcon", text: "text", icon: "icon", svgIcon: "svgIcon", iconClass: "iconClass", imageUrl: "imageUrl", disabled: "disabled", popupSettings: "popupSettings", fillMode: "fillMode", themeColor: "themeColor", look: "look", buttonClass: "buttonClass", arrowButtonClass: "arrowButtonClass", arrowButtonIcon: "arrowButtonIcon", arrowButtonSvgIcon: "arrowButtonSvgIcon", textField: "textField", data: "data" }, outputs: { buttonClick: "buttonClick", itemClick: "itemClick", open: "open", close: "close" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarSplitButtonComponent) }], viewQueries: [{ propertyName: "toolbarSplitButton", first: true, predicate: ["toolbarSplitButton"], descendants: true }, { propertyName: "sectionSplitButton", first: true, predicate: ["sectionSplitButton"], descendants: true }, { propertyName: "overflowMainButton", first: true, predicate: ["overflowMainButton"], descendants: true, read: ElementRef }, { propertyName: "overflowListItems", predicate: ["listItem"], descendants: true }], exportAs: ["kendoToolBarSplitButton"], usesInheritance: true, ngImport: i0, template: `
311
339
  <ng-template #toolbarTemplate>
312
340
  <kendo-splitbutton
@@ -323,6 +351,7 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
323
351
  [arrowButtonIcon]="arrowButtonIcon"
324
352
  [arrowButtonSvgIcon]="arrowButtonSvgIcon"
325
353
  [disabled]="disabled"
354
+ [size]="size"
326
355
  [tabIndex]="-1"
327
356
  [textField]="textField"
328
357
  [popupSettings]="popupSettings"
@@ -392,6 +421,7 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
392
421
  [arrowButtonIcon]="arrowButtonIcon"
393
422
  [arrowButtonSvgIcon]="arrowButtonSvgIcon"
394
423
  [disabled]="disabled"
424
+ [size]="size"
395
425
  [tabIndex]="-1"
396
426
  [textField]="textField"
397
427
  [popupSettings]="popupSettings"
@@ -427,6 +457,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
427
457
  [arrowButtonIcon]="arrowButtonIcon"
428
458
  [arrowButtonSvgIcon]="arrowButtonSvgIcon"
429
459
  [disabled]="disabled"
460
+ [size]="size"
430
461
  [tabIndex]="-1"
431
462
  [textField]="textField"
432
463
  [popupSettings]="popupSettings"
@@ -496,6 +527,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
496
527
  [arrowButtonIcon]="arrowButtonIcon"
497
528
  [arrowButtonSvgIcon]="arrowButtonSvgIcon"
498
529
  [disabled]="disabled"
530
+ [size]="size"
499
531
  [tabIndex]="-1"
500
532
  [textField]="textField"
501
533
  [popupSettings]="popupSettings"
@@ -511,7 +543,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
511
543
  standalone: true,
512
544
  imports: [SplitButtonComponent, NgClass, NgIf, IconWrapperComponent, NgFor]
513
545
  }]
514
- }], ctorParameters: function () { return []; }, propDecorators: { showText: [{
546
+ }], ctorParameters: function () { return [{ type: i1.ToolBarComponent }]; }, propDecorators: { showText: [{
515
547
  type: Input
516
548
  }], showIcon: [{
517
549
  type: Input
@@ -17,6 +17,10 @@ export class ToolBarToolComponent {
17
17
  visibility;
18
18
  element;
19
19
  isBuiltInTool = false;
20
+ /**
21
+ * @hidden
22
+ */
23
+ isHidden = false;
20
24
  /**
21
25
  * @hidden
22
26
  */
package/esm2022/util.mjs CHANGED
@@ -179,8 +179,10 @@ export const getValueForLocation = (property, displayMode, overflows) => {
179
179
  switch (displayMode) {
180
180
  case 'toolbar':
181
181
  return overflows ? undefined : property;
182
- case 'overflow':
182
+ case 'menu':
183
183
  return overflows ? property : undefined;
184
+ case 'never':
185
+ return;
184
186
  default:
185
187
  return property;
186
188
  }