@progress/kendo-angular-toolbar 5.0.4 → 6.0.0-dev.202204190531
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/bundles/kendo-angular-toolbar.umd.js +5 -0
- package/{dist/es2015/common → common}/constants.d.ts +0 -0
- package/{dist/es2015/common → common}/preventable-event.d.ts +0 -0
- package/{dist/es2015/common → common}/renderer-click.d.ts +0 -0
- package/{dist/es2015/direction.d.ts → direction.d.ts} +0 -0
- package/{dist/es2015/display-mode.d.ts → display-mode.d.ts} +0 -0
- package/{dist/es2015 → esm2015}/common/constants.js +0 -0
- package/{dist/es2015 → esm2015}/common/preventable-event.js +0 -0
- package/{dist/es → esm2015}/common/renderer-click.js +1 -0
- package/{dist/es2015 → esm2015}/direction.js +1 -0
- package/{dist/es2015 → esm2015}/display-mode.js +1 -0
- package/{dist/es2015 → esm2015}/group-selection-settings.js +1 -0
- package/{dist/es/common/constants.js → esm2015/kendo-angular-toolbar.js} +2 -2
- package/esm2015/localization/custom-messages.component.js +40 -0
- package/esm2015/localization/localized-toolbar-messages.directive.js +36 -0
- package/esm2015/localization/messages.js +23 -0
- package/{dist/es → esm2015}/main.js +0 -0
- package/{dist/es2015 → esm2015}/navigation.service.js +9 -9
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/{dist/es → esm2015}/popup-settings.js +1 -0
- package/{dist/es2015 → esm2015}/refresh.service.js +8 -10
- package/{dist/es → esm2015}/render-location.js +1 -0
- package/{dist/es2015 → esm2015}/renderer.component.js +36 -41
- package/{dist/es2015 → esm2015}/renderer.service.js +8 -7
- package/{dist/es → esm2015}/tool-options.js +1 -0
- package/{dist/es2015 → esm2015}/toolbar.component.js +164 -131
- package/{dist/es2015 → esm2015}/toolbar.module.js +27 -11
- package/{dist/es2015 → esm2015}/tools/toolbar-button.component.js +117 -114
- package/esm2015/tools/toolbar-buttongroup.component.js +267 -0
- package/esm2015/tools/toolbar-buttonlist.component.js +94 -0
- package/{dist/es2015 → esm2015}/tools/toolbar-dropdownbutton.component.js +119 -121
- package/esm2015/tools/toolbar-separator.component.js +68 -0
- package/{dist/es2015 → esm2015}/tools/toolbar-splitbutton.component.js +128 -126
- package/{dist/es2015 → esm2015}/tools/toolbar-tool.component.js +15 -19
- package/{dist/es2015 → esm2015}/util.js +0 -0
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-toolbar.js} +1012 -879
- package/{dist/es2015/group-selection-settings.d.ts → group-selection-settings.d.ts} +0 -0
- package/kendo-angular-toolbar.d.ts +9 -0
- package/{dist/es2015/localization → localization}/custom-messages.component.d.ts +4 -1
- package/{dist/es2015/localization → localization}/localized-toolbar-messages.directive.d.ts +3 -0
- package/{dist/es2015/localization → localization}/messages.d.ts +3 -0
- package/{dist/es2015/main.d.ts → main.d.ts} +0 -0
- package/{dist/es2015/navigation.service.d.ts → navigation.service.d.ts} +3 -0
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +34 -102
- package/{dist/es2015/popup-settings.d.ts → popup-settings.d.ts} +0 -0
- package/{dist/es2015/refresh.service.d.ts → refresh.service.d.ts} +3 -0
- package/{dist/es2015/render-location.d.ts → render-location.d.ts} +0 -0
- package/{dist/es2015/renderer.component.d.ts → renderer.component.d.ts} +4 -1
- package/{dist/es2015/renderer.service.d.ts → renderer.service.d.ts} +3 -0
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/{dist/es2015/tool-options.d.ts → tool-options.d.ts} +0 -0
- package/{dist/es2015/toolbar.component.d.ts → toolbar.component.d.ts} +26 -17
- package/toolbar.module.d.ts +37 -0
- package/{dist/es2015/tools → tools}/toolbar-button.component.d.ts +10 -6
- package/{dist/es2015/tools → tools}/toolbar-buttongroup.component.d.ts +7 -5
- package/{dist/es2015/tools → tools}/toolbar-buttonlist.component.d.ts +3 -0
- package/{dist/es2015/tools → tools}/toolbar-dropdownbutton.component.d.ts +15 -10
- package/{dist/es2015/tools → tools}/toolbar-separator.component.d.ts +3 -0
- package/{dist/es2015/tools → tools}/toolbar-splitbutton.component.d.ts +14 -9
- package/{dist/es2015/tools → tools}/toolbar-tool.component.d.ts +5 -2
- package/{dist/es2015/util.d.ts → util.d.ts} +0 -0
- package/dist/cdn/js/kendo-angular-toolbar.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/common/preventable-event.js +0 -29
- package/dist/es/direction.js +0 -4
- package/dist/es/display-mode.js +0 -4
- package/dist/es/group-selection-settings.js +0 -4
- package/dist/es/index.js +0 -14
- package/dist/es/localization/custom-messages.component.js +0 -43
- package/dist/es/localization/localized-toolbar-messages.directive.js +0 -35
- package/dist/es/localization/messages.js +0 -22
- package/dist/es/navigation.service.js +0 -130
- package/dist/es/package-metadata.js +0 -15
- package/dist/es/refresh.service.js +0 -22
- package/dist/es/renderer.component.js +0 -132
- package/dist/es/renderer.service.js +0 -52
- package/dist/es/toolbar.component.js +0 -648
- package/dist/es/toolbar.module.js +0 -60
- package/dist/es/tools/toolbar-button.component.js +0 -310
- package/dist/es/tools/toolbar-buttongroup.component.js +0 -165
- package/dist/es/tools/toolbar-buttonlist.component.js +0 -66
- package/dist/es/tools/toolbar-dropdownbutton.component.js +0 -368
- package/dist/es/tools/toolbar-separator.component.js +0 -67
- package/dist/es/tools/toolbar-splitbutton.component.js +0 -380
- package/dist/es/tools/toolbar-tool.component.js +0 -76
- package/dist/es/util.js +0 -204
- package/dist/es2015/common/renderer-click.js +0 -4
- package/dist/es2015/index.d.ts +0 -14
- package/dist/es2015/index.js +0 -14
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/localization/custom-messages.component.js +0 -35
- package/dist/es2015/localization/localized-toolbar-messages.directive.js +0 -31
- package/dist/es2015/localization/messages.js +0 -16
- package/dist/es2015/main.js +0 -14
- package/dist/es2015/popup-settings.js +0 -4
- package/dist/es2015/render-location.js +0 -4
- package/dist/es2015/tool-options.js +0 -4
- package/dist/es2015/toolbar.module.d.ts +0 -18
- package/dist/es2015/tools/toolbar-buttongroup.component.js +0 -216
- package/dist/es2015/tools/toolbar-buttonlist.component.js +0 -87
- package/dist/es2015/tools/toolbar-separator.component.js +0 -68
- package/dist/fesm5/index.js +0 -2672
- package/dist/npm/common/constants.js +0 -10
- package/dist/npm/common/preventable-event.js +0 -31
- package/dist/npm/common/renderer-click.js +0 -6
- package/dist/npm/direction.js +0 -6
- package/dist/npm/display-mode.js +0 -6
- package/dist/npm/group-selection-settings.js +0 -6
- package/dist/npm/index.js +0 -23
- package/dist/npm/localization/custom-messages.component.js +0 -45
- package/dist/npm/localization/localized-toolbar-messages.directive.js +0 -37
- package/dist/npm/localization/messages.js +0 -24
- package/dist/npm/main.js +0 -26
- package/dist/npm/navigation.service.js +0 -132
- package/dist/npm/package-metadata.js +0 -17
- package/dist/npm/popup-settings.js +0 -6
- package/dist/npm/refresh.service.js +0 -24
- package/dist/npm/render-location.js +0 -6
- package/dist/npm/renderer.component.js +0 -134
- package/dist/npm/renderer.service.js +0 -54
- package/dist/npm/tool-options.js +0 -6
- package/dist/npm/toolbar.component.js +0 -650
- package/dist/npm/toolbar.module.js +0 -62
- package/dist/npm/tools/toolbar-button.component.js +0 -312
- package/dist/npm/tools/toolbar-buttongroup.component.js +0 -167
- package/dist/npm/tools/toolbar-buttonlist.component.js +0 -68
- package/dist/npm/tools/toolbar-dropdownbutton.component.js +0 -370
- package/dist/npm/tools/toolbar-separator.component.js +0 -69
- package/dist/npm/tools/toolbar-splitbutton.component.js +0 -382
- package/dist/npm/tools/toolbar-tool.component.js +0 -78
- package/dist/npm/util.js +0 -209
- package/dist/systemjs/kendo-angular-toolbar.js +0 -5
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
* Copyright © 2021 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
|
|
6
|
-
var ToolBarButtonComponent_1;
|
|
7
|
-
import { Component, TemplateRef, forwardRef, ViewChild, Input, Output, EventEmitter, ElementRef } from '@angular/core';
|
|
5
|
+
import { Component, forwardRef, ViewChild, Input, Output, EventEmitter, ElementRef } from '@angular/core';
|
|
8
6
|
import { ToolBarToolComponent } from './toolbar-tool.component';
|
|
9
7
|
import { getValueForLocation } from '../util';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "@progress/kendo-angular-buttons";
|
|
10
|
+
import * as i2 from "@angular/common";
|
|
10
11
|
/**
|
|
11
12
|
* Represents the [Kendo UI ToolBar Button tool for Angular]({% slug controltypes_toolbar %}#toc-buttons).
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
+
export class ToolBarButtonComponent extends ToolBarToolComponent {
|
|
14
15
|
constructor() {
|
|
15
16
|
super();
|
|
16
17
|
// showText and showIcon showIcon should be declared first
|
|
@@ -170,112 +171,66 @@ let ToolBarButtonComponent = ToolBarButtonComponent_1 = class ToolBarButtonCompo
|
|
|
170
171
|
getButton() {
|
|
171
172
|
return (this.overflows ? this.overflowButtonElement : this.toolbarButtonElement).nativeElement;
|
|
172
173
|
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
]
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
]
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
]
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
]
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
], ToolBarButtonComponent.prototype, "icon", null);
|
|
234
|
-
tslib_1.__decorate([
|
|
235
|
-
Input(),
|
|
236
|
-
tslib_1.__metadata("design:type", String),
|
|
237
|
-
tslib_1.__metadata("design:paramtypes", [String])
|
|
238
|
-
], ToolBarButtonComponent.prototype, "iconClass", null);
|
|
239
|
-
tslib_1.__decorate([
|
|
240
|
-
Input(),
|
|
241
|
-
tslib_1.__metadata("design:type", String),
|
|
242
|
-
tslib_1.__metadata("design:paramtypes", [String])
|
|
243
|
-
], ToolBarButtonComponent.prototype, "imageUrl", null);
|
|
244
|
-
tslib_1.__decorate([
|
|
245
|
-
Output(),
|
|
246
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
247
|
-
], ToolBarButtonComponent.prototype, "click", void 0);
|
|
248
|
-
tslib_1.__decorate([
|
|
249
|
-
Output(),
|
|
250
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
251
|
-
], ToolBarButtonComponent.prototype, "pointerdown", void 0);
|
|
252
|
-
tslib_1.__decorate([
|
|
253
|
-
Output(),
|
|
254
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
255
|
-
], ToolBarButtonComponent.prototype, "selectedChange", void 0);
|
|
256
|
-
tslib_1.__decorate([
|
|
257
|
-
ViewChild('toolbarTemplate', { static: true }),
|
|
258
|
-
tslib_1.__metadata("design:type", TemplateRef)
|
|
259
|
-
], ToolBarButtonComponent.prototype, "toolbarTemplate", void 0);
|
|
260
|
-
tslib_1.__decorate([
|
|
261
|
-
ViewChild('popupTemplate', { static: true }),
|
|
262
|
-
tslib_1.__metadata("design:type", TemplateRef)
|
|
263
|
-
], ToolBarButtonComponent.prototype, "popupTemplate", void 0);
|
|
264
|
-
tslib_1.__decorate([
|
|
265
|
-
ViewChild('toolbarButton', { read: ElementRef, static: false }),
|
|
266
|
-
tslib_1.__metadata("design:type", ElementRef)
|
|
267
|
-
], ToolBarButtonComponent.prototype, "toolbarButtonElement", void 0);
|
|
268
|
-
tslib_1.__decorate([
|
|
269
|
-
ViewChild('overflowButton', { read: ElementRef, static: false }),
|
|
270
|
-
tslib_1.__metadata("design:type", ElementRef)
|
|
271
|
-
], ToolBarButtonComponent.prototype, "overflowButtonElement", void 0);
|
|
272
|
-
ToolBarButtonComponent = ToolBarButtonComponent_1 = tslib_1.__decorate([
|
|
273
|
-
Component({
|
|
274
|
-
exportAs: 'kendoToolBarButton',
|
|
275
|
-
// tslint:disable-next-line:no-forward-ref
|
|
276
|
-
providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarButtonComponent_1) }],
|
|
277
|
-
selector: 'kendo-toolbar-button',
|
|
278
|
-
template: `
|
|
174
|
+
}
|
|
175
|
+
ToolBarButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
176
|
+
ToolBarButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarButtonComponent, selector: "kendo-toolbar-button", inputs: { showText: "showText", showIcon: "showIcon", text: "text", style: "style", className: "className", title: "title", disabled: "disabled", toggleable: "toggleable", look: "look", togglable: "togglable", selected: "selected", fillMode: "fillMode", themeColor: "themeColor", icon: "icon", iconClass: "iconClass", imageUrl: "imageUrl" }, outputs: { click: "click", pointerdown: "pointerdown", selectedChange: "selectedChange" }, providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarButtonComponent) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "toolbarButtonElement", first: true, predicate: ["toolbarButton"], descendants: true, read: ElementRef }, { propertyName: "overflowButtonElement", first: true, predicate: ["overflowButton"], descendants: true, read: ElementRef }], exportAs: ["kendoToolBarButton"], usesInheritance: true, ngImport: i0, template: `
|
|
177
|
+
<ng-template #toolbarTemplate>
|
|
178
|
+
<button
|
|
179
|
+
#toolbarButton
|
|
180
|
+
[tabindex]="tabIndex"
|
|
181
|
+
type="button"
|
|
182
|
+
kendoButton
|
|
183
|
+
[ngStyle]="style"
|
|
184
|
+
[ngClass]="className"
|
|
185
|
+
[attr.title]="title"
|
|
186
|
+
[disabled]="disabled"
|
|
187
|
+
[toggleable]="toggleable"
|
|
188
|
+
[fillMode]="fillMode"
|
|
189
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
190
|
+
[selected]="selected"
|
|
191
|
+
[icon]="toolbarOptions.icon"
|
|
192
|
+
[iconClass]="toolbarOptions.iconClass"
|
|
193
|
+
[imageUrl]="toolbarOptions.imageUrl"
|
|
194
|
+
(click)="click.emit($event)"
|
|
195
|
+
(pointerdown)="pointerdown.emit($event)"
|
|
196
|
+
(selectedChange)="selectedChange.emit($event)"
|
|
197
|
+
(blur)="onBlur()"
|
|
198
|
+
>
|
|
199
|
+
{{ toolbarOptions.text }}
|
|
200
|
+
</button>
|
|
201
|
+
</ng-template>
|
|
202
|
+
<ng-template #popupTemplate>
|
|
203
|
+
<button
|
|
204
|
+
#overflowButton
|
|
205
|
+
tabindex="-1"
|
|
206
|
+
type="button"
|
|
207
|
+
kendoButton
|
|
208
|
+
class="k-overflow-button"
|
|
209
|
+
[ngStyle]="style"
|
|
210
|
+
[ngClass]="className"
|
|
211
|
+
[attr.title]="title"
|
|
212
|
+
[disabled]="disabled"
|
|
213
|
+
[toggleable]="toggleable"
|
|
214
|
+
[fillMode]="fillMode"
|
|
215
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
216
|
+
[selected]="selected"
|
|
217
|
+
[icon]="overflowOptions.icon"
|
|
218
|
+
[iconClass]="overflowOptions.iconClass"
|
|
219
|
+
[imageUrl]="overflowOptions.imageUrl"
|
|
220
|
+
(click)="click.emit($event)"
|
|
221
|
+
(selectedChange)="selectedChange.emit($event)"
|
|
222
|
+
>
|
|
223
|
+
{{ overflowOptions.text }}
|
|
224
|
+
</button>
|
|
225
|
+
</ng-template>
|
|
226
|
+
`, isInline: true, directives: [{ type: i1.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarButtonComponent, decorators: [{
|
|
228
|
+
type: Component,
|
|
229
|
+
args: [{
|
|
230
|
+
exportAs: 'kendoToolBarButton',
|
|
231
|
+
providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarButtonComponent) }],
|
|
232
|
+
selector: 'kendo-toolbar-button',
|
|
233
|
+
template: `
|
|
279
234
|
<ng-template #toolbarTemplate>
|
|
280
235
|
<button
|
|
281
236
|
#toolbarButton
|
|
@@ -326,7 +281,55 @@ ToolBarButtonComponent = ToolBarButtonComponent_1 = tslib_1.__decorate([
|
|
|
326
281
|
</button>
|
|
327
282
|
</ng-template>
|
|
328
283
|
`
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
284
|
+
}]
|
|
285
|
+
}], ctorParameters: function () { return []; }, propDecorators: { showText: [{
|
|
286
|
+
type: Input
|
|
287
|
+
}], showIcon: [{
|
|
288
|
+
type: Input
|
|
289
|
+
}], text: [{
|
|
290
|
+
type: Input
|
|
291
|
+
}], style: [{
|
|
292
|
+
type: Input
|
|
293
|
+
}], className: [{
|
|
294
|
+
type: Input
|
|
295
|
+
}], title: [{
|
|
296
|
+
type: Input
|
|
297
|
+
}], disabled: [{
|
|
298
|
+
type: Input
|
|
299
|
+
}], toggleable: [{
|
|
300
|
+
type: Input
|
|
301
|
+
}], look: [{
|
|
302
|
+
type: Input
|
|
303
|
+
}], togglable: [{
|
|
304
|
+
type: Input
|
|
305
|
+
}], selected: [{
|
|
306
|
+
type: Input
|
|
307
|
+
}], fillMode: [{
|
|
308
|
+
type: Input
|
|
309
|
+
}], themeColor: [{
|
|
310
|
+
type: Input
|
|
311
|
+
}], icon: [{
|
|
312
|
+
type: Input
|
|
313
|
+
}], iconClass: [{
|
|
314
|
+
type: Input
|
|
315
|
+
}], imageUrl: [{
|
|
316
|
+
type: Input
|
|
317
|
+
}], click: [{
|
|
318
|
+
type: Output
|
|
319
|
+
}], pointerdown: [{
|
|
320
|
+
type: Output
|
|
321
|
+
}], selectedChange: [{
|
|
322
|
+
type: Output
|
|
323
|
+
}], toolbarTemplate: [{
|
|
324
|
+
type: ViewChild,
|
|
325
|
+
args: ['toolbarTemplate', { static: true }]
|
|
326
|
+
}], popupTemplate: [{
|
|
327
|
+
type: ViewChild,
|
|
328
|
+
args: ['popupTemplate', { static: true }]
|
|
329
|
+
}], toolbarButtonElement: [{
|
|
330
|
+
type: ViewChild,
|
|
331
|
+
args: ['toolbarButton', { read: ElementRef, static: false }]
|
|
332
|
+
}], overflowButtonElement: [{
|
|
333
|
+
type: ViewChild,
|
|
334
|
+
args: ['overflowButton', { read: ElementRef, static: false }]
|
|
335
|
+
}] } });
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, forwardRef, ViewChild, ContentChildren, Input } from '@angular/core';
|
|
6
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import { ToolBarToolComponent } from './toolbar-tool.component';
|
|
8
|
+
import { ToolBarButtonComponent } from './toolbar-button.component';
|
|
9
|
+
import { makePeeker, getIndexOfFocused, seekFocusedIndex, getNextKey, getPrevKey, areEqual } from '../util';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
12
|
+
import * as i2 from "@progress/kendo-angular-buttons";
|
|
13
|
+
import * as i3 from "@angular/common";
|
|
14
|
+
/**
|
|
15
|
+
* Represents the Kendo UI Toolbar ButtonGroup for Angular.
|
|
16
|
+
*/
|
|
17
|
+
export class ToolBarButtonGroupComponent extends ToolBarToolComponent {
|
|
18
|
+
constructor(localization) {
|
|
19
|
+
super();
|
|
20
|
+
this.localization = localization;
|
|
21
|
+
/**
|
|
22
|
+
* By default, the selection mode of the ButtonGroup is set to `multiple`.
|
|
23
|
+
*/
|
|
24
|
+
this.selection = 'multiple';
|
|
25
|
+
this.focusedIndex = -1;
|
|
26
|
+
this.getNextKey = getNextKey(this.localization.rtl);
|
|
27
|
+
this.getPrevKey = getPrevKey(this.localization.rtl);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
set look(look) {
|
|
33
|
+
if (look) {
|
|
34
|
+
this.buttonComponents.forEach(b => b.fillMode = look === 'default' ? 'solid' : look);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
get buttonElements() {
|
|
38
|
+
return this.getButtonGroup()
|
|
39
|
+
.buttons.filter(b => !b.isDisabled)
|
|
40
|
+
.map(b => b.element);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
onFocus() {
|
|
46
|
+
// triggered on tabin
|
|
47
|
+
this.focusedIndex = 0;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
onNavigate(ev) {
|
|
53
|
+
ev.preventDefault();
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @hidden
|
|
57
|
+
*/
|
|
58
|
+
selectedChangeHandler(state, button) {
|
|
59
|
+
button.selected = state;
|
|
60
|
+
button.selectedChange.emit(state);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @hidden
|
|
64
|
+
*/
|
|
65
|
+
onButtonClick(ev) {
|
|
66
|
+
this.focusedIndex = this.buttonElements.findIndex(be => be === ev.target || be.contains(ev.target));
|
|
67
|
+
this.focusButton(this.focusedIndex, ev);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @hidden
|
|
71
|
+
*/
|
|
72
|
+
canFocus() {
|
|
73
|
+
return !(this.disabled || this.buttonElements.length === 0);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* @hidden
|
|
77
|
+
*/
|
|
78
|
+
focus(ev = {}) {
|
|
79
|
+
const nextKey = this.getNextKey(this.overflows);
|
|
80
|
+
const prevKey = this.getPrevKey(this.overflows);
|
|
81
|
+
this.focusedIndex = getIndexOfFocused(prevKey, nextKey, this.buttonElements)(ev);
|
|
82
|
+
this.focusButton(this.focusedIndex, ev);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @hidden
|
|
86
|
+
*/
|
|
87
|
+
handleKey(ev) {
|
|
88
|
+
const nextKey = this.getNextKey(this.overflows);
|
|
89
|
+
const prevKey = this.getPrevKey(this.overflows);
|
|
90
|
+
const peekAtIndex = makePeeker(this.buttonElements);
|
|
91
|
+
const isUnmodified = areEqual(this.focusedIndex);
|
|
92
|
+
this.focusedIndex = seekFocusedIndex(prevKey, nextKey, peekAtIndex)(this.focusedIndex, ev);
|
|
93
|
+
this.focusButton(this.focusedIndex, ev);
|
|
94
|
+
return !isUnmodified(this.focusedIndex);
|
|
95
|
+
}
|
|
96
|
+
getButtonGroup() {
|
|
97
|
+
return this.overflows ? this.overflowButtonGroup : this.toolbarButtonGroup;
|
|
98
|
+
}
|
|
99
|
+
focusButton(index, ev) {
|
|
100
|
+
// Guard against focusing twice on mousedown.
|
|
101
|
+
if (!ev.type || ev.type === 'focus' || ev.type === 'keydown') {
|
|
102
|
+
this.buttonElements[index].focus();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
ToolBarButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarButtonGroupComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
107
|
+
ToolBarButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarButtonGroupComponent, selector: "kendo-toolbar-buttongroup", inputs: { disabled: "disabled", selection: "selection", width: "width", look: "look" }, providers: [LocalizationService, { provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarButtonGroupComponent) }], queries: [{ propertyName: "buttonComponents", predicate: i0.forwardRef(function () { return ToolBarButtonComponent; }) }], viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }, { propertyName: "toolbarButtonGroup", first: true, predicate: ["toolbarButtonGroup"], descendants: true }, { propertyName: "overflowButtonGroup", first: true, predicate: ["overflowButtonGroup"], descendants: true }], exportAs: ["kendoToolBarButtonGroup"], usesInheritance: true, ngImport: i0, template: `
|
|
108
|
+
<ng-template #toolbarTemplate>
|
|
109
|
+
<kendo-buttongroup
|
|
110
|
+
#toolbarButtonGroup
|
|
111
|
+
[tabIndex]="-1"
|
|
112
|
+
[selection]="selection"
|
|
113
|
+
[disabled]="disabled"
|
|
114
|
+
[width]="width"
|
|
115
|
+
(navigate)="onNavigate($event)"
|
|
116
|
+
(focus)="onFocus()"
|
|
117
|
+
>
|
|
118
|
+
<span
|
|
119
|
+
kendoButton
|
|
120
|
+
*ngFor="let button of buttonComponents"
|
|
121
|
+
[ngStyle]="button.style"
|
|
122
|
+
[ngClass]="button.className"
|
|
123
|
+
[attr.title]="button.title"
|
|
124
|
+
[disabled]="button.disabled"
|
|
125
|
+
[togglable]="button.togglable"
|
|
126
|
+
[selected]="button.selected"
|
|
127
|
+
[fillMode]="button.fillMode"
|
|
128
|
+
[themeColor]="button.fillMode ? button.themeColor : null"
|
|
129
|
+
[icon]="button.toolbarOptions.icon"
|
|
130
|
+
[iconClass]="button.toolbarOptions.iconClass"
|
|
131
|
+
[imageUrl]="button.toolbarOptions.imageUrl"
|
|
132
|
+
(click)="button.click.emit($event); onButtonClick($event)"
|
|
133
|
+
(pointerdown)="button.pointerdown.emit($event)"
|
|
134
|
+
(selectedChange)="selectedChangeHandler($event, button)"
|
|
135
|
+
>
|
|
136
|
+
{{ button.toolbarOptions.text }}
|
|
137
|
+
</span>
|
|
138
|
+
</kendo-buttongroup>
|
|
139
|
+
</ng-template>
|
|
140
|
+
<ng-template #popupTemplate>
|
|
141
|
+
<kendo-buttongroup
|
|
142
|
+
#overflowButtonGroup
|
|
143
|
+
class="k-overflow-button"
|
|
144
|
+
[tabIndex]="-1"
|
|
145
|
+
[selection]="selection"
|
|
146
|
+
[disabled]="disabled"
|
|
147
|
+
[width]="width"
|
|
148
|
+
>
|
|
149
|
+
<span
|
|
150
|
+
kendoButton
|
|
151
|
+
class="k-overflow-button"
|
|
152
|
+
*ngFor="let button of buttonComponents"
|
|
153
|
+
[ngStyle]="button.style"
|
|
154
|
+
[ngClass]="button.className"
|
|
155
|
+
[attr.title]="button.title"
|
|
156
|
+
[disabled]="button.disabled"
|
|
157
|
+
[togglable]="button.togglable"
|
|
158
|
+
[selected]="button.selected"
|
|
159
|
+
[fillMode]="button.fillMode"
|
|
160
|
+
[themeColor]="button.fillMode ? button.themeColor : null"
|
|
161
|
+
[icon]="button.overflowOptions.icon"
|
|
162
|
+
[iconClass]="button.overflowOptions.iconClass"
|
|
163
|
+
[imageUrl]="button.overflowOptions.imageUrl"
|
|
164
|
+
(click)="button.click.emit($event); onButtonClick($event)"
|
|
165
|
+
(selectedChange)="selectedChangeHandler($event, button)"
|
|
166
|
+
>
|
|
167
|
+
{{ button.overflowOptions.text }}
|
|
168
|
+
</span>
|
|
169
|
+
</kendo-buttongroup>
|
|
170
|
+
</ng-template>
|
|
171
|
+
`, isInline: true, components: [{ type: i2.ButtonGroupComponent, selector: "kendo-buttongroup", inputs: ["disabled", "selection", "width", "tabIndex"], outputs: ["navigate"], exportAs: ["kendoButtonGroup"] }], directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarButtonGroupComponent, decorators: [{
|
|
173
|
+
type: Component,
|
|
174
|
+
args: [{
|
|
175
|
+
exportAs: 'kendoToolBarButtonGroup',
|
|
176
|
+
providers: [LocalizationService, { provide: ToolBarToolComponent, useExisting: forwardRef(() => ToolBarButtonGroupComponent) }],
|
|
177
|
+
selector: 'kendo-toolbar-buttongroup',
|
|
178
|
+
template: `
|
|
179
|
+
<ng-template #toolbarTemplate>
|
|
180
|
+
<kendo-buttongroup
|
|
181
|
+
#toolbarButtonGroup
|
|
182
|
+
[tabIndex]="-1"
|
|
183
|
+
[selection]="selection"
|
|
184
|
+
[disabled]="disabled"
|
|
185
|
+
[width]="width"
|
|
186
|
+
(navigate)="onNavigate($event)"
|
|
187
|
+
(focus)="onFocus()"
|
|
188
|
+
>
|
|
189
|
+
<span
|
|
190
|
+
kendoButton
|
|
191
|
+
*ngFor="let button of buttonComponents"
|
|
192
|
+
[ngStyle]="button.style"
|
|
193
|
+
[ngClass]="button.className"
|
|
194
|
+
[attr.title]="button.title"
|
|
195
|
+
[disabled]="button.disabled"
|
|
196
|
+
[togglable]="button.togglable"
|
|
197
|
+
[selected]="button.selected"
|
|
198
|
+
[fillMode]="button.fillMode"
|
|
199
|
+
[themeColor]="button.fillMode ? button.themeColor : null"
|
|
200
|
+
[icon]="button.toolbarOptions.icon"
|
|
201
|
+
[iconClass]="button.toolbarOptions.iconClass"
|
|
202
|
+
[imageUrl]="button.toolbarOptions.imageUrl"
|
|
203
|
+
(click)="button.click.emit($event); onButtonClick($event)"
|
|
204
|
+
(pointerdown)="button.pointerdown.emit($event)"
|
|
205
|
+
(selectedChange)="selectedChangeHandler($event, button)"
|
|
206
|
+
>
|
|
207
|
+
{{ button.toolbarOptions.text }}
|
|
208
|
+
</span>
|
|
209
|
+
</kendo-buttongroup>
|
|
210
|
+
</ng-template>
|
|
211
|
+
<ng-template #popupTemplate>
|
|
212
|
+
<kendo-buttongroup
|
|
213
|
+
#overflowButtonGroup
|
|
214
|
+
class="k-overflow-button"
|
|
215
|
+
[tabIndex]="-1"
|
|
216
|
+
[selection]="selection"
|
|
217
|
+
[disabled]="disabled"
|
|
218
|
+
[width]="width"
|
|
219
|
+
>
|
|
220
|
+
<span
|
|
221
|
+
kendoButton
|
|
222
|
+
class="k-overflow-button"
|
|
223
|
+
*ngFor="let button of buttonComponents"
|
|
224
|
+
[ngStyle]="button.style"
|
|
225
|
+
[ngClass]="button.className"
|
|
226
|
+
[attr.title]="button.title"
|
|
227
|
+
[disabled]="button.disabled"
|
|
228
|
+
[togglable]="button.togglable"
|
|
229
|
+
[selected]="button.selected"
|
|
230
|
+
[fillMode]="button.fillMode"
|
|
231
|
+
[themeColor]="button.fillMode ? button.themeColor : null"
|
|
232
|
+
[icon]="button.overflowOptions.icon"
|
|
233
|
+
[iconClass]="button.overflowOptions.iconClass"
|
|
234
|
+
[imageUrl]="button.overflowOptions.imageUrl"
|
|
235
|
+
(click)="button.click.emit($event); onButtonClick($event)"
|
|
236
|
+
(selectedChange)="selectedChangeHandler($event, button)"
|
|
237
|
+
>
|
|
238
|
+
{{ button.overflowOptions.text }}
|
|
239
|
+
</span>
|
|
240
|
+
</kendo-buttongroup>
|
|
241
|
+
</ng-template>
|
|
242
|
+
`
|
|
243
|
+
}]
|
|
244
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; }, propDecorators: { disabled: [{
|
|
245
|
+
type: Input
|
|
246
|
+
}], selection: [{
|
|
247
|
+
type: Input
|
|
248
|
+
}], width: [{
|
|
249
|
+
type: Input
|
|
250
|
+
}], look: [{
|
|
251
|
+
type: Input
|
|
252
|
+
}], toolbarTemplate: [{
|
|
253
|
+
type: ViewChild,
|
|
254
|
+
args: ['toolbarTemplate', { static: true }]
|
|
255
|
+
}], popupTemplate: [{
|
|
256
|
+
type: ViewChild,
|
|
257
|
+
args: ['popupTemplate', { static: true }]
|
|
258
|
+
}], buttonComponents: [{
|
|
259
|
+
type: ContentChildren,
|
|
260
|
+
args: [forwardRef(() => ToolBarButtonComponent)]
|
|
261
|
+
}], toolbarButtonGroup: [{
|
|
262
|
+
type: ViewChild,
|
|
263
|
+
args: ['toolbarButtonGroup', { static: false }]
|
|
264
|
+
}], overflowButtonGroup: [{
|
|
265
|
+
type: ViewChild,
|
|
266
|
+
args: ['overflowButtonGroup', { static: false }]
|
|
267
|
+
}] } });
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, Input, Output, EventEmitter, ViewChildren } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@angular/common";
|
|
8
|
+
import * as i2 from "@progress/kendo-angular-buttons";
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export class ToolBarButtonListComponent {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.disabled = false;
|
|
15
|
+
this.fillMode = 'solid';
|
|
16
|
+
this.themeColor = 'base';
|
|
17
|
+
this.itemClick = new EventEmitter();
|
|
18
|
+
}
|
|
19
|
+
getText(dataItem) {
|
|
20
|
+
if (dataItem) {
|
|
21
|
+
return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
onClick(item, index) {
|
|
26
|
+
const dataItem = this.data[index];
|
|
27
|
+
if (item.click) {
|
|
28
|
+
item.click(dataItem);
|
|
29
|
+
}
|
|
30
|
+
this.itemClick.emit(dataItem);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
ToolBarButtonListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarButtonListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
34
|
+
ToolBarButtonListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ToolBarButtonListComponent, selector: "kendo-toolbar-buttonlist", inputs: { data: "data", textField: "textField", disabled: "disabled", fillMode: "fillMode", themeColor: "themeColor" }, outputs: { itemClick: "itemClick" }, viewQueries: [{ propertyName: "buttons", predicate: ["button"], descendants: true }], ngImport: i0, template: `
|
|
35
|
+
<button
|
|
36
|
+
#button
|
|
37
|
+
type="button"
|
|
38
|
+
tabindex="-1"
|
|
39
|
+
kendoButton
|
|
40
|
+
style="padding-left: 16px"
|
|
41
|
+
class="k-overflow-button"
|
|
42
|
+
*ngFor="let item of data; let i = index"
|
|
43
|
+
[disabled]="disabled || item.disabled"
|
|
44
|
+
[icon]="item.icon"
|
|
45
|
+
[iconClass]="item.iconClass"
|
|
46
|
+
[imageUrl]="item.imageUrl"
|
|
47
|
+
[fillMode]="fillMode"
|
|
48
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
49
|
+
(click)="onClick(item, i)"
|
|
50
|
+
>
|
|
51
|
+
{{ getText(item) }}
|
|
52
|
+
</button>
|
|
53
|
+
`, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ToolBarButtonListComponent, decorators: [{
|
|
55
|
+
type: Component,
|
|
56
|
+
args: [{
|
|
57
|
+
selector: 'kendo-toolbar-buttonlist',
|
|
58
|
+
template: `
|
|
59
|
+
<button
|
|
60
|
+
#button
|
|
61
|
+
type="button"
|
|
62
|
+
tabindex="-1"
|
|
63
|
+
kendoButton
|
|
64
|
+
style="padding-left: 16px"
|
|
65
|
+
class="k-overflow-button"
|
|
66
|
+
*ngFor="let item of data; let i = index"
|
|
67
|
+
[disabled]="disabled || item.disabled"
|
|
68
|
+
[icon]="item.icon"
|
|
69
|
+
[iconClass]="item.iconClass"
|
|
70
|
+
[imageUrl]="item.imageUrl"
|
|
71
|
+
[fillMode]="fillMode"
|
|
72
|
+
[themeColor]="fillMode ? themeColor : null"
|
|
73
|
+
(click)="onClick(item, i)"
|
|
74
|
+
>
|
|
75
|
+
{{ getText(item) }}
|
|
76
|
+
</button>
|
|
77
|
+
`
|
|
78
|
+
}]
|
|
79
|
+
}], propDecorators: { data: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], textField: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], disabled: [{
|
|
84
|
+
type: Input
|
|
85
|
+
}], fillMode: [{
|
|
86
|
+
type: Input
|
|
87
|
+
}], themeColor: [{
|
|
88
|
+
type: Input
|
|
89
|
+
}], itemClick: [{
|
|
90
|
+
type: Output
|
|
91
|
+
}], buttons: [{
|
|
92
|
+
type: ViewChildren,
|
|
93
|
+
args: ['button']
|
|
94
|
+
}] } });
|