@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
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, TemplateRef, forwardRef, ViewChild, Input, ElementRef, Output, EventEmitter } from '@angular/core';
|
|
5
|
+
import { Component, TemplateRef, forwardRef, ViewChild, Input, ElementRef, Output, EventEmitter, ViewChildren, QueryList } from '@angular/core';
|
|
6
6
|
import { SplitButtonComponent } from '@progress/kendo-angular-buttons';
|
|
7
7
|
import { ToolBarToolComponent } from './toolbar-tool.component';
|
|
8
|
-
import { ToolBarButtonListComponent } from './toolbar-buttonlist.component';
|
|
9
8
|
import { getValueForLocation, makePeeker, getIndexOfFocused, getPrevKey, getNextKey, seekFocusedIndex, areEqual } from '../util';
|
|
10
9
|
import * as i0 from "@angular/core";
|
|
11
10
|
import * as i1 from "@progress/kendo-angular-buttons";
|
|
12
|
-
import * as i2 from "
|
|
13
|
-
import * as i3 from "@angular/common";
|
|
11
|
+
import * as i2 from "@angular/common";
|
|
14
12
|
/**
|
|
15
13
|
* Represents the [Kendo UI ToolBar SplitButton for Angular]({% slug controltypes_toolbar %}#toc-splitbuttons).
|
|
16
14
|
*/
|
|
@@ -173,7 +171,7 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
|
|
|
173
171
|
this.setTextDisplayMode();
|
|
174
172
|
}
|
|
175
173
|
get overflowButtons() {
|
|
176
|
-
return [this.
|
|
174
|
+
return [this.overflowMainButton, ...this.overflowListItems.toArray().filter(el => !el.nativeElement.classList.contains('k-disabled'))];
|
|
177
175
|
}
|
|
178
176
|
/**
|
|
179
177
|
* @hidden
|
|
@@ -223,6 +221,47 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
|
|
|
223
221
|
return !isUnmodified(this.focusedIndex);
|
|
224
222
|
}
|
|
225
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* @hidden
|
|
226
|
+
*/
|
|
227
|
+
getIconClasses(item) {
|
|
228
|
+
if (item) {
|
|
229
|
+
if (item.icon) {
|
|
230
|
+
return `k-icon k-i-${item.icon}`;
|
|
231
|
+
}
|
|
232
|
+
else if (item.iconClass) {
|
|
233
|
+
return item.iconClass;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
if (this.overflowOptions.icon) {
|
|
238
|
+
return `k-icon k-i-${this.overflowOptions.icon}`;
|
|
239
|
+
}
|
|
240
|
+
else if (this.overflowOptions.iconClass) {
|
|
241
|
+
return this.overflowOptions.iconClass;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* @hidden
|
|
247
|
+
*/
|
|
248
|
+
getText(dataItem) {
|
|
249
|
+
if (dataItem) {
|
|
250
|
+
return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
|
|
251
|
+
}
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* @hidden
|
|
256
|
+
*/
|
|
257
|
+
handleClick(ev, item, index) {
|
|
258
|
+
this.onButtonListClick(ev);
|
|
259
|
+
const dataItem = this.data[index];
|
|
260
|
+
if (item.click) {
|
|
261
|
+
item.click(dataItem);
|
|
262
|
+
}
|
|
263
|
+
this.itemClick.emit(dataItem);
|
|
264
|
+
}
|
|
226
265
|
focusButton(index, ev) {
|
|
227
266
|
if (!ev.type || ev.type === 'focus' || ev.type === 'keydown' || ev.type === 'click') {
|
|
228
267
|
this.overflowButtons[index].nativeElement.focus();
|
|
@@ -234,10 +273,11 @@ export class ToolBarSplitButtonComponent extends ToolBarToolComponent {
|
|
|
234
273
|
}
|
|
235
274
|
}
|
|
236
275
|
ToolBarSplitButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarSplitButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
237
|
-
ToolBarSplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ToolBarSplitButtonComponent, selector: "kendo-toolbar-splitbutton", inputs: { showText: "showText", showIcon: "showIcon", text: "text", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", disabled: "disabled", popupSettings: "popupSettings", fillMode: "fillMode", themeColor: "themeColor", look: "look", buttonClass: "buttonClass", arrowButtonClass: "arrowButtonClass", arrowButtonIcon: "arrowButtonIcon", textField: "textField", data: "data" }, outputs: { buttonClick: "buttonClick", itemClick: "itemClick", open: "open", close: "close" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarSplitButtonComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "toolbarSplitButton", first: true, predicate: ["toolbarSplitButton"], descendants: true }, { propertyName: "
|
|
276
|
+
ToolBarSplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ToolBarSplitButtonComponent, selector: "kendo-toolbar-splitbutton", inputs: { showText: "showText", showIcon: "showIcon", text: "text", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl", disabled: "disabled", popupSettings: "popupSettings", fillMode: "fillMode", themeColor: "themeColor", look: "look", buttonClass: "buttonClass", arrowButtonClass: "arrowButtonClass", arrowButtonIcon: "arrowButtonIcon", textField: "textField", data: "data" }, outputs: { buttonClick: "buttonClick", itemClick: "itemClick", open: "open", close: "close" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarSplitButtonComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "toolbarSplitButton", first: true, predicate: ["toolbarSplitButton"], descendants: true }, { propertyName: "overflowMainButton", first: true, predicate: ["overflowMainButton"], descendants: true, read: ElementRef }, { propertyName: "overflowListItems", predicate: ["listItem"], descendants: true }], exportAs: ["kendoToolBarSplitButton"], usesInheritance: true, ngImport: i0, template: `
|
|
238
277
|
<ng-template #toolbarTemplate>
|
|
239
278
|
<kendo-splitbutton
|
|
240
279
|
#toolbarSplitButton
|
|
280
|
+
class="k-toolbar-split-button"
|
|
241
281
|
[data]="data"
|
|
242
282
|
[text]="toolbarOptions.text"
|
|
243
283
|
[icon]="toolbarOptions.icon"
|
|
@@ -260,36 +300,35 @@ ToolBarSplitButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
|
|
|
260
300
|
</kendo-splitbutton>
|
|
261
301
|
</ng-template>
|
|
262
302
|
<ng-template #popupTemplate>
|
|
263
|
-
<
|
|
264
|
-
#overflowSplitButton
|
|
265
|
-
type="button"
|
|
303
|
+
<div #overflowMainButton
|
|
266
304
|
tabindex="-1"
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
class="k-overflow-button"
|
|
271
|
-
[disabled]="disabled"
|
|
272
|
-
[icon]="overflowOptions.icon"
|
|
273
|
-
[iconClass]="overflowOptions.iconClass"
|
|
274
|
-
[imageUrl]="overflowOptions.imageUrl"
|
|
305
|
+
role="menuitem"
|
|
306
|
+
class="k-item k-menu-item"
|
|
307
|
+
[class.k-disabled]="disabled"
|
|
275
308
|
[ngClass]="buttonClass"
|
|
276
|
-
(click)="onMainButtonClick($event)"
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
309
|
+
(click)="onMainButtonClick($event)">
|
|
310
|
+
<span
|
|
311
|
+
[ngClass]="{'k-link': true, 'k-menu-link': true}">
|
|
312
|
+
<span *ngIf="overflowOptions.icon || overflowOptions.iconClass" [ngClass]="getIconClasses()"></span>
|
|
313
|
+
<span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
|
|
314
|
+
</span>
|
|
315
|
+
</div>
|
|
316
|
+
<ng-container *ngFor="let item of data; let i = index">
|
|
317
|
+
<div #listItem
|
|
318
|
+
tabindex="-1"
|
|
319
|
+
role="menuitem"
|
|
320
|
+
class="k-item k-menu-item"
|
|
321
|
+
[class.k-disabled]="disabled || item.disabled"
|
|
322
|
+
(click)="handleClick($event, item, i)">
|
|
323
|
+
<span
|
|
324
|
+
class="k-link k-menu-link">
|
|
325
|
+
<span *ngIf="item.icon || item.iconClass" [ngClass]="getIconClasses(item)"></span>
|
|
326
|
+
<span *ngIf="getText(item)" class="k-menu-link-text">{{ getText(item) }}</span>
|
|
327
|
+
</span>
|
|
328
|
+
</div>
|
|
329
|
+
</ng-container>
|
|
291
330
|
</ng-template>
|
|
292
|
-
`, isInline: true, components: [{ type: i1.SplitButtonComponent, selector: "kendo-splitbutton", inputs: ["text", "icon", "svgIcon", "iconClass", "type", "imageUrl", "size", "rounded", "fillMode", "themeColor", "disabled", "popupSettings", "tabIndex", "textField", "data", "buttonClass", "arrowButtonClass", "arrowButtonIcon", "arrowButtonSvgIcon"], outputs: ["buttonClick", "itemClick", "focus", "blur", "open", "close"], exportAs: ["kendoSplitButton"] }, { type:
|
|
331
|
+
`, isInline: true, components: [{ type: i1.SplitButtonComponent, selector: "kendo-splitbutton", inputs: ["text", "icon", "svgIcon", "iconClass", "type", "imageUrl", "size", "rounded", "fillMode", "themeColor", "disabled", "popupSettings", "tabIndex", "textField", "data", "buttonClass", "arrowButtonClass", "arrowButtonIcon", "arrowButtonSvgIcon"], outputs: ["buttonClick", "itemClick", "focus", "blur", "open", "close"], exportAs: ["kendoSplitButton"] }], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
293
332
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ToolBarSplitButtonComponent, decorators: [{
|
|
294
333
|
type: Component,
|
|
295
334
|
args: [{
|
|
@@ -300,6 +339,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
300
339
|
<ng-template #toolbarTemplate>
|
|
301
340
|
<kendo-splitbutton
|
|
302
341
|
#toolbarSplitButton
|
|
342
|
+
class="k-toolbar-split-button"
|
|
303
343
|
[data]="data"
|
|
304
344
|
[text]="toolbarOptions.text"
|
|
305
345
|
[icon]="toolbarOptions.icon"
|
|
@@ -322,34 +362,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
322
362
|
</kendo-splitbutton>
|
|
323
363
|
</ng-template>
|
|
324
364
|
<ng-template #popupTemplate>
|
|
325
|
-
<
|
|
326
|
-
#overflowSplitButton
|
|
327
|
-
type="button"
|
|
365
|
+
<div #overflowMainButton
|
|
328
366
|
tabindex="-1"
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
class="k-overflow-button"
|
|
333
|
-
[disabled]="disabled"
|
|
334
|
-
[icon]="overflowOptions.icon"
|
|
335
|
-
[iconClass]="overflowOptions.iconClass"
|
|
336
|
-
[imageUrl]="overflowOptions.imageUrl"
|
|
367
|
+
role="menuitem"
|
|
368
|
+
class="k-item k-menu-item"
|
|
369
|
+
[class.k-disabled]="disabled"
|
|
337
370
|
[ngClass]="buttonClass"
|
|
338
|
-
(click)="onMainButtonClick($event)"
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
371
|
+
(click)="onMainButtonClick($event)">
|
|
372
|
+
<span
|
|
373
|
+
[ngClass]="{'k-link': true, 'k-menu-link': true}">
|
|
374
|
+
<span *ngIf="overflowOptions.icon || overflowOptions.iconClass" [ngClass]="getIconClasses()"></span>
|
|
375
|
+
<span *ngIf="overflowOptions.text" class="k-menu-link-text">{{overflowOptions.text}}</span>
|
|
376
|
+
</span>
|
|
377
|
+
</div>
|
|
378
|
+
<ng-container *ngFor="let item of data; let i = index">
|
|
379
|
+
<div #listItem
|
|
380
|
+
tabindex="-1"
|
|
381
|
+
role="menuitem"
|
|
382
|
+
class="k-item k-menu-item"
|
|
383
|
+
[class.k-disabled]="disabled || item.disabled"
|
|
384
|
+
(click)="handleClick($event, item, i)">
|
|
385
|
+
<span
|
|
386
|
+
class="k-link k-menu-link">
|
|
387
|
+
<span *ngIf="item.icon || item.iconClass" [ngClass]="getIconClasses(item)"></span>
|
|
388
|
+
<span *ngIf="getText(item)" class="k-menu-link-text">{{ getText(item) }}</span>
|
|
389
|
+
</span>
|
|
390
|
+
</div>
|
|
391
|
+
</ng-container>
|
|
353
392
|
</ng-template>
|
|
354
393
|
`
|
|
355
394
|
}]
|
|
@@ -402,10 +441,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
402
441
|
}], toolbarSplitButton: [{
|
|
403
442
|
type: ViewChild,
|
|
404
443
|
args: ['toolbarSplitButton', { static: false }]
|
|
405
|
-
}],
|
|
406
|
-
type: ViewChild,
|
|
407
|
-
args: ['overflowSplitButton', { read: ElementRef, static: false }]
|
|
408
|
-
}], overflowSplitButtonButtonList: [{
|
|
444
|
+
}], overflowMainButton: [{
|
|
409
445
|
type: ViewChild,
|
|
410
|
-
args: ['
|
|
446
|
+
args: ['overflowMainButton', { read: ElementRef }]
|
|
447
|
+
}], overflowListItems: [{
|
|
448
|
+
type: ViewChildren,
|
|
449
|
+
args: ['listItem']
|
|
411
450
|
}] } });
|
package/esm2020/util.mjs
CHANGED
|
@@ -185,3 +185,27 @@ export const getValueForLocation = (property, displayMode, overflows) => {
|
|
|
185
185
|
return property;
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
|
+
/**
|
|
189
|
+
* @hidden
|
|
190
|
+
*/
|
|
191
|
+
export const SIZES = {
|
|
192
|
+
small: 'sm',
|
|
193
|
+
medium: 'md',
|
|
194
|
+
large: 'lg'
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* @hidden
|
|
198
|
+
*
|
|
199
|
+
* Returns the styling classes to be added and removed
|
|
200
|
+
*/
|
|
201
|
+
export const getStylingClasses = (componentType, stylingOption, previousValue, newValue) => {
|
|
202
|
+
switch (stylingOption) {
|
|
203
|
+
case 'size':
|
|
204
|
+
return {
|
|
205
|
+
toRemove: `k-${componentType}-${SIZES[previousValue]}`,
|
|
206
|
+
toAdd: newValue !== 'none' ? `k-${componentType}-${SIZES[newValue]}` : ''
|
|
207
|
+
};
|
|
208
|
+
default:
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
};
|