@progress/kendo-angular-toolbar 21.4.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-toolbar.mjs +62 -62
- package/localization/messages.d.ts +1 -1
- package/package.json +12 -20
- package/esm2022/common/fillmode.mjs +0 -5
- package/esm2022/common/overflow-mode.mjs +0 -5
- package/esm2022/common/overflow-settings.mjs +0 -5
- package/esm2022/common/preventable-event.mjs +0 -25
- package/esm2022/common/renderer-click.mjs +0 -5
- package/esm2022/common/scroll-buttons.mjs +0 -5
- package/esm2022/common/size.mjs +0 -5
- package/esm2022/direction.mjs +0 -5
- package/esm2022/directives.mjs +0 -45
- package/esm2022/display-mode.mjs +0 -5
- package/esm2022/group-selection-settings.mjs +0 -5
- package/esm2022/index.mjs +0 -17
- package/esm2022/localization/custom-messages.component.mjs +0 -56
- package/esm2022/localization/localized-toolbar-messages.directive.mjs +0 -39
- package/esm2022/localization/messages.mjs +0 -39
- package/esm2022/navigation.service.mjs +0 -159
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/popup-settings.mjs +0 -5
- package/esm2022/progress-kendo-angular-toolbar.mjs +0 -8
- package/esm2022/refresh.service.mjs +0 -20
- package/esm2022/render-location.mjs +0 -5
- package/esm2022/renderer.component.mjs +0 -191
- package/esm2022/renderer.service.mjs +0 -52
- package/esm2022/scroll.service.mjs +0 -110
- package/esm2022/scrollable-button.component.mjs +0 -152
- package/esm2022/tool-options.mjs +0 -5
- package/esm2022/toolbar.component.mjs +0 -1582
- package/esm2022/toolbar.module.mjs +0 -46
- package/esm2022/tools/toolbar-button.component.mjs +0 -712
- package/esm2022/tools/toolbar-buttongroup.component.mjs +0 -448
- package/esm2022/tools/toolbar-dropdownbutton.component.mjs +0 -595
- package/esm2022/tools/toolbar-separator.component.mjs +0 -96
- package/esm2022/tools/toolbar-spacer.component.mjs +0 -76
- package/esm2022/tools/toolbar-splitbutton.component.mjs +0 -607
- package/esm2022/tools/toolbar-tool.component.mjs +0 -106
- package/esm2022/tools/tools.service.mjs +0 -25
- package/esm2022/util.mjs +0 -244
|
@@ -1,110 +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 { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
7
|
-
import { Subject } from 'rxjs';
|
|
8
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
-
import * as i0 from "@angular/core";
|
|
10
|
-
import * as i1 from "@progress/kendo-angular-l10n";
|
|
11
|
-
const DEFAULT_SCROLL_BEHAVIOR = 'smooth';
|
|
12
|
-
const DEFAULT_SCROLL_SPEED = 100;
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export class ScrollService {
|
|
17
|
-
ngZone;
|
|
18
|
-
localization;
|
|
19
|
-
owner;
|
|
20
|
-
position = 0;
|
|
21
|
-
scrollButtonActiveStateChange = new Subject();
|
|
22
|
-
get scrollElement() {
|
|
23
|
-
return this.owner.scrollContainer?.nativeElement;
|
|
24
|
-
}
|
|
25
|
-
get scrollContainerOverflowSize() {
|
|
26
|
-
if (!isDocumentAvailable()) {
|
|
27
|
-
return 0;
|
|
28
|
-
}
|
|
29
|
-
if (!this.scrollElement) {
|
|
30
|
-
return 0;
|
|
31
|
-
}
|
|
32
|
-
const overflowSize = Math.floor(this.scrollElement.scrollWidth - this.scrollElement.getBoundingClientRect().width);
|
|
33
|
-
return overflowSize < 0 ? 0 : overflowSize;
|
|
34
|
-
}
|
|
35
|
-
get toolsOverflow() {
|
|
36
|
-
return this.scrollContainerOverflowSize > 0;
|
|
37
|
-
}
|
|
38
|
-
constructor(ngZone, localization) {
|
|
39
|
-
this.ngZone = ngZone;
|
|
40
|
-
this.localization = localization;
|
|
41
|
-
}
|
|
42
|
-
toggleScrollButtonsState() {
|
|
43
|
-
const toolbar = this.owner;
|
|
44
|
-
if (!toolbar.hasScrollButtons) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const currentPrevButtonActive = !this.isDisabled('prev');
|
|
48
|
-
const currentNextButtonActive = !this.isDisabled('next');
|
|
49
|
-
const defaultOffset = 1;
|
|
50
|
-
const rtlDelta = this.localization.rtl ? -1 : 1;
|
|
51
|
-
const calculatedPrevButtonActive = (this.position * rtlDelta) > 0 && this.scrollContainerOverflowSize > 0;
|
|
52
|
-
const calculatedNextButtonActive = (this.position * rtlDelta) < this.scrollContainerOverflowSize - defaultOffset && this.scrollContainerOverflowSize > 0;
|
|
53
|
-
if (calculatedPrevButtonActive !== currentPrevButtonActive) {
|
|
54
|
-
this.ngZone.run(() => this.toggleButtonActiveState('prev', calculatedPrevButtonActive));
|
|
55
|
-
}
|
|
56
|
-
if (calculatedNextButtonActive !== currentNextButtonActive) {
|
|
57
|
-
this.ngZone.run(() => this.toggleButtonActiveState('next', calculatedNextButtonActive));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
onScroll(e) {
|
|
61
|
-
this.position = e.target.scrollLeft;
|
|
62
|
-
this.toggleScrollButtonsState();
|
|
63
|
-
}
|
|
64
|
-
scrollTools(direction) {
|
|
65
|
-
this.calculateListPosition(direction, DEFAULT_SCROLL_SPEED);
|
|
66
|
-
if (this.scrollElement) {
|
|
67
|
-
this.scrollElement.scrollTo({ left: this.position, behavior: DEFAULT_SCROLL_BEHAVIOR });
|
|
68
|
-
}
|
|
69
|
-
this.toggleScrollButtonsState();
|
|
70
|
-
}
|
|
71
|
-
updateScrollPosition(element) {
|
|
72
|
-
this.position = element.scrollLeft;
|
|
73
|
-
}
|
|
74
|
-
calculateListPosition(direction, scrollSpeed) {
|
|
75
|
-
if (direction === 'prev') {
|
|
76
|
-
if (!this.localization.rtl) {
|
|
77
|
-
this.position = this.position - scrollSpeed <= 0 ? 0 : this.position - scrollSpeed;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
this.position = this.position + scrollSpeed >= 0 ? 0 : this.position + scrollSpeed;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
else if (direction === 'next' && this.position < this.scrollContainerOverflowSize) {
|
|
84
|
-
if (this.position + scrollSpeed > this.scrollContainerOverflowSize) {
|
|
85
|
-
if (this.localization.rtl) {
|
|
86
|
-
this.position = -this.scrollContainerOverflowSize;
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
this.position = this.scrollContainerOverflowSize;
|
|
90
|
-
}
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if (this.localization.rtl) {
|
|
94
|
-
this.position -= scrollSpeed;
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
this.position += scrollSpeed;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
toggleButtonActiveState(buttonType, active) {
|
|
102
|
-
this.scrollButtonActiveStateChange.next({ buttonType, active });
|
|
103
|
-
}
|
|
104
|
-
isDisabled = (buttonType) => this.owner[`${buttonType}ScrollButton`]?.nativeElement.classList.contains('k-disabled');
|
|
105
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollService, deps: [{ token: i0.NgZone }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
106
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollService });
|
|
107
|
-
}
|
|
108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollService, decorators: [{
|
|
109
|
-
type: Injectable
|
|
110
|
-
}], ctorParameters: () => [{ type: i0.NgZone }, { type: i1.LocalizationService }] });
|
|
@@ -1,152 +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, ElementRef, HostBinding, Input, Renderer2, NgZone, Output, EventEmitter } from '@angular/core';
|
|
6
|
-
import { Subscription } from 'rxjs';
|
|
7
|
-
import { caretAltLeftIcon, caretAltRightIcon } from '@progress/kendo-svg-icons';
|
|
8
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
-
import { IconWrapperComponent } from '@progress/kendo-angular-icons';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
import * as i1 from "@progress/kendo-angular-l10n";
|
|
12
|
-
const DIRECTION_CLASSES = {
|
|
13
|
-
left: 'caret-alt-left',
|
|
14
|
-
right: 'caret-alt-right'
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
*/
|
|
19
|
-
export class ToolbarScrollableButtonComponent {
|
|
20
|
-
host;
|
|
21
|
-
renderer;
|
|
22
|
-
ngZone;
|
|
23
|
-
localization;
|
|
24
|
-
get prevClass() {
|
|
25
|
-
return this.prev;
|
|
26
|
-
}
|
|
27
|
-
get nextClass() {
|
|
28
|
-
return !this.prev;
|
|
29
|
-
}
|
|
30
|
-
role = 'button';
|
|
31
|
-
prev = false;
|
|
32
|
-
overflow;
|
|
33
|
-
onClick = new EventEmitter();
|
|
34
|
-
get iconClass() {
|
|
35
|
-
return this.scrollButtonIconClass;
|
|
36
|
-
}
|
|
37
|
-
get customIconClass() {
|
|
38
|
-
return this.customScrollButtonIconClass;
|
|
39
|
-
}
|
|
40
|
-
get svgIcon() {
|
|
41
|
-
return this.scrollButtonSVGIcon;
|
|
42
|
-
}
|
|
43
|
-
caretAltLeftIcon = caretAltLeftIcon;
|
|
44
|
-
caretAltRightIcon = caretAltRightIcon;
|
|
45
|
-
subs = new Subscription();
|
|
46
|
-
constructor(host, renderer, ngZone, localization) {
|
|
47
|
-
this.host = host;
|
|
48
|
-
this.renderer = renderer;
|
|
49
|
-
this.ngZone = ngZone;
|
|
50
|
-
this.localization = localization;
|
|
51
|
-
}
|
|
52
|
-
ngAfterViewInit() {
|
|
53
|
-
this.ngZone.runOutsideAngular(() => {
|
|
54
|
-
this.subs.add(this.renderer.listen(this.host.nativeElement, 'click', this.clickHandler));
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
ngOnDestroy() {
|
|
58
|
-
this.subs.unsubscribe();
|
|
59
|
-
}
|
|
60
|
-
clickHandler = () => {
|
|
61
|
-
const buttonType = this.prev ? 'prev' : 'next';
|
|
62
|
-
this.onClick.emit(buttonType);
|
|
63
|
-
};
|
|
64
|
-
get scrollButtonIconClass() {
|
|
65
|
-
const defaultPrevIcon = !this.localization.rtl ?
|
|
66
|
-
DIRECTION_CLASSES.left :
|
|
67
|
-
DIRECTION_CLASSES.right;
|
|
68
|
-
const defaultNextIcon = !this.localization.rtl ?
|
|
69
|
-
DIRECTION_CLASSES.right :
|
|
70
|
-
DIRECTION_CLASSES.left;
|
|
71
|
-
if (typeof this.overflow === 'object') {
|
|
72
|
-
const prevIcon = typeof this.overflow.prevButtonIcon === 'undefined' ? defaultPrevIcon : '';
|
|
73
|
-
const nextIcon = typeof this.overflow.nextButtonIcon === 'undefined' ? defaultNextIcon : '';
|
|
74
|
-
if (prevIcon && this.prev) {
|
|
75
|
-
return prevIcon;
|
|
76
|
-
}
|
|
77
|
-
else if (nextIcon && !this.prev) {
|
|
78
|
-
return nextIcon;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
get customScrollButtonIconClass() {
|
|
83
|
-
if (typeof this.overflow === 'object') {
|
|
84
|
-
const prevIcon = this.overflow.prevButtonIcon;
|
|
85
|
-
const nextIcon = this.overflow.nextButtonIcon;
|
|
86
|
-
if (prevIcon && this.prev) {
|
|
87
|
-
return `k-icon ${prevIcon}`;
|
|
88
|
-
}
|
|
89
|
-
if (nextIcon && !this.prev) {
|
|
90
|
-
return `k-icon ${nextIcon}`;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
get scrollButtonSVGIcon() {
|
|
95
|
-
const defaultPrevSVGIcon = !this.localization.rtl ?
|
|
96
|
-
this.caretAltLeftIcon :
|
|
97
|
-
this.caretAltRightIcon;
|
|
98
|
-
const defaultNextSVGIcon = !this.localization.rtl ?
|
|
99
|
-
this.caretAltRightIcon :
|
|
100
|
-
this.caretAltLeftIcon;
|
|
101
|
-
if (typeof this.overflow === 'object') {
|
|
102
|
-
const prevIcon = this.overflow.prevSVGButtonIcon !== undefined ? this.overflow.prevSVGButtonIcon : defaultPrevSVGIcon;
|
|
103
|
-
const nextIcon = this.overflow.nextSVGButtonIcon !== undefined ? this.overflow.nextSVGButtonIcon : defaultNextSVGIcon;
|
|
104
|
-
if (prevIcon || nextIcon) {
|
|
105
|
-
return this.prev ? prevIcon : nextIcon;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolbarScrollableButtonComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
110
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ToolbarScrollableButtonComponent, isStandalone: true, selector: "[kendoToolbarScrollableButton]", inputs: { prev: "prev", overflow: "overflow" }, outputs: { onClick: "onClick" }, host: { properties: { "class.k-toolbar-prev": "this.prevClass", "class.k-toolbar-next": "this.nextClass", "attr.role": "this.role" } }, ngImport: i0, template: `
|
|
111
|
-
<kendo-icon-wrapper
|
|
112
|
-
[name]="iconClass"
|
|
113
|
-
[customFontClass]="customIconClass"
|
|
114
|
-
[svgIcon]="svgIcon"
|
|
115
|
-
innerCssClass="k-button-icon"
|
|
116
|
-
>
|
|
117
|
-
</kendo-icon-wrapper>
|
|
118
|
-
`, isInline: true, dependencies: [{ kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }] });
|
|
119
|
-
}
|
|
120
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ToolbarScrollableButtonComponent, decorators: [{
|
|
121
|
-
type: Component,
|
|
122
|
-
args: [{
|
|
123
|
-
template: `
|
|
124
|
-
<kendo-icon-wrapper
|
|
125
|
-
[name]="iconClass"
|
|
126
|
-
[customFontClass]="customIconClass"
|
|
127
|
-
[svgIcon]="svgIcon"
|
|
128
|
-
innerCssClass="k-button-icon"
|
|
129
|
-
>
|
|
130
|
-
</kendo-icon-wrapper>
|
|
131
|
-
`,
|
|
132
|
-
// eslint-disable-next-line @angular-eslint/component-selector
|
|
133
|
-
selector: '[kendoToolbarScrollableButton]',
|
|
134
|
-
standalone: true,
|
|
135
|
-
imports: [IconWrapperComponent]
|
|
136
|
-
}]
|
|
137
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }, { type: i1.LocalizationService }], propDecorators: { prevClass: [{
|
|
138
|
-
type: HostBinding,
|
|
139
|
-
args: ['class.k-toolbar-prev']
|
|
140
|
-
}], nextClass: [{
|
|
141
|
-
type: HostBinding,
|
|
142
|
-
args: ['class.k-toolbar-next']
|
|
143
|
-
}], role: [{
|
|
144
|
-
type: HostBinding,
|
|
145
|
-
args: ['attr.role']
|
|
146
|
-
}], prev: [{
|
|
147
|
-
type: Input
|
|
148
|
-
}], overflow: [{
|
|
149
|
-
type: Input
|
|
150
|
-
}], onClick: [{
|
|
151
|
-
type: Output
|
|
152
|
-
}] } });
|
package/esm2022/tool-options.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 {};
|