@progress/kendo-angular-menu 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.
- package/data-binding/binding-directive-base.d.ts +1 -1
- package/fesm2022/progress-kendo-angular-menu.mjs +87 -87
- package/menu-base.d.ts +1 -1
- package/package.json +11 -19
- package/esm2022/constants.mjs +0 -8
- package/esm2022/context-menu/context-menu-event.mjs +0 -25
- package/esm2022/context-menu/context-menu-items.service.mjs +0 -27
- package/esm2022/context-menu/context-menu-popup-event.mjs +0 -29
- package/esm2022/context-menu/context-menu-select-event.mjs +0 -14
- package/esm2022/context-menu/context-menu-target-container.directive.mjs +0 -49
- package/esm2022/context-menu/context-menu-target.directive.mjs +0 -62
- package/esm2022/context-menu/context-menu-target.service.mjs +0 -27
- package/esm2022/context-menu/context-menu-template.directive.mjs +0 -39
- package/esm2022/context-menu/context-menu.component.mjs +0 -527
- package/esm2022/context-menu/context-menu.module.mjs +0 -69
- package/esm2022/context-menu/context-menu.service.mjs +0 -30
- package/esm2022/data-binding/binding-directive-base.mjs +0 -46
- package/esm2022/data-binding/flat-binding.directive.mjs +0 -139
- package/esm2022/data-binding/hierachy-binding.directive.mjs +0 -124
- package/esm2022/data-binding/utils.mjs +0 -31
- package/esm2022/directives.mjs +0 -48
- package/esm2022/dom-queries.mjs +0 -104
- package/esm2022/index.mjs +0 -29
- package/esm2022/menu-animation.interface.mjs +0 -5
- package/esm2022/menu-base.mjs +0 -103
- package/esm2022/menu-event.mjs +0 -22
- package/esm2022/menu-item.component.mjs +0 -149
- package/esm2022/menu-item.interface.mjs +0 -5
- package/esm2022/menu-select-event.mjs +0 -14
- package/esm2022/menu.component.mjs +0 -304
- package/esm2022/menu.module.mjs +0 -65
- package/esm2022/menus.module.mjs +0 -59
- package/esm2022/open-on-click-settings.mjs +0 -10
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/preventable-event.mjs +0 -34
- package/esm2022/progress-kendo-angular-menu.mjs +0 -8
- package/esm2022/rendering/arrow.component.mjs +0 -70
- package/esm2022/rendering/link.directive.mjs +0 -69
- package/esm2022/rendering/list.component.mjs +0 -679
- package/esm2022/rendering/popup-settings.mjs +0 -74
- package/esm2022/services/actions.service.mjs +0 -192
- package/esm2022/services/hover.service.mjs +0 -127
- package/esm2022/services/items.service.mjs +0 -128
- package/esm2022/services/navigation.service.mjs +0 -268
- package/esm2022/size.mjs +0 -5
- package/esm2022/templates/item-content-template.directive.mjs +0 -53
- package/esm2022/templates/item-link-template.directive.mjs +0 -57
- package/esm2022/templates/item-template.directive.mjs +0 -54
- package/esm2022/utils.mjs +0 -52
|
@@ -1,268 +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, NgZone } from '@angular/core';
|
|
6
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
-
import { ItemsService } from './items.service';
|
|
8
|
-
import { ActionsService } from './actions.service';
|
|
9
|
-
import { Keys, normalizeKeys } from '@progress/kendo-angular-common';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
import * as i1 from "./items.service";
|
|
12
|
-
import * as i2 from "./actions.service";
|
|
13
|
-
import * as i3 from "@progress/kendo-angular-l10n";
|
|
14
|
-
const DEFAULT_ACTIVE = '0';
|
|
15
|
-
const NO_SPACE_REGEX = /\S/;
|
|
16
|
-
const handlers = {};
|
|
17
|
-
handlers[Keys.ArrowLeft] = 'left';
|
|
18
|
-
handlers[Keys.ArrowRight] = 'right';
|
|
19
|
-
handlers[Keys.ArrowUp] = 'up';
|
|
20
|
-
handlers[Keys.ArrowDown] = 'down';
|
|
21
|
-
handlers[Keys.Home] = 'home';
|
|
22
|
-
handlers[Keys.End] = 'end';
|
|
23
|
-
handlers[Keys.Space] = 'enter';
|
|
24
|
-
handlers[Keys.Enter] = 'enter';
|
|
25
|
-
handlers[Keys.NumpadEnter] = 'enter';
|
|
26
|
-
handlers[Keys.KeyN] = 'enter';
|
|
27
|
-
handlers[Keys.Escape] = 'esc';
|
|
28
|
-
handlers[Keys.Tab] = 'tab';
|
|
29
|
-
const handlersRTL = Object.assign({}, handlers, {
|
|
30
|
-
'ArrowLeft': 'right',
|
|
31
|
-
'ArrowRight': 'left'
|
|
32
|
-
});
|
|
33
|
-
function isPrintableCharacter(key) {
|
|
34
|
-
return key.length === 1 && NO_SPACE_REGEX.test(key);
|
|
35
|
-
}
|
|
36
|
-
const resolvedPromise = Promise.resolve(null);
|
|
37
|
-
/**
|
|
38
|
-
* @hidden
|
|
39
|
-
*/
|
|
40
|
-
export class NavigationService {
|
|
41
|
-
items;
|
|
42
|
-
actions;
|
|
43
|
-
localization;
|
|
44
|
-
ngZone;
|
|
45
|
-
vertical = false;
|
|
46
|
-
activeIndex = DEFAULT_ACTIVE;
|
|
47
|
-
focusedIdx;
|
|
48
|
-
get focusedItem() {
|
|
49
|
-
return this.items.get(this.focusedIdx);
|
|
50
|
-
}
|
|
51
|
-
get activeItem() {
|
|
52
|
-
return this.items.get(this.activeIndex);
|
|
53
|
-
}
|
|
54
|
-
get handlers() {
|
|
55
|
-
return this.localization.rtl ? handlersRTL : handlers;
|
|
56
|
-
}
|
|
57
|
-
constructor(items, actions, localization, ngZone) {
|
|
58
|
-
this.items = items;
|
|
59
|
-
this.actions = actions;
|
|
60
|
-
this.localization = localization;
|
|
61
|
-
this.ngZone = ngZone;
|
|
62
|
-
}
|
|
63
|
-
focus(item) {
|
|
64
|
-
if (item.index === this.focusedIdx) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (!this.activeItem || !this.items.hasParent(item, this.activeItem)) {
|
|
68
|
-
this.setActive(item);
|
|
69
|
-
}
|
|
70
|
-
this.setFocus(item);
|
|
71
|
-
}
|
|
72
|
-
setFocus(item) {
|
|
73
|
-
this.focusedIdx = item.index;
|
|
74
|
-
item.focus();
|
|
75
|
-
}
|
|
76
|
-
focusLeave() {
|
|
77
|
-
const focused = this.focusedItem;
|
|
78
|
-
if (focused) {
|
|
79
|
-
this.actions.closeToRoot(focused);
|
|
80
|
-
this.actions.execute();
|
|
81
|
-
}
|
|
82
|
-
this.focusedIdx = null;
|
|
83
|
-
}
|
|
84
|
-
updateActive() {
|
|
85
|
-
if (!this.activeItem && this.items.hasItems) {
|
|
86
|
-
const firstItem = this.items.get(DEFAULT_ACTIVE);
|
|
87
|
-
firstItem.toggleActive(true);
|
|
88
|
-
this.ngZone.runOutsideAngular(() => {
|
|
89
|
-
resolvedPromise.then(() => {
|
|
90
|
-
this.activeIndex = DEFAULT_ACTIVE;
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
keydown(e) {
|
|
96
|
-
const current = this.focusedItem || this.activeItem;
|
|
97
|
-
if (!current) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const code = normalizeKeys(e);
|
|
101
|
-
const handler = this.handlers[code];
|
|
102
|
-
if (handler) {
|
|
103
|
-
if (handler !== 'tab') {
|
|
104
|
-
e.preventDefault();
|
|
105
|
-
}
|
|
106
|
-
this[handler](current, e);
|
|
107
|
-
}
|
|
108
|
-
else if (isPrintableCharacter(e.key)) {
|
|
109
|
-
this.search(current, e.key);
|
|
110
|
-
}
|
|
111
|
-
this.actions.execute();
|
|
112
|
-
}
|
|
113
|
-
focusIndex(index) {
|
|
114
|
-
if (!index && this.activeItem) {
|
|
115
|
-
this.setFocus(this.activeItem);
|
|
116
|
-
}
|
|
117
|
-
else if (index === 'first') {
|
|
118
|
-
this.focusFirst();
|
|
119
|
-
}
|
|
120
|
-
else if (index === 'last') {
|
|
121
|
-
this.focusLast();
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
const item = this.items.get(index);
|
|
125
|
-
if (item) {
|
|
126
|
-
this.focus(item);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
focusFirst() {
|
|
131
|
-
const items = this.items.siblings(this.items.get('0'));
|
|
132
|
-
this.focus(items[0]);
|
|
133
|
-
}
|
|
134
|
-
focusLast() {
|
|
135
|
-
const items = this.items.siblings(this.items.get('0'));
|
|
136
|
-
this.focus(items[items.length - 1]);
|
|
137
|
-
}
|
|
138
|
-
search(current, key) {
|
|
139
|
-
const siblings = this.items.siblings(current);
|
|
140
|
-
const startIndex = siblings.indexOf(current);
|
|
141
|
-
const items = siblings.slice(startIndex + 1).concat(siblings.slice(0, startIndex));
|
|
142
|
-
for (let idx = 0; idx < items.length; idx++) {
|
|
143
|
-
const sibling = items[idx];
|
|
144
|
-
const text = sibling.item.text || "";
|
|
145
|
-
if (text.toLowerCase().startsWith(key.toLowerCase())) {
|
|
146
|
-
this.focus(sibling);
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
down(current) {
|
|
152
|
-
if (current.level === 0 && !this.vertical) {
|
|
153
|
-
if (current.hasContent) {
|
|
154
|
-
this.actions.open(current, this.focusChild(current, 0));
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
this.focus(this.items.next(current));
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
up(current) {
|
|
162
|
-
if (current.level === 0 && !this.vertical) {
|
|
163
|
-
if (current.hasContent) {
|
|
164
|
-
this.actions.open(current, this.focusChild(current, current.children.length - 1));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
this.focus(this.items.previous(current));
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
left(current) {
|
|
172
|
-
if (this.vertical && current.level === 0 && current.disabled) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
if (current.level > 1 || (this.vertical && current.level > 0)) {
|
|
176
|
-
const parent = this.items.parent(current);
|
|
177
|
-
this.focus(parent);
|
|
178
|
-
this.actions.close(parent);
|
|
179
|
-
}
|
|
180
|
-
else if (this.vertical && current.level === 0 && !current.disabled) {
|
|
181
|
-
if (current.hasContent) {
|
|
182
|
-
this.actions.open(current, this.focusChild(current, current.children.length - 1));
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
this.focus(this.items.previous(this.activeItem));
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
right(current) {
|
|
190
|
-
if (this.vertical && current.level === 0 && current.disabled) {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
if (current.horizontal && !current.disabled) {
|
|
194
|
-
if (current.hasContent) {
|
|
195
|
-
this.actions.open(current, this.focusChild(current, 0));
|
|
196
|
-
}
|
|
197
|
-
else if (!this.vertical || current.level > 0) {
|
|
198
|
-
this.focus(this.items.next(this.activeItem));
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
this.focus(this.items.next(this.activeItem));
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
home(current) {
|
|
206
|
-
const siblings = this.items.siblings(current);
|
|
207
|
-
this.focus(siblings[0]);
|
|
208
|
-
}
|
|
209
|
-
end(current) {
|
|
210
|
-
const siblings = this.items.siblings(current);
|
|
211
|
-
this.focus(siblings[siblings.length - 1]);
|
|
212
|
-
}
|
|
213
|
-
enter(current, domEvent) {
|
|
214
|
-
const actions = this.actions;
|
|
215
|
-
if (current.disabled) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
if (current.hasContent) {
|
|
219
|
-
actions.select(current, domEvent);
|
|
220
|
-
actions.open(current, this.focusChild(current, 0));
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
actions.select(current, domEvent, null, () => {
|
|
224
|
-
current.navigate();
|
|
225
|
-
});
|
|
226
|
-
this.focus(this.items.root(current));
|
|
227
|
-
actions.closeToRoot(current);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
esc(current) {
|
|
231
|
-
if (current.level > 0) {
|
|
232
|
-
const parent = this.items.parent(current);
|
|
233
|
-
this.actions.close(parent);
|
|
234
|
-
this.focus(parent);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
tab(current) {
|
|
238
|
-
if (current.level > 0) {
|
|
239
|
-
this.activeItem.focus();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
focusChild(item, index) {
|
|
243
|
-
return () => {
|
|
244
|
-
const child = this.items.children(item)[index];
|
|
245
|
-
this.setFocus(child);
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
setActive(item) {
|
|
249
|
-
const focused = this.focusedItem;
|
|
250
|
-
const active = this.items.root(item);
|
|
251
|
-
if (this.activeItem) {
|
|
252
|
-
this.activeItem.toggleActive(false);
|
|
253
|
-
}
|
|
254
|
-
this.activeIndex = active.index;
|
|
255
|
-
active.toggleActive(true);
|
|
256
|
-
if (focused) {
|
|
257
|
-
this.actions.closeToRoot(focused);
|
|
258
|
-
if (focused.level > 0) {
|
|
259
|
-
this.actions.open(active);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService, deps: [{ token: i1.ItemsService }, { token: i2.ActionsService }, { token: i3.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
264
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService });
|
|
265
|
-
}
|
|
266
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NavigationService, decorators: [{
|
|
267
|
-
type: Injectable
|
|
268
|
-
}], ctorParameters: () => [{ type: i1.ItemsService }, { type: i2.ActionsService }, { type: i3.LocalizationService }, { type: i0.NgZone }] });
|
package/esm2022/size.mjs
DELETED
|
@@ -1,5 +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
|
-
export {};
|
|
@@ -1,53 +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 { Directive, TemplateRef, Optional } from '@angular/core';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Represents a template for the content of the Menu items ([see example]({% slug templates_menu %})). To define the template,
|
|
9
|
-
* nest an `<ng-template>` tag with the `kendoMenuItemContentTemplate` directive inside a `<kendo-menu-item>` component.
|
|
10
|
-
*
|
|
11
|
-
* The available fields in the template context are:
|
|
12
|
-
* - `item`—The item data.
|
|
13
|
-
* - `index`—The item index.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts-preview
|
|
17
|
-
*
|
|
18
|
-
* _@Component({
|
|
19
|
-
* selector: 'my-app',
|
|
20
|
-
* template: `
|
|
21
|
-
* <kendo-menu>
|
|
22
|
-
* <kendo-menu-item text="item2">
|
|
23
|
-
* <ng-template kendoMenuItemContentTemplate let-item="item" let-index="index">
|
|
24
|
-
* <div style="padding: 10px;">
|
|
25
|
-
* My Content Template for: {{ item.text }} at index: {{ index }}
|
|
26
|
-
* </div>
|
|
27
|
-
* </ng-template>
|
|
28
|
-
* </kendo-menu-item>
|
|
29
|
-
* </kendo-menu>
|
|
30
|
-
* `
|
|
31
|
-
* })
|
|
32
|
-
*
|
|
33
|
-
* class AppComponent {
|
|
34
|
-
* }
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export class ItemContentTemplateDirective {
|
|
38
|
-
templateRef;
|
|
39
|
-
constructor(templateRef) {
|
|
40
|
-
this.templateRef = templateRef;
|
|
41
|
-
}
|
|
42
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemContentTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
43
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ItemContentTemplateDirective, isStandalone: true, selector: "[kendoMenuItemContentTemplate]", ngImport: i0 });
|
|
44
|
-
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemContentTemplateDirective, decorators: [{
|
|
46
|
-
type: Directive,
|
|
47
|
-
args: [{
|
|
48
|
-
selector: '[kendoMenuItemContentTemplate]',
|
|
49
|
-
standalone: true
|
|
50
|
-
}]
|
|
51
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
|
|
52
|
-
type: Optional
|
|
53
|
-
}] }] });
|
|
@@ -1,57 +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 { Directive, TemplateRef, Optional } from '@angular/core';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Represents a template for the links of the Menu items ([see example]({% slug templates_menu %})). To define a template
|
|
9
|
-
* for an item, nest an `<ng-template>` tag with the `kendoMenuItemLinkTemplate` directive inside a `<kendo-menu-item>`
|
|
10
|
-
* component. To define a template for all Menu items, nest the template inside the `<kendo-menu>` component.
|
|
11
|
-
*
|
|
12
|
-
* The available fields in the template context are:
|
|
13
|
-
* - `item`—The item data.
|
|
14
|
-
* - `index`—The item index.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts-preview
|
|
18
|
-
*
|
|
19
|
-
* _@Component({
|
|
20
|
-
* selector: 'my-app',
|
|
21
|
-
* template: `
|
|
22
|
-
* <kendo-menu>
|
|
23
|
-
* <kendo-menu-item text="item2">
|
|
24
|
-
* <ng-template kendoMenuItemLinkTemplate let-item="item" let-index="index">
|
|
25
|
-
* <span [kendoMenuItemLink]="index">
|
|
26
|
-
* {{ item.text }}
|
|
27
|
-
* @if (item.items && item.items.length) {
|
|
28
|
-
* <span [kendoMenuExpandArrow]="index"></span>
|
|
29
|
-
* }
|
|
30
|
-
* </span>
|
|
31
|
-
* </ng-template>
|
|
32
|
-
* </kendo-menu-item>
|
|
33
|
-
* </kendo-menu>
|
|
34
|
-
* `
|
|
35
|
-
* })
|
|
36
|
-
*
|
|
37
|
-
* class AppComponent {
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export class ItemLinkTemplateDirective {
|
|
42
|
-
templateRef;
|
|
43
|
-
constructor(templateRef) {
|
|
44
|
-
this.templateRef = templateRef;
|
|
45
|
-
}
|
|
46
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemLinkTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
47
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ItemLinkTemplateDirective, isStandalone: true, selector: "[kendoMenuItemLinkTemplate]", ngImport: i0 });
|
|
48
|
-
}
|
|
49
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemLinkTemplateDirective, decorators: [{
|
|
50
|
-
type: Directive,
|
|
51
|
-
args: [{
|
|
52
|
-
selector: '[kendoMenuItemLinkTemplate]',
|
|
53
|
-
standalone: true
|
|
54
|
-
}]
|
|
55
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
|
|
56
|
-
type: Optional
|
|
57
|
-
}] }] });
|
|
@@ -1,54 +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 { Directive, TemplateRef, Optional } from '@angular/core';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Represents a template for the Menu items ([see example]({% slug templates_menu %})). To define a template
|
|
9
|
-
* for an item, nest an `<ng-template>` tag with the `kendoMenuItemTemplate` directive inside a `<kendo-menu-item>`
|
|
10
|
-
* component. To define a template for all Menu items, nest the template inside the `<kendo-menu>` component.
|
|
11
|
-
*
|
|
12
|
-
* The available fields in the template context are:
|
|
13
|
-
* - `item`—The item data.
|
|
14
|
-
* - `index`—The item index.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts-preview
|
|
18
|
-
*
|
|
19
|
-
* _@Component({
|
|
20
|
-
* selector: 'my-app',
|
|
21
|
-
* template: `
|
|
22
|
-
* <kendo-menu>
|
|
23
|
-
* <kendo-menu-item text="item2">
|
|
24
|
-
* <ng-template kendoMenuItemTemplate let-item="item" let-index="index">
|
|
25
|
-
* <div style="padding: 10px;">
|
|
26
|
-
* My Template for: {{ item.text }} at index: {{ index }}
|
|
27
|
-
* </div>
|
|
28
|
-
* </ng-template>
|
|
29
|
-
* </kendo-menu-item>
|
|
30
|
-
* </kendo-menu>
|
|
31
|
-
* `
|
|
32
|
-
* })
|
|
33
|
-
*
|
|
34
|
-
* class AppComponent {
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export class ItemTemplateDirective {
|
|
39
|
-
templateRef;
|
|
40
|
-
constructor(templateRef) {
|
|
41
|
-
this.templateRef = templateRef;
|
|
42
|
-
}
|
|
43
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
44
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ItemTemplateDirective, isStandalone: true, selector: "[kendoMenuItemTemplate]", ngImport: i0 });
|
|
45
|
-
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemTemplateDirective, decorators: [{
|
|
47
|
-
type: Directive,
|
|
48
|
-
args: [{
|
|
49
|
-
selector: '[kendoMenuItemTemplate]',
|
|
50
|
-
standalone: true
|
|
51
|
-
}]
|
|
52
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
|
|
53
|
-
type: Optional
|
|
54
|
-
}] }] });
|
package/esm2022/utils.mjs
DELETED
|
@@ -1,52 +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 { ElementRef } from '@angular/core';
|
|
6
|
-
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
7
|
-
import { caretAltDownIcon, caretAltLeftIcon, caretAltRightIcon } from '@progress/kendo-svg-icons';
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
export const defined = (value) => typeof value !== 'undefined';
|
|
12
|
-
/**
|
|
13
|
-
* @hidden
|
|
14
|
-
*/
|
|
15
|
-
export const bodyFactory = () => {
|
|
16
|
-
if (isDocumentAvailable()) {
|
|
17
|
-
return new ElementRef(document.body);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* @hidden
|
|
22
|
-
*/
|
|
23
|
-
export const getSizeClass = (size) => {
|
|
24
|
-
const SIZE_CLASSES = {
|
|
25
|
-
'small': 'k-menu-group-sm',
|
|
26
|
-
'medium': 'k-menu-group-md',
|
|
27
|
-
'large': 'k-menu-group-lg'
|
|
28
|
-
};
|
|
29
|
-
return SIZE_CLASSES[size];
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
export const getFontIcon = (horizontal, rtl) => {
|
|
35
|
-
const icon = horizontal ?
|
|
36
|
-
rtl ?
|
|
37
|
-
'caret-alt-left' :
|
|
38
|
-
'caret-alt-right' :
|
|
39
|
-
'caret-alt-down';
|
|
40
|
-
return icon;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* @hidden
|
|
44
|
-
*/
|
|
45
|
-
export const getSVGIcon = (horizontal, rtl) => {
|
|
46
|
-
const icon = horizontal ?
|
|
47
|
-
rtl ?
|
|
48
|
-
caretAltLeftIcon :
|
|
49
|
-
caretAltRightIcon :
|
|
50
|
-
caretAltDownIcon;
|
|
51
|
-
return icon;
|
|
52
|
-
};
|