@progress/kendo-react-popup 6.1.1 → 7.0.0-develop.2
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/LICENSE.md +1 -1
- package/{dist/npm/Popup.d.ts → Popup.d.ts} +5 -1
- package/{dist/npm/PopupWithoutContext.d.ts → PopupWithoutContext.d.ts} +5 -1
- package/animation.d.ts +8 -0
- package/dist/cdn/js/kendo-react-popup.js +5 -1
- package/index.d.ts +16 -0
- package/index.js +5 -0
- package/index.mjs +372 -0
- package/{dist/npm/models → models}/Align.d.ts +4 -0
- package/{dist/npm/models → models}/Collision.d.ts +4 -0
- package/{dist/npm/models → models}/CollisionType.d.ts +5 -1
- package/{dist/es/models → models}/Events.d.ts +4 -0
- package/{dist/npm/models → models}/Margin.d.ts +4 -0
- package/models/Offset.d.ts +18 -0
- package/models/PopupAnimation.d.ts +17 -0
- package/{dist/es/models → models}/PopupProps.d.ts +4 -1
- package/models/PositionMode.d.ts +9 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +27 -27
- package/{dist/npm/util.d.ts → util.d.ts} +4 -0
- package/about.md +0 -3
- package/dist/es/Popup.d.ts +0 -27
- package/dist/es/Popup.js +0 -34
- package/dist/es/PopupWithoutContext.d.ts +0 -183
- package/dist/es/PopupWithoutContext.js +0 -485
- package/dist/es/animation.d.ts +0 -4
- package/dist/es/animation.js +0 -59
- package/dist/es/main.d.ts +0 -12
- package/dist/es/main.js +0 -3
- package/dist/es/models/Align.d.ts +0 -24
- package/dist/es/models/Align.js +0 -1
- package/dist/es/models/Collision.d.ts +0 -14
- package/dist/es/models/Collision.js +0 -1
- package/dist/es/models/CollisionType.d.ts +0 -10
- package/dist/es/models/CollisionType.js +0 -1
- package/dist/es/models/Events.js +0 -1
- package/dist/es/models/Margin.d.ts +0 -14
- package/dist/es/models/Margin.js +0 -1
- package/dist/es/models/Offset.d.ts +0 -14
- package/dist/es/models/Offset.js +0 -1
- package/dist/es/models/PopupAnimation.d.ts +0 -13
- package/dist/es/models/PopupAnimation.js +0 -1
- package/dist/es/models/PopupProps.js +0 -1
- package/dist/es/models/PopupSettings.d.ts +0 -87
- package/dist/es/models/PopupSettings.js +0 -2
- package/dist/es/models/PositionMode.d.ts +0 -5
- package/dist/es/models/PositionMode.js +0 -1
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/util.d.ts +0 -17
- package/dist/es/util.js +0 -58
- package/dist/npm/Popup.js +0 -37
- package/dist/npm/PopupWithoutContext.js +0 -488
- package/dist/npm/animation.d.ts +0 -4
- package/dist/npm/animation.js +0 -63
- package/dist/npm/main.d.ts +0 -12
- package/dist/npm/main.js +0 -8
- package/dist/npm/models/Align.js +0 -2
- package/dist/npm/models/Collision.js +0 -2
- package/dist/npm/models/CollisionType.js +0 -2
- package/dist/npm/models/Events.d.ts +0 -36
- package/dist/npm/models/Events.js +0 -2
- package/dist/npm/models/Margin.js +0 -2
- package/dist/npm/models/Offset.d.ts +0 -14
- package/dist/npm/models/Offset.js +0 -2
- package/dist/npm/models/PopupAnimation.d.ts +0 -13
- package/dist/npm/models/PopupAnimation.js +0 -2
- package/dist/npm/models/PopupProps.d.ts +0 -116
- package/dist/npm/models/PopupProps.js +0 -2
- package/dist/npm/models/PopupSettings.d.ts +0 -87
- package/dist/npm/models/PopupSettings.js +0 -3
- package/dist/npm/models/PositionMode.d.ts +0 -5
- package/dist/npm/models/PositionMode.js +0 -2
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/util.js +0 -64
- package/dist/systemjs/kendo-react-popup.js +0 -1
- package/e2e-legacy/basics.tests.ts +0 -164
- package/e2e-next/basic.tests.ts +0 -26
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Collision } from './Collision';
|
|
3
|
-
import { Align } from './Align';
|
|
4
|
-
import { OpenEvent, CloseEvent, PositionEvent } from './Events';
|
|
5
|
-
import { Offset } from './Offset';
|
|
6
|
-
import { PopupAnimation } from './PopupAnimation';
|
|
7
|
-
import { Margin } from './Margin';
|
|
8
|
-
import { PositionMode } from './PositionMode';
|
|
9
|
-
import { PopupSettings } from '@progress/kendo-popup-common';
|
|
10
|
-
/**
|
|
11
|
-
* Represents the props of the [KendoReact Popup component]({% slug overview_popup %}).
|
|
12
|
-
*/
|
|
13
|
-
export interface PopupProps extends PopupSettings {
|
|
14
|
-
/**
|
|
15
|
-
* Controls the Popup animation ([see example]({% slug animations_popup %})). By default, the opening and closing animations are enabled.
|
|
16
|
-
*/
|
|
17
|
-
animate?: boolean | PopupAnimation;
|
|
18
|
-
/**
|
|
19
|
-
* Specifies the element which will be used as an anchor ([see example]({% slug alignmentpositioning_popup %})). The Popup opens next to that element.
|
|
20
|
-
*/
|
|
21
|
-
anchor?: HTMLElement | null;
|
|
22
|
-
/**
|
|
23
|
-
* Defines the container to which the Popup will be appended. Defaults to [`body`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body).
|
|
24
|
-
* * If set to `null` the Popup will be rendered without React Portal.
|
|
25
|
-
*/
|
|
26
|
-
appendTo?: HTMLElement | null;
|
|
27
|
-
/**
|
|
28
|
-
* Specifies the pivot point of the anchor ([see example]({% slug alignmentpositioning_popup %})).
|
|
29
|
-
*/
|
|
30
|
-
anchorAlign?: Align;
|
|
31
|
-
/**
|
|
32
|
-
* Configures the collision behavior of the Popup ([see example]({% slug viewportboundarydetection_popup %})).
|
|
33
|
-
*/
|
|
34
|
-
collision?: Collision;
|
|
35
|
-
/**
|
|
36
|
-
* Configures the margin value that will be added to the popup dimensions
|
|
37
|
-
* in pixels and leaves a blank space between the popup and the anchor.
|
|
38
|
-
*/
|
|
39
|
-
margin?: Margin;
|
|
40
|
-
/**
|
|
41
|
-
* Specifies the position mode of the component. By default, the Popup uses fixed positioning.
|
|
42
|
-
* To make the Popup acquire absolute positioning, set this option to `absolute`.
|
|
43
|
-
*
|
|
44
|
-
* > If you need to support mobile browsers with the zoom option, use the `absolute` positioning of the Popup.
|
|
45
|
-
*/
|
|
46
|
-
positionMode?: PositionMode;
|
|
47
|
-
/**
|
|
48
|
-
* Used to set the document scale when using a [scale transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale).
|
|
49
|
-
*
|
|
50
|
-
* The document or container scale is required to compute the popup position correctly. Detecting the scale is not reliable and must be set by providing a value for SCALE. See [Support for Document Scale]({% slug documentscale_popup %}).
|
|
51
|
-
*
|
|
52
|
-
* > Using this token is not necessary for user-applied browser zoom.
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
scale?: number;
|
|
56
|
-
/**
|
|
57
|
-
* Specifies the pivot point of the Popup ([see example]({% slug alignmentpositioning_popup %})).
|
|
58
|
-
*/
|
|
59
|
-
popupAlign?: Align;
|
|
60
|
-
/**
|
|
61
|
-
* Specifies the absolute position of the element ([see example]({% slug alignmentpositioning_popup %})). The Popup opens next to that point. The pivot point of the Popup is defined by the `popupAlign` configuration option. The boundary detection is applied by using the window viewport.
|
|
62
|
-
*/
|
|
63
|
-
offset?: Offset;
|
|
64
|
-
/**
|
|
65
|
-
* Specifies a list of CSS classes that will be added to the internal animated element ([see example]({% slug appearance_popup %})).
|
|
66
|
-
*/
|
|
67
|
-
popupClass?: string | Array<string> | {
|
|
68
|
-
[key: string]: boolean;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Specifies a list of CSS classes that will be added to the Popup element.
|
|
72
|
-
*/
|
|
73
|
-
className?: string | Array<string>;
|
|
74
|
-
/**
|
|
75
|
-
* Specifies the id that will be added to the Popup element.
|
|
76
|
-
*/
|
|
77
|
-
id?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Represents the styles that are applied to the Popup.
|
|
80
|
-
*/
|
|
81
|
-
style?: React.CSSProperties;
|
|
82
|
-
/**
|
|
83
|
-
* Fires after the Popup is opened and the opening animation ends.
|
|
84
|
-
*/
|
|
85
|
-
onOpen?: (event: OpenEvent) => void;
|
|
86
|
-
/**
|
|
87
|
-
* Fires after the Popup is closed.
|
|
88
|
-
*/
|
|
89
|
-
onClose?: (event: CloseEvent) => void;
|
|
90
|
-
/**
|
|
91
|
-
* Fires after the Popup position is set.
|
|
92
|
-
*/
|
|
93
|
-
onPosition?: (event: PositionEvent) => void;
|
|
94
|
-
/**
|
|
95
|
-
* Controls the Popup visibility ([see example]({% slug hidden_popup %})). Defaults to `false`.
|
|
96
|
-
*/
|
|
97
|
-
show?: boolean;
|
|
98
|
-
/**
|
|
99
|
-
* @hidden
|
|
100
|
-
*
|
|
101
|
-
* If contentKey has changed, the popup will recalculate its position.
|
|
102
|
-
*/
|
|
103
|
-
contentKey?: any;
|
|
104
|
-
/**
|
|
105
|
-
* @hidden
|
|
106
|
-
*/
|
|
107
|
-
children?: React.ReactNode;
|
|
108
|
-
/**
|
|
109
|
-
* @hidden
|
|
110
|
-
*/
|
|
111
|
-
useBaseStyles?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* @hidden
|
|
114
|
-
*/
|
|
115
|
-
role?: string;
|
|
116
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Collision } from './Collision';
|
|
3
|
-
import { Align } from './Align';
|
|
4
|
-
import { OpenEvent, CloseEvent } from './Events';
|
|
5
|
-
import { Offset } from './Offset';
|
|
6
|
-
import { PopupAnimation } from './PopupAnimation';
|
|
7
|
-
import { Margin } from './Margin';
|
|
8
|
-
import { PositionMode } from './PositionMode';
|
|
9
|
-
import { PopupSettings as PopupSettingsBase } from '@progress/kendo-popup-common';
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*/
|
|
13
|
-
export interface PopupSettings extends PopupSettingsBase {
|
|
14
|
-
/**
|
|
15
|
-
* Controls the Popup animation ([see example]({% slug animations_popup %})). By default, the opening and closing animations are enabled.
|
|
16
|
-
*/
|
|
17
|
-
animate?: boolean | PopupAnimation;
|
|
18
|
-
/**
|
|
19
|
-
* Specifies the element which will be used as an anchor ([see example]({% slug alignmentpositioning_popup %})). The Popup opens next to that element.
|
|
20
|
-
*/
|
|
21
|
-
anchor?: HTMLElement | null;
|
|
22
|
-
/**
|
|
23
|
-
* Defines the container to which the Popup will be appended. Defaults to [`body`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body).
|
|
24
|
-
*/
|
|
25
|
-
appendTo?: HTMLElement | null;
|
|
26
|
-
/**
|
|
27
|
-
* Specifies the pivot point of the anchor ([see example]({% slug alignmentpositioning_popup %})).
|
|
28
|
-
*/
|
|
29
|
-
anchorAlign?: Align;
|
|
30
|
-
/**
|
|
31
|
-
* Configures the collision behavior of the Popup ([see example]({% slug viewportboundarydetection_popup %})).
|
|
32
|
-
*/
|
|
33
|
-
collision?: Collision;
|
|
34
|
-
/**
|
|
35
|
-
* Configures the margin value that will be added to the popup dimensions
|
|
36
|
-
* in pixels and leaves a blank space between the popup and the anchor.
|
|
37
|
-
*/
|
|
38
|
-
margin?: Margin;
|
|
39
|
-
/**
|
|
40
|
-
* Specifies the position mode of the component. By default, the Popup uses abosolute positioning.
|
|
41
|
-
* To make the Popup acquire fixed positioning, set this option to `fixed`.
|
|
42
|
-
*
|
|
43
|
-
* > If you need to support mobile browsers with the zoom option, use the `absolute` positioning of the Popup.
|
|
44
|
-
*/
|
|
45
|
-
positionMode?: PositionMode;
|
|
46
|
-
/**
|
|
47
|
-
* Used to set the document scale when using a [scale transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale).
|
|
48
|
-
*
|
|
49
|
-
* The document or container scale is required to compute the popup position correctly. Detecting the scale is not reliable and must be set by providing a value for SCALE.
|
|
50
|
-
*
|
|
51
|
-
* > Using this token is not necessary for user-applied browser zoom.
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
scale?: number;
|
|
55
|
-
/**
|
|
56
|
-
* Specifies the pivot point of the Popup ([see example]({% slug alignmentpositioning_popup %})).
|
|
57
|
-
*/
|
|
58
|
-
popupAlign?: Align;
|
|
59
|
-
/**
|
|
60
|
-
* Specifies the absolute position of the element ([see example]({% slug alignmentpositioning_popup %})). The Popup opens next to that point. The pivot point of the Popup is defined by the `popupAlign` configuration option. The boundary detection is applied by using the window viewport.
|
|
61
|
-
*/
|
|
62
|
-
offset?: Offset;
|
|
63
|
-
/**
|
|
64
|
-
* Specifies a list of CSS classes that will be added to the internal animated element ([see example]({% slug appearance_popup %})).
|
|
65
|
-
*/
|
|
66
|
-
popupClass?: string | Array<string>;
|
|
67
|
-
/**
|
|
68
|
-
* Specifies a list of CSS classes that will be added to the Popup element.
|
|
69
|
-
*/
|
|
70
|
-
className?: string | Array<string>;
|
|
71
|
-
/**
|
|
72
|
-
* Specifies the id that will be added to the Popup element.
|
|
73
|
-
*/
|
|
74
|
-
id?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Represents the styles that are applied to the Popup.
|
|
77
|
-
*/
|
|
78
|
-
style?: React.CSSProperties;
|
|
79
|
-
/**
|
|
80
|
-
* Fires after the Popup is opened and the opening animation ends.
|
|
81
|
-
*/
|
|
82
|
-
onOpen?: (event: OpenEvent) => void;
|
|
83
|
-
/**
|
|
84
|
-
* Fires after the Popup is closed.
|
|
85
|
-
*/
|
|
86
|
-
onClose?: (event: CloseEvent) => void;
|
|
87
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.packageMetadata = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
exports.packageMetadata = {
|
|
8
|
-
name: '@progress/kendo-react-popup',
|
|
9
|
-
productName: 'KendoReact',
|
|
10
|
-
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate: 1700063458,
|
|
12
|
-
version: '',
|
|
13
|
-
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
14
|
-
};
|
package/dist/npm/util.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.throttle = exports.FRAME_DURATION = exports.hasBoundingRect = exports.isDifferentOffset = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
var isDifferentOffset = function (oldOffset, newOffset) {
|
|
8
|
-
var oldLeft = oldOffset.left, oldTop = oldOffset.top;
|
|
9
|
-
var newLeft = newOffset.left, newTop = newOffset.top;
|
|
10
|
-
return Math.abs(oldLeft - newLeft) >= 1 || Math.abs(oldTop - newTop) >= 1;
|
|
11
|
-
};
|
|
12
|
-
exports.isDifferentOffset = isDifferentOffset;
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
var hasBoundingRect = function (elem) { return !!elem.getBoundingClientRect; };
|
|
17
|
-
exports.hasBoundingRect = hasBoundingRect;
|
|
18
|
-
/**
|
|
19
|
-
* @hidden
|
|
20
|
-
*/
|
|
21
|
-
exports.FRAME_DURATION = 1000 / 60; // 1000ms divided by 60fps
|
|
22
|
-
/**
|
|
23
|
-
* @hidden
|
|
24
|
-
*/
|
|
25
|
-
var throttle = function (func, wait, options) {
|
|
26
|
-
if (options === void 0) { options = {}; }
|
|
27
|
-
var timeout, context, args, result;
|
|
28
|
-
var previous = 0;
|
|
29
|
-
options = options || {};
|
|
30
|
-
var later = function () {
|
|
31
|
-
previous = options.leading === false ? 0 : new Date().getTime();
|
|
32
|
-
timeout = undefined;
|
|
33
|
-
result = func.apply(context, args);
|
|
34
|
-
if (!timeout) {
|
|
35
|
-
context = args = null;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var throttled = function () {
|
|
39
|
-
var now = new Date().getTime();
|
|
40
|
-
if (!previous && options.leading === false) {
|
|
41
|
-
previous = now;
|
|
42
|
-
}
|
|
43
|
-
var remaining = wait - (now - previous);
|
|
44
|
-
context = undefined; // this
|
|
45
|
-
args = arguments;
|
|
46
|
-
if (remaining <= 0 || remaining > wait) {
|
|
47
|
-
if (timeout) {
|
|
48
|
-
clearTimeout(timeout);
|
|
49
|
-
timeout = undefined;
|
|
50
|
-
}
|
|
51
|
-
previous = now;
|
|
52
|
-
result = func.apply(context, args);
|
|
53
|
-
if (!timeout) {
|
|
54
|
-
context = args = null;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else if (!timeout && options.trailing !== false) {
|
|
58
|
-
timeout = window.setTimeout(later, remaining);
|
|
59
|
-
}
|
|
60
|
-
return result;
|
|
61
|
-
};
|
|
62
|
-
return throttled;
|
|
63
|
-
};
|
|
64
|
-
exports.throttle = throttle;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register("@progress/kendo-react-popup",["@progress/kendo-popup-common","@progress/kendo-react-common","prop-types","react","react-dom"],function(e,t){var p={},a={},l={},u={},c={};return Object.defineProperty(p,"__esModule",{value:!0}),Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(l,"__esModule",{value:!0}),Object.defineProperty(u,"__esModule",{value:!0}),Object.defineProperty(c,"__esModule",{value:!0}),{setters:[function(t){Object.keys(t).forEach(function(e){p[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){a[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){l[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){u[e]=t[e]})},function(t){Object.keys(t).forEach(function(e){c[e]=t[e]})}],execute:function(){e((()=>{"use strict";var o={980:function(e,o,t){var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=(Object.defineProperty(o,"__esModule",{value:!0}),o.Popup=o.PopupPropsContext=void 0,t(954)),r=t(763);o.PopupPropsContext=i.createContext(function(e){return e}),o.Popup=i.forwardRef(function(e,t){e=i.useContext(o.PopupPropsContext).call(void 0,e);return i.createElement(r.PopupWithoutContext,n({ref:t},e))}),o.Popup.displayName="Popup"},763:function(e,t,o){var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}))(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),h=this&&this.__assign||function(){return(h=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},l=(Object.defineProperty(t,"__esModule",{value:!0}),t.PopupWithoutContext=void 0,o(954)),u=o(493),r=o(895),s=o(187),d=o(811),f=o(384),p=o(169),a=o(363);function g(e,t){if(e===t)return 1;if(!!e==!!t){var o=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);if(o.length===n.length){for(var i=0;i<o.length;i++){var r=o[i];if(e[r]!==t[r])return}return 1}}}var m,v,o={left:-1e3,top:0},y=((c=m=m||{}).hiding="hiding",c.hidden="hidden",c.showing="showing",c.shown="shown",c.reposition="reposition","k-animation-container-shown"),c=(v=l.Component,i(P,v),Object.defineProperty(P.prototype,"element",{get:function(){return this._popup},enumerable:!1,configurable:!0}),P.getDerivedStateFromProps=function(e,t){var o=e.show,n=e.anchor,i=e.anchorAlign,r=e.appendTo,s=e.collision,p=e.popupAlign,a=e.className,l=e.popupClass,u=e.style,c=e.offset,d=e.contentKey,o=h(h({},t),{props:{show:o,anchor:n,anchorAlign:i,appendTo:r,collision:s,popupAlign:p,className:a,popupClass:l,style:u,offset:c,contentKey:d}});return e.show?t.current===m.hidden||t.current===m.hiding?h(h({},o),{current:m.showing,previous:t.current}):t.current===m.showing?h(h({},o),{current:m.shown,previous:t.current}):t.current!==m.shown||g(c,t.props.offset)&&g(i,t.props.anchorAlign)&&g(r,t.props.appendTo)&&g(s,t.props.collision)&&g(p,t.props.popupAlign)&&g(u,t.props.style)&&n===t.props.anchor&&l===t.props.popupClass&&a===t.props.className?o:h(h({},o),{current:m.reposition,previous:t.current}):t.current===m.hiding||t.current===m.hidden?h(h({},o),{current:m.hidden,previous:t.current}):h(h({},o),{current:m.hiding,previous:t.current})},P.prototype.componentDidUpdate=function(e){this.state.current===m.showing&&this._popup?this.show(this._popup):this.state.current===m.hiding&&this._popup?(this.onClosing(this._popup),this.animate(this._popup.firstChild,"exit",this.onClosed)):this.state.current===m.reposition&&this.state.previous===m.shown?this.setState({current:m.shown,previous:this.state.current}):this.state.current===m.shown&&e.contentKey!==this.props.contentKey&&this._popup&&this.setPosition(this._popup)},P.prototype.componentDidMount=function(){this.state.current===m.showing&&this._popup&&this.show(this._popup)},P.prototype.componentWillUnmount=function(){this.detachRepositionHandlers()},P.prototype.render=function(){var t=this,e=this.props,o=e.children,n=e.className,i=e.popupClass,r=e.show,s=e.id,e=e.positionMode,p=this.props.appendTo||(d.canUseDOM?(this.props.anchor&&this.props.anchor.ownerDocument?this.props.anchor.ownerDocument:document).body:void 0),e=(this.state.current===m.reposition&&this.state.previous===m.shown&&this._popup&&this.setPosition(this._popup),Object.assign({},{position:e,top:0,left:-1e4},this.props.style||{})),a=this.state.current===m.hiding;return(r||a)&&p?(r=this.getCurrentZIndex(),a=l.createElement(d.ZIndexContext.Provider,{value:r},l.createElement("div",{className:(0,d.classNames)("k-animation-container",n),id:s,ref:function(e){return t._popup=e},style:h({zIndex:r},e)},l.createElement("div",{className:(0,d.classNames)("k-child-animation-container"),style:{transitionDelay:"0ms"}},l.createElement("div",{role:this.props.role,className:(0,d.classNames)("k-popup",i)},o)))),null!==this.props.appendTo?u.createPortal(a,p):a):null},Object.defineProperty(P.prototype,"animationDuration",{get:function(){var e=this.props.animate,t=0,o=0;return e&&(!0===e?t=o=300:(t=e.openDuration||0,o=e.closeDuration||0)),{enter:t,exit:o}},enumerable:!1,configurable:!0}),P.prototype.attachRepositionHandlers=function(e){var t=this;this.detachRepositionHandlers(),this._scrollableParents=f.domUtils.scrollableParents(this.props.anchor||e),this._scrollableParents&&this._scrollableParents.map(function(e){return e.addEventListener("scroll",t.reposition)}),window.addEventListener("resize",this.reposition)},P.prototype.detachRepositionHandlers=function(){var t=this;this._scrollableParents&&(this._scrollableParents.map(function(e){return e.removeEventListener("scroll",t.reposition)}),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)},P.prototype.reposition=function(){this.setState({current:m.reposition,previous:this.state.current})},P.propTypes={anchor:function(e){e=e.anchor;return e&&"number"!=typeof e.nodeType?new Error("Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."):null},appendTo:function(e){e=e.appendTo;return e&&"number"!=typeof e.nodeType?new Error("Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."):null},className:r.oneOfType([r.string,r.arrayOf(r.string),r.object]),id:r.string,popupClass:r.oneOfType([r.string,r.arrayOf(r.string),r.object]),collision:r.shape({horizontal:r.oneOf([f.Collision.fit,f.Collision.flip,f.Collision.none]),vertical:r.oneOf([f.Collision.fit,f.Collision.flip,f.Collision.none])}),anchorAlign:r.shape({horizontal:r.oneOf([f.AlignPoint.left,f.AlignPoint.center,f.AlignPoint.right]),vertical:r.oneOf([f.AlignPoint.top,f.AlignPoint.center,f.AlignPoint.bottom])}),popupAlign:r.shape({horizontal:r.oneOf([f.AlignPoint.left,f.AlignPoint.center,f.AlignPoint.right]),vertical:r.oneOf([f.AlignPoint.top,f.AlignPoint.center,f.AlignPoint.bottom])}),offset:r.shape({left:r.number,top:r.number}),children:r.oneOfType([r.element,r.node]),show:r.bool,animate:r.oneOfType([r.bool,r.shape({openDuration:r.number,closeDuration:r.number})]),margin:r.shape({horizontal:r.number,vertical:r.number}),positionMode:r.oneOf(["fixed","absolute"]),scale:r.number,style:r.object,onClose:r.func,onPosition:r.func,onOpen:r.func},P.defaultProps={collision:{horizontal:f.Collision.fit,vertical:f.Collision.flip},anchorAlign:{horizontal:f.AlignPoint.left,vertical:f.AlignPoint.bottom},popupAlign:{horizontal:f.AlignPoint.left,vertical:f.AlignPoint.top},offset:o,animate:!0,show:!1,margin:{horizontal:0,vertical:0},positionMode:"absolute"},P.contextType=d.ZIndexContext,P.displayName="PopupComponent",P);function P(e){var c=v.call(this,e)||this;return c.context=0,c.state={current:m.hidden,previous:m.hidden,props:{}},c._popup=null,c.show=function(e){c.setPosition(e),c.animate(e.firstChild,"enter",c.onOpened),c.setState({current:m.shown,previous:c.state.current})},c.setPosition=function(e){var t=c.props,o=t.anchorAlign,n=t.popupAlign,i=t.collision,r=t.offset,s=t.anchor,p=t.margin,a=t.scale,t=t.positionMode,l=e.style,u=l.width,l=l.height,r=(e.style.width=e.offsetWidth+"px",e.style.height=e.offsetHeight+"px",(0,f.alignElement)({anchor:s,anchorAlign:o,element:e,elementAlign:n,offset:r,margin:p,positionMode:t,scale:a})),p=(0,f.positionElement)({anchor:s,anchorAlign:o,element:e,elementAlign:n,collisions:i,currentLocation:r,margin:c.props.margin});e.style.top=p.offset.top+"px",e.style.left=p.offset.left+"px",e.style.width=u,e.style.height=l,c._collisions={fit:p.fit,fitted:p.fitted,flip:p.flip,flipped:p.flipped},c.props.onPosition&&(t={target:c,flipped:p.flipped,fitted:p.fitted},c.props.onPosition.call(void 0,t))},c.onOpened=function(){var e=c._popup;e&&(c.props.show&&e.classList.add(y),c.attachRepositionHandlers(e),c.props.onOpen)&&c.props.onOpen.call(void 0,{target:c})},c.animate=function(e,t,o){var n,i;c.props.popupAlign&&(i=(n=c.props.popupAlign).horizontal,n=n.vertical,i="left"===i&&"center"===n?"right":"right"===i&&"center"===n?"left":"top"===n?"down":"up",c._collisions&&c._collisions.flipped&&(i={down:"up",up:"down",left:"right",right:"left"}[i]),(0,s.slide)(e,i,c.animationDuration[t],t,o))},c.onClosing=function(e){c.props.show||e.classList.remove(y),c.detachRepositionHandlers()},c.onClosed=function(){c.state.current===m.hiding&&c.state.previous===m.shown&&c.setState({current:m.hidden,previous:c.state.current}),c.props.onClose&&c.props.onClose.call(void 0,{target:c})},c.getCurrentZIndex=function(){return c.context?c.context+1:100},(0,d.validatePackage)(a.packageMetadata),c.reposition=(0,p.throttle)(c.reposition.bind(c),p.FRAME_DURATION),c}t.PopupWithoutContext=c},187:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.slide=void 0;function l(t){t.style.transitionDuration="",Array.from(t.classList).forEach(function(e){e.startsWith("k-slide-")&&t.classList.remove(e)})}var u="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);t.slide=function(t,e,o,n,i){if(0===o)return i();function r(e){e.target===t&&(t.removeEventListener("transitionend",r),l(t),t.style.display="exit"===n?"none":"",i())}var s,p="k-slide-"+e+"-"+n,a=p+"-active",e=(t.addEventListener("transitionend",r),t.ownerDocument);e&&(s=e.defaultView)&&(e=function(){l(t),t.classList.add(p),s.requestAnimationFrame(function(){t.style.transitionDuration=o+"ms",t.classList.add(a)})},u?s.requestAnimationFrame(e):e())}},363:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata=void 0,t.packageMetadata={name:"@progress/kendo-react-popup",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1700063458,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"}},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.throttle=t.FRAME_DURATION=t.hasBoundingRect=t.isDifferentOffset=void 0,t.isDifferentOffset=function(e,t){var o=e.left,e=e.top,n=t.left,t=t.top;return 1<=Math.abs(o-n)||1<=Math.abs(e-t)},t.hasBoundingRect=function(e){return!!e.getBoundingClientRect},t.FRAME_DURATION=1e3/60,t.throttle=function(o,n,i){function r(){u=!1===i.leading?0:(new Date).getTime(),s=void 0,l=o.apply(p,a),s||(p=a=null)}var s,p,a,l,u=0;i=(i=void 0===i?{}:i)||{};return function(){var e=(new Date).getTime(),t=(u||!1!==i.leading||(u=e),n-(e-u));return p=void 0,a=arguments,t<=0||n<t?(s&&(clearTimeout(s),s=void 0),u=e,l=o.apply(p,a),s||(p=a=null)):s||!1===i.trailing||(s=window.setTimeout(r,t)),l}}},384:e=>{e.exports=p},811:e=>{e.exports=a},895:e=>{e.exports=l},954:e=>{e.exports=u},493:e=>{e.exports=c}},n={};function i(e){var t=n[e];return void 0!==t||(t=n[e]={exports:{}},o[e].call(t.exports,t,t.exports,i)),t.exports}var e,t,r,s={};return e=s,Object.defineProperty(e,"__esModule",{value:!0}),e.PopupPropsContext=e.PopupWithoutContext=e.Popup=void 0,t=i(980),Object.defineProperty(e,"Popup",{enumerable:!0,get:function(){return t.Popup}}),Object.defineProperty(e,"PopupPropsContext",{enumerable:!0,get:function(){return t.PopupPropsContext}}),r=i(763),Object.defineProperty(e,"PopupWithoutContext",{enumerable:!0,get:function(){return r.PopupWithoutContext}}),s})())}}});
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { Browser, By } from '@progress/kendo-e2e';
|
|
2
|
-
import { DELAYS, LOCATORS } from '../../../e2eUtils/const';
|
|
3
|
-
|
|
4
|
-
jest.retryTimes(3);
|
|
5
|
-
|
|
6
|
-
let browser: Browser;
|
|
7
|
-
|
|
8
|
-
beforeAll(async () => {
|
|
9
|
-
browser = new Browser();
|
|
10
|
-
await browser.driver.manage().window().setRect({ width: 1920, height: 1080 });
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
beforeEach(async () => {
|
|
14
|
-
await browser.navigateTo('http://localhost:8888/examples/e2e/basic.html');
|
|
15
|
-
await browser.find(LOCATORS.APP);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
afterEach(async () => {
|
|
19
|
-
expect(await browser.getErrorLogs()).toEqual([]);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
afterAll(async () => {
|
|
23
|
-
await browser.close();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const animationContainer = '.k-animation-container';
|
|
27
|
-
const animationChildSelector = animationContainer + ' > .k-child-animation-container';
|
|
28
|
-
const staticPopup = '.static.k-animation-container';
|
|
29
|
-
const togglePopupBtn = 'button.toggle';
|
|
30
|
-
|
|
31
|
-
it('open and close events is fired on time', async () => {
|
|
32
|
-
await browser.click(By.css('.animationToggle'));
|
|
33
|
-
await browser.sleep(DELAYS.DEFAULT);
|
|
34
|
-
|
|
35
|
-
await browser.click(By.css(togglePopupBtn));
|
|
36
|
-
|
|
37
|
-
const time1 = Date.now();
|
|
38
|
-
const popupClose = await browser.find(By.id('popupConsole'));
|
|
39
|
-
expect(await browser.waitSafely(async () => (await popupClose.getAttribute('value')).includes('open'))).toBe(true);
|
|
40
|
-
const time2 = Date.now();
|
|
41
|
-
expect(time2 - time1).toBeGreaterThan(300);
|
|
42
|
-
expect(time2 - time1).toBeLessThan(450);
|
|
43
|
-
|
|
44
|
-
await browser.click(By.css(togglePopupBtn));
|
|
45
|
-
const time3 = Date.now();
|
|
46
|
-
expect(await browser.waitSafely(async () => (await popupClose.getAttribute('value')).includes('close'))).toBe(true);
|
|
47
|
-
const time4 = Date.now();
|
|
48
|
-
expect(time4 - time3).toBeGreaterThan(300);
|
|
49
|
-
expect(time4 - time3).toBeLessThan(450);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const data = [
|
|
53
|
-
['left top', 'left top', 0, 0],
|
|
54
|
-
['left top', 'left bottom', 0, -52],
|
|
55
|
-
['left top', 'center center', -51, -26],
|
|
56
|
-
['left top', 'right top', -102, 0],
|
|
57
|
-
['left top', 'right bottom', -102, -52],
|
|
58
|
-
['left center', 'left top', 0, 10],
|
|
59
|
-
['left center', 'right bottom', -102, -42],
|
|
60
|
-
['left bottom', 'left top', 0, 20],
|
|
61
|
-
['left bottom', 'right bottom', -102, -32],
|
|
62
|
-
['center bottom', 'right bottom', -52, -32],
|
|
63
|
-
['center top', 'left top', 50, 0],
|
|
64
|
-
['center top', 'right bottom', -52, -52],
|
|
65
|
-
['right top', 'left top', 100, 0],
|
|
66
|
-
['right top', 'right bottom', -2, -52],
|
|
67
|
-
['right center', 'left top', 100, 10],
|
|
68
|
-
['right center', 'right bottom', -2, -42],
|
|
69
|
-
['right bottom', 'left top', 100, 20],
|
|
70
|
-
['right bottom', 'center center', 49, -6],
|
|
71
|
-
['right bottom', 'right bottom', -2, -32]
|
|
72
|
-
];
|
|
73
|
-
it.each(data)('open at (anchorAlign: %s, popupAlign: %s)', async (anchorAlign, popupAlign, xDiff, yDiff) => {
|
|
74
|
-
await setAlign(anchorAlign as string, popupAlign as string);
|
|
75
|
-
await browser.click(By.css(togglePopupBtn));
|
|
76
|
-
const aRect = await (await browser.find(By.css('.anchor'))).getRect();
|
|
77
|
-
const pRect = await (await browser.find(LOCATORS.POPUP)).getRect();
|
|
78
|
-
expect(pRect.x - aRect.x).toEqual(xDiff);
|
|
79
|
-
expect(pRect.y - aRect.y).toEqual(yDiff);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it('open at top - 100px, left: 100px', async () => {
|
|
83
|
-
await browser.click(By.css('button.staticToggle'));
|
|
84
|
-
const popup = await browser.find(By.css(staticPopup));
|
|
85
|
-
expect(await popup.getCssValue('left')).toEqual('100px');
|
|
86
|
-
expect(await popup.getCssValue('top')).toEqual('100px');
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('reposition static popup', async () => {
|
|
90
|
-
await browser.click(By.css('button.staticToggle'));
|
|
91
|
-
const popup = await browser.find(By.css(staticPopup));
|
|
92
|
-
|
|
93
|
-
await browser.type(await browser.find(By.id('leftStatic')), '110');
|
|
94
|
-
await browser.type(await browser.find(By.id('topStatic')), '120');
|
|
95
|
-
await browser.sleep(DELAYS.DEFAULT);
|
|
96
|
-
|
|
97
|
-
expect(await popup.getCssValue('left')).toEqual('110px');
|
|
98
|
-
expect(await popup.getCssValue('top')).toEqual('120px');
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it('animation transition time', async () => {
|
|
102
|
-
await browser.click(By.css('.animationToggle'));
|
|
103
|
-
await browser.sleep(DELAYS.SMALL);
|
|
104
|
-
|
|
105
|
-
await browser.click(By.css(togglePopupBtn));
|
|
106
|
-
await browser.sleep(DELAYS.ANIMATION);
|
|
107
|
-
expect((await browser.findAll(By.css(animationChildSelector))).length).toBeGreaterThan(0);
|
|
108
|
-
|
|
109
|
-
await browser.click(By.css(togglePopupBtn));
|
|
110
|
-
await browser.sleep(DELAYS.SMALL);
|
|
111
|
-
expect((await browser.findAll(By.css(animationChildSelector))).length).toBeGreaterThan(0);
|
|
112
|
-
await browser.sleep(DELAYS.ANIMATION);
|
|
113
|
-
expect((await browser.findAll(By.css(animationChildSelector))).length).toEqual(0);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const testData = [
|
|
117
|
-
{anchorAlign: 'left bottom', popupAlign: 'right top', position: {left: 30, top: 100}, collision: 'fit', xDiff: -30, yDiff: 20},
|
|
118
|
-
{anchorAlign: 'left bottom', popupAlign: 'right top', position: {left: 30, top: 100}, collision: 'flip', xDiff: 100, yDiff: 20},
|
|
119
|
-
{anchorAlign: 'left top', popupAlign: 'left bottom', position: {left: 500, top: 20}, collision: 'fit', xDiff: 0, yDiff: -20},
|
|
120
|
-
{anchorAlign: 'left top', popupAlign: 'left bottom', position: {left: 500, top: 20}, collision: 'flip', xDiff: 0, yDiff: 20},
|
|
121
|
-
{anchorAlign: 'right top', popupAlign: 'left top', position: {top: 100, right: 20}, collision: 'fit', xDiff: 100, yDiff: 0},
|
|
122
|
-
{anchorAlign: 'right top', popupAlign: 'left top', position: {top: 100, right: 20}, collision: 'flip', xDiff: 100, yDiff: 0},
|
|
123
|
-
{anchorAlign: 'left bottom', popupAlign: 'left top', position: {bottom: 20, right: 300}, collision: 'fit', xDiff: 0, yDiff: 20},
|
|
124
|
-
{anchorAlign: 'left bottom', popupAlign: 'left top', position: {bottom: 20, right: 300}, collision: 'flip', xDiff: 0, yDiff: 20}
|
|
125
|
-
];
|
|
126
|
-
it.each(testData)('popup collisions left - flip', async (testData) => {
|
|
127
|
-
await setAlign(testData.anchorAlign, testData.popupAlign);
|
|
128
|
-
await setAnchorPosition(testData.position);
|
|
129
|
-
await setCollisions(testData.collision);
|
|
130
|
-
await browser.click(By.css(togglePopupBtn));
|
|
131
|
-
const aRect = await (await browser.find(By.css('.anchor'))).getRect();
|
|
132
|
-
const pRect = await (await browser.find(LOCATORS.POPUP)).getRect();
|
|
133
|
-
expect(pRect.x - aRect.x).toEqual(testData.xDiff);
|
|
134
|
-
expect(pRect.y - aRect.y).toEqual(testData.yDiff);
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
async function setAlign(anchorAlign: string, popupAlign: string) {
|
|
138
|
-
await setValue('#anchorAlignSettings .horizontal', anchorAlign.split(' ')[0]);
|
|
139
|
-
await setValue('#anchorAlignSettings .vertical', anchorAlign.split(' ')[1]);
|
|
140
|
-
await setValue('#popupAlignSettings .horizontal', popupAlign.split(' ')[0]);
|
|
141
|
-
await setValue('#popupAlignSettings .vertical', popupAlign.split(' ')[1]);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
async function setAnchorPosition(position: any) {
|
|
145
|
-
await setValue('#anchorLeft', position.left, true);
|
|
146
|
-
await setValue('#anchorTop', position.top, true);
|
|
147
|
-
await setValue('#anchorRight', position.right, true);
|
|
148
|
-
await setValue('#anchorBottom', position.bottom, true);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
async function setCollisions(collision: string) {
|
|
152
|
-
await setValue('#collisionsSettings .horizontal', collision);
|
|
153
|
-
await setValue('#collisionsSettings .vertical', collision);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
async function setValue(selector: string, value: string, clear = false) {
|
|
157
|
-
if (value !== undefined) {
|
|
158
|
-
const input = await browser.find(By.css(selector));
|
|
159
|
-
if (clear) {
|
|
160
|
-
await input.clear();
|
|
161
|
-
}
|
|
162
|
-
await input.sendKeys(value);
|
|
163
|
-
}
|
|
164
|
-
}
|
package/e2e-next/basic.tests.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Browser } from '@progress/kendo-e2e';
|
|
2
|
-
import { getMenuItem } from '../../../e2eUtils/utils';
|
|
3
|
-
import { LOCATORS } from '../../../e2eUtils/const';
|
|
4
|
-
|
|
5
|
-
let browser: Browser;
|
|
6
|
-
|
|
7
|
-
beforeAll(() => {
|
|
8
|
-
browser = new Browser();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
beforeEach(async () => {
|
|
12
|
-
await browser.navigateTo('http://localhost:3000/menu/overview');
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
afterEach(async () => {
|
|
16
|
-
expect(await browser.getErrorLogs()).toEqual([]);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
afterAll(async () => {
|
|
20
|
-
await browser.close();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('should not have errors', async () => {
|
|
24
|
-
await browser.click(getMenuItem("Item1"));
|
|
25
|
-
expect(await browser.isVisible(LOCATORS.POPUP)).toBe(true);
|
|
26
|
-
});
|