@progress/kendo-angular-toolbar 5.0.0-dev.202201190923 → 6.0.0-next.202203010923

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.
Files changed (134) hide show
  1. package/bundles/kendo-angular-toolbar.umd.js +5 -0
  2. package/{dist/es2015/common → common}/constants.d.ts +0 -0
  3. package/{dist/es2015/common → common}/preventable-event.d.ts +0 -0
  4. package/{dist/es2015/common → common}/renderer-click.d.ts +0 -0
  5. package/{dist/es2015/direction.d.ts → direction.d.ts} +0 -0
  6. package/{dist/es2015/display-mode.d.ts → display-mode.d.ts} +0 -0
  7. package/{dist/es2015 → esm2015}/common/constants.js +0 -0
  8. package/{dist/es2015 → esm2015}/common/preventable-event.js +0 -0
  9. package/{dist/es → esm2015}/common/renderer-click.js +1 -0
  10. package/{dist/es2015 → esm2015}/direction.js +1 -0
  11. package/{dist/es2015 → esm2015}/display-mode.js +1 -0
  12. package/{dist/es2015 → esm2015}/group-selection-settings.js +1 -0
  13. package/{dist/es/common/constants.js → esm2015/kendo-angular-toolbar.js} +2 -2
  14. package/esm2015/localization/custom-messages.component.js +40 -0
  15. package/esm2015/localization/localized-toolbar-messages.directive.js +36 -0
  16. package/esm2015/localization/messages.js +22 -0
  17. package/{dist/es → esm2015}/main.js +0 -0
  18. package/{dist/es2015 → esm2015}/navigation.service.js +9 -9
  19. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  20. package/{dist/es → esm2015}/popup-settings.js +1 -0
  21. package/{dist/es2015 → esm2015}/refresh.service.js +8 -10
  22. package/{dist/es → esm2015}/render-location.js +1 -0
  23. package/{dist/es2015 → esm2015}/renderer.component.js +36 -41
  24. package/{dist/es2015 → esm2015}/renderer.service.js +8 -7
  25. package/{dist/es → esm2015}/tool-options.js +1 -0
  26. package/{dist/es2015 → esm2015}/toolbar.component.js +141 -124
  27. package/{dist/es2015 → esm2015}/toolbar.module.js +27 -11
  28. package/{dist/es2015 → esm2015}/tools/toolbar-button.component.js +118 -114
  29. package/esm2015/tools/toolbar-buttongroup.component.js +268 -0
  30. package/esm2015/tools/toolbar-buttonlist.component.js +94 -0
  31. package/{dist/es2015 → esm2015}/tools/toolbar-dropdownbutton.component.js +120 -121
  32. package/esm2015/tools/toolbar-separator.component.js +69 -0
  33. package/{dist/es2015 → esm2015}/tools/toolbar-splitbutton.component.js +130 -125
  34. package/{dist/es2015 → esm2015}/tools/toolbar-tool.component.js +15 -19
  35. package/{dist/es2015 → esm2015}/util.js +0 -0
  36. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-toolbar.js} +1001 -878
  37. package/{dist/es2015/group-selection-settings.d.ts → group-selection-settings.d.ts} +0 -0
  38. package/kendo-angular-toolbar.d.ts +9 -0
  39. package/{dist/es2015/localization → localization}/custom-messages.component.d.ts +4 -1
  40. package/{dist/es2015/localization → localization}/localized-toolbar-messages.directive.d.ts +3 -0
  41. package/{dist/es2015/localization → localization}/messages.d.ts +3 -0
  42. package/{dist/es2015/main.d.ts → main.d.ts} +0 -0
  43. package/{dist/es2015/navigation.service.d.ts → navigation.service.d.ts} +3 -0
  44. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  45. package/package.json +32 -97
  46. package/{dist/es2015/popup-settings.d.ts → popup-settings.d.ts} +0 -0
  47. package/{dist/es2015/refresh.service.d.ts → refresh.service.d.ts} +3 -0
  48. package/{dist/es2015/render-location.d.ts → render-location.d.ts} +0 -0
  49. package/{dist/es2015/renderer.component.d.ts → renderer.component.d.ts} +4 -1
  50. package/{dist/es2015/renderer.service.d.ts → renderer.service.d.ts} +3 -0
  51. package/schematics/ngAdd/index.js +5 -2
  52. package/schematics/ngAdd/index.js.map +1 -1
  53. package/{dist/es2015/tool-options.d.ts → tool-options.d.ts} +0 -0
  54. package/{dist/es2015/toolbar.component.d.ts → toolbar.component.d.ts} +23 -16
  55. package/toolbar.module.d.ts +37 -0
  56. package/{dist/es2015/tools → tools}/toolbar-button.component.d.ts +10 -6
  57. package/{dist/es2015/tools → tools}/toolbar-buttongroup.component.d.ts +7 -5
  58. package/{dist/es2015/tools → tools}/toolbar-buttonlist.component.d.ts +3 -0
  59. package/{dist/es2015/tools → tools}/toolbar-dropdownbutton.component.d.ts +15 -10
  60. package/{dist/es2015/tools → tools}/toolbar-separator.component.d.ts +3 -0
  61. package/{dist/es2015/tools → tools}/toolbar-splitbutton.component.d.ts +14 -9
  62. package/{dist/es2015/tools → tools}/toolbar-tool.component.d.ts +5 -2
  63. package/{dist/es2015/util.d.ts → util.d.ts} +0 -0
  64. package/dist/cdn/js/kendo-angular-toolbar.js +0 -20
  65. package/dist/cdn/main.js +0 -5
  66. package/dist/es/common/preventable-event.js +0 -29
  67. package/dist/es/direction.js +0 -4
  68. package/dist/es/display-mode.js +0 -4
  69. package/dist/es/group-selection-settings.js +0 -4
  70. package/dist/es/index.js +0 -14
  71. package/dist/es/localization/custom-messages.component.js +0 -43
  72. package/dist/es/localization/localized-toolbar-messages.directive.js +0 -35
  73. package/dist/es/localization/messages.js +0 -22
  74. package/dist/es/navigation.service.js +0 -130
  75. package/dist/es/package-metadata.js +0 -15
  76. package/dist/es/refresh.service.js +0 -22
  77. package/dist/es/renderer.component.js +0 -132
  78. package/dist/es/renderer.service.js +0 -52
  79. package/dist/es/toolbar.component.js +0 -627
  80. package/dist/es/toolbar.module.js +0 -60
  81. package/dist/es/tools/toolbar-button.component.js +0 -310
  82. package/dist/es/tools/toolbar-buttongroup.component.js +0 -165
  83. package/dist/es/tools/toolbar-buttonlist.component.js +0 -66
  84. package/dist/es/tools/toolbar-dropdownbutton.component.js +0 -368
  85. package/dist/es/tools/toolbar-separator.component.js +0 -67
  86. package/dist/es/tools/toolbar-splitbutton.component.js +0 -380
  87. package/dist/es/tools/toolbar-tool.component.js +0 -76
  88. package/dist/es/util.js +0 -204
  89. package/dist/es2015/common/renderer-click.js +0 -4
  90. package/dist/es2015/index.d.ts +0 -14
  91. package/dist/es2015/index.js +0 -14
  92. package/dist/es2015/index.metadata.json +0 -1
  93. package/dist/es2015/localization/custom-messages.component.js +0 -35
  94. package/dist/es2015/localization/localized-toolbar-messages.directive.js +0 -31
  95. package/dist/es2015/localization/messages.js +0 -16
  96. package/dist/es2015/main.js +0 -14
  97. package/dist/es2015/popup-settings.js +0 -4
  98. package/dist/es2015/render-location.js +0 -4
  99. package/dist/es2015/tool-options.js +0 -4
  100. package/dist/es2015/toolbar.module.d.ts +0 -18
  101. package/dist/es2015/tools/toolbar-buttongroup.component.js +0 -216
  102. package/dist/es2015/tools/toolbar-buttonlist.component.js +0 -87
  103. package/dist/es2015/tools/toolbar-separator.component.js +0 -68
  104. package/dist/fesm5/index.js +0 -2651
  105. package/dist/npm/common/constants.js +0 -10
  106. package/dist/npm/common/preventable-event.js +0 -31
  107. package/dist/npm/common/renderer-click.js +0 -6
  108. package/dist/npm/direction.js +0 -6
  109. package/dist/npm/display-mode.js +0 -6
  110. package/dist/npm/group-selection-settings.js +0 -6
  111. package/dist/npm/index.js +0 -23
  112. package/dist/npm/localization/custom-messages.component.js +0 -45
  113. package/dist/npm/localization/localized-toolbar-messages.directive.js +0 -37
  114. package/dist/npm/localization/messages.js +0 -24
  115. package/dist/npm/main.js +0 -26
  116. package/dist/npm/navigation.service.js +0 -132
  117. package/dist/npm/package-metadata.js +0 -17
  118. package/dist/npm/popup-settings.js +0 -6
  119. package/dist/npm/refresh.service.js +0 -24
  120. package/dist/npm/render-location.js +0 -6
  121. package/dist/npm/renderer.component.js +0 -134
  122. package/dist/npm/renderer.service.js +0 -54
  123. package/dist/npm/tool-options.js +0 -6
  124. package/dist/npm/toolbar.component.js +0 -629
  125. package/dist/npm/toolbar.module.js +0 -62
  126. package/dist/npm/tools/toolbar-button.component.js +0 -312
  127. package/dist/npm/tools/toolbar-buttongroup.component.js +0 -167
  128. package/dist/npm/tools/toolbar-buttonlist.component.js +0 -68
  129. package/dist/npm/tools/toolbar-dropdownbutton.component.js +0 -370
  130. package/dist/npm/tools/toolbar-separator.component.js +0 -69
  131. package/dist/npm/tools/toolbar-splitbutton.component.js +0 -382
  132. package/dist/npm/tools/toolbar-tool.component.js +0 -78
  133. package/dist/npm/util.js +0 -209
  134. package/dist/systemjs/kendo-angular-toolbar.js +0 -5
@@ -1,2651 +0,0 @@
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 { __decorate, __metadata, __extends } from 'tslib';
6
- import { Injectable, EventEmitter, NgZone, Input, Component, Output, ContentChildren, QueryList, ViewChild, ElementRef, TemplateRef, ViewContainerRef, ViewChildren, HostBinding, HostListener, ChangeDetectorRef, Renderer2, forwardRef, Directive, NgModule } from '@angular/core';
7
- import { PopupService, PopupModule } from '@progress/kendo-angular-popup';
8
- import { Keys, isDocumentAvailable, ResizeSensorComponent, ResizeSensorModule } from '@progress/kendo-angular-common';
9
- import { LocalizationService, L10N_PREFIX, ComponentMessages } from '@progress/kendo-angular-l10n';
10
- import { validatePackage } from '@progress/kendo-licensing';
11
- import { take, filter, takeUntil } from 'rxjs/operators';
12
- import { merge, fromEvent, Subject, Subscription } from 'rxjs';
13
- import { ButtonGroupComponent, DropDownButtonComponent, SplitButtonComponent, ButtonsModule } from '@progress/kendo-angular-buttons';
14
- import { CommonModule } from '@angular/common';
15
-
16
- /**
17
- * @hidden
18
- */
19
- var packageMetadata = {
20
- name: '@progress/kendo-angular-toolbar',
21
- productName: 'Kendo UI for Angular',
22
- productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
23
- publishDate: 1642584102,
24
- version: '',
25
- licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
26
- };
27
-
28
- /**
29
- * @hidden
30
- */
31
- var RefreshService = /** @class */ (function () {
32
- function RefreshService() {
33
- this.onRefresh = new EventEmitter();
34
- }
35
- RefreshService.prototype.refresh = function (tool) {
36
- this.onRefresh.emit(tool);
37
- };
38
- RefreshService = __decorate([
39
- Injectable()
40
- ], RefreshService);
41
- return RefreshService;
42
- }());
43
-
44
- /**
45
- * @hidden
46
- */
47
- var focusableRegex = /^(?:a|input|select|textarea|button|object)$/i;
48
- /**
49
- * @hidden
50
- */
51
- function outerWidth(element) {
52
- var width = element.offsetWidth;
53
- var style = getComputedStyle(element);
54
- width += parseFloat(style.marginLeft) || 0 + parseFloat(style.marginRight) || 0;
55
- return width;
56
- }
57
- /**
58
- * @hidden
59
- */
60
- function innerWidth(element) {
61
- var width = element.offsetWidth;
62
- var style = getComputedStyle(element);
63
- width -= parseFloat(style.paddingLeft) || 0 + parseFloat(style.borderLeftWidth) || 0;
64
- width -= parseFloat(style.paddingRight) || 0 + parseFloat(style.borderRightWidth) || 0;
65
- return width;
66
- }
67
- /**
68
- * @hidden
69
- */
70
- var closest = function (node, predicate) {
71
- while (node && !predicate(node)) {
72
- node = node.parentNode;
73
- }
74
- return node;
75
- };
76
- /**
77
- * @hidden
78
- */
79
- var isVisible = function (element) {
80
- var rect = element.getBoundingClientRect();
81
- var hasSize = rect.width > 0 && rect.height > 0;
82
- var hasPosition = rect.x !== 0 && rect.y !== 0;
83
- // Elements can have zero size due to styling, but they should still count as visible.
84
- // For example, the selection checkbox has no size, but is made visible through styling.
85
- return (hasSize || hasPosition) && window.getComputedStyle(element).visibility !== 'hidden';
86
- };
87
- /**
88
- * @hidden
89
- */
90
- var findElement = function (node, predicate, matchSelf) {
91
- if (matchSelf === void 0) { matchSelf = true; }
92
- if (!node) {
93
- return;
94
- }
95
- if (matchSelf && predicate(node)) {
96
- return node;
97
- }
98
- node = node.firstChild;
99
- while (node) {
100
- if (node.nodeType === 1) {
101
- var element = findElement(node, predicate);
102
- if (element) {
103
- return element;
104
- }
105
- }
106
- node = node.nextSibling;
107
- }
108
- };
109
- /**
110
- * @hidden
111
- */
112
- var isFocusable = function (element, checkVisibility) {
113
- if (checkVisibility === void 0) { checkVisibility = true; }
114
- if (element.tagName) {
115
- var tagName = element.tagName.toLowerCase();
116
- var tabIndex = element.getAttribute('tabIndex');
117
- var focusable = tabIndex !== null;
118
- if (focusableRegex.test(tagName)) {
119
- focusable = !element.disabled;
120
- }
121
- return focusable && (!checkVisibility || isVisible(element));
122
- }
123
- return false;
124
- };
125
- /**
126
- * @hidden
127
- */
128
- var findFocusable = function (element, checkVisibility) {
129
- if (checkVisibility === void 0) { checkVisibility = true; }
130
- return findElement(element, function (node) { return isFocusable(node, checkVisibility); });
131
- };
132
- /**
133
- * @hidden
134
- */
135
- var findFocusableChild = function (element, checkVisibility) {
136
- if (checkVisibility === void 0) { checkVisibility = true; }
137
- return findElement(element, function (node) { return isFocusable(node, checkVisibility); }, false);
138
- };
139
- /**
140
- * @hidden
141
- */
142
- var findFocusableSibling = function (element, checkVisibility, reverse) {
143
- if (checkVisibility === void 0) { checkVisibility = true; }
144
- var node = reverse ? element.prevSibling : element.nextSibling;
145
- while (node) {
146
- if (node.nodeType === 1) {
147
- var result = findElement(node, function (el) { return isFocusable(el, checkVisibility); });
148
- if (result) {
149
- return result;
150
- }
151
- }
152
- node = reverse ? node.prevSibling : node.nextSibling;
153
- }
154
- };
155
- /**
156
- * @hidden
157
- */
158
- var isPresent = function (value) { return value !== null && value !== undefined; };
159
- /**
160
- * @hidden
161
- */
162
- var makePeeker = function (collection) { return function (index) { return isPresent(collection[index]); }; };
163
- /**
164
- * @hidden
165
- */
166
- var getIndexOfFocused = function (prevKeyCode, nextKeyCode, collection) { return function (ev) {
167
- switch (ev.type) {
168
- case 'keydown':
169
- if (ev.keyCode === prevKeyCode) {
170
- return collection.length - 1;
171
- }
172
- if (ev.keyCode === nextKeyCode) {
173
- return 0;
174
- }
175
- break;
176
- case 'click':
177
- return collection.findIndex(function (be) { return be === ev.target || be.contains(ev.target); });
178
- case 'focus':
179
- return 0;
180
- default:
181
- return 0;
182
- }
183
- }; };
184
- /**
185
- * @hidden
186
- */
187
- var seekFocusedIndex = function (prevKeyCode, nextKeyCode, seeker) { return function (startIndex, ev) {
188
- switch (ev.keyCode) {
189
- case prevKeyCode:
190
- return seeker(startIndex - 1) ? startIndex - 1 : startIndex;
191
- case nextKeyCode:
192
- return seeker(startIndex + 1) ? startIndex + 1 : startIndex;
193
- default:
194
- return startIndex;
195
- }
196
- }; };
197
- /**
198
- * @hidden
199
- */
200
- var areEqual = function (first) { return function (second) { return first === second; }; };
201
- /**
202
- * @hidden
203
- */
204
- var getNextKey = function (rtl) {
205
- if (rtl === void 0) { rtl = false; }
206
- return function (overflows) {
207
- if (overflows === void 0) { overflows = true; }
208
- return overflows ? Keys.ArrowDown : rtl ? Keys.ArrowLeft : Keys.ArrowRight;
209
- };
210
- };
211
- /**
212
- * @hidden
213
- */
214
- var getPrevKey = function (rtl) {
215
- if (rtl === void 0) { rtl = false; }
216
- return function (overflows) {
217
- if (overflows === void 0) { overflows = true; }
218
- return overflows ? Keys.ArrowUp : rtl ? Keys.ArrowRight : Keys.ArrowLeft;
219
- };
220
- };
221
- /**
222
- * @hidden
223
- */
224
- var getValueForLocation = function (property, displayMode, overflows) {
225
- switch (displayMode) {
226
- case 'toolbar':
227
- return overflows ? undefined : property;
228
- case 'overflow':
229
- return overflows ? property : undefined;
230
- default:
231
- return property;
232
- }
233
- };
234
-
235
- /**
236
- * @hidden
237
- */
238
- var NavigationService = /** @class */ (function () {
239
- function NavigationService(zone) {
240
- this.zone = zone;
241
- this.focused = { renderedTool: null, index: -1 };
242
- this.renderedTools = [];
243
- this.isPopupFocused = false;
244
- this.isOverflowButtonFocused = false;
245
- }
246
- NavigationService.prototype.setRenderedTools = function (rts) {
247
- this.renderedTools = rts.slice();
248
- };
249
- NavigationService.prototype.click = function (_a) {
250
- var context = _a.context, ev = _a.event;
251
- if (this.focused.renderedTool !== context && ev) {
252
- this.focus(context, ev);
253
- }
254
- };
255
- NavigationService.prototype.moveFocusToToolBar = function () {
256
- this.isPopupFocused = false;
257
- this.focusOverflowButton();
258
- };
259
- NavigationService.prototype.moveFocusToPopup = function () {
260
- this.isPopupFocused = true;
261
- this.blurOverflowButton();
262
- this.focus();
263
- };
264
- NavigationService.prototype.focusNext = function (ev) {
265
- if (!this.isOverflowButtonFocused && this.focused.renderedTool && !this.focused.renderedTool.tool.handleKey(ev)) {
266
- var nextRT = this.getFocusableTools().slice(this.focused.index + 1)[0];
267
- if (nextRT) {
268
- this.focus(nextRT, ev);
269
- }
270
- else {
271
- if (this.isOverflowButtonVisible() && !this.isPopupFocused) {
272
- this.focusOverflowButton();
273
- }
274
- }
275
- }
276
- };
277
- NavigationService.prototype.focusPrev = function (ev) {
278
- if (this.isOverflowButtonFocused) {
279
- var lastFocusableRT = this.getFocusableTools().reverse()[0];
280
- this.focus(lastFocusableRT, ev);
281
- }
282
- else if (this.focused.renderedTool && !this.focused.renderedTool.tool.handleKey(ev)) {
283
- var prevRT = this.getFocusableTools()
284
- .slice(0, this.focused.index)
285
- .reverse()[0];
286
- if (prevRT) {
287
- this.focus(prevRT, ev);
288
- }
289
- }
290
- };
291
- NavigationService.prototype.resetNavigation = function () {
292
- this.blurOverflowButton();
293
- this.focused.renderedTool = null;
294
- this.focused.index = -1;
295
- };
296
- NavigationService.prototype.focusFirst = function (ev) {
297
- var firstTool = this.getFocusableTools()[0];
298
- var overFlowButton = this.overflowButton;
299
- if (firstTool) {
300
- this.focused.renderedTool = firstTool;
301
- this.focused.index = this.getFocusableTools().findIndex(function (rt) { return rt === firstTool; });
302
- this.focus(firstTool, ev);
303
- }
304
- else if (overFlowButton) {
305
- overFlowButton.nativeElement.focus();
306
- }
307
- };
308
- NavigationService.prototype.getFocusableTools = function () {
309
- var _this = this;
310
- return this.renderedTools.filter(function (rt) { return rt.tool.overflows === _this.isPopupFocused && rt.tool.canFocus(); });
311
- };
312
- NavigationService.prototype.focus = function (renderedTool, ev) {
313
- var _this = this;
314
- // running the code below in onStable fixes issue #2939
315
- this.zone.onStable.pipe(take(1)).subscribe(function () {
316
- if (!renderedTool) {
317
- var focusableRTs = _this.getFocusableTools();
318
- var lastFocusedRT_1 = focusableRTs.find(function (rt) { return rt === _this.focused.renderedTool; }) || focusableRTs[0];
319
- // guard against only disabled tools
320
- if (lastFocusedRT_1) {
321
- _this.focused.renderedTool = lastFocusedRT_1;
322
- _this.focused.index = _this.getFocusableTools().findIndex(function (rt) { return rt === lastFocusedRT_1; });
323
- // if event is undefined, then this means that the tool is the first one in the overflow popup
324
- lastFocusedRT_1.tool.focus(ev);
325
- }
326
- }
327
- else if (renderedTool.tool.canFocus && renderedTool.tool.canFocus()) {
328
- _this.focused.renderedTool = renderedTool;
329
- _this.focused.index = _this.getFocusableTools().findIndex(function (rt) { return rt === renderedTool; });
330
- renderedTool.tool.focus(ev);
331
- _this.blurOverflowButton();
332
- }
333
- });
334
- };
335
- NavigationService.prototype.blurOverflowButton = function () {
336
- if (this.overflowButton) {
337
- this.isOverflowButtonFocused = false;
338
- this.overflowButton.nativeElement.tabIndex = -1;
339
- }
340
- };
341
- NavigationService.prototype.focusOverflowButton = function () {
342
- this.isOverflowButtonFocused = true;
343
- this.overflowButton.nativeElement.tabIndex = 0;
344
- this.overflowButton.nativeElement.focus();
345
- };
346
- NavigationService.prototype.isOverflowButtonVisible = function () {
347
- return (isPresent(this.overflowButton) &&
348
- window.getComputedStyle(this.overflowButton.nativeElement).getPropertyValue('visibility') === 'visible');
349
- };
350
- NavigationService = __decorate([
351
- Injectable(),
352
- __metadata("design:paramtypes", [NgZone])
353
- ], NavigationService);
354
- return NavigationService;
355
- }());
356
-
357
- /**
358
- * Represents the Base ToolBar Tool component for Angular.
359
- * Extend this class to create custom tools.
360
- */
361
- var ToolBarToolComponent = /** @class */ (function () {
362
- function ToolBarToolComponent() {
363
- this.tabIndex = -1; //Focus movement inside the toolbar is managed using roving tabindex.
364
- this.overflows = true;
365
- // this should be replaced with showTool: DisplayMode = 'both';
366
- /**
367
- * @hidden
368
- */
369
- this.responsive = true;
370
- }
371
- Object.defineProperty(ToolBarToolComponent.prototype, "toolbarDisplay", {
372
- get: function () {
373
- return this.overflows ? 'none' : 'inline-block';
374
- },
375
- enumerable: true,
376
- configurable: true
377
- });
378
- Object.defineProperty(ToolBarToolComponent.prototype, "overflowDisplay", {
379
- get: function () {
380
- return this.overflows ? 'block' : 'none';
381
- },
382
- enumerable: true,
383
- configurable: true
384
- });
385
- /**
386
- * Determines if the tool can be focused.
387
- * If the returned value is `false`, the tool will not be part of the keyboard navigation.
388
- * @returns `true` if the tool should take part in keyboard navigation.
389
- */
390
- ToolBarToolComponent.prototype.canFocus = function () {
391
- return false;
392
- };
393
- /**
394
- * Called when the tool is focused.
395
- * The method accepts as argument the original browser event, which can be a `KeyboardEvent`, `MouseEvent` or `FocusEvent`.
396
- * @param {Event} ev - This is the event that caused the tool to be focused.
397
- */
398
- // @ts-ignore
399
- ToolBarToolComponent.prototype.focus = function (ev) {
400
- /* noop */
401
- };
402
- /**
403
- * Called when the tool is focused and one of the arrow keys is pressed.
404
- * The returned boolean value determines whether the `ToolBarComponent` will move the focus to the next/previous `ToolBarToolComponent`
405
- * ([see example]({% slug customcontroltypes_toolbar %}#toc-adding-keyboard-navigation)).
406
- * @param {KeyboardEvent} ev - The last pressed arrow key
407
- * @returns
408
- */
409
- // @ts-ignore
410
- ToolBarToolComponent.prototype.handleKey = function (ev) {
411
- return false;
412
- };
413
- __decorate([
414
- Input(),
415
- __metadata("design:type", Boolean)
416
- ], ToolBarToolComponent.prototype, "responsive", void 0);
417
- ToolBarToolComponent = __decorate([
418
- Component({
419
- // tslint:disable-next-line:component-selector
420
- selector: 'toolbar-tool',
421
- template: ""
422
- })
423
- ], ToolBarToolComponent);
424
- return ToolBarToolComponent;
425
- }());
426
-
427
- /**
428
- * @hidden
429
- */
430
- var PreventableEvent = /** @class */ (function () {
431
- function PreventableEvent() {
432
- this.prevented = false;
433
- }
434
- /**
435
- * Prevents the default action for a specified event.
436
- * In this way, the source component suppresses the built-in behavior that follows the event.
437
- */
438
- PreventableEvent.prototype.preventDefault = function () {
439
- this.prevented = true;
440
- };
441
- /**
442
- * If the event is prevented by any of its subscribers, returns `true`.
443
- *
444
- * @returns `true` if the default action was prevented. Otherwise, returns `false`.
445
- */
446
- PreventableEvent.prototype.isDefaultPrevented = function () {
447
- return this.prevented;
448
- };
449
- return PreventableEvent;
450
- }());
451
-
452
- /**
453
- * @hidden
454
- */
455
- var defaultPopupWidth = '150px';
456
-
457
- var getInitialPopupSettings = function (isRtl) { return ({
458
- animate: true,
459
- anchorAlign: { horizontal: isRtl ? 'left' : 'right', vertical: 'bottom' },
460
- popupAlign: { horizontal: isRtl ? 'left' : 'right', vertical: 'top' }
461
- }); };
462
- /**
463
- * Represents the [Kendo UI ToolBar component for Angular]({% slug overview_toolbar %}).
464
- */
465
- var ToolBarComponent = /** @class */ (function () {
466
- function ToolBarComponent(localization, popupService, refreshService, navigationService, element, cdr, zone, renderer) {
467
- this.localization = localization;
468
- this.popupService = popupService;
469
- this.refreshService = refreshService;
470
- this.navigationService = navigationService;
471
- this.element = element;
472
- this.cdr = cdr;
473
- this.zone = zone;
474
- this.renderer = renderer;
475
- /**
476
- * Hides the overflowing tools in a popup.
477
- */
478
- this.overflow = false;
479
- /**
480
- * Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the ToolBar.
481
- */
482
- this.tabindex = 0;
483
- /**
484
- * Fires when the overflow popup of the ToolBar is opened.
485
- */
486
- this.open = new EventEmitter();
487
- /**
488
- * Fires when the overflow popup of the ToolBar is closed.
489
- */
490
- this.close = new EventEmitter();
491
- this.hostClasses = true;
492
- this.cancelRenderedToolsSubscription$ = new Subject();
493
- this.subscriptions = new Subscription();
494
- validatePackage(packageMetadata);
495
- this.direction = localization.rtl ? 'rtl' : 'ltr';
496
- }
497
- Object.defineProperty(ToolBarComponent.prototype, "resizable", {
498
- get: function () {
499
- return this.overflow;
500
- },
501
- /**
502
- * @hidden
503
- */
504
- set: function (value) {
505
- this.overflow = value;
506
- },
507
- enumerable: true,
508
- configurable: true
509
- });
510
- Object.defineProperty(ToolBarComponent.prototype, "popupSettings", {
511
- get: function () {
512
- return this._popupSettings || getInitialPopupSettings(this.localization.rtl);
513
- },
514
- /**
515
- * Configures the popup of the ToolBar drop-down list.
516
- *
517
- * The available options are:
518
- * - `animate: Boolean`—Controls the popup animation. By default, the open and close animations are enabled.
519
- * - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup.
520
- */
521
- set: function (settings) {
522
- this._popupSettings = Object.assign({}, getInitialPopupSettings(this.localization.rtl), settings);
523
- },
524
- enumerable: true,
525
- configurable: true
526
- });
527
- Object.defineProperty(ToolBarComponent.prototype, "tabIndex", {
528
- get: function () {
529
- return this.tabindex;
530
- },
531
- /**
532
- * @hidden
533
- */
534
- set: function (tabIndex) {
535
- this.tabindex = tabIndex;
536
- },
537
- enumerable: true,
538
- configurable: true
539
- });
540
- Object.defineProperty(ToolBarComponent.prototype, "appendTo", {
541
- get: function () {
542
- var appendTo = this.popupSettings.appendTo;
543
- if (!appendTo || appendTo === 'root') {
544
- return undefined;
545
- }
546
- return appendTo === 'component' ? this.container : appendTo;
547
- },
548
- enumerable: true,
549
- configurable: true
550
- });
551
- Object.defineProperty(ToolBarComponent.prototype, "popupOpen", {
552
- get: function () {
553
- return this._open;
554
- },
555
- set: function (open) {
556
- if (this.popupOpen === open) {
557
- return;
558
- }
559
- var eventArgs = new PreventableEvent();
560
- if (open) {
561
- this.open.emit(eventArgs);
562
- }
563
- else {
564
- this.close.emit(eventArgs);
565
- }
566
- if (eventArgs.isDefaultPrevented()) {
567
- return;
568
- }
569
- this.toggle(open);
570
- },
571
- enumerable: true,
572
- configurable: true
573
- });
574
- /**
575
- * @hidden
576
- */
577
- ToolBarComponent.prototype.onFocus = function (ev) {
578
- this.navigationService.resetNavigation();
579
- this.navigationService.focusFirst(ev);
580
- // prevents ExpressionChangedAfterItHasBeenCheckedError when tools with popup are opened/closed asynchronously
581
- this.element.nativeElement.setAttribute('tabindex', '-1');
582
- };
583
- /**
584
- * @hidden
585
- */
586
- ToolBarComponent.prototype.onFocusOut = function (event) {
587
- var _this = this;
588
- // prevents ExpressionChangedAfterItHasBeenCheckedError when tools with popup are opened/closed asynchronously
589
- if (closest(event.relatedTarget, function (el) { return el === _this.element.nativeElement; })) {
590
- this.element.nativeElement.setAttribute('tabindex', '-1');
591
- return;
592
- }
593
- this.element.nativeElement.setAttribute('tabindex', this.tabindex.toString());
594
- };
595
- Object.defineProperty(ToolBarComponent.prototype, "getRole", {
596
- get: function () {
597
- return 'toolbar';
598
- },
599
- enumerable: true,
600
- configurable: true
601
- });
602
- Object.defineProperty(ToolBarComponent.prototype, "getDir", {
603
- get: function () {
604
- return this.direction;
605
- },
606
- enumerable: true,
607
- configurable: true
608
- });
609
- Object.defineProperty(ToolBarComponent.prototype, "resizableClass", {
610
- get: function () {
611
- return this.overflow;
612
- },
613
- enumerable: true,
614
- configurable: true
615
- });
616
- ToolBarComponent.prototype.ngAfterViewInit = function () {
617
- var _this = this;
618
- var element = this.element.nativeElement;
619
- if (!element.getAttribute('tabindex')) {
620
- this.element.nativeElement.setAttribute('tabindex', '0');
621
- }
622
- this.zone.runOutsideAngular(function () {
623
- _this.toolbarKeydownListener = _this.renderer.listen(_this.element.nativeElement, 'keydown', function (ev) {
624
- switch (ev.keyCode) {
625
- case Keys.ArrowLeft:
626
- _this.zone.run(function () {
627
- ev.preventDefault();
628
- _this.direction === 'ltr' ? _this.navigationService.focusPrev(ev) : _this.navigationService.focusNext(ev);
629
- // prevents ExpressionChangedAfterItHasBeenCheckedError when tools with popup are opened/closed asynchronously
630
- _this.element.nativeElement.setAttribute('tabindex', '-1');
631
- });
632
- break;
633
- case Keys.ArrowRight:
634
- _this.zone.run(function () {
635
- ev.preventDefault();
636
- _this.direction === 'ltr' ? _this.navigationService.focusNext(ev) : _this.navigationService.focusPrev(ev);
637
- // prevents ExpressionChangedAfterItHasBeenCheckedError when tools with popup are opened/closed asynchronously
638
- _this.element.nativeElement.setAttribute('tabindex', '-1');
639
- });
640
- break;
641
- case Keys.Tab:
642
- _this.zone.run(function () { return _this.navigationService.resetNavigation(); });
643
- break;
644
- case Keys.Escape:
645
- _this.zone.run(function () { return _this.toggle(false); });
646
- break;
647
- default:
648
- break;
649
- }
650
- });
651
- });
652
- if (this.overflow) {
653
- this.subscriptions.add(merge(this.resizeSensor.resize.pipe(filter(function () { return _this.overflow; })), this.renderedTools.changes).subscribe(function () {
654
- return _this.onResize();
655
- }));
656
- // because of https://github.com/telerik/kendo-angular-buttons/pull/276
657
- this.zone.runOutsideAngular(function () { return setTimeout(function () { return _this.onResize(); }); });
658
- this.navigationService.overflowButton = this.overflowButton;
659
- }
660
- this.navigationService.setRenderedTools(this.renderedTools.toArray());
661
- this.subscriptions.add(this.renderedTools.changes.subscribe(function (rts) {
662
- return _this.navigationService.setRenderedTools(rts.toArray());
663
- }));
664
- };
665
- ToolBarComponent.prototype.ngOnInit = function () {
666
- var _this = this;
667
- this.subscriptions.add(this.localization.changes.subscribe(function (_a) {
668
- var rtl = _a.rtl;
669
- return (_this.direction = rtl ? 'rtl' : 'ltr');
670
- }));
671
- if (isDocumentAvailable()) {
672
- this.zone.runOutsideAngular(function () {
673
- return _this.subscriptions.add(fromEvent(document, 'click')
674
- .pipe(filter(function () { return !!_this.popupRef; }), filter(function (ev) { return !_this.popupRef.popup.instance.container.nativeElement.contains(ev.target); }), filter(function (ev) { return !_this.overflowButton.nativeElement.contains(ev.target); }))
675
- .subscribe(function () {
676
- _this.zone.run(function () {
677
- _this.popupOpen = false;
678
- });
679
- }));
680
- });
681
- }
682
- };
683
- ToolBarComponent.prototype.ngOnChanges = function (changes) {
684
- if (changes.tabindex) {
685
- // prevents ExpressionChangedAfterItHasBeenCheckedError when tools with popup are opened/closed asynchronously
686
- this.element.nativeElement.setAttribute('tabindex', changes.tabindex.currentValue.toString());
687
- }
688
- };
689
- ToolBarComponent.prototype.ngOnDestroy = function () {
690
- if (this.popupRef) {
691
- this.popupRef.close();
692
- }
693
- if (this.toolbarKeydownListener) {
694
- this.toolbarKeydownListener();
695
- }
696
- this.cancelRenderedToolsSubscription$.next();
697
- this.subscriptions.unsubscribe();
698
- };
699
- Object.defineProperty(ToolBarComponent.prototype, "moreToolsTitle", {
700
- /**
701
- * @hidden
702
- */
703
- get: function () {
704
- return this.localization.get('moreToolsTitle');
705
- },
706
- enumerable: true,
707
- configurable: true
708
- });
709
- /**
710
- * @hidden
711
- */
712
- ToolBarComponent.prototype.onRendererClick = function (data) {
713
- this.navigationService.click(data);
714
- this.element.nativeElement.setAttribute('tabindex', '-1');
715
- };
716
- /**
717
- * @hidden
718
- */
719
- ToolBarComponent.prototype.showPopup = function () {
720
- this.popupOpen = !this.popupOpen;
721
- this.navigationService.click({ context: undefined, event: undefined });
722
- };
723
- /**
724
- * Toggles the visibility of the overflow popup.
725
- */
726
- ToolBarComponent.prototype.toggle = function (popupOpen) {
727
- this._open = popupOpen !== undefined ? popupOpen : !this.popupOpen;
728
- if (this.popupRef) {
729
- this.popupRef.close();
730
- this.popupRef = null;
731
- }
732
- if (this.popupOpen) {
733
- this.popupRef = this.popupService.open({
734
- anchor: this.overflowButton,
735
- anchorAlign: this.popupSettings.anchorAlign,
736
- popupAlign: this.popupSettings.popupAlign,
737
- content: this.popupTemplate,
738
- appendTo: this.appendTo,
739
- animate: this.popupSettings.animate,
740
- popupClass: this.popupSettings.popupClass,
741
- positionMode: 'absolute'
742
- });
743
- this.setPopupContentDimensions();
744
- this.popupRef.popupOpen.subscribe(this.onPopupOpen.bind(this));
745
- this.popupRef.popupClose.subscribe(this.onPopupClose.bind(this));
746
- }
747
- };
748
- /**
749
- * @hidden
750
- */
751
- ToolBarComponent.prototype.onResize = function () {
752
- if (isDocumentAvailable()) {
753
- var containerWidth = innerWidth(this.element.nativeElement) - this.overflowAnchorWidth;
754
- this.shrink(containerWidth, this.childrenWidth);
755
- this.stretch(containerWidth, this.childrenWidth);
756
- }
757
- this.cdr.detectChanges();
758
- this.resizeSensor.acceptSize();
759
- };
760
- /**
761
- * @hidden
762
- */
763
- ToolBarComponent.prototype.onPopupOpen = function () {
764
- var _this = this;
765
- this.zone.runOutsideAngular(function () {
766
- _this.overflowKeydownListener = _this.renderer.listen(_this.popupRef.popupElement, 'keydown', function (ev) {
767
- switch (ev.keyCode) {
768
- case Keys.ArrowUp:
769
- _this.zone.run(function () {
770
- ev.preventDefault();
771
- _this.navigationService.focusPrev(ev);
772
- });
773
- break;
774
- case Keys.ArrowDown:
775
- _this.zone.run(function () {
776
- ev.preventDefault();
777
- _this.navigationService.focusNext(ev);
778
- });
779
- break;
780
- case Keys.Escape:
781
- _this.zone.run(function () { return _this.toggle(false); });
782
- break;
783
- case Keys.Tab:
784
- _this.zone.run(function () {
785
- _this.toggle(false);
786
- _this.navigationService.resetNavigation();
787
- });
788
- break;
789
- default:
790
- break;
791
- }
792
- });
793
- });
794
- this.cancelRenderedToolsSubscription$.next();
795
- this.navigationService.moveFocusToPopup();
796
- this.navigationService.setRenderedTools(this.overflowRenderedTools.toArray());
797
- this.overflowRenderedTools.changes
798
- .pipe(takeUntil(this.cancelRenderedToolsSubscription$))
799
- .subscribe(function (rts) { return _this.navigationService.setRenderedTools(rts.toArray()); });
800
- };
801
- /**
802
- * @hidden
803
- */
804
- ToolBarComponent.prototype.onPopupClose = function () {
805
- var _this = this;
806
- this.cancelRenderedToolsSubscription$.next();
807
- this.navigationService.setRenderedTools(this.renderedTools.toArray());
808
- this.renderedTools.changes
809
- .pipe(takeUntil(this.cancelRenderedToolsSubscription$))
810
- .subscribe(function (rts) { return _this.navigationService.setRenderedTools(rts.toArray()); });
811
- this.navigationService.moveFocusToToolBar();
812
- if (this.overflowKeydownListener) {
813
- this.overflowKeydownListener();
814
- }
815
- };
816
- Object.defineProperty(ToolBarComponent.prototype, "displayAnchor", {
817
- get: function () {
818
- return this.allTools.filter(function (t) { return t.overflows && t.responsive; }).length > 0 ? 'visible' : 'hidden';
819
- },
820
- enumerable: true,
821
- configurable: true
822
- });
823
- Object.defineProperty(ToolBarComponent.prototype, "popupWidth", {
824
- get: function () {
825
- if (!this.popupSettings || !this.popupSettings.width) {
826
- return defaultPopupWidth;
827
- }
828
- return isNaN(this.popupSettings.width) ? this.popupSettings.width : this.popupSettings.width + "px";
829
- },
830
- enumerable: true,
831
- configurable: true
832
- });
833
- Object.defineProperty(ToolBarComponent.prototype, "popupHeight", {
834
- get: function () {
835
- if (!this.popupSettings || !this.popupSettings.height) {
836
- return;
837
- }
838
- return isNaN(this.popupSettings.height) ? this.popupSettings.height : this.popupSettings.height + "px";
839
- },
840
- enumerable: true,
841
- configurable: true
842
- });
843
- Object.defineProperty(ToolBarComponent.prototype, "overflowAnchorWidth", {
844
- get: function () {
845
- if (!this.overflow) {
846
- return 0;
847
- }
848
- if (!this.cachedOverflowAnchorWidth) {
849
- this.cachedOverflowAnchorWidth = outerWidth(this.overflowButton.nativeElement);
850
- }
851
- return this.cachedOverflowAnchorWidth;
852
- },
853
- enumerable: true,
854
- configurable: true
855
- });
856
- Object.defineProperty(ToolBarComponent.prototype, "childrenWidth", {
857
- get: function () {
858
- var width = this.renderedTools.reduce(function (totalWidth, tool) { return tool.width + totalWidth; }, 0);
859
- return Math.ceil(width);
860
- },
861
- enumerable: true,
862
- configurable: true
863
- });
864
- Object.defineProperty(ToolBarComponent.prototype, "visibleTools", {
865
- get: function () {
866
- return this.allTools.filter(function (tool) {
867
- return tool.overflows === false;
868
- });
869
- },
870
- enumerable: true,
871
- configurable: true
872
- });
873
- Object.defineProperty(ToolBarComponent.prototype, "overflowTools", {
874
- get: function () {
875
- return this.allTools.filter(function (tool) {
876
- return tool.overflows === true;
877
- });
878
- },
879
- enumerable: true,
880
- configurable: true
881
- });
882
- ToolBarComponent.prototype.shrink = function (containerWidth, childrenWidth) {
883
- var width;
884
- if (containerWidth < childrenWidth) {
885
- for (var i = this.visibleTools.length - 1; i >= 0; i--) {
886
- if (containerWidth > childrenWidth) {
887
- break;
888
- }
889
- else {
890
- width = this.hideLastVisibleTool();
891
- childrenWidth -= width;
892
- }
893
- }
894
- }
895
- };
896
- ToolBarComponent.prototype.stretch = function (containerWidth, childrenWidth) {
897
- var width;
898
- if (containerWidth > childrenWidth) {
899
- for (var i = this.overflowTools.length - 1; i >= 0; i--) {
900
- width = this.showFirstHiddenTool(containerWidth, childrenWidth);
901
- if (width) {
902
- childrenWidth += width;
903
- }
904
- else {
905
- break;
906
- }
907
- }
908
- }
909
- };
910
- ToolBarComponent.prototype.hideLastVisibleTool = function () {
911
- var tool = this.visibleTools[this.visibleTools.length - 1];
912
- var renderedElement = this.renderedTools.find(function (r) {
913
- return r.tool === tool;
914
- });
915
- var width = renderedElement.width;
916
- tool.overflows = true;
917
- this.refreshService.refresh(tool);
918
- return width;
919
- };
920
- ToolBarComponent.prototype.showFirstHiddenTool = function (containerWidth, childrenWidth) {
921
- var tool = this.overflowTools[0];
922
- var renderedElement = this.renderedTools.find(function (r) { return r.tool === tool; });
923
- tool.overflows = false;
924
- tool.visibility = 'hidden';
925
- this.refreshService.refresh(tool);
926
- if (containerWidth > childrenWidth + renderedElement.width) {
927
- tool.visibility = 'visible';
928
- this.refreshService.refresh(tool);
929
- }
930
- else {
931
- tool.overflows = true;
932
- this.refreshService.refresh(tool);
933
- }
934
- return renderedElement.width; // returns 0 if `overflows` is true
935
- };
936
- ToolBarComponent.prototype.setPopupContentDimensions = function () {
937
- var popupContentContainer = this.popupRef.popup.instance.contentContainer.nativeElement;
938
- popupContentContainer.style.width = this.popupWidth;
939
- popupContentContainer.style.height = this.popupHeight;
940
- popupContentContainer.style.overflow = 'auto';
941
- };
942
- __decorate([
943
- Input(),
944
- __metadata("design:type", Boolean)
945
- ], ToolBarComponent.prototype, "overflow", void 0);
946
- __decorate([
947
- Input(),
948
- __metadata("design:type", Boolean),
949
- __metadata("design:paramtypes", [Boolean])
950
- ], ToolBarComponent.prototype, "resizable", null);
951
- __decorate([
952
- Input(),
953
- __metadata("design:type", Object),
954
- __metadata("design:paramtypes", [Object])
955
- ], ToolBarComponent.prototype, "popupSettings", null);
956
- __decorate([
957
- Input(),
958
- __metadata("design:type", Number)
959
- ], ToolBarComponent.prototype, "tabindex", void 0);
960
- __decorate([
961
- Input('tabIndex'),
962
- __metadata("design:type", Number),
963
- __metadata("design:paramtypes", [Number])
964
- ], ToolBarComponent.prototype, "tabIndex", null);
965
- __decorate([
966
- Output(),
967
- __metadata("design:type", EventEmitter)
968
- ], ToolBarComponent.prototype, "open", void 0);
969
- __decorate([
970
- Output(),
971
- __metadata("design:type", EventEmitter)
972
- ], ToolBarComponent.prototype, "close", void 0);
973
- __decorate([
974
- ContentChildren(ToolBarToolComponent),
975
- __metadata("design:type", QueryList)
976
- ], ToolBarComponent.prototype, "allTools", void 0);
977
- __decorate([
978
- ViewChild('overflowButton', { static: false }),
979
- __metadata("design:type", ElementRef)
980
- ], ToolBarComponent.prototype, "overflowButton", void 0);
981
- __decorate([
982
- ViewChild('popupTemplate', { static: true }),
983
- __metadata("design:type", TemplateRef)
984
- ], ToolBarComponent.prototype, "popupTemplate", void 0);
985
- __decorate([
986
- ViewChild('resizeSensor', { static: false }),
987
- __metadata("design:type", ResizeSensorComponent)
988
- ], ToolBarComponent.prototype, "resizeSensor", void 0);
989
- __decorate([
990
- ViewChild('container', { read: ViewContainerRef, static: true }),
991
- __metadata("design:type", ViewContainerRef)
992
- ], ToolBarComponent.prototype, "container", void 0);
993
- __decorate([
994
- ViewChildren('toolbarRenderer'),
995
- __metadata("design:type", QueryList)
996
- ], ToolBarComponent.prototype, "renderedTools", void 0);
997
- __decorate([
998
- ViewChildren('overflowRenderer'),
999
- __metadata("design:type", QueryList)
1000
- ], ToolBarComponent.prototype, "overflowRenderedTools", void 0);
1001
- __decorate([
1002
- HostBinding('class.k-widget'),
1003
- HostBinding('class.k-toolbar'),
1004
- __metadata("design:type", Boolean)
1005
- ], ToolBarComponent.prototype, "hostClasses", void 0);
1006
- __decorate([
1007
- HostListener('focus', ['$event']),
1008
- __metadata("design:type", Function),
1009
- __metadata("design:paramtypes", [Object]),
1010
- __metadata("design:returntype", void 0)
1011
- ], ToolBarComponent.prototype, "onFocus", null);
1012
- __decorate([
1013
- HostListener('focusout', ['$event']),
1014
- __metadata("design:type", Function),
1015
- __metadata("design:paramtypes", [Object]),
1016
- __metadata("design:returntype", void 0)
1017
- ], ToolBarComponent.prototype, "onFocusOut", null);
1018
- __decorate([
1019
- HostBinding('attr.role'),
1020
- __metadata("design:type", String),
1021
- __metadata("design:paramtypes", [])
1022
- ], ToolBarComponent.prototype, "getRole", null);
1023
- __decorate([
1024
- HostBinding('attr.dir'),
1025
- __metadata("design:type", String),
1026
- __metadata("design:paramtypes", [])
1027
- ], ToolBarComponent.prototype, "getDir", null);
1028
- __decorate([
1029
- HostBinding('class.k-toolbar-resizable'),
1030
- __metadata("design:type", Boolean),
1031
- __metadata("design:paramtypes", [])
1032
- ], ToolBarComponent.prototype, "resizableClass", null);
1033
- ToolBarComponent = __decorate([
1034
- Component({
1035
- exportAs: 'kendoToolBar',
1036
- providers: [
1037
- RefreshService,
1038
- NavigationService,
1039
- LocalizationService,
1040
- {
1041
- provide: L10N_PREFIX,
1042
- useValue: 'kendo.toolbar'
1043
- }
1044
- ],
1045
- selector: 'kendo-toolbar',
1046
- template: "\n <ng-container kendoToolbarLocalizedMessages\n i18n-moreToolsTitle=\"kendo.toolbar.moreToolsTitle|The title of the **more tools** button in a responsive ToolBar\"\n moreToolsTitle=\"More tools\"\n >\n </ng-container>\n <ng-container *ngFor=\"let tool of allTools; let index = index\">\n <kendo-toolbar-renderer\n #toolbarRenderer\n (rendererClick)=\"onRendererClick($event)\"\n [location]=\"'toolbar'\"\n [resizable]=\"overflow\"\n [tool]=\"tool\"\n ></kendo-toolbar-renderer>\n </ng-container>\n <button\n #overflowButton\n type=\"button\"\n tabindex=\"-1\"\n [title]=\"moreToolsTitle\"\n [attr.aria-label]=\"moreToolsTitle\"\n *ngIf=\"overflow\"\n [style.visibility]=\"displayAnchor\"\n class=\"k-overflow-anchor k-button\"\n (click)=\"showPopup()\"\n >\n <span class=\"k-icon k-i-more-vertical\"></span>\n </button>\n <ng-template #popupTemplate>\n <ul class=\"k-overflow-container k-list-container k-reset\">\n <ng-container *ngFor=\"let tool of allTools; let index = index\">\n <li class=\"k-item\">\n <kendo-toolbar-renderer\n #overflowRenderer\n (rendererClick)=\"onRendererClick($event)\"\n [location]=\"'overflow'\"\n [resizable]=\"overflow\"\n [tool]=\"tool\"\n ></kendo-toolbar-renderer>\n </li>\n </ng-container>\n </ul>\n </ng-template>\n <ng-container #container></ng-container>\n <kendo-resize-sensor *ngIf=\"overflow\" [rateLimit]=\"1000\" #resizeSensor></kendo-resize-sensor>\n "
1047
- }),
1048
- __metadata("design:paramtypes", [LocalizationService,
1049
- PopupService,
1050
- RefreshService,
1051
- NavigationService,
1052
- ElementRef,
1053
- ChangeDetectorRef,
1054
- NgZone,
1055
- Renderer2])
1056
- ], ToolBarComponent);
1057
- return ToolBarComponent;
1058
- }());
1059
-
1060
- /**
1061
- * Represents the [Kendo UI ToolBar Button tool for Angular]({% slug controltypes_toolbar %}#toc-buttons).
1062
- */
1063
- var ToolBarButtonComponent = /** @class */ (function (_super) {
1064
- __extends(ToolBarButtonComponent, _super);
1065
- function ToolBarButtonComponent() {
1066
- var _this = _super.call(this) || this;
1067
- // showText and showIcon showIcon should be declared first
1068
- /**
1069
- * Specifies where button text should be displayed
1070
- */
1071
- _this.showText = 'both';
1072
- /**
1073
- * Specifies where button icon should be displayed
1074
- */
1075
- _this.showIcon = 'both';
1076
- /**
1077
- * Provides visual styling that indicates if the Button is active
1078
- * ([see example]({% slug controltypes_toolbar %}#toc-toggle-buttons)).
1079
- * By default, `toggleable` is set to `false`.
1080
- */
1081
- _this.toggleable = false;
1082
- /**
1083
- * Sets the selected state of the Button.
1084
- */
1085
- _this.selected = false;
1086
- /**
1087
- * The fillMode property specifies the background and border styles of the Button.
1088
- *
1089
- * The available values are:
1090
- * * `solid` (default)
1091
- * * `flat`
1092
- * * `outline`
1093
- * * `link`
1094
- * * `null`
1095
- */
1096
- _this.fillMode = 'solid';
1097
- /**
1098
- * The Button allows you to specify predefined theme colors.
1099
- * The theme color will be applied as a background and border color while also amending the text color accordingly
1100
- * ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-themeColor)).
1101
- *
1102
- * The possible values are:
1103
- * * `base` &mdash;Applies coloring based on the `base` theme color. (default)
1104
- * * `primary` &mdash;Applies coloring based on the `primary` theme color.
1105
- * * `secondary`&mdash;Applies coloring based on the `secondary` theme color.
1106
- * * `tertiary`&mdash; Applies coloring based on the `tertiary` theme color.
1107
- * * `info`&mdash;Applies coloring based on the `info` theme color.
1108
- * * `success`&mdash; Applies coloring based on the `success` theme color.
1109
- * * `warning`&mdash; Applies coloring based on the `warning` theme color.
1110
- * * `error`&mdash; Applies coloring based on the `error` theme color.
1111
- * * `dark`&mdash; Applies coloring based on the `dark` theme color.
1112
- * * `light`&mdash; Applies coloring based on the `light` theme color.
1113
- * * `inverse`&mdash; Applies coloring based on the `inverse` theme color.
1114
- * * `null` &mdash;Removes the default CSS class (no class would be rendered).
1115
- */
1116
- _this.themeColor = 'base';
1117
- /**
1118
- * Fires each time the Button is clicked.
1119
- */
1120
- _this.click = new EventEmitter();
1121
- /**
1122
- * Fires when the Button [pointerdown](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/pointerdown_event) event is triggered.
1123
- */
1124
- _this.pointerdown = new EventEmitter();
1125
- /**
1126
- * Fires each time the selected state of a Toggle Button is changed.
1127
- * The event argument is the new selected state (Boolean).
1128
- */
1129
- _this.selectedChange = new EventEmitter();
1130
- _this.toolbarOptions = {
1131
- text: '',
1132
- icon: '',
1133
- iconClass: '',
1134
- imageUrl: ''
1135
- };
1136
- _this.overflowOptions = {
1137
- text: '',
1138
- icon: '',
1139
- iconClass: '',
1140
- imageUrl: ''
1141
- };
1142
- return _this;
1143
- }
1144
- ToolBarButtonComponent_1 = ToolBarButtonComponent;
1145
- Object.defineProperty(ToolBarButtonComponent.prototype, "text", {
1146
- /**
1147
- * Specifies the text of the Button ([see example]({% slug controltypes_toolbar %}#toc-buttons)).
1148
- */
1149
- set: function (text) {
1150
- this.toolbarOptions.text = getValueForLocation(text, this.showText, false);
1151
- this.overflowOptions.text = getValueForLocation(text, this.showText, true);
1152
- },
1153
- enumerable: true,
1154
- configurable: true
1155
- });
1156
- Object.defineProperty(ToolBarButtonComponent.prototype, "look", {
1157
- /**
1158
- * @hidden
1159
- */
1160
- set: function (look) {
1161
- if (look) {
1162
- this.fillMode = look === 'default' ? 'solid' : look;
1163
- }
1164
- },
1165
- enumerable: true,
1166
- configurable: true
1167
- });
1168
- Object.defineProperty(ToolBarButtonComponent.prototype, "togglable", {
1169
- /**
1170
- * @hidden
1171
- */
1172
- get: function () {
1173
- return this.toggleable;
1174
- },
1175
- set: function (value) {
1176
- this.toggleable = value;
1177
- },
1178
- enumerable: true,
1179
- configurable: true
1180
- });
1181
- Object.defineProperty(ToolBarButtonComponent.prototype, "icon", {
1182
- /**
1183
- * Defines the name for an existing icon in a Kendo UI theme
1184
- * ([see example]({% slug controltypes_toolbar %}#toc-buttons)).
1185
- * The icon is rendered inside the Button by a `span.k-icon` element.
1186
- */
1187
- set: function (icon) {
1188
- this.toolbarOptions.icon = getValueForLocation(icon, this.showIcon, false);
1189
- this.overflowOptions.icon = getValueForLocation(icon, this.showIcon, true);
1190
- },
1191
- enumerable: true,
1192
- configurable: true
1193
- });
1194
- Object.defineProperty(ToolBarButtonComponent.prototype, "iconClass", {
1195
- /**
1196
- * Defines a CSS class&mdash;or multiple classes separated by spaces&mdash;
1197
- * which are applied to a `span` element inside the Button. Allows the usage of custom icons.
1198
- */
1199
- set: function (iconClass) {
1200
- this.toolbarOptions.iconClass = getValueForLocation(iconClass, this.showIcon, false);
1201
- this.overflowOptions.iconClass = getValueForLocation(iconClass, this.showIcon, true);
1202
- },
1203
- enumerable: true,
1204
- configurable: true
1205
- });
1206
- Object.defineProperty(ToolBarButtonComponent.prototype, "imageUrl", {
1207
- /**
1208
- * Defines a URL which is used for an `img` element inside the Button.
1209
- * The URL can be relative or absolute. If relative, it is evaluated with relation to the web page URL.
1210
- */
1211
- set: function (imageUrl) {
1212
- this.toolbarOptions.imageUrl = getValueForLocation(imageUrl, this.showIcon, false);
1213
- this.overflowOptions.imageUrl = getValueForLocation(imageUrl, this.showIcon, true);
1214
- },
1215
- enumerable: true,
1216
- configurable: true
1217
- });
1218
- /**
1219
- * @hidden
1220
- */
1221
- ToolBarButtonComponent.prototype.onBlur = function () {
1222
- this.getButton().tabIndex = -1;
1223
- };
1224
- /**
1225
- * @hidden
1226
- */
1227
- ToolBarButtonComponent.prototype.canFocus = function () {
1228
- return !this.disabled;
1229
- };
1230
- /**
1231
- * @hidden
1232
- */
1233
- ToolBarButtonComponent.prototype.focus = function (ev) {
1234
- // guard against focusing twice on mousedown.
1235
- if (!ev || ev.type === 'focus' || ev.type === 'keydown') {
1236
- this.getButton().focus();
1237
- }
1238
- this.getButton().tabIndex = 0;
1239
- };
1240
- /**
1241
- * @hidden
1242
- */
1243
- ToolBarButtonComponent.prototype.handleKey = function () {
1244
- this.getButton().tabIndex = -1;
1245
- return false;
1246
- };
1247
- ToolBarButtonComponent.prototype.getButton = function () {
1248
- return (this.overflows ? this.overflowButtonElement : this.toolbarButtonElement).nativeElement;
1249
- };
1250
- var ToolBarButtonComponent_1;
1251
- __decorate([
1252
- Input(),
1253
- __metadata("design:type", String)
1254
- ], ToolBarButtonComponent.prototype, "showText", void 0);
1255
- __decorate([
1256
- Input(),
1257
- __metadata("design:type", String)
1258
- ], ToolBarButtonComponent.prototype, "showIcon", void 0);
1259
- __decorate([
1260
- Input(),
1261
- __metadata("design:type", String),
1262
- __metadata("design:paramtypes", [String])
1263
- ], ToolBarButtonComponent.prototype, "text", null);
1264
- __decorate([
1265
- Input(),
1266
- __metadata("design:type", Object)
1267
- ], ToolBarButtonComponent.prototype, "style", void 0);
1268
- __decorate([
1269
- Input(),
1270
- __metadata("design:type", Object)
1271
- ], ToolBarButtonComponent.prototype, "className", void 0);
1272
- __decorate([
1273
- Input(),
1274
- __metadata("design:type", String)
1275
- ], ToolBarButtonComponent.prototype, "title", void 0);
1276
- __decorate([
1277
- Input(),
1278
- __metadata("design:type", Boolean)
1279
- ], ToolBarButtonComponent.prototype, "disabled", void 0);
1280
- __decorate([
1281
- Input(),
1282
- __metadata("design:type", Boolean)
1283
- ], ToolBarButtonComponent.prototype, "toggleable", void 0);
1284
- __decorate([
1285
- Input(),
1286
- __metadata("design:type", String),
1287
- __metadata("design:paramtypes", [String])
1288
- ], ToolBarButtonComponent.prototype, "look", null);
1289
- __decorate([
1290
- Input(),
1291
- __metadata("design:type", Boolean),
1292
- __metadata("design:paramtypes", [Boolean])
1293
- ], ToolBarButtonComponent.prototype, "togglable", null);
1294
- __decorate([
1295
- Input(),
1296
- __metadata("design:type", Boolean)
1297
- ], ToolBarButtonComponent.prototype, "selected", void 0);
1298
- __decorate([
1299
- Input(),
1300
- __metadata("design:type", String)
1301
- ], ToolBarButtonComponent.prototype, "fillMode", void 0);
1302
- __decorate([
1303
- Input(),
1304
- __metadata("design:type", String)
1305
- ], ToolBarButtonComponent.prototype, "themeColor", void 0);
1306
- __decorate([
1307
- Input(),
1308
- __metadata("design:type", String),
1309
- __metadata("design:paramtypes", [String])
1310
- ], ToolBarButtonComponent.prototype, "icon", null);
1311
- __decorate([
1312
- Input(),
1313
- __metadata("design:type", String),
1314
- __metadata("design:paramtypes", [String])
1315
- ], ToolBarButtonComponent.prototype, "iconClass", null);
1316
- __decorate([
1317
- Input(),
1318
- __metadata("design:type", String),
1319
- __metadata("design:paramtypes", [String])
1320
- ], ToolBarButtonComponent.prototype, "imageUrl", null);
1321
- __decorate([
1322
- Output(),
1323
- __metadata("design:type", EventEmitter)
1324
- ], ToolBarButtonComponent.prototype, "click", void 0);
1325
- __decorate([
1326
- Output(),
1327
- __metadata("design:type", EventEmitter)
1328
- ], ToolBarButtonComponent.prototype, "pointerdown", void 0);
1329
- __decorate([
1330
- Output(),
1331
- __metadata("design:type", EventEmitter)
1332
- ], ToolBarButtonComponent.prototype, "selectedChange", void 0);
1333
- __decorate([
1334
- ViewChild('toolbarTemplate', { static: true }),
1335
- __metadata("design:type", TemplateRef)
1336
- ], ToolBarButtonComponent.prototype, "toolbarTemplate", void 0);
1337
- __decorate([
1338
- ViewChild('popupTemplate', { static: true }),
1339
- __metadata("design:type", TemplateRef)
1340
- ], ToolBarButtonComponent.prototype, "popupTemplate", void 0);
1341
- __decorate([
1342
- ViewChild('toolbarButton', { read: ElementRef, static: false }),
1343
- __metadata("design:type", ElementRef)
1344
- ], ToolBarButtonComponent.prototype, "toolbarButtonElement", void 0);
1345
- __decorate([
1346
- ViewChild('overflowButton', { read: ElementRef, static: false }),
1347
- __metadata("design:type", ElementRef)
1348
- ], ToolBarButtonComponent.prototype, "overflowButtonElement", void 0);
1349
- ToolBarButtonComponent = ToolBarButtonComponent_1 = __decorate([
1350
- Component({
1351
- exportAs: 'kendoToolBarButton',
1352
- // tslint:disable-next-line:no-forward-ref
1353
- providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(function () { return ToolBarButtonComponent_1; }) }],
1354
- selector: 'kendo-toolbar-button',
1355
- template: "\n <ng-template #toolbarTemplate>\n <button\n #toolbarButton\n [tabindex]=\"tabIndex\"\n type=\"button\"\n kendoButton\n [ngStyle]=\"style\"\n [ngClass]=\"className\"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [toggleable]=\"toggleable\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n [selected]=\"selected\"\n [icon]=\"toolbarOptions.icon\"\n [iconClass]=\"toolbarOptions.iconClass\"\n [imageUrl]=\"toolbarOptions.imageUrl\"\n (click)=\"click.emit($event)\"\n (pointerdown)=\"pointerdown.emit($event)\"\n (selectedChange)=\"selectedChange.emit($event)\"\n (blur)=\"onBlur()\"\n >\n {{ toolbarOptions.text }}\n </button>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n #overflowButton\n tabindex=\"-1\"\n type=\"button\"\n kendoButton\n class=\"k-overflow-button\"\n [ngStyle]=\"style\"\n [ngClass]=\"className\"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [toggleable]=\"toggleable\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n [selected]=\"selected\"\n [icon]=\"overflowOptions.icon\"\n [iconClass]=\"overflowOptions.iconClass\"\n [imageUrl]=\"overflowOptions.imageUrl\"\n (click)=\"click.emit($event)\"\n (selectedChange)=\"selectedChange.emit($event)\"\n >\n {{ overflowOptions.text }}\n </button>\n </ng-template>\n "
1356
- }),
1357
- __metadata("design:paramtypes", [])
1358
- ], ToolBarButtonComponent);
1359
- return ToolBarButtonComponent;
1360
- }(ToolBarToolComponent));
1361
-
1362
- /**
1363
- * Represents the Kendo UI Toolbar ButtonGroup for Angular.
1364
- */
1365
- var ToolBarButtonGroupComponent = /** @class */ (function (_super) {
1366
- __extends(ToolBarButtonGroupComponent, _super);
1367
- function ToolBarButtonGroupComponent(localization) {
1368
- var _this = _super.call(this) || this;
1369
- _this.localization = localization;
1370
- /**
1371
- * By default, the selection mode of the ButtonGroup is set to `multiple`.
1372
- */
1373
- _this.selection = 'multiple';
1374
- _this.focusedIndex = -1;
1375
- _this.getNextKey = getNextKey(_this.localization.rtl);
1376
- _this.getPrevKey = getPrevKey(_this.localization.rtl);
1377
- return _this;
1378
- }
1379
- ToolBarButtonGroupComponent_1 = ToolBarButtonGroupComponent;
1380
- Object.defineProperty(ToolBarButtonGroupComponent.prototype, "look", {
1381
- /**
1382
- * @hidden
1383
- */
1384
- set: function (look) {
1385
- if (look) {
1386
- this.buttonComponents.forEach(function (b) { return b.fillMode = look === 'default' ? 'solid' : look; });
1387
- }
1388
- },
1389
- enumerable: true,
1390
- configurable: true
1391
- });
1392
- Object.defineProperty(ToolBarButtonGroupComponent.prototype, "buttonElements", {
1393
- get: function () {
1394
- return this.getButtonGroup()
1395
- .buttons.filter(function (b) { return !b.isDisabled; })
1396
- .map(function (b) { return b.element; });
1397
- },
1398
- enumerable: true,
1399
- configurable: true
1400
- });
1401
- /**
1402
- * @hidden
1403
- */
1404
- ToolBarButtonGroupComponent.prototype.onFocus = function () {
1405
- // triggered on tabin
1406
- this.focusedIndex = 0;
1407
- };
1408
- /**
1409
- * @hidden
1410
- */
1411
- ToolBarButtonGroupComponent.prototype.onNavigate = function (ev) {
1412
- ev.preventDefault();
1413
- };
1414
- /**
1415
- * @hidden
1416
- */
1417
- ToolBarButtonGroupComponent.prototype.selectedChangeHandler = function (state, button) {
1418
- button.selected = state;
1419
- button.selectedChange.emit(state);
1420
- };
1421
- /**
1422
- * @hidden
1423
- */
1424
- ToolBarButtonGroupComponent.prototype.onButtonClick = function (ev) {
1425
- this.focusedIndex = this.buttonElements.findIndex(function (be) { return be === ev.target || be.contains(ev.target); });
1426
- this.focusButton(this.focusedIndex, ev);
1427
- };
1428
- /**
1429
- * @hidden
1430
- */
1431
- ToolBarButtonGroupComponent.prototype.canFocus = function () {
1432
- return !(this.disabled || this.buttonElements.length === 0);
1433
- };
1434
- /**
1435
- * @hidden
1436
- */
1437
- ToolBarButtonGroupComponent.prototype.focus = function (ev) {
1438
- if (ev === void 0) { ev = {}; }
1439
- var nextKey = this.getNextKey(this.overflows);
1440
- var prevKey = this.getPrevKey(this.overflows);
1441
- this.focusedIndex = getIndexOfFocused(prevKey, nextKey, this.buttonElements)(ev);
1442
- this.focusButton(this.focusedIndex, ev);
1443
- };
1444
- /**
1445
- * @hidden
1446
- */
1447
- ToolBarButtonGroupComponent.prototype.handleKey = function (ev) {
1448
- var nextKey = this.getNextKey(this.overflows);
1449
- var prevKey = this.getPrevKey(this.overflows);
1450
- var peekAtIndex = makePeeker(this.buttonElements);
1451
- var isUnmodified = areEqual(this.focusedIndex);
1452
- this.focusedIndex = seekFocusedIndex(prevKey, nextKey, peekAtIndex)(this.focusedIndex, ev);
1453
- this.focusButton(this.focusedIndex, ev);
1454
- return !isUnmodified(this.focusedIndex);
1455
- };
1456
- ToolBarButtonGroupComponent.prototype.getButtonGroup = function () {
1457
- return this.overflows ? this.overflowButtonGroup : this.toolbarButtonGroup;
1458
- };
1459
- ToolBarButtonGroupComponent.prototype.focusButton = function (index, ev) {
1460
- // Guard against focusing twice on mousedown.
1461
- if (!ev.type || ev.type === 'focus' || ev.type === 'keydown') {
1462
- this.buttonElements[index].focus();
1463
- }
1464
- };
1465
- var ToolBarButtonGroupComponent_1;
1466
- __decorate([
1467
- Input(),
1468
- __metadata("design:type", Boolean)
1469
- ], ToolBarButtonGroupComponent.prototype, "disabled", void 0);
1470
- __decorate([
1471
- Input(),
1472
- __metadata("design:type", String)
1473
- ], ToolBarButtonGroupComponent.prototype, "selection", void 0);
1474
- __decorate([
1475
- Input(),
1476
- __metadata("design:type", String)
1477
- ], ToolBarButtonGroupComponent.prototype, "width", void 0);
1478
- __decorate([
1479
- Input(),
1480
- __metadata("design:type", String),
1481
- __metadata("design:paramtypes", [String])
1482
- ], ToolBarButtonGroupComponent.prototype, "look", null);
1483
- __decorate([
1484
- ViewChild('toolbarTemplate', { static: true }),
1485
- __metadata("design:type", TemplateRef)
1486
- ], ToolBarButtonGroupComponent.prototype, "toolbarTemplate", void 0);
1487
- __decorate([
1488
- ViewChild('popupTemplate', { static: true }),
1489
- __metadata("design:type", TemplateRef)
1490
- ], ToolBarButtonGroupComponent.prototype, "popupTemplate", void 0);
1491
- __decorate([
1492
- ContentChildren(forwardRef(function () { return ToolBarButtonComponent; })),
1493
- __metadata("design:type", QueryList)
1494
- ], ToolBarButtonGroupComponent.prototype, "buttonComponents", void 0);
1495
- __decorate([
1496
- ViewChild('toolbarButtonGroup', { static: false }),
1497
- __metadata("design:type", ButtonGroupComponent)
1498
- ], ToolBarButtonGroupComponent.prototype, "toolbarButtonGroup", void 0);
1499
- __decorate([
1500
- ViewChild('overflowButtonGroup', { static: false }),
1501
- __metadata("design:type", ButtonGroupComponent)
1502
- ], ToolBarButtonGroupComponent.prototype, "overflowButtonGroup", void 0);
1503
- ToolBarButtonGroupComponent = ToolBarButtonGroupComponent_1 = __decorate([
1504
- Component({
1505
- exportAs: 'kendoToolBarButtonGroup',
1506
- // tslint:disable-next-line:no-forward-ref
1507
- providers: [LocalizationService, { provide: ToolBarToolComponent, useExisting: forwardRef(function () { return ToolBarButtonGroupComponent_1; }) }],
1508
- selector: 'kendo-toolbar-buttongroup',
1509
- template: "\n <ng-template #toolbarTemplate>\n <kendo-buttongroup\n #toolbarButtonGroup\n [tabIndex]=\"-1\"\n [selection]=\"selection\"\n [disabled]=\"disabled\"\n [width]=\"width\"\n (navigate)=\"onNavigate($event)\"\n (focus)=\"onFocus()\"\n >\n <span\n kendoButton\n *ngFor=\"let button of buttonComponents\"\n [ngStyle]=\"button.style\"\n [ngClass]=\"button.className\"\n [attr.title]=\"button.title\"\n [disabled]=\"button.disabled\"\n [togglable]=\"button.togglable\"\n [selected]=\"button.selected\"\n [fillMode]=\"button.fillMode\"\n [themeColor]=\"button.fillMode ? button.themeColor : null\"\n [icon]=\"button.toolbarOptions.icon\"\n [iconClass]=\"button.toolbarOptions.iconClass\"\n [imageUrl]=\"button.toolbarOptions.imageUrl\"\n (click)=\"button.click.emit($event); onButtonClick($event)\"\n (pointerdown)=\"button.pointerdown.emit($event)\"\n (selectedChange)=\"selectedChangeHandler($event, button)\"\n >\n {{ button.toolbarOptions.text }}\n </span>\n </kendo-buttongroup>\n </ng-template>\n <ng-template #popupTemplate>\n <kendo-buttongroup\n #overflowButtonGroup\n class=\"k-overflow-button\"\n [tabIndex]=\"-1\"\n [selection]=\"selection\"\n [disabled]=\"disabled\"\n [width]=\"width\"\n >\n <span\n kendoButton\n class=\"k-overflow-button\"\n *ngFor=\"let button of buttonComponents\"\n [ngStyle]=\"button.style\"\n [ngClass]=\"button.className\"\n [attr.title]=\"button.title\"\n [disabled]=\"button.disabled\"\n [togglable]=\"button.togglable\"\n [selected]=\"button.selected\"\n [fillMode]=\"button.fillMode\"\n [themeColor]=\"button.fillMode ? button.themeColor : null\"\n [icon]=\"button.overflowOptions.icon\"\n [iconClass]=\"button.overflowOptions.iconClass\"\n [imageUrl]=\"button.overflowOptions.imageUrl\"\n (click)=\"button.click.emit($event); onButtonClick($event)\"\n (selectedChange)=\"selectedChangeHandler($event, button)\"\n >\n {{ button.overflowOptions.text }}\n </span>\n </kendo-buttongroup>\n </ng-template>\n "
1510
- }),
1511
- __metadata("design:paramtypes", [LocalizationService])
1512
- ], ToolBarButtonGroupComponent);
1513
- return ToolBarButtonGroupComponent;
1514
- }(ToolBarToolComponent));
1515
-
1516
- /**
1517
- * @hidden
1518
- */
1519
- var ToolBarButtonListComponent = /** @class */ (function () {
1520
- function ToolBarButtonListComponent() {
1521
- this.disabled = false;
1522
- this.fillMode = 'solid';
1523
- this.themeColor = 'base';
1524
- this.itemClick = new EventEmitter();
1525
- }
1526
- ToolBarButtonListComponent.prototype.getText = function (dataItem) {
1527
- if (dataItem) {
1528
- return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
1529
- }
1530
- return undefined;
1531
- };
1532
- ToolBarButtonListComponent.prototype.onClick = function (item, index) {
1533
- var dataItem = this.data[index];
1534
- if (item.click) {
1535
- item.click(dataItem);
1536
- }
1537
- this.itemClick.emit(dataItem);
1538
- };
1539
- __decorate([
1540
- Input(),
1541
- __metadata("design:type", Array)
1542
- ], ToolBarButtonListComponent.prototype, "data", void 0);
1543
- __decorate([
1544
- Input(),
1545
- __metadata("design:type", String)
1546
- ], ToolBarButtonListComponent.prototype, "textField", void 0);
1547
- __decorate([
1548
- Input(),
1549
- __metadata("design:type", Boolean)
1550
- ], ToolBarButtonListComponent.prototype, "disabled", void 0);
1551
- __decorate([
1552
- Input(),
1553
- __metadata("design:type", String)
1554
- ], ToolBarButtonListComponent.prototype, "fillMode", void 0);
1555
- __decorate([
1556
- Input(),
1557
- __metadata("design:type", String)
1558
- ], ToolBarButtonListComponent.prototype, "themeColor", void 0);
1559
- __decorate([
1560
- Output(),
1561
- __metadata("design:type", EventEmitter)
1562
- ], ToolBarButtonListComponent.prototype, "itemClick", void 0);
1563
- __decorate([
1564
- ViewChildren('button'),
1565
- __metadata("design:type", QueryList)
1566
- ], ToolBarButtonListComponent.prototype, "buttons", void 0);
1567
- ToolBarButtonListComponent = __decorate([
1568
- Component({
1569
- selector: 'kendo-toolbar-buttonlist',
1570
- template: "\n <button\n #button\n type=\"button\"\n tabindex=\"-1\"\n kendoButton\n style=\"padding-left: 16px\"\n class=\"k-overflow-button\"\n *ngFor=\"let item of data; let i = index\"\n [disabled]=\"disabled || item.disabled\"\n [icon]=\"item.icon\"\n [iconClass]=\"item.iconClass\"\n [imageUrl]=\"item.imageUrl\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n (click)=\"onClick(item, i)\"\n >\n {{ getText(item) }}\n </button>\n "
1571
- })
1572
- ], ToolBarButtonListComponent);
1573
- return ToolBarButtonListComponent;
1574
- }());
1575
-
1576
- /**
1577
- * Represents the [Kendo UI ToolBar DropDownButton for Angular]({% slug controltypes_toolbar %}#toc-dropdownbuttons).
1578
- */
1579
- var ToolBarDropDownButtonComponent = /** @class */ (function (_super) {
1580
- __extends(ToolBarDropDownButtonComponent, _super);
1581
- function ToolBarDropDownButtonComponent() {
1582
- var _this = _super.call(this) || this;
1583
- // showText and showIcon showIcon should be declared first
1584
- /**
1585
- * Defines the location of the button text that will be displayed.
1586
- */
1587
- _this.showText = 'both';
1588
- /**
1589
- * Defines the location of the button icon that will be displayed.
1590
- */
1591
- _this.showIcon = 'both';
1592
- /**
1593
- * The fillMode property specifies the background and border styles of the Button.
1594
- *
1595
- * The available values are:
1596
- * * `solid` (default)
1597
- * * `flat`
1598
- * * `outline`
1599
- * * `link`
1600
- * * `null`
1601
- */
1602
- _this.fillMode = 'solid';
1603
- /**
1604
- * The Button allows you to specify predefined theme colors.
1605
- * The theme color will be applied as a background and border color while also amending the text color accordingly
1606
- * ([see example]({% slug api_buttons_dropdownbuttoncomponent %}#toc-themeColor)).
1607
- *
1608
- * The possible values are:
1609
- * * `base` &mdash;Applies coloring based on the `base` theme color. (default)
1610
- * * `primary` &mdash;Applies coloring based on the `primary` theme color.
1611
- * * `secondary`&mdash;Applies coloring based on the `secondary` theme color.
1612
- * * `tertiary`&mdash; Applies coloring based on the `tertiary` theme color.
1613
- * * `info`&mdash;Applies coloring based on the `info` theme color.
1614
- * * `success`&mdash; Applies coloring based on the `success` theme color.
1615
- * * `warning`&mdash; Applies coloring based on the `warning` theme color.
1616
- * * `error`&mdash; Applies coloring based on the `error` theme color.
1617
- * * `dark`&mdash; Applies coloring based on the `dark` theme color.
1618
- * * `light`&mdash; Applies coloring based on the `light` theme color.
1619
- * * `inverse`&mdash; Applies coloring based on the `inverse` theme color.
1620
- * * `null` &mdash;Removes the default CSS class (no class would be rendered).
1621
- */
1622
- _this.themeColor = 'base';
1623
- /**
1624
- * Fires each time the user clicks a DropDownButton item.
1625
- * The event data contains the data item that is bound to the clicked list item.
1626
- */
1627
- _this.itemClick = new EventEmitter();
1628
- /**
1629
- * Fires each time the popup is about to open.
1630
- * This event is preventable. If you cancel the event, the popup will remain closed.
1631
- */
1632
- _this.open = new EventEmitter();
1633
- /**
1634
- * Fires each time the popup is about to close.
1635
- * This event is preventable. If you cancel the event, the popup will remain open.
1636
- */
1637
- _this.close = new EventEmitter();
1638
- _this.toolbarOptions = {
1639
- text: '',
1640
- icon: '',
1641
- iconClass: '',
1642
- imageUrl: ''
1643
- };
1644
- _this.overflowOptions = {
1645
- text: '',
1646
- icon: '',
1647
- iconClass: '',
1648
- imageUrl: ''
1649
- };
1650
- _this._popupSettings = { animate: true, popupClass: '' };
1651
- _this.focusedIndex = -1;
1652
- _this.getNextKey = getNextKey();
1653
- _this.getPrevKey = getPrevKey();
1654
- return _this;
1655
- }
1656
- ToolBarDropDownButtonComponent_1 = ToolBarDropDownButtonComponent;
1657
- Object.defineProperty(ToolBarDropDownButtonComponent.prototype, "text", {
1658
- /**
1659
- * Sets the text of the DropDownButton
1660
- * ([see example]({% slug controltypes_toolbar %}#toc-dropdownbuttons).
1661
- */
1662
- set: function (text) {
1663
- this.toolbarOptions.text = getValueForLocation(text, this.showText, false);
1664
- this.overflowOptions.text = getValueForLocation(text, this.showText, true);
1665
- },
1666
- enumerable: true,
1667
- configurable: true
1668
- });
1669
- Object.defineProperty(ToolBarDropDownButtonComponent.prototype, "icon", {
1670
- /**
1671
- * Defines an icon that will be rendered next to the button text.
1672
- */
1673
- set: function (icon) {
1674
- this.toolbarOptions.icon = getValueForLocation(icon, this.showIcon, false);
1675
- this.overflowOptions.icon = getValueForLocation(icon, this.showIcon, true);
1676
- },
1677
- enumerable: true,
1678
- configurable: true
1679
- });
1680
- Object.defineProperty(ToolBarDropDownButtonComponent.prototype, "iconClass", {
1681
- /**
1682
- * Defines an icon with a custom CSS class that will be rendered next to the button text.
1683
- */
1684
- set: function (iconClass) {
1685
- this.toolbarOptions.iconClass = getValueForLocation(iconClass, this.showIcon, false);
1686
- this.overflowOptions.iconClass = getValueForLocation(iconClass, this.showIcon, true);
1687
- },
1688
- enumerable: true,
1689
- configurable: true
1690
- });
1691
- Object.defineProperty(ToolBarDropDownButtonComponent.prototype, "imageUrl", {
1692
- /**
1693
- * Defines the location of an image that will be displayed next to the button text.
1694
- */
1695
- set: function (imageUrl) {
1696
- this.toolbarOptions.imageUrl = getValueForLocation(imageUrl, this.showIcon, false);
1697
- this.overflowOptions.imageUrl = getValueForLocation(imageUrl, this.showIcon, true);
1698
- },
1699
- enumerable: true,
1700
- configurable: true
1701
- });
1702
- Object.defineProperty(ToolBarDropDownButtonComponent.prototype, "popupSettings", {
1703
- get: function () {
1704
- return this._popupSettings;
1705
- },
1706
- /**
1707
- * Configures the popup of the DropDownButton.
1708
- *
1709
- * The available options are:
1710
- * - `animate:Boolean`&mdash;Controls the popup animation. By default, the open and close animations are enabled.
1711
- * - `popupClass:String`&mdash;Specifies a list of CSS classes that are used to style the popup.
1712
- */
1713
- set: function (settings) {
1714
- this._popupSettings = Object.assign({ animate: true, popupClass: '' }, settings);
1715
- },
1716
- enumerable: true,
1717
- configurable: true
1718
- });
1719
- Object.defineProperty(ToolBarDropDownButtonComponent.prototype, "look", {
1720
- /**
1721
- * @hidden
1722
- */
1723
- set: function (look) {
1724
- if (look) {
1725
- this.fillMode = look === 'default' ? 'solid' : look;
1726
- }
1727
- },
1728
- enumerable: true,
1729
- configurable: true
1730
- });
1731
- Object.defineProperty(ToolBarDropDownButtonComponent.prototype, "primary", {
1732
- /**
1733
- * @hidden
1734
- */
1735
- set: function (primary) {
1736
- this.themeColor = primary ? 'primary' : 'base';
1737
- },
1738
- enumerable: true,
1739
- configurable: true
1740
- });
1741
- Object.defineProperty(ToolBarDropDownButtonComponent.prototype, "data", {
1742
- get: function () {
1743
- if (!this._data) {
1744
- this.data = [];
1745
- }
1746
- return this._data;
1747
- },
1748
- /**
1749
- * Sets the data of the DropDownButton
1750
- * ([see example]({% slug controltypes_toolbar %}#toc-dropdownbuttons)).
1751
- *
1752
- * > The data has to be provided in an array-like list.
1753
- */
1754
- set: function (data) {
1755
- this._data = data || [];
1756
- },
1757
- enumerable: true,
1758
- configurable: true
1759
- });
1760
- Object.defineProperty(ToolBarDropDownButtonComponent.prototype, "overflowButtons", {
1761
- get: function () {
1762
- return this.overflowDropDownButtonButtonList.buttons.toArray().filter(function (b) { return !b.nativeElement.disabled; }).slice();
1763
- },
1764
- enumerable: true,
1765
- configurable: true
1766
- });
1767
- /**
1768
- * @hidden
1769
- */
1770
- ToolBarDropDownButtonComponent.prototype.onButtonListClick = function (ev) {
1771
- this.focusedIndex = this.overflowDropDownButtonButtonList.buttons
1772
- .toArray()
1773
- .findIndex(function (b) { return b.nativeElement.contains(ev.target); });
1774
- };
1775
- /**
1776
- * @hidden
1777
- */
1778
- ToolBarDropDownButtonComponent.prototype.canFocus = function () {
1779
- return !this.disabled;
1780
- };
1781
- /**
1782
- * @hidden
1783
- */
1784
- ToolBarDropDownButtonComponent.prototype.focus = function (ev) {
1785
- if (ev === void 0) { ev = {}; }
1786
- if (!this.overflows) {
1787
- if (ev.type === 'focus' || ev.type === 'keydown') {
1788
- this.toolbarDropDownButton.focus();
1789
- }
1790
- }
1791
- else if (this.overflowButtons.length > 0) {
1792
- this.focusedIndex = getIndexOfFocused(this.getPrevKey(), this.getNextKey(), this.overflowButtons.map(function (ob) { return ob.nativeElement; }))(ev);
1793
- this.focusButton(this.focusedIndex, ev);
1794
- }
1795
- };
1796
- /**
1797
- * @hidden
1798
- */
1799
- ToolBarDropDownButtonComponent.prototype.handleKey = function (ev) {
1800
- if (!this.overflows && (ev.keyCode === this.getPrevKey(this.overflows) || ev.keyCode === this.getNextKey(this.overflows))) {
1801
- return false;
1802
- }
1803
- if (this.overflows) {
1804
- var peekAtIndex = makePeeker(this.overflowButtons);
1805
- var isUnmodified = areEqual(this.focusedIndex);
1806
- this.focusedIndex = seekFocusedIndex(this.getPrevKey(), this.getNextKey(), peekAtIndex)(this.focusedIndex, ev);
1807
- this.focusButton(this.focusedIndex, ev);
1808
- return !isUnmodified(this.focusedIndex);
1809
- }
1810
- };
1811
- ToolBarDropDownButtonComponent.prototype.focusButton = function (index, ev) {
1812
- if (!ev.type || ev.type === 'focus' || ev.type === 'keydown') {
1813
- this.overflowButtons[index].nativeElement.focus();
1814
- }
1815
- };
1816
- var ToolBarDropDownButtonComponent_1;
1817
- __decorate([
1818
- Input(),
1819
- __metadata("design:type", String)
1820
- ], ToolBarDropDownButtonComponent.prototype, "showText", void 0);
1821
- __decorate([
1822
- Input(),
1823
- __metadata("design:type", String)
1824
- ], ToolBarDropDownButtonComponent.prototype, "showIcon", void 0);
1825
- __decorate([
1826
- Input(),
1827
- __metadata("design:type", String),
1828
- __metadata("design:paramtypes", [String])
1829
- ], ToolBarDropDownButtonComponent.prototype, "text", null);
1830
- __decorate([
1831
- Input(),
1832
- __metadata("design:type", String),
1833
- __metadata("design:paramtypes", [String])
1834
- ], ToolBarDropDownButtonComponent.prototype, "icon", null);
1835
- __decorate([
1836
- Input(),
1837
- __metadata("design:type", String),
1838
- __metadata("design:paramtypes", [String])
1839
- ], ToolBarDropDownButtonComponent.prototype, "iconClass", null);
1840
- __decorate([
1841
- Input(),
1842
- __metadata("design:type", String),
1843
- __metadata("design:paramtypes", [String])
1844
- ], ToolBarDropDownButtonComponent.prototype, "imageUrl", null);
1845
- __decorate([
1846
- Input(),
1847
- __metadata("design:type", Object),
1848
- __metadata("design:paramtypes", [Object])
1849
- ], ToolBarDropDownButtonComponent.prototype, "popupSettings", null);
1850
- __decorate([
1851
- Input(),
1852
- __metadata("design:type", String),
1853
- __metadata("design:paramtypes", [String])
1854
- ], ToolBarDropDownButtonComponent.prototype, "look", null);
1855
- __decorate([
1856
- Input(),
1857
- __metadata("design:type", Boolean),
1858
- __metadata("design:paramtypes", [Boolean])
1859
- ], ToolBarDropDownButtonComponent.prototype, "primary", null);
1860
- __decorate([
1861
- Input(),
1862
- __metadata("design:type", String)
1863
- ], ToolBarDropDownButtonComponent.prototype, "fillMode", void 0);
1864
- __decorate([
1865
- Input(),
1866
- __metadata("design:type", String)
1867
- ], ToolBarDropDownButtonComponent.prototype, "themeColor", void 0);
1868
- __decorate([
1869
- Input(),
1870
- __metadata("design:type", String)
1871
- ], ToolBarDropDownButtonComponent.prototype, "buttonClass", void 0);
1872
- __decorate([
1873
- Input(),
1874
- __metadata("design:type", String)
1875
- ], ToolBarDropDownButtonComponent.prototype, "textField", void 0);
1876
- __decorate([
1877
- Input(),
1878
- __metadata("design:type", Boolean)
1879
- ], ToolBarDropDownButtonComponent.prototype, "disabled", void 0);
1880
- __decorate([
1881
- Input(),
1882
- __metadata("design:type", Array),
1883
- __metadata("design:paramtypes", [Array])
1884
- ], ToolBarDropDownButtonComponent.prototype, "data", null);
1885
- __decorate([
1886
- Output(),
1887
- __metadata("design:type", EventEmitter)
1888
- ], ToolBarDropDownButtonComponent.prototype, "itemClick", void 0);
1889
- __decorate([
1890
- Output(),
1891
- __metadata("design:type", EventEmitter)
1892
- ], ToolBarDropDownButtonComponent.prototype, "open", void 0);
1893
- __decorate([
1894
- Output(),
1895
- __metadata("design:type", EventEmitter)
1896
- ], ToolBarDropDownButtonComponent.prototype, "close", void 0);
1897
- __decorate([
1898
- ViewChild('toolbarTemplate', { static: true }),
1899
- __metadata("design:type", TemplateRef)
1900
- ], ToolBarDropDownButtonComponent.prototype, "toolbarTemplate", void 0);
1901
- __decorate([
1902
- ViewChild('popupTemplate', { static: true }),
1903
- __metadata("design:type", TemplateRef)
1904
- ], ToolBarDropDownButtonComponent.prototype, "popupTemplate", void 0);
1905
- __decorate([
1906
- ViewChild('dropdownButton', { read: ElementRef, static: true }),
1907
- __metadata("design:type", ElementRef)
1908
- ], ToolBarDropDownButtonComponent.prototype, "dropdownButton", void 0);
1909
- __decorate([
1910
- ViewChild(DropDownButtonComponent, { static: false }),
1911
- __metadata("design:type", DropDownButtonComponent)
1912
- ], ToolBarDropDownButtonComponent.prototype, "dropDownButtonComponent", void 0);
1913
- __decorate([
1914
- ViewChild('toolbarDropDownButton', { static: false }),
1915
- __metadata("design:type", DropDownButtonComponent)
1916
- ], ToolBarDropDownButtonComponent.prototype, "toolbarDropDownButton", void 0);
1917
- __decorate([
1918
- ViewChild('overflowDropDownButtonButtonList', { static: false }),
1919
- __metadata("design:type", ToolBarButtonListComponent)
1920
- ], ToolBarDropDownButtonComponent.prototype, "overflowDropDownButtonButtonList", void 0);
1921
- ToolBarDropDownButtonComponent = ToolBarDropDownButtonComponent_1 = __decorate([
1922
- Component({
1923
- exportAs: 'kendoToolBarDropDownButton',
1924
- // tslint:disable-next-line:no-forward-ref
1925
- providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(function () { return ToolBarDropDownButtonComponent_1; }) }],
1926
- selector: 'kendo-toolbar-dropdownbutton',
1927
- template: "\n <ng-template #toolbarTemplate>\n <kendo-dropdownbutton\n #toolbarDropDownButton\n [icon]=\"toolbarOptions.icon\"\n [iconClass]=\"toolbarOptions.iconClass\"\n [imageUrl]=\"toolbarOptions.imageUrl\"\n [buttonClass]=\"buttonClass\"\n [disabled]=\"disabled\"\n [tabIndex]=\"-1\"\n [data]=\"data\"\n [textField]=\"textField\"\n [popupSettings]=\"popupSettings\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n (open)=\"open.emit($event)\"\n (close)=\"close.emit($event)\"\n (itemClick)=\"itemClick.emit($event)\"\n >\n {{ toolbarOptions.text }}\n </kendo-dropdownbutton>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n type=\"button\"\n tabindex=\"-1\"\n kendoButton\n class=\"k-overflow-button\"\n [disabled]=\"true\"\n [icon]=\"overflowOptions.icon\"\n [iconClass]=\"overflowOptions.iconClass\"\n [imageUrl]=\"overflowOptions.imageUrl\"\n [ngClass]=\"buttonClass\"\n (click)=\"itemClick.emit($event)\"\n >\n {{ overflowOptions.text }}\n </button>\n <kendo-toolbar-buttonlist\n #overflowDropDownButtonButtonList\n [data]=\"data\"\n [disabled]=\"disabled\"\n [textField]=\"textField\"\n (itemClick)=\"itemClick.emit($event)\"\n (click)=\"onButtonListClick($event)\"\n >\n </kendo-toolbar-buttonlist>\n </ng-template>\n "
1928
- }),
1929
- __metadata("design:paramtypes", [])
1930
- ], ToolBarDropDownButtonComponent);
1931
- return ToolBarDropDownButtonComponent;
1932
- }(ToolBarToolComponent));
1933
-
1934
- /**
1935
- * Represents the [Kendo UI ToolBar SplitButton for Angular]({% slug controltypes_toolbar %}#toc-splitbuttons).
1936
- */
1937
- var ToolBarSplitButtonComponent = /** @class */ (function (_super) {
1938
- __extends(ToolBarSplitButtonComponent, _super);
1939
- function ToolBarSplitButtonComponent() {
1940
- var _this = _super.call(this) || this;
1941
- // showText and showIcon showIcon should be declared first
1942
- /**
1943
- * Specifies where button text should be displayed
1944
- */
1945
- _this.showText = 'both';
1946
- /**
1947
- * Specifies where button icon should be displayed
1948
- */
1949
- _this.showIcon = 'both';
1950
- /**
1951
- * The fillMode property specifies the background and border styles of the Button.
1952
- *
1953
- * The available values are:
1954
- * * `solid` (default)
1955
- * * `flat`
1956
- * * `outline`
1957
- * * `link`
1958
- * * `null`
1959
- */
1960
- _this.fillMode = 'solid';
1961
- /**
1962
- * The Button allows you to specify predefined theme colors.
1963
- * The theme color will be applied as a background and border color while also amending the text color accordingly.
1964
- *
1965
- * The possible values are:
1966
- * * `base` &mdash;Applies coloring based on the `base` theme color. (default)
1967
- * * `primary` &mdash;Applies coloring based on the `primary` theme color.
1968
- * * `secondary`&mdash;Applies coloring based on the `secondary` theme color.
1969
- * * `tertiary`&mdash; Applies coloring based on the `tertiary` theme color.
1970
- * * `info`&mdash;Applies coloring based on the `info` theme color.
1971
- * * `success`&mdash; Applies coloring based on the `success` theme color.
1972
- * * `warning`&mdash; Applies coloring based on the `warning` theme color.
1973
- * * `error`&mdash; Applies coloring based on the `error` theme color.
1974
- * * `dark`&mdash; Applies coloring based on the `dark` theme color.
1975
- * * `light`&mdash; Applies coloring based on the `light` theme color.
1976
- * * `inverse`&mdash; Applies coloring based on the `inverse` theme color.
1977
- * * `null` &mdash;Removes the default CSS class (no class would be rendered).
1978
- */
1979
- _this.themeColor = 'base';
1980
- /**
1981
- * Specifies the name of the [font icon]({% slug icons %}#toc-list-of-font-icons) that will
1982
- * be rendered for the button which opens the popup.
1983
- */
1984
- _this.arrowButtonIcon = 'arrow-s';
1985
- /**
1986
- * Configures the text field of the button-list popup.
1987
- */
1988
- _this.textField = 'text';
1989
- /**
1990
- * Fires each time the user clicks the main button.
1991
- */
1992
- _this.buttonClick = new EventEmitter();
1993
- /**
1994
- * Fires each time the user clicks the drop-down list.
1995
- * The event data contains the data item that is bound to the clicked list item.
1996
- */
1997
- _this.itemClick = new EventEmitter();
1998
- /**
1999
- * Fires each time the popup is about to open.
2000
- * This event is preventable. If you cancel the event, the popup will remain closed.
2001
- */
2002
- _this.open = new EventEmitter();
2003
- /**
2004
- * Fires each time the popup is about to close.
2005
- * This event is preventable. If you cancel the event, the popup will remain open.
2006
- */
2007
- _this.close = new EventEmitter();
2008
- _this.toolbarOptions = {
2009
- text: '',
2010
- icon: '',
2011
- iconClass: '',
2012
- imageUrl: ''
2013
- };
2014
- _this.overflowOptions = {
2015
- text: '',
2016
- icon: '',
2017
- iconClass: '',
2018
- imageUrl: ''
2019
- };
2020
- _this._popupSettings = { animate: true, popupClass: '' };
2021
- _this.focusedIndex = -1;
2022
- _this.getNextKey = getNextKey();
2023
- _this.getPrevKey = getPrevKey();
2024
- return _this;
2025
- }
2026
- ToolBarSplitButtonComponent_1 = ToolBarSplitButtonComponent;
2027
- Object.defineProperty(ToolBarSplitButtonComponent.prototype, "text", {
2028
- /**
2029
- * Sets the text of the SplitButton ([see example]({% slug controltypes_toolbar %}#toc-splitbuttons).
2030
- */
2031
- set: function (text) {
2032
- this.toolbarOptions.text = getValueForLocation(text, this.showText, false);
2033
- this.overflowOptions.text = getValueForLocation(text, this.showText, true);
2034
- },
2035
- enumerable: true,
2036
- configurable: true
2037
- });
2038
- Object.defineProperty(ToolBarSplitButtonComponent.prototype, "icon", {
2039
- /**
2040
- * Defines the icon that will be rendered next to the button text
2041
- * ([see example]({% slug controltypes_toolbar %}#toc-splitbuttons)).
2042
- */
2043
- set: function (icon) {
2044
- this.toolbarOptions.icon = getValueForLocation(icon, this.showIcon, false);
2045
- this.overflowOptions.icon = getValueForLocation(icon, this.showIcon, true);
2046
- },
2047
- enumerable: true,
2048
- configurable: true
2049
- });
2050
- Object.defineProperty(ToolBarSplitButtonComponent.prototype, "iconClass", {
2051
- /**
2052
- * Defines an icon with a custom CSS class that will be rendered next to the button text.
2053
- */
2054
- set: function (iconClass) {
2055
- this.toolbarOptions.iconClass = getValueForLocation(iconClass, this.showIcon, false);
2056
- this.overflowOptions.iconClass = getValueForLocation(iconClass, this.showIcon, true);
2057
- },
2058
- enumerable: true,
2059
- configurable: true
2060
- });
2061
- Object.defineProperty(ToolBarSplitButtonComponent.prototype, "imageUrl", {
2062
- /**
2063
- * Defines the location of an image that will be displayed next to the button text.
2064
- */
2065
- set: function (imageUrl) {
2066
- this.toolbarOptions.imageUrl = getValueForLocation(imageUrl, this.showIcon, false);
2067
- this.overflowOptions.imageUrl = getValueForLocation(imageUrl, this.showIcon, true);
2068
- },
2069
- enumerable: true,
2070
- configurable: true
2071
- });
2072
- Object.defineProperty(ToolBarSplitButtonComponent.prototype, "popupSettings", {
2073
- get: function () {
2074
- if (!this._popupSettings) {
2075
- this._popupSettings = { animate: true, popupClass: '' };
2076
- }
2077
- return this._popupSettings;
2078
- },
2079
- /**
2080
- * Configures the popup of the SplitButton.
2081
- *
2082
- * The available options are:
2083
- * - `animate:Boolean`&mdash;Controls the popup animation. By default, the open and close animations are enabled.
2084
- * - `popupClass:String`&mdash;Specifies a list of CSS classes that are used to style the popup.
2085
- */
2086
- set: function (value) {
2087
- this._popupSettings = value;
2088
- },
2089
- enumerable: true,
2090
- configurable: true
2091
- });
2092
- Object.defineProperty(ToolBarSplitButtonComponent.prototype, "look", {
2093
- /**
2094
- * @hidden
2095
- */
2096
- set: function (look) {
2097
- if (look) {
2098
- this.fillMode = look === 'default' ? 'solid' : look;
2099
- }
2100
- },
2101
- enumerable: true,
2102
- configurable: true
2103
- });
2104
- Object.defineProperty(ToolBarSplitButtonComponent.prototype, "data", {
2105
- get: function () {
2106
- if (!this._data) {
2107
- this.data = [];
2108
- }
2109
- return this._data;
2110
- },
2111
- /**
2112
- * Sets the data of the SplitButton ([see example]({% slug controltypes_toolbar %}#toc-splitbuttons)).
2113
- *
2114
- * > The data has to be provided in an array-like list.
2115
- */
2116
- set: function (data) {
2117
- this._data = data || [];
2118
- },
2119
- enumerable: true,
2120
- configurable: true
2121
- });
2122
- Object.defineProperty(ToolBarSplitButtonComponent.prototype, "overflowButtons", {
2123
- get: function () {
2124
- return [this.overflowSplitButton].concat(this.overflowSplitButtonButtonList.buttons.toArray().filter(function (b) { return !b.nativeElement.disabled; }));
2125
- },
2126
- enumerable: true,
2127
- configurable: true
2128
- });
2129
- /**
2130
- * @hidden
2131
- */
2132
- ToolBarSplitButtonComponent.prototype.onButtonListClick = function (ev) {
2133
- this.focusedIndex = this.overflowButtons.findIndex(function (b) { return b.nativeElement.contains(ev.target); });
2134
- };
2135
- /**
2136
- * @hidden
2137
- */
2138
- ToolBarSplitButtonComponent.prototype.onMainButtonClick = function (ev) {
2139
- this.buttonClick.emit(ev);
2140
- this.focusedIndex = 0;
2141
- };
2142
- /**
2143
- * @hidden
2144
- */
2145
- ToolBarSplitButtonComponent.prototype.canFocus = function () {
2146
- return !this.disabled;
2147
- };
2148
- /**
2149
- * @hidden
2150
- */
2151
- ToolBarSplitButtonComponent.prototype.focus = function (ev) {
2152
- if (ev === void 0) { ev = {}; }
2153
- if (!this.overflows) {
2154
- if (ev.type === 'focus' || ev.type === 'keydown') {
2155
- this.toolbarSplitButton.focus();
2156
- }
2157
- }
2158
- else if (this.overflowButtons.length > 0) {
2159
- this.focusedIndex = getIndexOfFocused(this.getPrevKey(), this.getNextKey(), this.overflowButtons.map(function (ob) { return ob.nativeElement; }))(ev);
2160
- this.focusButton(this.focusedIndex, ev);
2161
- }
2162
- };
2163
- /**
2164
- * @hidden
2165
- */
2166
- ToolBarSplitButtonComponent.prototype.handleKey = function (ev) {
2167
- if (!this.overflows && (ev.keyCode === this.getPrevKey(this.overflows) || ev.keyCode === this.getNextKey(this.overflows))) {
2168
- return false;
2169
- }
2170
- if (this.overflows) {
2171
- var peekAtIndex = makePeeker(this.overflowButtons);
2172
- var isUnmodified = areEqual(this.focusedIndex);
2173
- this.focusedIndex = seekFocusedIndex(this.getPrevKey(), this.getNextKey(), peekAtIndex)(this.focusedIndex, ev);
2174
- this.focusButton(this.focusedIndex, ev);
2175
- return !isUnmodified(this.focusedIndex);
2176
- }
2177
- };
2178
- ToolBarSplitButtonComponent.prototype.focusButton = function (index, ev) {
2179
- if (!ev.type || ev.type === 'focus' || ev.type === 'keydown' || ev.type === 'click') {
2180
- this.overflowButtons[index].nativeElement.focus();
2181
- }
2182
- };
2183
- var ToolBarSplitButtonComponent_1;
2184
- __decorate([
2185
- Input(),
2186
- __metadata("design:type", String)
2187
- ], ToolBarSplitButtonComponent.prototype, "showText", void 0);
2188
- __decorate([
2189
- Input(),
2190
- __metadata("design:type", String)
2191
- ], ToolBarSplitButtonComponent.prototype, "showIcon", void 0);
2192
- __decorate([
2193
- Input(),
2194
- __metadata("design:type", String),
2195
- __metadata("design:paramtypes", [String])
2196
- ], ToolBarSplitButtonComponent.prototype, "text", null);
2197
- __decorate([
2198
- Input(),
2199
- __metadata("design:type", String),
2200
- __metadata("design:paramtypes", [String])
2201
- ], ToolBarSplitButtonComponent.prototype, "icon", null);
2202
- __decorate([
2203
- Input(),
2204
- __metadata("design:type", String),
2205
- __metadata("design:paramtypes", [String])
2206
- ], ToolBarSplitButtonComponent.prototype, "iconClass", null);
2207
- __decorate([
2208
- Input(),
2209
- __metadata("design:type", String),
2210
- __metadata("design:paramtypes", [String])
2211
- ], ToolBarSplitButtonComponent.prototype, "imageUrl", null);
2212
- __decorate([
2213
- Input(),
2214
- __metadata("design:type", Boolean)
2215
- ], ToolBarSplitButtonComponent.prototype, "disabled", void 0);
2216
- __decorate([
2217
- Input(),
2218
- __metadata("design:type", Object),
2219
- __metadata("design:paramtypes", [Object])
2220
- ], ToolBarSplitButtonComponent.prototype, "popupSettings", null);
2221
- __decorate([
2222
- Input(),
2223
- __metadata("design:type", String)
2224
- ], ToolBarSplitButtonComponent.prototype, "fillMode", void 0);
2225
- __decorate([
2226
- Input(),
2227
- __metadata("design:type", String)
2228
- ], ToolBarSplitButtonComponent.prototype, "themeColor", void 0);
2229
- __decorate([
2230
- Input(),
2231
- __metadata("design:type", String),
2232
- __metadata("design:paramtypes", [String])
2233
- ], ToolBarSplitButtonComponent.prototype, "look", null);
2234
- __decorate([
2235
- Input(),
2236
- __metadata("design:type", String)
2237
- ], ToolBarSplitButtonComponent.prototype, "buttonClass", void 0);
2238
- __decorate([
2239
- Input(),
2240
- __metadata("design:type", Object)
2241
- ], ToolBarSplitButtonComponent.prototype, "arrowButtonClass", void 0);
2242
- __decorate([
2243
- Input(),
2244
- __metadata("design:type", String)
2245
- ], ToolBarSplitButtonComponent.prototype, "arrowButtonIcon", void 0);
2246
- __decorate([
2247
- Input(),
2248
- __metadata("design:type", String)
2249
- ], ToolBarSplitButtonComponent.prototype, "textField", void 0);
2250
- __decorate([
2251
- Input(),
2252
- __metadata("design:type", Array),
2253
- __metadata("design:paramtypes", [Array])
2254
- ], ToolBarSplitButtonComponent.prototype, "data", null);
2255
- __decorate([
2256
- Output(),
2257
- __metadata("design:type", EventEmitter)
2258
- ], ToolBarSplitButtonComponent.prototype, "buttonClick", void 0);
2259
- __decorate([
2260
- Output(),
2261
- __metadata("design:type", EventEmitter)
2262
- ], ToolBarSplitButtonComponent.prototype, "itemClick", void 0);
2263
- __decorate([
2264
- Output(),
2265
- __metadata("design:type", EventEmitter)
2266
- ], ToolBarSplitButtonComponent.prototype, "open", void 0);
2267
- __decorate([
2268
- Output(),
2269
- __metadata("design:type", EventEmitter)
2270
- ], ToolBarSplitButtonComponent.prototype, "close", void 0);
2271
- __decorate([
2272
- ViewChild('toolbarTemplate', { static: true }),
2273
- __metadata("design:type", TemplateRef)
2274
- ], ToolBarSplitButtonComponent.prototype, "toolbarTemplate", void 0);
2275
- __decorate([
2276
- ViewChild('popupTemplate', { static: true }),
2277
- __metadata("design:type", TemplateRef)
2278
- ], ToolBarSplitButtonComponent.prototype, "popupTemplate", void 0);
2279
- __decorate([
2280
- ViewChild('toolbarSplitButton', { static: false }),
2281
- __metadata("design:type", SplitButtonComponent)
2282
- ], ToolBarSplitButtonComponent.prototype, "toolbarSplitButton", void 0);
2283
- __decorate([
2284
- ViewChild('overflowSplitButton', { read: ElementRef, static: false }),
2285
- __metadata("design:type", ElementRef)
2286
- ], ToolBarSplitButtonComponent.prototype, "overflowSplitButton", void 0);
2287
- __decorate([
2288
- ViewChild('overflowSplitButtonButtonList', { static: false }),
2289
- __metadata("design:type", ToolBarButtonListComponent)
2290
- ], ToolBarSplitButtonComponent.prototype, "overflowSplitButtonButtonList", void 0);
2291
- ToolBarSplitButtonComponent = ToolBarSplitButtonComponent_1 = __decorate([
2292
- Component({
2293
- exportAs: 'kendoToolBarSplitButton',
2294
- // tslint:disable-next-line:no-forward-ref
2295
- providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(function () { return ToolBarSplitButtonComponent_1; }) }],
2296
- selector: 'kendo-toolbar-splitbutton',
2297
- template: "\n <ng-template #toolbarTemplate>\n <kendo-splitbutton\n #toolbarSplitButton\n [data]=\"data\"\n [text]=\"toolbarOptions.text\"\n [icon]=\"toolbarOptions.icon\"\n [iconClass]=\"toolbarOptions.iconClass\"\n [imageUrl]=\"toolbarOptions.imageUrl\"\n [buttonClass]=\"buttonClass\"\n [arrowButtonClass]=\"arrowButtonClass\"\n [arrowButtonIcon]=\"arrowButtonIcon\"\n [disabled]=\"disabled\"\n [tabIndex]=\"-1\"\n [textField]=\"textField\"\n [popupSettings]=\"popupSettings\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n (buttonClick)=\"buttonClick.emit($event)\"\n (open)=\"open.emit($event)\"\n (close)=\"close.emit($event)\"\n (itemClick)=\"itemClick.emit($event)\"\n >\n </kendo-splitbutton>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n #overflowSplitButton\n type=\"button\"\n tabindex=\"-1\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n kendoButton\n class=\"k-overflow-button\"\n [disabled]=\"disabled\"\n [icon]=\"overflowOptions.icon\"\n [iconClass]=\"overflowOptions.iconClass\"\n [imageUrl]=\"overflowOptions.imageUrl\"\n [ngClass]=\"buttonClass\"\n (click)=\"buttonClick.emit($event)\"\n (click)=\"onMainButtonClick($event)\"\n >\n {{ overflowOptions.text }}\n </button>\n <kendo-toolbar-buttonlist\n #overflowSplitButtonButtonList\n [data]=\"data\"\n [disabled]=\"disabled\"\n [fillMode]=\"fillMode\"\n [themeColor]=\"fillMode ? themeColor : null\"\n [textField]=\"textField\"\n (itemClick)=\"itemClick.emit($event)\"\n (click)=\"onButtonListClick($event)\"\n >\n </kendo-toolbar-buttonlist>\n </ng-template>\n "
2298
- }),
2299
- __metadata("design:paramtypes", [])
2300
- ], ToolBarSplitButtonComponent);
2301
- return ToolBarSplitButtonComponent;
2302
- }(ToolBarToolComponent));
2303
-
2304
- /**
2305
- * Represents the [Kendo UI ToolBar Separator for Angular]({% slug controltypes_toolbar %}#toc-separators).
2306
- */
2307
- var ToolBarSeparatorComponent = /** @class */ (function (_super) {
2308
- __extends(ToolBarSeparatorComponent, _super);
2309
- function ToolBarSeparatorComponent() {
2310
- return _super.call(this) || this;
2311
- }
2312
- ToolBarSeparatorComponent_1 = ToolBarSeparatorComponent;
2313
- /**
2314
- * @hidden
2315
- */
2316
- ToolBarSeparatorComponent.prototype.canFocus = function () {
2317
- return false;
2318
- };
2319
- // If this is not here, the docs display info from its parent(ToolBarToolComponent).
2320
- /**
2321
- * @hidden
2322
- */
2323
- ToolBarSeparatorComponent.prototype.focus = function () {
2324
- /* noop */
2325
- };
2326
- // If this is not here, the docs display info from its parent(ToolBarToolComponent).
2327
- /**
2328
- * @hidden
2329
- */
2330
- ToolBarSeparatorComponent.prototype.handleKey = function () {
2331
- return false;
2332
- };
2333
- ToolBarSeparatorComponent.prototype.ngAfterViewInit = function () {
2334
- if (!this.popupTemplate) {
2335
- this.popupTemplate = this.toolbarTemplate;
2336
- }
2337
- };
2338
- var ToolBarSeparatorComponent_1;
2339
- __decorate([
2340
- ViewChild('toolbarTemplate', { static: true }),
2341
- __metadata("design:type", TemplateRef)
2342
- ], ToolBarSeparatorComponent.prototype, "toolbarTemplate", void 0);
2343
- __decorate([
2344
- ViewChild('popupTemplate', { static: true }),
2345
- __metadata("design:type", TemplateRef)
2346
- ], ToolBarSeparatorComponent.prototype, "popupTemplate", void 0);
2347
- __decorate([
2348
- ViewChild('separator', { static: false }),
2349
- __metadata("design:type", ElementRef)
2350
- ], ToolBarSeparatorComponent.prototype, "separator", void 0);
2351
- ToolBarSeparatorComponent = ToolBarSeparatorComponent_1 = __decorate([
2352
- Component({
2353
- exportAs: 'kendoToolBarSeparator',
2354
- // tslint:disable-next-line:no-forward-ref
2355
- providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(function () { return ToolBarSeparatorComponent_1; }) }],
2356
- selector: 'kendo-toolbar-separator',
2357
- template: "\n <ng-template #toolbarTemplate>\n <div class=\"k-separator\"></div>\n </ng-template>\n "
2358
- }),
2359
- __metadata("design:paramtypes", [])
2360
- ], ToolBarSeparatorComponent);
2361
- return ToolBarSeparatorComponent;
2362
- }(ToolBarToolComponent));
2363
-
2364
- /**
2365
- * @hidden
2366
- */
2367
- var RendererService = /** @class */ (function () {
2368
- function RendererService() {
2369
- }
2370
- RendererService.prototype.getElement = function () {
2371
- return this.element.nativeElement;
2372
- };
2373
- RendererService.prototype.querySelector = function (selector) {
2374
- return this.element.nativeElement.querySelector(selector);
2375
- };
2376
- RendererService.prototype.querySelectorAll = function (selector) {
2377
- return this.element.nativeElement.querySelectorAll(selector);
2378
- };
2379
- RendererService.prototype.findFocusable = function () {
2380
- return findFocusable(this.element.nativeElement, false);
2381
- };
2382
- RendererService.prototype.findFocusableChild = function (element) {
2383
- if (!element) {
2384
- element = this.findFocusable();
2385
- }
2386
- return findFocusableChild(element, false);
2387
- };
2388
- RendererService.prototype.findNextFocusableSibling = function (element) {
2389
- if (!element) {
2390
- element = this.findFocusable();
2391
- }
2392
- return findFocusableSibling(element, false);
2393
- };
2394
- RendererService.prototype.findPrevFocusableSibling = function (element) {
2395
- if (!element) {
2396
- element = this.findFocusable();
2397
- }
2398
- return findFocusableSibling(element, false, true);
2399
- };
2400
- RendererService.prototype.setAttribute = function (element, attr, value) {
2401
- this.renderer.setAttribute(element, attr, value);
2402
- };
2403
- RendererService = __decorate([
2404
- Injectable()
2405
- ], RendererService);
2406
- return RendererService;
2407
- }());
2408
-
2409
- /**
2410
- * @hidden
2411
- */
2412
- var ToolBarRendererComponent = /** @class */ (function () {
2413
- function ToolBarRendererComponent(element, renderer, rendererService, refreshService) {
2414
- var _this = this;
2415
- this.element = element;
2416
- this.renderer = renderer;
2417
- this.rendererService = rendererService;
2418
- this.refreshService = refreshService;
2419
- this.rendererClick = new EventEmitter();
2420
- this.rendererService.element = element;
2421
- this.rendererService.renderer = this;
2422
- this.refreshSubscription = this.refreshService.onRefresh.subscribe(function (tool) {
2423
- if (_this.tool === tool) {
2424
- _this.refresh();
2425
- }
2426
- });
2427
- }
2428
- ToolBarRendererComponent.prototype.onClick = function (ev) {
2429
- this.rendererClick.emit({ context: this, event: ev });
2430
- };
2431
- ToolBarRendererComponent.prototype.ngOnInit = function () {
2432
- if (this.resizable) {
2433
- if (this.location === 'toolbar') {
2434
- this.template = this.tool.toolbarTemplate;
2435
- this.renderer.setStyle(this.element.nativeElement, 'visibility', 'hidden');
2436
- this.renderer.setStyle(this.element.nativeElement, 'display', 'none');
2437
- }
2438
- else {
2439
- this.template = this.tool.popupTemplate;
2440
- this.renderer.setStyle(this.element.nativeElement, 'display', 'none');
2441
- }
2442
- }
2443
- else {
2444
- this.tool.overflows = false;
2445
- this.template = this.tool.toolbarTemplate;
2446
- this.renderer.setStyle(this.element.nativeElement, 'visibility', 'display');
2447
- this.renderer.setStyle(this.element.nativeElement, 'display', 'inline-block');
2448
- }
2449
- };
2450
- ToolBarRendererComponent.prototype.ngOnDestroy = function () {
2451
- this.refreshSubscription.unsubscribe();
2452
- };
2453
- ToolBarRendererComponent.prototype.ngAfterViewInit = function () {
2454
- if (this.resizable) {
2455
- this.refresh();
2456
- }
2457
- };
2458
- Object.defineProperty(ToolBarRendererComponent.prototype, "width", {
2459
- /**
2460
- * @hidden
2461
- */
2462
- get: function () {
2463
- return this.tool.overflows ? 0 : outerWidth(this.element.nativeElement);
2464
- },
2465
- enumerable: true,
2466
- configurable: true
2467
- });
2468
- /**
2469
- * @hidden
2470
- */
2471
- ToolBarRendererComponent.prototype.isDisplayed = function () {
2472
- return this.element.nativeElement.style.display !== 'none';
2473
- };
2474
- /**
2475
- * @hidden
2476
- */
2477
- ToolBarRendererComponent.prototype.refresh = function () {
2478
- if (this.resizable) {
2479
- if (this.location === 'toolbar') {
2480
- this.renderer.setStyle(this.element.nativeElement, 'visibility', this.tool.visibility);
2481
- this.renderer.setStyle(this.element.nativeElement, 'display', this.tool.toolbarDisplay);
2482
- }
2483
- else {
2484
- this.renderer.setStyle(this.element.nativeElement, 'display', this.tool.overflowDisplay);
2485
- }
2486
- }
2487
- };
2488
- /**
2489
- * @hidden
2490
- */
2491
- ToolBarRendererComponent.prototype.setAttribute = function (element, attr, value) {
2492
- this.renderer.setAttribute(element, attr, value);
2493
- };
2494
- __decorate([
2495
- Input(),
2496
- __metadata("design:type", ToolBarToolComponent)
2497
- ], ToolBarRendererComponent.prototype, "tool", void 0);
2498
- __decorate([
2499
- Input(),
2500
- __metadata("design:type", String)
2501
- ], ToolBarRendererComponent.prototype, "location", void 0);
2502
- __decorate([
2503
- Input(),
2504
- __metadata("design:type", Boolean)
2505
- ], ToolBarRendererComponent.prototype, "resizable", void 0);
2506
- __decorate([
2507
- Output(),
2508
- __metadata("design:type", EventEmitter)
2509
- ], ToolBarRendererComponent.prototype, "rendererClick", void 0);
2510
- __decorate([
2511
- HostListener('click', ['$event']),
2512
- __metadata("design:type", Function),
2513
- __metadata("design:paramtypes", [Object]),
2514
- __metadata("design:returntype", void 0)
2515
- ], ToolBarRendererComponent.prototype, "onClick", null);
2516
- ToolBarRendererComponent = __decorate([
2517
- Component({
2518
- exportAs: 'kendoToolBarRenderer',
2519
- providers: [RendererService],
2520
- selector: 'kendo-toolbar-renderer',
2521
- template: "\n <ng-container *ngIf=\"location === 'toolbar'\">\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n </ng-container>\n <ng-container *ngIf=\"location === 'overflow' && tool.responsive\">\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n </ng-container>\n "
2522
- }),
2523
- __metadata("design:paramtypes", [ElementRef,
2524
- Renderer2,
2525
- RendererService,
2526
- RefreshService])
2527
- ], ToolBarRendererComponent);
2528
- return ToolBarRendererComponent;
2529
- }());
2530
-
2531
- /**
2532
- * @hidden
2533
- */
2534
- var ToolbarMessages = /** @class */ (function (_super) {
2535
- __extends(ToolbarMessages, _super);
2536
- function ToolbarMessages() {
2537
- return _super !== null && _super.apply(this, arguments) || this;
2538
- }
2539
- __decorate([
2540
- Input(),
2541
- __metadata("design:type", String)
2542
- ], ToolbarMessages.prototype, "moreToolsTitle", void 0);
2543
- return ToolbarMessages;
2544
- }(ComponentMessages));
2545
-
2546
- /**
2547
- * @hidden
2548
- */
2549
- var LocalizedToolbarMessagesDirective = /** @class */ (function (_super) {
2550
- __extends(LocalizedToolbarMessagesDirective, _super);
2551
- function LocalizedToolbarMessagesDirective(service) {
2552
- var _this = _super.call(this) || this;
2553
- _this.service = service;
2554
- return _this;
2555
- }
2556
- LocalizedToolbarMessagesDirective_1 = LocalizedToolbarMessagesDirective;
2557
- var LocalizedToolbarMessagesDirective_1;
2558
- LocalizedToolbarMessagesDirective = LocalizedToolbarMessagesDirective_1 = __decorate([
2559
- Directive({
2560
- providers: [
2561
- {
2562
- provide: ToolbarMessages,
2563
- useExisting: forwardRef(function () { return LocalizedToolbarMessagesDirective_1; }) // tslint:disable-line:no-forward-ref
2564
- }
2565
- ],
2566
- selector: '[kendoToolbarLocalizedMessages]'
2567
- }),
2568
- __metadata("design:paramtypes", [LocalizationService])
2569
- ], LocalizedToolbarMessagesDirective);
2570
- return LocalizedToolbarMessagesDirective;
2571
- }(ToolbarMessages));
2572
-
2573
- /**
2574
- * Custom component messages override default component messages.
2575
- */
2576
- var ToolbarCustomMessagesComponent = /** @class */ (function (_super) {
2577
- __extends(ToolbarCustomMessagesComponent, _super);
2578
- function ToolbarCustomMessagesComponent(service) {
2579
- var _this = _super.call(this) || this;
2580
- _this.service = service;
2581
- return _this;
2582
- }
2583
- ToolbarCustomMessagesComponent_1 = ToolbarCustomMessagesComponent;
2584
- Object.defineProperty(ToolbarCustomMessagesComponent.prototype, "override", {
2585
- get: function () {
2586
- return true;
2587
- },
2588
- enumerable: true,
2589
- configurable: true
2590
- });
2591
- var ToolbarCustomMessagesComponent_1;
2592
- ToolbarCustomMessagesComponent = ToolbarCustomMessagesComponent_1 = __decorate([
2593
- Component({
2594
- providers: [
2595
- {
2596
- provide: ToolbarMessages,
2597
- useExisting: forwardRef(function () { return ToolbarCustomMessagesComponent_1; }) // tslint:disable-line:no-forward-ref
2598
- }
2599
- ],
2600
- selector: 'kendo-toolbar-messages',
2601
- template: ""
2602
- }),
2603
- __metadata("design:paramtypes", [LocalizationService])
2604
- ], ToolbarCustomMessagesComponent);
2605
- return ToolbarCustomMessagesComponent;
2606
- }(ToolbarMessages));
2607
-
2608
- var TOOLBAR_TOOLS = [
2609
- ToolBarToolComponent,
2610
- ToolBarButtonComponent,
2611
- ToolBarButtonGroupComponent,
2612
- ToolBarDropDownButtonComponent,
2613
- ToolBarSplitButtonComponent,
2614
- ToolBarSeparatorComponent
2615
- ];
2616
- var TOOLBAR_COMMON = [
2617
- ToolBarRendererComponent,
2618
- ToolBarButtonListComponent,
2619
- ToolbarCustomMessagesComponent,
2620
- LocalizedToolbarMessagesDirective
2621
- ];
2622
- /**
2623
- * Represents the [NgModule]({{ site.data.urls.angular['ngmoduleapi'] }}) definition for the ToolBar component.
2624
- *
2625
- * The package exports:
2626
- * - `ToolBarComponent`&mdash;The ToolBarComponent class.
2627
- * - `ToolBarToolComponent`&mdash;The base Tool component class.
2628
- * - `ToolBarButtonComponent`&mdash;The Button Tool component class.
2629
- * - `ToolBarButtonGroupComponent`&mdash;The ButtonGroup Tool component class.
2630
- * - `ToolBarDropDownButtonComponent`&mdash;The DropDownButton Tool component class.
2631
- * - `ToolBarSplitButtonComponent`&mdash;The SplitButton Tool component class.
2632
- * - `ToolBarSeparatorComponent`&mdash;The Separator Tool component class.
2633
- */
2634
- var ToolBarModule = /** @class */ (function () {
2635
- function ToolBarModule() {
2636
- }
2637
- ToolBarModule = __decorate([
2638
- NgModule({
2639
- declarations: [ToolBarComponent, TOOLBAR_TOOLS, TOOLBAR_COMMON],
2640
- exports: [ToolBarComponent, TOOLBAR_TOOLS, ToolbarCustomMessagesComponent, LocalizedToolbarMessagesDirective],
2641
- imports: [CommonModule, ButtonsModule, PopupModule, ResizeSensorModule]
2642
- })
2643
- ], ToolBarModule);
2644
- return ToolBarModule;
2645
- }());
2646
-
2647
- /**
2648
- * Generated bundle index. Do not edit.
2649
- */
2650
-
2651
- export { ToolbarMessages, NavigationService, RefreshService, ToolBarRendererComponent, RendererService, ToolBarButtonListComponent, ToolBarComponent, ToolBarToolComponent, ToolBarButtonComponent, ToolBarButtonGroupComponent, ToolBarDropDownButtonComponent, ToolBarSplitButtonComponent, ToolBarSeparatorComponent, ToolBarModule, LocalizedToolbarMessagesDirective, ToolbarCustomMessagesComponent };