@progress/kendo-angular-buttons 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/fesm2022/progress-kendo-angular-buttons.mjs +105 -105
- package/listbutton/list-button.d.ts +1 -1
- package/package.json +11 -19
- package/splitbutton/localization/messages.d.ts +1 -1
- package/esm2022/button/button-settings.mjs +0 -5
- package/esm2022/button/button.component.mjs +0 -558
- package/esm2022/button/button.module.mjs +0 -43
- package/esm2022/button/button.service.mjs +0 -22
- package/esm2022/button/selection-settings.mjs +0 -5
- package/esm2022/buttongroup/buttongroup.component.mjs +0 -340
- package/esm2022/buttongroup/buttongroup.module.mjs +0 -49
- package/esm2022/buttons.module.mjs +0 -58
- package/esm2022/chip/chip-content-click-event-args.interface.mjs +0 -5
- package/esm2022/chip/chip-list-remove-event-args.interface.mjs +0 -5
- package/esm2022/chip/chip-list.component.mjs +0 -360
- package/esm2022/chip/chip-remove-event-args.interface.mjs +0 -5
- package/esm2022/chip/chip.component.mjs +0 -585
- package/esm2022/chip/chip.module.mjs +0 -45
- package/esm2022/chip/models/avatar-settings.interface.mjs +0 -5
- package/esm2022/chip/models/selection.mjs +0 -5
- package/esm2022/common/models/arrow-settings.mjs +0 -5
- package/esm2022/common/models/fillmode.mjs +0 -5
- package/esm2022/common/models/rounded.mjs +0 -5
- package/esm2022/common/models/size.mjs +0 -5
- package/esm2022/common/models/styling-classes.mjs +0 -5
- package/esm2022/common/models/theme-color.mjs +0 -5
- package/esm2022/common/models.mjs +0 -10
- package/esm2022/direction.mjs +0 -5
- package/esm2022/directives.mjs +0 -176
- package/esm2022/dropdownbutton/dropdownbutton.component.mjs +0 -482
- package/esm2022/dropdownbutton/dropdownbutton.module.mjs +0 -50
- package/esm2022/floatingactionbutton/animations/animations.mjs +0 -33
- package/esm2022/floatingactionbutton/dial-item.component.mjs +0 -161
- package/esm2022/floatingactionbutton/dial-list.component.mjs +0 -98
- package/esm2022/floatingactionbutton/floatingactionbutton.component.mjs +0 -954
- package/esm2022/floatingactionbutton/floatingactionbutton.module.mjs +0 -47
- package/esm2022/floatingactionbutton/models/align.mjs +0 -5
- package/esm2022/floatingactionbutton/models/item-animation.interface.mjs +0 -5
- package/esm2022/floatingactionbutton/models/item-click.event.mjs +0 -5
- package/esm2022/floatingactionbutton/models/item.interface.mjs +0 -5
- package/esm2022/floatingactionbutton/models/offset.mjs +0 -5
- package/esm2022/floatingactionbutton/models/position-mode.mjs +0 -5
- package/esm2022/floatingactionbutton/templates/dial-item-template.directive.mjs +0 -37
- package/esm2022/floatingactionbutton/templates/fab-template.directive.mjs +0 -38
- package/esm2022/floatingactionbutton/utils.mjs +0 -38
- package/esm2022/focusable/focus.service.mjs +0 -38
- package/esm2022/focusable/focusable.directive.mjs +0 -67
- package/esm2022/index.mjs +0 -33
- package/esm2022/listbutton/button-item-template.directive.mjs +0 -47
- package/esm2022/listbutton/container.service.mjs +0 -18
- package/esm2022/listbutton/list-button.mjs +0 -461
- package/esm2022/listbutton/list-item-model.mjs +0 -5
- package/esm2022/listbutton/list.component.mjs +0 -177
- package/esm2022/listbutton/popup-settings.mjs +0 -5
- package/esm2022/navigation/key-events.mjs +0 -13
- package/esm2022/navigation/navigation-action.mjs +0 -20
- package/esm2022/navigation/navigation-config.mjs +0 -9
- package/esm2022/navigation/navigation.service.mjs +0 -111
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/preventable-event.mjs +0 -25
- package/esm2022/progress-kendo-angular-buttons.mjs +0 -8
- package/esm2022/speechtotextbutton/models/error-event.mjs +0 -5
- package/esm2022/speechtotextbutton/models/integration-mode.mjs +0 -5
- package/esm2022/speechtotextbutton/models/result-event.mjs +0 -5
- package/esm2022/speechtotextbutton/models/speechtotextbutton-settings.mjs +0 -5
- package/esm2022/speechtotextbutton/speechtotextbutton.component.mjs +0 -532
- package/esm2022/speechtotextbutton/speechtotextbutton.module.mjs +0 -31
- package/esm2022/splitbutton/localization/custom-messages.component.mjs +0 -40
- package/esm2022/splitbutton/localization/localized-messages.directive.mjs +0 -39
- package/esm2022/splitbutton/localization/messages.mjs +0 -50
- package/esm2022/splitbutton/splitbutton.component.mjs +0 -761
- package/esm2022/splitbutton/splitbutton.module.mjs +0 -37
- package/esm2022/util.mjs +0 -108
|
@@ -1,461 +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 { EventEmitter, ElementRef, NgZone, ChangeDetectorRef, Component, Input, ViewContainerRef, Output, ViewChild, TemplateRef } from '@angular/core';
|
|
6
|
-
import { Subscription, fromEvent, merge } from 'rxjs';
|
|
7
|
-
import { filter, tap } from 'rxjs/operators';
|
|
8
|
-
import { FocusService } from './../focusable/focus.service';
|
|
9
|
-
import { KeyEvents } from './../navigation/key-events';
|
|
10
|
-
import { NavigationService } from './../navigation/navigation.service';
|
|
11
|
-
import { NavigationAction } from './../navigation/navigation-action';
|
|
12
|
-
import { isDocumentAvailable, guid, Keys, isChanged, hasObservers, normalizeKeys, parseCSSClassNames } from '@progress/kendo-angular-common';
|
|
13
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
14
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
15
|
-
import { packageMetadata } from '../package-metadata';
|
|
16
|
-
import { PreventableEvent } from '../preventable-event';
|
|
17
|
-
import { PopupService } from '@progress/kendo-angular-popup';
|
|
18
|
-
import { isPresent } from '../util';
|
|
19
|
-
import { PopupContainerService } from './container.service';
|
|
20
|
-
import { MultiTabStop } from '@progress/kendo-angular-common';
|
|
21
|
-
import { ListComponent } from './list.component';
|
|
22
|
-
import * as i0 from "@angular/core";
|
|
23
|
-
import * as i1 from "./../focusable/focus.service";
|
|
24
|
-
import * as i2 from "./../navigation/navigation.service";
|
|
25
|
-
import * as i3 from "@progress/kendo-angular-popup";
|
|
26
|
-
import * as i4 from "@progress/kendo-angular-l10n";
|
|
27
|
-
import * as i5 from "./container.service";
|
|
28
|
-
/**
|
|
29
|
-
* @hidden
|
|
30
|
-
*/
|
|
31
|
-
export class ListButton extends MultiTabStop {
|
|
32
|
-
focusService;
|
|
33
|
-
navigationService;
|
|
34
|
-
wrapperRef;
|
|
35
|
-
_zone;
|
|
36
|
-
popupService;
|
|
37
|
-
elRef;
|
|
38
|
-
cdr;
|
|
39
|
-
containerService;
|
|
40
|
-
listId = guid();
|
|
41
|
-
buttonId = guid();
|
|
42
|
-
_data;
|
|
43
|
-
_open = false;
|
|
44
|
-
_disabled = false;
|
|
45
|
-
_active = false;
|
|
46
|
-
_popupSettings = { animate: true, popupClass: '' };
|
|
47
|
-
_isFocused = false;
|
|
48
|
-
_itemClick;
|
|
49
|
-
_blur;
|
|
50
|
-
wrapper;
|
|
51
|
-
subs = new Subscription();
|
|
52
|
-
direction;
|
|
53
|
-
popupRef;
|
|
54
|
-
popupSubs = new Subscription();
|
|
55
|
-
button;
|
|
56
|
-
buttonList;
|
|
57
|
-
popupTemplate;
|
|
58
|
-
container;
|
|
59
|
-
/**
|
|
60
|
-
* Sets the disabled state of the DropDownButton.
|
|
61
|
-
* When `true`, the button is disabled and cannot be interacted with.
|
|
62
|
-
*/
|
|
63
|
-
set disabled(value) {
|
|
64
|
-
if (value && this.openState) {
|
|
65
|
-
this.openState = false;
|
|
66
|
-
}
|
|
67
|
-
this._disabled = value;
|
|
68
|
-
}
|
|
69
|
-
get disabled() {
|
|
70
|
-
return this._disabled;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
74
|
-
* Determines the order of focus when navigating with the keyboard.
|
|
75
|
-
*
|
|
76
|
-
* @default 0
|
|
77
|
-
*/
|
|
78
|
-
tabIndex = 0;
|
|
79
|
-
/**
|
|
80
|
-
* The CSS classes applied to the main button.
|
|
81
|
-
* Supports the same values as [`ngClass`](link:site.data.urls.angular['ngclassapi']).
|
|
82
|
-
*/
|
|
83
|
-
buttonClass;
|
|
84
|
-
/**
|
|
85
|
-
* Fires when the popup is about to open.
|
|
86
|
-
* This event is preventable. Canceling the event keeps the popup closed.
|
|
87
|
-
*/
|
|
88
|
-
open = new EventEmitter();
|
|
89
|
-
/**
|
|
90
|
-
* Fires when the popup is about to close.
|
|
91
|
-
* This event is preventable. Canceling the event keeps the popup open.
|
|
92
|
-
*/
|
|
93
|
-
close = new EventEmitter();
|
|
94
|
-
/**
|
|
95
|
-
* Needed by the kendoToggleButtonTabStop directive
|
|
96
|
-
*
|
|
97
|
-
* @hidden
|
|
98
|
-
*/
|
|
99
|
-
escape = new EventEmitter();
|
|
100
|
-
/**
|
|
101
|
-
* @hidden
|
|
102
|
-
*/
|
|
103
|
-
get componentTabIndex() {
|
|
104
|
-
return this.disabled ? (-1) : this.tabIndex;
|
|
105
|
-
}
|
|
106
|
-
get appendTo() {
|
|
107
|
-
const { appendTo } = this.popupSettings;
|
|
108
|
-
if (!appendTo || appendTo === 'root') {
|
|
109
|
-
return undefined;
|
|
110
|
-
}
|
|
111
|
-
return appendTo === 'component' ? this.containerService.container : appendTo;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Configures the popup of the DropDownButton.
|
|
115
|
-
*/
|
|
116
|
-
set popupSettings(settings) {
|
|
117
|
-
this._popupSettings = { animate: true, popupClass: '', ...settings };
|
|
118
|
-
}
|
|
119
|
-
get popupSettings() {
|
|
120
|
-
return this._popupSettings;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* @hidden
|
|
124
|
-
*/
|
|
125
|
-
get anchorAlign() {
|
|
126
|
-
const align = { horizontal: this.popupSettings.align || 'left', vertical: 'bottom' };
|
|
127
|
-
if (this.direction === 'rtl' && !isPresent(this.popupSettings.align)) {
|
|
128
|
-
align.horizontal = 'right';
|
|
129
|
-
}
|
|
130
|
-
return align;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* @hidden
|
|
134
|
-
*/
|
|
135
|
-
get popupAlign() {
|
|
136
|
-
const align = { horizontal: this.popupSettings.align || 'left', vertical: 'top' };
|
|
137
|
-
if (this.direction === 'rtl' && !isPresent(this.popupSettings.align)) {
|
|
138
|
-
align.horizontal = 'right';
|
|
139
|
-
}
|
|
140
|
-
return align;
|
|
141
|
-
}
|
|
142
|
-
isClosePrevented = false;
|
|
143
|
-
constructor(focusService, navigationService, wrapperRef, _zone, popupService, elRef, localization, cdr, containerService) {
|
|
144
|
-
super();
|
|
145
|
-
this.focusService = focusService;
|
|
146
|
-
this.navigationService = navigationService;
|
|
147
|
-
this.wrapperRef = wrapperRef;
|
|
148
|
-
this._zone = _zone;
|
|
149
|
-
this.popupService = popupService;
|
|
150
|
-
this.elRef = elRef;
|
|
151
|
-
this.cdr = cdr;
|
|
152
|
-
this.containerService = containerService;
|
|
153
|
-
validatePackage(packageMetadata);
|
|
154
|
-
this.focusService = focusService;
|
|
155
|
-
this.navigationService = navigationService;
|
|
156
|
-
this.wrapper = wrapperRef.nativeElement;
|
|
157
|
-
this.subs.add(localization.changes.subscribe(({ rtl }) => (this.direction = rtl ? 'rtl' : 'ltr')));
|
|
158
|
-
this.subscribeEvents();
|
|
159
|
-
}
|
|
160
|
-
ngOnChanges(changes) {
|
|
161
|
-
if (isChanged("popupSettings", changes) && isPresent(this.popupRef)) {
|
|
162
|
-
const popup = this.popupRef.popup.instance;
|
|
163
|
-
const newSettings = changes['popupSettings'].currentValue;
|
|
164
|
-
popup.popupClass = newSettings.popupClass;
|
|
165
|
-
popup.animate = newSettings.animate;
|
|
166
|
-
popup.popupAlign = this.popupAlign;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
get popupClasses() {
|
|
170
|
-
const popupClasses = ['k-menu-popup'];
|
|
171
|
-
if (!this._popupSettings.popupClass) {
|
|
172
|
-
return popupClasses.join(' ');
|
|
173
|
-
}
|
|
174
|
-
const parsedPopupClasses = parseCSSClassNames(this._popupSettings.popupClass);
|
|
175
|
-
if (parsedPopupClasses?.length) {
|
|
176
|
-
popupClasses.push(...parsedPopupClasses);
|
|
177
|
-
}
|
|
178
|
-
return popupClasses.join(' ');
|
|
179
|
-
}
|
|
180
|
-
get openState() {
|
|
181
|
-
return this._open;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* @hidden
|
|
185
|
-
*/
|
|
186
|
-
set openState(open) {
|
|
187
|
-
if (this.disabled) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
this._open = open;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Returns the current open state of the popup.
|
|
194
|
-
*/
|
|
195
|
-
get isOpen() {
|
|
196
|
-
return this._open;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* @hidden
|
|
200
|
-
*/
|
|
201
|
-
togglePopupVisibility() {
|
|
202
|
-
if (this._disabled) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
this._toggle(!this.openState, true);
|
|
206
|
-
if (!this.isClosePrevented) {
|
|
207
|
-
this.focusService.focus(this.openState ? 0 : -1);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* @hidden
|
|
212
|
-
*/
|
|
213
|
-
onItemClick(index) {
|
|
214
|
-
this.emitItemClickHandler(index);
|
|
215
|
-
this.togglePopupVisibility();
|
|
216
|
-
if (isDocumentAvailable() && !this.isClosePrevented) {
|
|
217
|
-
this.focusButton();
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
ngOnDestroy() {
|
|
221
|
-
this.openState = false;
|
|
222
|
-
this.subs.unsubscribe();
|
|
223
|
-
this.destroyPopup();
|
|
224
|
-
}
|
|
225
|
-
subscribeEvents() {
|
|
226
|
-
if (!isDocumentAvailable()) {
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
this.subscribeListItemFocusEvent();
|
|
230
|
-
this.subscribeComponentBlurredEvent();
|
|
231
|
-
this.subscribeNavigationEvents();
|
|
232
|
-
}
|
|
233
|
-
subscribeListItemFocusEvent() {
|
|
234
|
-
this.subs.add(this.focusService.onFocus.subscribe(() => {
|
|
235
|
-
this._isFocused = true;
|
|
236
|
-
}));
|
|
237
|
-
}
|
|
238
|
-
subscribeComponentBlurredEvent() {
|
|
239
|
-
this._zone.runOutsideAngular(() => {
|
|
240
|
-
this.subs.add(this.navigationService.tab.pipe(filter(() => this._isFocused), tap(() => this.focusButton())).subscribe(this.handleTab.bind(this)));
|
|
241
|
-
this.subs.add(fromEvent(document, 'click')
|
|
242
|
-
.pipe(filter((event) => !this.wrapperContains(event.target)), filter(() => this._isFocused))
|
|
243
|
-
.subscribe(() => this._zone.run(() => this.blurWrapper())));
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
subscribeNavigationEvents() {
|
|
247
|
-
this.subs.add(this.navigationService.navigate
|
|
248
|
-
.subscribe(this.onArrowKeyNavigate.bind(this)));
|
|
249
|
-
this.subs.add(this.navigationService.enterup.subscribe(this.onNavigationEnterUp.bind(this)));
|
|
250
|
-
this.subs.add(this.navigationService.open.subscribe(this.onNavigationOpen.bind(this)));
|
|
251
|
-
this.subs.add(merge(this.navigationService.close, this.navigationService.esc).subscribe(this.onNavigationClose.bind(this)));
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Toggles the visibility of the popup.
|
|
255
|
-
* If the `toggle` method is used, the `open` and `close` events are not fired.
|
|
256
|
-
*
|
|
257
|
-
* @param open - The desired state of the popup.
|
|
258
|
-
*/
|
|
259
|
-
toggle(open) {
|
|
260
|
-
if (this.disabled) {
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
const value = open ?? !this.openState;
|
|
264
|
-
this._toggle(value, false);
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* @hidden
|
|
268
|
-
*/
|
|
269
|
-
keyDownHandler(event, isHost) {
|
|
270
|
-
this.keyHandler(event, null, isHost);
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* @hidden
|
|
274
|
-
*/
|
|
275
|
-
keyUpHandler(event) {
|
|
276
|
-
this.keyHandler(event, KeyEvents.keyup);
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* @hidden
|
|
280
|
-
*/
|
|
281
|
-
keyHandler(event, keyEvent, isHost) {
|
|
282
|
-
if (this._disabled) {
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
const eventData = event;
|
|
286
|
-
if (!isHost) {
|
|
287
|
-
eventData.stopImmediatePropagation();
|
|
288
|
-
}
|
|
289
|
-
const focused = this.focusService.focused || 0;
|
|
290
|
-
const code = normalizeKeys(eventData);
|
|
291
|
-
const action = this.navigationService.process({
|
|
292
|
-
altKey: eventData.altKey,
|
|
293
|
-
current: focused,
|
|
294
|
-
code: code,
|
|
295
|
-
keyEvent: keyEvent,
|
|
296
|
-
max: this._data ? this._data.length - 1 : 0,
|
|
297
|
-
min: 0,
|
|
298
|
-
target: event.target
|
|
299
|
-
});
|
|
300
|
-
if (action !== NavigationAction.Undefined &&
|
|
301
|
-
action !== NavigationAction.Tab &&
|
|
302
|
-
(action !== NavigationAction.Enter || (action === NavigationAction.Enter && this.openState))) {
|
|
303
|
-
if (!(code === Keys.Space && action === NavigationAction.EnterUp)) {
|
|
304
|
-
eventData.preventDefault();
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
emitItemClickHandler(index) {
|
|
309
|
-
const dataItem = this._data[index];
|
|
310
|
-
if (this._itemClick && !dataItem.disabled) {
|
|
311
|
-
this._itemClick.emit(dataItem);
|
|
312
|
-
}
|
|
313
|
-
if (dataItem?.click && !dataItem?.disabled) {
|
|
314
|
-
dataItem.click(dataItem);
|
|
315
|
-
}
|
|
316
|
-
this.focusService.focus(index);
|
|
317
|
-
}
|
|
318
|
-
focusWrapper() {
|
|
319
|
-
if (this.openState) {
|
|
320
|
-
this.togglePopupVisibility();
|
|
321
|
-
this.focusButton();
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
wrapperContains(element) {
|
|
325
|
-
return this.wrapper === element || this.wrapper.contains(element);
|
|
326
|
-
}
|
|
327
|
-
blurWrapper(emit = true) {
|
|
328
|
-
if (!this._isFocused) {
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
if (this.openState) {
|
|
332
|
-
this.togglePopupVisibility();
|
|
333
|
-
}
|
|
334
|
-
this._isFocused = false;
|
|
335
|
-
if (emit) {
|
|
336
|
-
this._blur.emit();
|
|
337
|
-
this.cdr.markForCheck();
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
focusButton() {
|
|
341
|
-
if (this.button) {
|
|
342
|
-
this.button.nativeElement.focus();
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
handleTab() {
|
|
346
|
-
this.blurWrapper();
|
|
347
|
-
}
|
|
348
|
-
onNavigationEnterUp(_args) {
|
|
349
|
-
if (!this._disabled && !this.openState) {
|
|
350
|
-
this._active = false;
|
|
351
|
-
}
|
|
352
|
-
if (this.openState) {
|
|
353
|
-
const focused = this.focusService.focused;
|
|
354
|
-
if (isPresent(focused) && focused !== -1) {
|
|
355
|
-
this.emitItemClickHandler(focused);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
this.togglePopupVisibility();
|
|
359
|
-
if (!this.openState && isDocumentAvailable()) {
|
|
360
|
-
this.button.nativeElement.focus();
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
onNavigationOpen() {
|
|
364
|
-
if (!this._disabled && !this.openState) {
|
|
365
|
-
this.togglePopupVisibility();
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
onNavigationClose(e) {
|
|
369
|
-
if (this.openState && !this.isClosePrevented) {
|
|
370
|
-
this.togglePopupVisibility();
|
|
371
|
-
if (isDocumentAvailable()) {
|
|
372
|
-
if (e?.esc && hasObservers(this.escape)) {
|
|
373
|
-
this.escape.emit();
|
|
374
|
-
}
|
|
375
|
-
this.button.nativeElement.focus();
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
onArrowKeyNavigate({ index }) {
|
|
380
|
-
this.focusService.focus(index);
|
|
381
|
-
}
|
|
382
|
-
_toggle(open, emitEvent) {
|
|
383
|
-
if (this.openState === open) {
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
const eventArgs = new PreventableEvent();
|
|
387
|
-
if (emitEvent) {
|
|
388
|
-
if (open && !this.openState) {
|
|
389
|
-
this.open.emit(eventArgs);
|
|
390
|
-
}
|
|
391
|
-
else if (!open && this.openState) {
|
|
392
|
-
this.close.emit(eventArgs);
|
|
393
|
-
}
|
|
394
|
-
if (eventArgs.isDefaultPrevented()) {
|
|
395
|
-
this.isClosePrevented = true;
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
this.openState = open;
|
|
400
|
-
this.destroyPopup();
|
|
401
|
-
if (this.openState) {
|
|
402
|
-
this.createPopup();
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
createPopup() {
|
|
406
|
-
this.popupRef = this.popupService.open({
|
|
407
|
-
anchor: this.elRef,
|
|
408
|
-
anchorAlign: this.anchorAlign,
|
|
409
|
-
animate: this.popupSettings.animate,
|
|
410
|
-
appendTo: this.appendTo,
|
|
411
|
-
content: this.containerService.template,
|
|
412
|
-
popupAlign: this.popupAlign,
|
|
413
|
-
popupClass: this.popupClasses
|
|
414
|
-
});
|
|
415
|
-
this.popupSubs = this.popupRef.popupAnchorViewportLeave.subscribe(() => {
|
|
416
|
-
this.togglePopupVisibility();
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
destroyPopup() {
|
|
420
|
-
if (this.popupRef) {
|
|
421
|
-
this.popupRef.close();
|
|
422
|
-
this.popupRef = null;
|
|
423
|
-
this.popupSubs.unsubscribe();
|
|
424
|
-
this.isClosePrevented = false;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListButton, deps: [{ token: i1.FocusService }, { token: i2.NavigationService }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i3.PopupService }, { token: i0.ElementRef }, { token: i4.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i5.PopupContainerService }], target: i0.ɵɵFactoryTarget.Component });
|
|
428
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ListButton, selector: "ng-component", inputs: { disabled: "disabled", tabIndex: "tabIndex", buttonClass: "buttonClass", popupSettings: "popupSettings" }, outputs: { open: "open", close: "close", escape: "escape" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true, read: ElementRef }, { propertyName: "buttonList", first: true, predicate: ["buttonList"], descendants: true }, { propertyName: "popupTemplate", first: true, predicate: ["popupTemplate"], descendants: true }, { propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
|
|
429
|
-
}
|
|
430
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListButton, decorators: [{
|
|
431
|
-
type: Component,
|
|
432
|
-
args: [{
|
|
433
|
-
template: ''
|
|
434
|
-
}]
|
|
435
|
-
}], ctorParameters: () => [{ type: i1.FocusService }, { type: i2.NavigationService }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i3.PopupService }, { type: i0.ElementRef }, { type: i4.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i5.PopupContainerService }], propDecorators: { button: [{
|
|
436
|
-
type: ViewChild,
|
|
437
|
-
args: ['button', { read: ElementRef }]
|
|
438
|
-
}], buttonList: [{
|
|
439
|
-
type: ViewChild,
|
|
440
|
-
args: ['buttonList']
|
|
441
|
-
}], popupTemplate: [{
|
|
442
|
-
type: ViewChild,
|
|
443
|
-
args: ['popupTemplate']
|
|
444
|
-
}], container: [{
|
|
445
|
-
type: ViewChild,
|
|
446
|
-
args: ['container', { read: ViewContainerRef }]
|
|
447
|
-
}], disabled: [{
|
|
448
|
-
type: Input
|
|
449
|
-
}], tabIndex: [{
|
|
450
|
-
type: Input
|
|
451
|
-
}], buttonClass: [{
|
|
452
|
-
type: Input
|
|
453
|
-
}], open: [{
|
|
454
|
-
type: Output
|
|
455
|
-
}], close: [{
|
|
456
|
-
type: Output
|
|
457
|
-
}], escape: [{
|
|
458
|
-
type: Output
|
|
459
|
-
}], popupSettings: [{
|
|
460
|
-
type: Input
|
|
461
|
-
}] } });
|
|
@@ -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,177 +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 { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
6
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
7
|
-
import { packageMetadata } from '../package-metadata';
|
|
8
|
-
import { ButtonItemTemplateDirective } from './button-item-template.directive';
|
|
9
|
-
import { SIZES } from '../util';
|
|
10
|
-
import { IconWrapperComponent } from '@progress/kendo-angular-icons';
|
|
11
|
-
import { FocusableDirective } from '../focusable/focusable.directive';
|
|
12
|
-
import { NgClass } from '@angular/common';
|
|
13
|
-
import { TemplateContextDirective } from '@progress/kendo-angular-common';
|
|
14
|
-
import * as i0 from "@angular/core";
|
|
15
|
-
/**
|
|
16
|
-
* @hidden
|
|
17
|
-
*/
|
|
18
|
-
export class ListComponent {
|
|
19
|
-
data;
|
|
20
|
-
textField;
|
|
21
|
-
itemTemplate;
|
|
22
|
-
onItemClick = new EventEmitter();
|
|
23
|
-
onItemBlur = new EventEmitter();
|
|
24
|
-
set size(size) {
|
|
25
|
-
if (size) {
|
|
26
|
-
this.sizeClass = `k-menu-group-${SIZES[size]}`;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this.sizeClass = '';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
sizeClass = '';
|
|
33
|
-
constructor() {
|
|
34
|
-
validatePackage(packageMetadata);
|
|
35
|
-
}
|
|
36
|
-
getText(dataItem) {
|
|
37
|
-
if (dataItem) {
|
|
38
|
-
return this.textField ? dataItem[this.textField] : dataItem.text || dataItem;
|
|
39
|
-
}
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
getIconClasses(dataItem) {
|
|
43
|
-
const icon = dataItem.icon ? 'k-icon k-i-' + dataItem.icon : undefined;
|
|
44
|
-
const classes = {};
|
|
45
|
-
classes[icon || dataItem.iconClass] = true;
|
|
46
|
-
return classes;
|
|
47
|
-
}
|
|
48
|
-
onClick(index) {
|
|
49
|
-
this.onItemClick.emit(index);
|
|
50
|
-
}
|
|
51
|
-
onBlur() {
|
|
52
|
-
this.onItemBlur.emit();
|
|
53
|
-
}
|
|
54
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
55
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ListComponent, isStandalone: true, selector: "kendo-button-list", inputs: { data: "data", textField: "textField", itemTemplate: "itemTemplate", size: "size" }, outputs: { onItemClick: "onItemClick", onItemBlur: "onItemBlur" }, ngImport: i0, template: `
|
|
56
|
-
<ul class="k-group k-menu-group k-reset" role="list" [ngClass]="sizeClass">
|
|
57
|
-
@for (dataItem of data; track dataItem; let index = $index) {
|
|
58
|
-
<li kendoButtonFocusable
|
|
59
|
-
[index]="index"
|
|
60
|
-
tabindex="-1"
|
|
61
|
-
class="k-item k-menu-item"
|
|
62
|
-
role="listitem"
|
|
63
|
-
[attr.aria-disabled]="dataItem.disabled ? true : false"
|
|
64
|
-
(click)="$event.stopImmediatePropagation(); onClick(index);"
|
|
65
|
-
(blur)="onBlur()">
|
|
66
|
-
@if (itemTemplate?.templateRef) {
|
|
67
|
-
<span
|
|
68
|
-
class="k-link k-menu-link"
|
|
69
|
-
[class.k-disabled]="dataItem.disabled"
|
|
70
|
-
[ngClass]="dataItem.cssClass">
|
|
71
|
-
<ng-template
|
|
72
|
-
[templateContext]="{ templateRef: itemTemplate?.templateRef, $implicit: dataItem }"
|
|
73
|
-
></ng-template>
|
|
74
|
-
</span>
|
|
75
|
-
}
|
|
76
|
-
@if (!itemTemplate?.templateRef) {
|
|
77
|
-
<span
|
|
78
|
-
class="k-link k-menu-link"
|
|
79
|
-
[class.k-disabled]="dataItem.disabled"
|
|
80
|
-
[ngClass]="dataItem.cssClass">
|
|
81
|
-
@if (dataItem.icon || dataItem.iconClass || dataItem.svgIcon) {
|
|
82
|
-
<kendo-icon-wrapper
|
|
83
|
-
[name]="dataItem.icon"
|
|
84
|
-
[svgIcon]="dataItem.svgIcon"
|
|
85
|
-
[customFontClass]="dataItem.iconClass"
|
|
86
|
-
></kendo-icon-wrapper>
|
|
87
|
-
}
|
|
88
|
-
@if (dataItem.imageUrl) {
|
|
89
|
-
<img
|
|
90
|
-
class="k-image"
|
|
91
|
-
[src]="dataItem.imageUrl"
|
|
92
|
-
[alt]="dataItem.imageAlt"
|
|
93
|
-
>
|
|
94
|
-
}
|
|
95
|
-
@if (getText(dataItem)) {
|
|
96
|
-
<span class="k-menu-link-text">
|
|
97
|
-
{{ getText(dataItem) }}
|
|
98
|
-
</span>
|
|
99
|
-
}
|
|
100
|
-
</span>
|
|
101
|
-
}
|
|
102
|
-
</li>
|
|
103
|
-
}
|
|
104
|
-
</ul>
|
|
105
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: FocusableDirective, selector: "[kendoButtonFocusable]", inputs: ["index"] }, { kind: "directive", type: TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }] });
|
|
106
|
-
}
|
|
107
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ListComponent, decorators: [{
|
|
108
|
-
type: Component,
|
|
109
|
-
args: [{
|
|
110
|
-
selector: 'kendo-button-list',
|
|
111
|
-
template: `
|
|
112
|
-
<ul class="k-group k-menu-group k-reset" role="list" [ngClass]="sizeClass">
|
|
113
|
-
@for (dataItem of data; track dataItem; let index = $index) {
|
|
114
|
-
<li kendoButtonFocusable
|
|
115
|
-
[index]="index"
|
|
116
|
-
tabindex="-1"
|
|
117
|
-
class="k-item k-menu-item"
|
|
118
|
-
role="listitem"
|
|
119
|
-
[attr.aria-disabled]="dataItem.disabled ? true : false"
|
|
120
|
-
(click)="$event.stopImmediatePropagation(); onClick(index);"
|
|
121
|
-
(blur)="onBlur()">
|
|
122
|
-
@if (itemTemplate?.templateRef) {
|
|
123
|
-
<span
|
|
124
|
-
class="k-link k-menu-link"
|
|
125
|
-
[class.k-disabled]="dataItem.disabled"
|
|
126
|
-
[ngClass]="dataItem.cssClass">
|
|
127
|
-
<ng-template
|
|
128
|
-
[templateContext]="{ templateRef: itemTemplate?.templateRef, $implicit: dataItem }"
|
|
129
|
-
></ng-template>
|
|
130
|
-
</span>
|
|
131
|
-
}
|
|
132
|
-
@if (!itemTemplate?.templateRef) {
|
|
133
|
-
<span
|
|
134
|
-
class="k-link k-menu-link"
|
|
135
|
-
[class.k-disabled]="dataItem.disabled"
|
|
136
|
-
[ngClass]="dataItem.cssClass">
|
|
137
|
-
@if (dataItem.icon || dataItem.iconClass || dataItem.svgIcon) {
|
|
138
|
-
<kendo-icon-wrapper
|
|
139
|
-
[name]="dataItem.icon"
|
|
140
|
-
[svgIcon]="dataItem.svgIcon"
|
|
141
|
-
[customFontClass]="dataItem.iconClass"
|
|
142
|
-
></kendo-icon-wrapper>
|
|
143
|
-
}
|
|
144
|
-
@if (dataItem.imageUrl) {
|
|
145
|
-
<img
|
|
146
|
-
class="k-image"
|
|
147
|
-
[src]="dataItem.imageUrl"
|
|
148
|
-
[alt]="dataItem.imageAlt"
|
|
149
|
-
>
|
|
150
|
-
}
|
|
151
|
-
@if (getText(dataItem)) {
|
|
152
|
-
<span class="k-menu-link-text">
|
|
153
|
-
{{ getText(dataItem) }}
|
|
154
|
-
</span>
|
|
155
|
-
}
|
|
156
|
-
</span>
|
|
157
|
-
}
|
|
158
|
-
</li>
|
|
159
|
-
}
|
|
160
|
-
</ul>
|
|
161
|
-
`,
|
|
162
|
-
standalone: true,
|
|
163
|
-
imports: [NgClass, FocusableDirective, TemplateContextDirective, IconWrapperComponent]
|
|
164
|
-
}]
|
|
165
|
-
}], ctorParameters: () => [], propDecorators: { data: [{
|
|
166
|
-
type: Input
|
|
167
|
-
}], textField: [{
|
|
168
|
-
type: Input
|
|
169
|
-
}], itemTemplate: [{
|
|
170
|
-
type: Input
|
|
171
|
-
}], onItemClick: [{
|
|
172
|
-
type: Output
|
|
173
|
-
}], onItemBlur: [{
|
|
174
|
-
type: Output
|
|
175
|
-
}], size: [{
|
|
176
|
-
type: Input
|
|
177
|
-
}] } });
|
|
@@ -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,13 +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
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export var KeyEvents;
|
|
9
|
-
(function (KeyEvents) {
|
|
10
|
-
KeyEvents[KeyEvents["keydown"] = 0] = "keydown";
|
|
11
|
-
KeyEvents[KeyEvents["keypress"] = 1] = "keypress";
|
|
12
|
-
KeyEvents[KeyEvents["keyup"] = 2] = "keyup";
|
|
13
|
-
})(KeyEvents || (KeyEvents = {}));
|
|
@@ -1,20 +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
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export var NavigationAction;
|
|
9
|
-
(function (NavigationAction) {
|
|
10
|
-
// eslint-disable-next-line id-denylist
|
|
11
|
-
NavigationAction[NavigationAction["Undefined"] = 0] = "Undefined";
|
|
12
|
-
NavigationAction[NavigationAction["Open"] = 1] = "Open";
|
|
13
|
-
NavigationAction[NavigationAction["Close"] = 2] = "Close";
|
|
14
|
-
NavigationAction[NavigationAction["Enter"] = 3] = "Enter";
|
|
15
|
-
NavigationAction[NavigationAction["EnterPress"] = 4] = "EnterPress";
|
|
16
|
-
NavigationAction[NavigationAction["EnterUp"] = 5] = "EnterUp";
|
|
17
|
-
NavigationAction[NavigationAction["Tab"] = 6] = "Tab";
|
|
18
|
-
NavigationAction[NavigationAction["Esc"] = 7] = "Esc";
|
|
19
|
-
NavigationAction[NavigationAction["Navigate"] = 8] = "Navigate";
|
|
20
|
-
})(NavigationAction || (NavigationAction = {}));
|