@progress/kendo-angular-popup 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/esm2022/scale.mjs DELETED
@@ -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
- import { InjectionToken } from '@angular/core';
6
- /**
7
- * Use the `SCALE` injection token to set the document scale when you use a [scale transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale).
8
- *
9
- * The document or container scale is required to compute the popup position correctly. Set the value for `SCALE` to ensure correct positioning. See [Support for Document Scale]({% slug documentscale_popup %}).
10
- *
11
- * > You do not need to use this token for user-applied browser zoom.
12
- */
13
- export const SCALE = new InjectionToken('Popup Document Scale');
@@ -1,69 +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, Inject, Optional } from '@angular/core';
6
- import { DOMService } from './dom.service';
7
- import { eitherRect, removeStackingOffset, scaleRect } from '../util';
8
- import { SCALE } from '../scale';
9
- import * as i0 from "@angular/core";
10
- import * as i1 from "./dom.service";
11
- /**
12
- * @hidden
13
- */
14
- export class AlignService {
15
- _dom;
16
- scale;
17
- constructor(_dom, scale = 1) {
18
- this._dom = _dom;
19
- this.scale = scale;
20
- }
21
- alignElement(settings) {
22
- const { anchor, element, anchorAlign, elementAlign, margin, offset, positionMode } = settings;
23
- const scale = this.scale || 1;
24
- const fixedMode = positionMode === 'fixed' || !this._dom.hasOffsetParent(element);
25
- const anchorRect = fixedMode ? this.absoluteRect(anchor, element, offset, scale) : this.relativeRect(anchor, element, offset, scale);
26
- const elementRect = scaleRect(this._dom.offset(element.nativeElement), scale);
27
- const result = this._dom.align({
28
- anchorAlign: anchorAlign,
29
- anchorRect: anchorRect,
30
- elementAlign: elementAlign,
31
- elementRect: elementRect,
32
- margin
33
- });
34
- return result;
35
- }
36
- absoluteRect(anchor, element, offset, scale) {
37
- const scrollPos = this.elementScrollPosition(anchor, element);
38
- const rect = eitherRect(this._dom.offset(anchor), offset);
39
- const stackScale = 2 * scale;
40
- const stackScroll = this._dom.stackingElementScroll(element);
41
- if (scale !== 1 && stackScroll) {
42
- stackScroll.x /= stackScale;
43
- stackScroll.y /= stackScale;
44
- }
45
- const stackOffset = this._dom.stackingElementOffset(element);
46
- if (scale !== 1 && stackOffset) {
47
- stackOffset.left /= stackScale;
48
- stackOffset.top /= stackScale;
49
- }
50
- return this._dom.removeScroll(this._dom.addScroll(removeStackingOffset(scaleRect(rect, scale), stackOffset), stackScroll), scrollPos);
51
- }
52
- elementScrollPosition(anchor, element) {
53
- return anchor ? { x: 0, y: 0 } : this._dom.scrollPosition(element);
54
- }
55
- relativeRect(anchor, element, offset, scale) {
56
- const rect = eitherRect(this._dom.position(anchor, element, scale), offset);
57
- return scaleRect(rect, scale);
58
- }
59
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AlignService, deps: [{ token: i1.DOMService }, { token: SCALE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
60
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AlignService });
61
- }
62
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AlignService, decorators: [{
63
- type: Injectable
64
- }], ctorParameters: () => [{ type: i1.DOMService }, { type: undefined, decorators: [{
65
- type: Inject,
66
- args: [SCALE]
67
- }, {
68
- type: Optional
69
- }] }] });
@@ -1,138 +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, isDevMode, EventEmitter } from '@angular/core';
6
- import { animate, style, AnimationBuilder } from '@angular/animations';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "@angular/animations";
9
- const LEFT = 'left';
10
- const RIGHT = 'right';
11
- const DOWN = 'down';
12
- const UP = 'up';
13
- const DEFAULT_TYPE = 'slide';
14
- const DEFAULT_DURATION = 100;
15
- const animationTypes = {};
16
- animationTypes.expand = (direction) => {
17
- const scale = direction === UP || direction === DOWN ? 'scaleY' : 'scaleX';
18
- const startScale = 0;
19
- const endScale = 1;
20
- let origin;
21
- if (direction === DOWN) {
22
- origin = 'top';
23
- }
24
- else if (direction === LEFT) {
25
- origin = RIGHT;
26
- }
27
- else if (direction === RIGHT) {
28
- origin = LEFT;
29
- }
30
- else {
31
- origin = 'bottom';
32
- }
33
- return {
34
- start: { transform: `${scale}(${startScale})`, transformOrigin: origin },
35
- end: { transform: `${scale}(${endScale})` }
36
- };
37
- };
38
- animationTypes.slide = (direction) => {
39
- const translate = direction === LEFT || direction === RIGHT ? 'translateX' : 'translateY';
40
- const start = direction === RIGHT || direction === DOWN ? -100 : 100;
41
- const end = 0;
42
- return {
43
- start: { transform: `${translate}(${start}%)` },
44
- end: { transform: `${translate}(${end}%)` }
45
- };
46
- };
47
- animationTypes.fade = () => {
48
- return {
49
- start: { opacity: 0 },
50
- end: { opacity: 1 }
51
- };
52
- };
53
- animationTypes.zoom = () => {
54
- const start = 0;
55
- const end = 1;
56
- return {
57
- start: { transform: `scale(${start})` },
58
- end: { transform: `scale(${end})` }
59
- };
60
- };
61
- /**
62
- * @hidden
63
- */
64
- export class AnimationService {
65
- animationBuilder;
66
- start = new EventEmitter();
67
- end = new EventEmitter();
68
- flip;
69
- player;
70
- constructor(animationBuilder) {
71
- this.animationBuilder = animationBuilder;
72
- }
73
- play(element, options, flip) {
74
- if (!this.flip || this.flip.horizontal !== flip.horizontal ||
75
- this.flip.vertical !== flip.vertical) {
76
- this.flip = flip;
77
- const type = options.type || DEFAULT_TYPE;
78
- const statesFn = animationTypes[type];
79
- if (statesFn) {
80
- const direction = this.getDirection(flip, options);
81
- const states = statesFn(direction);
82
- this.playStates(element, states, options);
83
- }
84
- else if (isDevMode()) {
85
- throw new Error(`Unsupported animation type: "${type}". The supported types are slide, expand, fade and zoom.`);
86
- }
87
- }
88
- }
89
- ngOnDestroy() {
90
- this.stopPlayer();
91
- }
92
- playStates(element, states, options) {
93
- this.stopPlayer();
94
- const duration = options.duration || DEFAULT_DURATION;
95
- const factory = this.animationBuilder.build([
96
- style(states.start),
97
- animate(`${duration}ms ease-in`, style(states.end))
98
- ]);
99
- const player = this.player = factory.create(element);
100
- player.onDone(() => {
101
- this.end.emit();
102
- this.stopPlayer();
103
- });
104
- this.start.emit();
105
- player.play();
106
- }
107
- getDirection(flip, options) {
108
- let direction = options.direction || DOWN;
109
- if (flip.horizontal) {
110
- if (direction === LEFT) {
111
- direction = RIGHT;
112
- }
113
- else if (direction === RIGHT) {
114
- direction = LEFT;
115
- }
116
- }
117
- if (flip.vertical) {
118
- if (direction === DOWN) {
119
- direction = UP;
120
- }
121
- else if (direction === UP) {
122
- direction = DOWN;
123
- }
124
- }
125
- return direction;
126
- }
127
- stopPlayer() {
128
- if (this.player) {
129
- this.player.destroy();
130
- this.player = null;
131
- }
132
- }
133
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AnimationService, deps: [{ token: i1.AnimationBuilder }], target: i0.ɵɵFactoryTarget.Injectable });
134
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AnimationService });
135
- }
136
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AnimationService, decorators: [{
137
- type: Injectable
138
- }], ctorParameters: () => [{ type: i1.AnimationBuilder }] });
@@ -1,155 +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 { align, boundingOffset, getWindowViewPort, offset, positionWithScroll, restrictToView, addScroll, removeScroll, scrollPosition } from '@progress/kendo-popup-common';
7
- import { isWindowAvailable, hasRelativeStackingContext, scrollableParents, zIndex } from '../util';
8
- import { isDocumentAvailable } from '@progress/kendo-angular-common';
9
- import * as i0 from "@angular/core";
10
- const STYLES = [
11
- 'font-size',
12
- 'font-family',
13
- 'font-stretch',
14
- 'font-style',
15
- 'font-weight',
16
- 'line-height'
17
- ];
18
- /**
19
- * @hidden
20
- */
21
- export class DOMService {
22
- _dummy;
23
- addOffset(current, addition) {
24
- return {
25
- left: current.left + addition.left,
26
- top: current.top + addition.top
27
- };
28
- }
29
- addScroll(rect, scroll) {
30
- return addScroll(rect, scroll);
31
- }
32
- align(settings) {
33
- return align(settings);
34
- }
35
- boundingOffset(el) {
36
- return boundingOffset(el);
37
- }
38
- getFontStyles(el) {
39
- const window = this.getWindow();
40
- if (!window || !el) {
41
- return [];
42
- }
43
- const computedStyles = window.getComputedStyle(el);
44
- return STYLES.map(key => ({ key: key, value: computedStyles[key] }));
45
- }
46
- getWindow() {
47
- return isWindowAvailable() ? window : null;
48
- }
49
- hasOffsetParent(el) {
50
- if (!el || !isDocumentAvailable()) {
51
- return false;
52
- }
53
- return !!this.nativeElement(el).offsetParent;
54
- }
55
- offset(el) {
56
- if (!el || !isDocumentAvailable()) {
57
- return null;
58
- }
59
- return offset(el);
60
- }
61
- offsetAtPoint(el, currentLocation) {
62
- if (!el || !isDocumentAvailable()) {
63
- return null;
64
- }
65
- const element = this.nativeElement(el);
66
- const { left, top, transition } = element.style;
67
- element.style.transition = 'none';
68
- element.style.left = `${currentLocation.left}px`;
69
- element.style.top = `${currentLocation.top}px`;
70
- const currentOffset = offset(element);
71
- element.style.left = left;
72
- element.style.top = top;
73
- // prevents elements with transition to be animated because of the change
74
- this._dummy = element.offsetHeight;
75
- element.style.transition = transition;
76
- return currentOffset;
77
- }
78
- nativeElement(el) {
79
- if (!el || !isDocumentAvailable()) {
80
- return null;
81
- }
82
- return el.nativeElement || el;
83
- }
84
- position(element, popup, scale = 1) {
85
- if (!element || !popup) {
86
- return null;
87
- }
88
- return positionWithScroll(element, this.nativeElement(popup), scale);
89
- }
90
- removeScroll(rect, scroll) {
91
- return removeScroll(rect, scroll);
92
- }
93
- restrictToView(settings) {
94
- return restrictToView(settings);
95
- }
96
- scrollPosition(el) {
97
- return scrollPosition(this.nativeElement(el));
98
- }
99
- scrollableParents(el) {
100
- return scrollableParents(el);
101
- }
102
- stackingElementOffset(el) {
103
- const relativeContextElement = this.getRelativeContextElement(el);
104
- if (!relativeContextElement) {
105
- return null;
106
- }
107
- return offset(relativeContextElement);
108
- }
109
- stackingElementScroll(el) {
110
- const relativeContextElement = this.getRelativeContextElement(el);
111
- if (!relativeContextElement) {
112
- return { x: 0, y: 0 };
113
- }
114
- return {
115
- x: relativeContextElement.scrollLeft,
116
- y: relativeContextElement.scrollTop
117
- };
118
- }
119
- getRelativeContextElement(el) {
120
- if (!el || !hasRelativeStackingContext()) {
121
- return null;
122
- }
123
- let parent = this.nativeElement(el).parentElement;
124
- while (parent) {
125
- if (window.getComputedStyle(parent).transform !== 'none') {
126
- return parent;
127
- }
128
- parent = parent.parentElement;
129
- }
130
- return null;
131
- }
132
- useRelativePosition(el) {
133
- return !!this.getRelativeContextElement(el);
134
- }
135
- windowViewPort(el) {
136
- return getWindowViewPort(this.nativeElement(el));
137
- }
138
- zIndex(anchor, container) {
139
- return zIndex(anchor, this.nativeElement(container));
140
- }
141
- zoomLevel() {
142
- if (!isDocumentAvailable() || !isWindowAvailable()) {
143
- return 1;
144
- }
145
- return parseFloat((document.documentElement.clientWidth / window.innerWidth).toFixed(2)) || 1;
146
- }
147
- isZoomed() {
148
- return this.zoomLevel() > 1;
149
- }
150
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DOMService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
151
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DOMService });
152
- }
153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DOMService, decorators: [{
154
- type: Injectable
155
- }] });
@@ -1,58 +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 { Inject, Injectable, Optional } from '@angular/core';
6
- import { DOMService } from './dom.service';
7
- import { eitherRect, scaleRect } from '../util';
8
- import { SCALE } from '../scale';
9
- import * as i0 from "@angular/core";
10
- import * as i1 from "./dom.service";
11
- /**
12
- * @hidden
13
- */
14
- export class PositionService {
15
- _dom;
16
- scale;
17
- constructor(_dom, scale = 1) {
18
- this._dom = _dom;
19
- this.scale = scale;
20
- }
21
- positionElement(settings) {
22
- const { anchor, currentLocation, element, anchorAlign, elementAlign, collisions, margin } = settings;
23
- const dom = this._dom;
24
- const scale = this.scale || 1;
25
- const elementOffset = dom.offsetAtPoint(element, currentLocation);
26
- const elementRect = scaleRect(elementOffset, scale);
27
- const anchorOffset = scaleRect(dom.offset(anchor), scale);
28
- const anchorRect = eitherRect(anchorOffset, currentLocation);
29
- const viewPort = settings.viewPort || dom.windowViewPort(element);
30
- viewPort.width = viewPort.width / scale;
31
- viewPort.height = viewPort.height / scale;
32
- const result = dom.restrictToView({
33
- anchorAlign,
34
- anchorRect,
35
- collisions,
36
- elementAlign,
37
- elementRect,
38
- margin,
39
- viewPort
40
- });
41
- const offset = dom.addOffset(currentLocation, result.offset);
42
- return {
43
- flip: result.flip,
44
- flipped: result.flipped,
45
- offset: offset
46
- };
47
- }
48
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PositionService, deps: [{ token: i1.DOMService }, { token: SCALE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
49
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PositionService });
50
- }
51
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: PositionService, decorators: [{
52
- type: Injectable
53
- }], ctorParameters: () => [{ type: i1.DOMService }, { type: undefined, decorators: [{
54
- type: Inject,
55
- args: [SCALE]
56
- }, {
57
- type: Optional
58
- }] }] });
@@ -1,48 +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 { fromEvent } from 'rxjs';
7
- import { auditTime } from 'rxjs/operators';
8
- import { isDocumentAvailable } from '@progress/kendo-angular-common';
9
- import { FRAME_DURATION } from '../util';
10
- import { DOMService } from './dom.service';
11
- import * as i0 from "@angular/core";
12
- import * as i1 from "./dom.service";
13
- /**
14
- * @hidden
15
- */
16
- export class ResizeService {
17
- _dom;
18
- _zone;
19
- subscription;
20
- constructor(_dom, _zone) {
21
- this._dom = _dom;
22
- this._zone = _zone;
23
- }
24
- subscribe(callback) {
25
- if (!isDocumentAvailable()) {
26
- return;
27
- }
28
- this._zone.runOutsideAngular(() => {
29
- this.subscription = fromEvent(this._dom.getWindow(), "resize")
30
- .pipe(auditTime(FRAME_DURATION))
31
- .subscribe(() => callback());
32
- });
33
- }
34
- unsubscribe() {
35
- if (!this.subscription) {
36
- return;
37
- }
38
- this.subscription.unsubscribe();
39
- }
40
- isUnsubscribed() {
41
- return this.subscription && this.subscription.closed;
42
- }
43
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ResizeService, deps: [{ token: i1.DOMService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
44
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ResizeService });
45
- }
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ResizeService, decorators: [{
47
- type: Injectable
48
- }], ctorParameters: () => [{ type: i1.DOMService }, { type: i0.NgZone }] });
@@ -1,81 +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 { fromEvent, merge } from 'rxjs';
7
- import { auditTime } from 'rxjs/operators';
8
- import { isDocumentAvailable } from '@progress/kendo-angular-common';
9
- import { DOMService } from './dom.service';
10
- import { FRAME_DURATION } from '../util';
11
- import * as i0 from "@angular/core";
12
- import * as i1 from "./dom.service";
13
- /**
14
- * @hidden
15
- */
16
- export const THRESHOLD_DIFF = 1;
17
- /**
18
- * @hidden
19
- */
20
- export class ScrollableService {
21
- _dom;
22
- _zone;
23
- element;
24
- subscription;
25
- constructor(_dom, _zone) {
26
- this._dom = _dom;
27
- this._zone = _zone;
28
- }
29
- forElement(element) {
30
- this.unsubscribe();
31
- this.element = element;
32
- return this;
33
- }
34
- subscribe(callback) {
35
- if (!callback || !isDocumentAvailable() || !this.element) {
36
- return;
37
- }
38
- const parents = this._dom.scrollableParents(this.element);
39
- this._zone.runOutsideAngular(() => {
40
- const observables = parents.map(p => fromEvent(p, "scroll").pipe(auditTime(FRAME_DURATION)));
41
- const subscriber = (e) => {
42
- const target = e.target;
43
- const isParent = parents.filter(p => p === target).length > 0;
44
- const isDocument = target === document;
45
- const isWindow = target === window;
46
- if (isParent || isDocument || isWindow) {
47
- callback(this.isVisible(this.element, target));
48
- }
49
- };
50
- this.subscription = merge(...observables).subscribe(subscriber);
51
- });
52
- }
53
- unsubscribe() {
54
- if (!this.subscription) {
55
- return;
56
- }
57
- this.subscription.unsubscribe();
58
- }
59
- isVisible(elem, container) {
60
- const elemRect = this._dom.boundingOffset(elem);
61
- const containerRect = this._dom.boundingOffset(this._dom.nativeElement(container));
62
- if (THRESHOLD_DIFF < (containerRect.top - elemRect.bottom)) {
63
- return false;
64
- }
65
- if (THRESHOLD_DIFF < (elemRect.top - containerRect.bottom)) {
66
- return false;
67
- }
68
- if (THRESHOLD_DIFF < (elemRect.left - containerRect.right)) {
69
- return false;
70
- }
71
- if (THRESHOLD_DIFF < (containerRect.left - elemRect.right)) {
72
- return false;
73
- }
74
- return true;
75
- }
76
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollableService, deps: [{ token: i1.DOMService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
77
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollableService });
78
- }
79
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ScrollableService, decorators: [{
80
- type: Injectable
81
- }], ctorParameters: () => [{ type: i1.DOMService }, { type: i0.NgZone }] });