@progress/kendo-angular-toolbar 21.4.1-develop.1 → 22.0.0-develop.1

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 (40) hide show
  1. package/fesm2022/progress-kendo-angular-toolbar.mjs +62 -62
  2. package/localization/messages.d.ts +1 -1
  3. package/package.json +12 -20
  4. package/esm2022/common/fillmode.mjs +0 -5
  5. package/esm2022/common/overflow-mode.mjs +0 -5
  6. package/esm2022/common/overflow-settings.mjs +0 -5
  7. package/esm2022/common/preventable-event.mjs +0 -25
  8. package/esm2022/common/renderer-click.mjs +0 -5
  9. package/esm2022/common/scroll-buttons.mjs +0 -5
  10. package/esm2022/common/size.mjs +0 -5
  11. package/esm2022/direction.mjs +0 -5
  12. package/esm2022/directives.mjs +0 -45
  13. package/esm2022/display-mode.mjs +0 -5
  14. package/esm2022/group-selection-settings.mjs +0 -5
  15. package/esm2022/index.mjs +0 -17
  16. package/esm2022/localization/custom-messages.component.mjs +0 -56
  17. package/esm2022/localization/localized-toolbar-messages.directive.mjs +0 -39
  18. package/esm2022/localization/messages.mjs +0 -39
  19. package/esm2022/navigation.service.mjs +0 -159
  20. package/esm2022/package-metadata.mjs +0 -16
  21. package/esm2022/popup-settings.mjs +0 -5
  22. package/esm2022/progress-kendo-angular-toolbar.mjs +0 -8
  23. package/esm2022/refresh.service.mjs +0 -20
  24. package/esm2022/render-location.mjs +0 -5
  25. package/esm2022/renderer.component.mjs +0 -191
  26. package/esm2022/renderer.service.mjs +0 -52
  27. package/esm2022/scroll.service.mjs +0 -110
  28. package/esm2022/scrollable-button.component.mjs +0 -152
  29. package/esm2022/tool-options.mjs +0 -5
  30. package/esm2022/toolbar.component.mjs +0 -1582
  31. package/esm2022/toolbar.module.mjs +0 -46
  32. package/esm2022/tools/toolbar-button.component.mjs +0 -712
  33. package/esm2022/tools/toolbar-buttongroup.component.mjs +0 -448
  34. package/esm2022/tools/toolbar-dropdownbutton.component.mjs +0 -595
  35. package/esm2022/tools/toolbar-separator.component.mjs +0 -96
  36. package/esm2022/tools/toolbar-spacer.component.mjs +0 -76
  37. package/esm2022/tools/toolbar-splitbutton.component.mjs +0 -607
  38. package/esm2022/tools/toolbar-tool.component.mjs +0 -106
  39. package/esm2022/tools/tools.service.mjs +0 -25
  40. package/esm2022/util.mjs +0 -244
@@ -1,106 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { TemplateRef, Input, Directive, ElementRef, inject, ViewChild } from '@angular/core';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * Represents the base ToolBar Tool component for Angular.
9
- *
10
- * Extend this class to create a custom tool for the ToolBar.
11
- *
12
- * @example
13
- * ```typescript
14
- * import { Component } from '@angular/core';
15
- * import { ToolBarToolComponent } from '@progress/kendo-angular-toolbar';
16
- *
17
- * @Component({
18
- * providers: [{ provide: ToolBarToolComponent, useExisting: forwardRef(() => CustomToolComponent) }],
19
- * selector: 'custom-tool',
20
- * })
21
- *
22
- * export class CustomToolComponent extends ToolBarToolComponent {
23
- *
24
- * constructor() {
25
- * super();
26
- * }
27
- * }
28
- * ```
29
- */
30
- export class ToolBarToolComponent {
31
- toolbarTemplate;
32
- sectionTemplate;
33
- popupTemplate;
34
- tabIndex = -1; //Focus movement inside the toolbar is managed using roving tabindex.
35
- overflows = true;
36
- visibility;
37
- element;
38
- isBuiltInTool = false;
39
- /**
40
- * @hidden
41
- */
42
- isHidden = false;
43
- /**
44
- * @hidden
45
- */
46
- location;
47
- constructor() {
48
- this.element = inject(ElementRef);
49
- }
50
- // this should be replaced with showTool: DisplayMode = 'both';
51
- /**
52
- * @hidden
53
- */
54
- responsive = true;
55
- get toolbarDisplay() {
56
- return this.overflows ? 'none' : 'inline-flex';
57
- }
58
- get overflowDisplay() {
59
- return this.overflows ? 'block' : 'none';
60
- }
61
- /**
62
- * Determines if the tool can receive focus.
63
- * Returns `true` if the tool participates in keyboard navigation.
64
- * @returns `true` if the tool is focusable.
65
- */
66
- canFocus() {
67
- return false;
68
- }
69
- /**
70
- * Called when the tool receives focus.
71
- * Accepts the original browser event, which can be a `KeyboardEvent`, `MouseEvent`, or `FocusEvent`.
72
- * @param {Event} _ev - The event that triggers focus for the tool.
73
- */
74
- focus(_ev) {
75
- /* noop */
76
- }
77
- /**
78
- * Called when the tool is focused and an arrow key is pressed.
79
- * Returns a boolean value that determines if the `ToolBarComponent` moves focus to the next or previous tool
80
- * ([see example]({% slug customcontroltypes_toolbar %}#toc-adding-keyboard-navigation)).
81
- * @param {KeyboardEvent} _ev - The last pressed arrow key.
82
- * @returns `true` if focus moves to another tool.
83
- */
84
- handleKey(_ev) {
85
- return false;
86
- }
87
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolBarToolComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
88
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ToolBarToolComponent, isStandalone: true, inputs: { responsive: "responsive" }, viewQueries: [{ propertyName: "toolbarTemplate", first: true, predicate: ["toolbarTemplate"], descendants: true, static: true }, { propertyName: "sectionTemplate", first: true, predicate: ["sectionTemplate"], descendants: true, static: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true, static: true }], ngImport: i0 });
89
- }
90
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolBarToolComponent, decorators: [{
91
- type: Directive,
92
- args: [{
93
- standalone: true
94
- }]
95
- }], ctorParameters: () => [], propDecorators: { toolbarTemplate: [{
96
- type: ViewChild,
97
- args: ['toolbarTemplate', { static: true }]
98
- }], sectionTemplate: [{
99
- type: ViewChild,
100
- args: ['sectionTemplate', { static: true }]
101
- }], popupTemplate: [{
102
- type: ViewChild,
103
- args: ['popupTemplate', { static: true }]
104
- }], responsive: [{
105
- type: Input
106
- }] } });
@@ -1,25 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Injectable } from '@angular/core';
6
- import { Subject } from 'rxjs';
7
- import * as i0 from "@angular/core";
8
- /**
9
- * @hidden
10
- */
11
- export class ToolbarToolsService {
12
- renderedToolsChange = new Subject();
13
- overflowToolsChange = new Subject();
14
- renderedTools = [];
15
- overflowTools = [];
16
- allTools = [];
17
- reset() {
18
- this.renderedTools = this.overflowTools = this.allTools = [];
19
- }
20
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolbarToolsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
21
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolbarToolsService });
22
- }
23
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolbarToolsService, decorators: [{
24
- type: Injectable
25
- }] });
package/esm2022/util.mjs DELETED
@@ -1,244 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Keys, normalizeKeys } from '@progress/kendo-angular-common';
6
- /**
7
- * @hidden
8
- */
9
- const focusableRegex = /^(?:a|input|select|textarea|button|object)$/i;
10
- /**
11
- * @hidden
12
- */
13
- export function outerWidth(element) {
14
- let width = element.offsetWidth;
15
- const style = getComputedStyle(element);
16
- width += parseFloat(style.marginLeft) || 0 + parseFloat(style.marginRight) || 0;
17
- return width;
18
- }
19
- /**
20
- * @hidden
21
- */
22
- export function innerWidth(element) {
23
- let width = element.offsetWidth;
24
- const style = getComputedStyle(element);
25
- width -= parseFloat(style.paddingLeft) || 0 + parseFloat(style.borderLeftWidth) || 0;
26
- width -= parseFloat(style.paddingRight) || 0 + parseFloat(style.borderRightWidth) || 0;
27
- return width;
28
- }
29
- /**
30
- * @hidden
31
- */
32
- export function outerHeight(element) {
33
- let width = element.offsetHeight;
34
- const style = getComputedStyle(element);
35
- width += parseFloat(style.marginTop) || 0 + parseFloat(style.marginBottom) || 0;
36
- return width;
37
- }
38
- /**
39
- * @hidden
40
- */
41
- export const closest = (node, predicate) => {
42
- while (node && !predicate(node)) {
43
- node = node.parentNode;
44
- }
45
- return node;
46
- };
47
- /**
48
- * @hidden
49
- */
50
- export const isVisible = (element) => {
51
- const rect = element.getBoundingClientRect();
52
- const hasSize = rect.width > 0 && rect.height > 0;
53
- const hasPosition = rect.x !== 0 && rect.y !== 0;
54
- // Elements can have zero size due to styling, but they should still count as visible.
55
- // For example, the selection checkbox has no size, but is made visible through styling.
56
- return (hasSize || hasPosition) && window.getComputedStyle(element).visibility !== 'hidden';
57
- };
58
- /**
59
- * @hidden
60
- */
61
- export const findElement = (node, predicate, matchSelf = true) => {
62
- if (!node) {
63
- return;
64
- }
65
- if (matchSelf && predicate(node)) {
66
- return node;
67
- }
68
- node = node.firstChild;
69
- while (node) {
70
- if (node.nodeType === 1) {
71
- const element = findElement(node, predicate);
72
- if (element) {
73
- return element;
74
- }
75
- }
76
- node = node.nextSibling;
77
- }
78
- };
79
- /**
80
- * @hidden
81
- */
82
- export const isFocusable = (element, checkVisibility = true) => {
83
- if (element.tagName) {
84
- const tagName = element.tagName.toLowerCase();
85
- const tabIndex = element.getAttribute('tabIndex');
86
- let focusable = tabIndex !== null;
87
- if (focusableRegex.test(tagName)) {
88
- focusable = !element.disabled;
89
- }
90
- return focusable && (!checkVisibility || isVisible(element));
91
- }
92
- return false;
93
- };
94
- /**
95
- * @hidden
96
- */
97
- export const findFocusable = (element, checkVisibility = true) => {
98
- return findElement(element, node => isFocusable(node, checkVisibility));
99
- };
100
- /**
101
- * @hidden
102
- */
103
- export const findFocusableChild = (element, checkVisibility = true) => {
104
- return findElement(element, node => isFocusable(node, checkVisibility), false);
105
- };
106
- /**
107
- * @hidden
108
- */
109
- export const findFocusableSibling = (element, checkVisibility = true, reverse) => {
110
- let node = reverse ? element.prevSibling : element.nextSibling;
111
- while (node) {
112
- if (node.nodeType === 1) {
113
- const result = findElement(node, el => isFocusable(el, checkVisibility));
114
- if (result) {
115
- return result;
116
- }
117
- }
118
- node = reverse ? node.prevSibling : node.nextSibling;
119
- }
120
- };
121
- /**
122
- * @hidden
123
- */
124
- export const isPresent = (value) => value !== null && value !== undefined;
125
- /**
126
- * @hidden
127
- */
128
- export const makePeeker = (collection) => (index) => isPresent(collection[index]);
129
- /**
130
- * @hidden
131
- */
132
- export const getIndexOfFocused = (prevKeyCode, nextKeyCode, collection) => (ev) => {
133
- const code = normalizeKeys(ev);
134
- switch (ev.type) {
135
- case 'keydown':
136
- if (code === prevKeyCode) {
137
- return collection.length - 1;
138
- }
139
- if (code === nextKeyCode) {
140
- return 0;
141
- }
142
- break;
143
- case 'click':
144
- return collection.findIndex(be => be === ev.target || be.contains(ev.target));
145
- case 'focus':
146
- return 0;
147
- default:
148
- return 0;
149
- }
150
- };
151
- /**
152
- * @hidden
153
- */
154
- export const seekFocusedIndex = (prevKeyCode, nextKeyCode, seeker) => (startIndex, ev) => {
155
- const code = normalizeKeys(ev);
156
- switch (code) {
157
- case prevKeyCode:
158
- return seeker(startIndex - 1) ? startIndex - 1 : startIndex;
159
- case nextKeyCode:
160
- return seeker(startIndex + 1) ? startIndex + 1 : startIndex;
161
- default:
162
- return startIndex;
163
- }
164
- };
165
- /**
166
- * @hidden
167
- */
168
- export const areEqual = (first) => (second) => first === second;
169
- /**
170
- * @hidden
171
- */
172
- export const getNextKey = (rtl = false) => (overflows = true) => overflows ? Keys.ArrowDown : rtl ? Keys.ArrowLeft : Keys.ArrowRight;
173
- /**
174
- * @hidden
175
- */
176
- export const getPrevKey = (rtl = false) => (overflows = true) => overflows ? Keys.ArrowUp : rtl ? Keys.ArrowRight : Keys.ArrowLeft;
177
- /**
178
- * @hidden
179
- */
180
- export const getValueForLocation = (property, displayMode, overflows) => {
181
- switch (displayMode) {
182
- case 'toolbar':
183
- return overflows ? undefined : property;
184
- case 'menu':
185
- return overflows ? property : undefined;
186
- case 'never':
187
- return;
188
- default:
189
- return property;
190
- }
191
- };
192
- /**
193
- * @hidden
194
- */
195
- export const SIZES = {
196
- small: 'sm',
197
- medium: 'md',
198
- large: 'lg'
199
- };
200
- /**
201
- * @hidden
202
- *
203
- * Returns the styling classes to be added and removed
204
- */
205
- export const getStylingClasses = (componentType, stylingOption, previousValue, newValue) => {
206
- switch (stylingOption) {
207
- case 'size':
208
- return {
209
- toRemove: `k-${componentType}-${SIZES[previousValue]}`,
210
- toAdd: newValue !== 'none' ? `k-${componentType}-${SIZES[newValue]}` : ''
211
- };
212
- case 'fillMode':
213
- return {
214
- toRemove: `k-${componentType}-${previousValue}`,
215
- toAdd: newValue !== 'none' ? `k-${componentType}-${newValue}` : ''
216
- };
217
- default:
218
- break;
219
- }
220
- };
221
- /**
222
- * @hidden
223
- *
224
- * Checks whether a Node is Text or Element node.
225
- * nodeType 1 is Element, nodeType 3 is Text
226
- */
227
- export const isElementOrTextNode = n => n.nodeType === 1 || n.nodeType === 3;
228
- /**
229
- * @hidden
230
- */
231
- export const normalizeOverflowSettings = (overflow) => {
232
- const defaultOverflowSettings = { mode: 'none', scrollButtons: 'auto', scrollButtonsPosition: 'split' };
233
- let normalizedSettings = {};
234
- if (typeof overflow === 'object') {
235
- normalizedSettings = Object.assign(defaultOverflowSettings, overflow);
236
- }
237
- else if (typeof overflow === 'boolean') {
238
- normalizedSettings = overflow ? Object.assign(defaultOverflowSettings, { mode: 'menu' }) : defaultOverflowSettings;
239
- }
240
- else {
241
- normalizedSettings = Object.assign(defaultOverflowSettings, { mode: overflow });
242
- }
243
- return normalizedSettings;
244
- };