@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.
Files changed (79) hide show
  1. package/LICENSE.md +1 -1
  2. package/{dist/npm/Popup.d.ts → Popup.d.ts} +5 -1
  3. package/{dist/npm/PopupWithoutContext.d.ts → PopupWithoutContext.d.ts} +5 -1
  4. package/animation.d.ts +8 -0
  5. package/dist/cdn/js/kendo-react-popup.js +5 -1
  6. package/index.d.ts +16 -0
  7. package/index.js +5 -0
  8. package/index.mjs +372 -0
  9. package/{dist/npm/models → models}/Align.d.ts +4 -0
  10. package/{dist/npm/models → models}/Collision.d.ts +4 -0
  11. package/{dist/npm/models → models}/CollisionType.d.ts +5 -1
  12. package/{dist/es/models → models}/Events.d.ts +4 -0
  13. package/{dist/npm/models → models}/Margin.d.ts +4 -0
  14. package/models/Offset.d.ts +18 -0
  15. package/models/PopupAnimation.d.ts +17 -0
  16. package/{dist/es/models → models}/PopupProps.d.ts +4 -1
  17. package/models/PositionMode.d.ts +9 -0
  18. package/package-metadata.d.ts +9 -0
  19. package/package.json +27 -27
  20. package/{dist/npm/util.d.ts → util.d.ts} +4 -0
  21. package/about.md +0 -3
  22. package/dist/es/Popup.d.ts +0 -27
  23. package/dist/es/Popup.js +0 -34
  24. package/dist/es/PopupWithoutContext.d.ts +0 -183
  25. package/dist/es/PopupWithoutContext.js +0 -485
  26. package/dist/es/animation.d.ts +0 -4
  27. package/dist/es/animation.js +0 -59
  28. package/dist/es/main.d.ts +0 -12
  29. package/dist/es/main.js +0 -3
  30. package/dist/es/models/Align.d.ts +0 -24
  31. package/dist/es/models/Align.js +0 -1
  32. package/dist/es/models/Collision.d.ts +0 -14
  33. package/dist/es/models/Collision.js +0 -1
  34. package/dist/es/models/CollisionType.d.ts +0 -10
  35. package/dist/es/models/CollisionType.js +0 -1
  36. package/dist/es/models/Events.js +0 -1
  37. package/dist/es/models/Margin.d.ts +0 -14
  38. package/dist/es/models/Margin.js +0 -1
  39. package/dist/es/models/Offset.d.ts +0 -14
  40. package/dist/es/models/Offset.js +0 -1
  41. package/dist/es/models/PopupAnimation.d.ts +0 -13
  42. package/dist/es/models/PopupAnimation.js +0 -1
  43. package/dist/es/models/PopupProps.js +0 -1
  44. package/dist/es/models/PopupSettings.d.ts +0 -87
  45. package/dist/es/models/PopupSettings.js +0 -2
  46. package/dist/es/models/PositionMode.d.ts +0 -5
  47. package/dist/es/models/PositionMode.js +0 -1
  48. package/dist/es/package-metadata.d.ts +0 -5
  49. package/dist/es/package-metadata.js +0 -11
  50. package/dist/es/util.d.ts +0 -17
  51. package/dist/es/util.js +0 -58
  52. package/dist/npm/Popup.js +0 -37
  53. package/dist/npm/PopupWithoutContext.js +0 -488
  54. package/dist/npm/animation.d.ts +0 -4
  55. package/dist/npm/animation.js +0 -63
  56. package/dist/npm/main.d.ts +0 -12
  57. package/dist/npm/main.js +0 -8
  58. package/dist/npm/models/Align.js +0 -2
  59. package/dist/npm/models/Collision.js +0 -2
  60. package/dist/npm/models/CollisionType.js +0 -2
  61. package/dist/npm/models/Events.d.ts +0 -36
  62. package/dist/npm/models/Events.js +0 -2
  63. package/dist/npm/models/Margin.js +0 -2
  64. package/dist/npm/models/Offset.d.ts +0 -14
  65. package/dist/npm/models/Offset.js +0 -2
  66. package/dist/npm/models/PopupAnimation.d.ts +0 -13
  67. package/dist/npm/models/PopupAnimation.js +0 -2
  68. package/dist/npm/models/PopupProps.d.ts +0 -116
  69. package/dist/npm/models/PopupProps.js +0 -2
  70. package/dist/npm/models/PopupSettings.d.ts +0 -87
  71. package/dist/npm/models/PopupSettings.js +0 -3
  72. package/dist/npm/models/PositionMode.d.ts +0 -5
  73. package/dist/npm/models/PositionMode.js +0 -2
  74. package/dist/npm/package-metadata.d.ts +0 -5
  75. package/dist/npm/package-metadata.js +0 -14
  76. package/dist/npm/util.js +0 -64
  77. package/dist/systemjs/kendo-react-popup.js +0 -1
  78. package/e2e-legacy/basics.tests.ts +0 -164
  79. package/e2e-next/basic.tests.ts +0 -26
@@ -1,59 +0,0 @@
1
- var clearSlide = function (element) {
2
- element.style.transitionDuration = '';
3
- Array.from(element.classList).forEach(function (c) {
4
- if (c.startsWith('k-slide-')) {
5
- element.classList.remove(c);
6
- }
7
- });
8
- };
9
- var firefox = typeof window !== 'undefined' &&
10
- /Firefox/.test(window.navigator.userAgent);
11
- /**
12
- * @hidden
13
- */
14
- export var slide = function (element, direction, duration, type, callback) {
15
- if (duration === 0) {
16
- return callback();
17
- }
18
- var slideClass = 'k-slide-' + direction + '-' + type;
19
- var slideActiveClass = slideClass + '-active';
20
- var transitionend = function (e) {
21
- // if event is attached using react,
22
- // the animation does not work well in firefox,
23
- // when the show/hide button is toggled quickly.
24
- if (e.target === element) {
25
- element.removeEventListener('transitionend', transitionend);
26
- clearSlide(element);
27
- if (type === 'exit') {
28
- element.style.display = 'none';
29
- }
30
- else {
31
- element.style.display = '';
32
- }
33
- callback();
34
- }
35
- };
36
- element.addEventListener('transitionend', transitionend);
37
- var ownerDocument = element.ownerDocument;
38
- if (!ownerDocument) {
39
- return;
40
- }
41
- var defaultView = ownerDocument.defaultView;
42
- if (!defaultView) {
43
- return;
44
- }
45
- var animate = function () {
46
- clearSlide(element);
47
- element.classList.add(slideClass);
48
- defaultView.requestAnimationFrame(function () {
49
- element.style.transitionDuration = duration + 'ms';
50
- element.classList.add(slideActiveClass);
51
- });
52
- };
53
- if (firefox) {
54
- defaultView.requestAnimationFrame(animate);
55
- }
56
- else {
57
- animate();
58
- }
59
- };
package/dist/es/main.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { Popup, PopupPropsContext } from './Popup';
2
- import { PopupWithoutContext } from './PopupWithoutContext';
3
- import { PopupProps } from './models/PopupProps';
4
- import { Align } from './models/Align';
5
- import { Collision } from './models/Collision';
6
- import { Offset } from './models/Offset';
7
- import { PopupAnimation } from './models/PopupAnimation';
8
- import { OpenEvent as PopupOpenEvent, CloseEvent as PopupCloseEvent } from './models/Events';
9
- import { Margin } from './models/Margin';
10
- import { CollisionType } from './models/CollisionType';
11
- import { PositionMode } from './models/PositionMode';
12
- export { Popup, PopupWithoutContext, PopupPropsContext, PopupProps, Align, Collision, Offset, PopupAnimation, Margin, PositionMode, CollisionType, PopupOpenEvent, PopupCloseEvent };
package/dist/es/main.js DELETED
@@ -1,3 +0,0 @@
1
- import { Popup, PopupPropsContext } from './Popup';
2
- import { PopupWithoutContext } from './PopupWithoutContext';
3
- export { Popup, PopupWithoutContext, PopupPropsContext };
@@ -1,24 +0,0 @@
1
- import { AlignStrategy } from '@progress/kendo-popup-common';
2
- /**
3
- * Defines the horizontal and vertical aligning point of the Popup.
4
- */
5
- export interface Align extends AlignStrategy {
6
- /**
7
- * Defines the possible horizontal point values that are relative to the anchor or the Popup.
8
- *
9
- * The available options are:
10
- * - `left`—Uses the leftmost point of the anchor element.
11
- * - `center`—Uses the center point of the anchor element.
12
- * - `right`—Uses the rightmost point of the anchor element.
13
- */
14
- horizontal: 'left' | 'center' | 'right';
15
- /**
16
- * Defines the possible vertical point values that are relative to the anchor or the Popup.
17
- *
18
- * The available options are:
19
- * - `top`—Uses the top point of the anchor element.
20
- * - `center`—Uses the center point of the anchor element.
21
- * - `bottom`—Uses the bottom point of the anchor element.
22
- */
23
- vertical: 'top' | 'center' | 'bottom';
24
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- import { CollisionType } from './CollisionType';
2
- /**
3
- * Defines the horizontal and vertical collision behavior of the Popup.
4
- */
5
- export interface Collision {
6
- /**
7
- * Defines the horizontal collision behavior of the Popup.
8
- */
9
- horizontal: CollisionType;
10
- /**
11
- * Defines the vertical collision behavior of the Popup.
12
- */
13
- vertical: CollisionType;
14
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import { CollisionType as CollisionTypeBase } from '@progress/kendo-popup-common';
2
- /**
3
- * Defines the possible collision behavior when the Popup is not fully visible.
4
- *
5
- * The available options are:
6
- * - `fit`—Moves the Popup horizontally until it is fully displayed in the viewport.
7
- * - `flip`—Flips the Popup position based on the origin and the position properties.
8
- * - `none`—The Popup is rendered at its original position.
9
- */
10
- export declare type CollisionType = CollisionTypeBase;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- import { MarginSettings } from '@progress/kendo-popup-common';
2
- /**
3
- * Defines the horizontal and the vertical margin offset of the component.
4
- */
5
- export interface Margin extends MarginSettings {
6
- /**
7
- * Defines the possible horizontal margin value.
8
- */
9
- horizontal: number;
10
- /**
11
- * Defines the possible vertical margin value.
12
- */
13
- vertical: number;
14
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- import { OffsetPosition } from '@progress/kendo-popup-common';
2
- /**
3
- * The offset position of the Popup.
4
- */
5
- export interface Offset extends OffsetPosition {
6
- /**
7
- * Defines the top position of the Popup.
8
- */
9
- top: number;
10
- /**
11
- * Defines the left position of the Popup.
12
- */
13
- left: number;
14
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- /**
2
- * The animation settings for the Popup component.
3
- */
4
- export interface PopupAnimation {
5
- /**
6
- * The duration of the opening animation in milliseconds. Defaults to `300ms`.
7
- */
8
- openDuration?: number;
9
- /**
10
- * The duration of the closing animation in milliseconds. Defaults to `300ms`.
11
- */
12
- closeDuration?: number;
13
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -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,2 +0,0 @@
1
- export {};
2
- // tslint:enable:max-line-length
@@ -1,5 +0,0 @@
1
- import { PositionMode as PositionModeBase } from '@progress/kendo-popup-common';
2
- /**
3
- * The type which defines all possible position modes of the Popup.
4
- */
5
- export declare type PositionMode = PositionModeBase;
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import { PackageMetadata } from '@progress/kendo-licensing';
2
- /**
3
- * @hidden
4
- */
5
- export declare const packageMetadata: PackageMetadata;
@@ -1,11 +0,0 @@
1
- /**
2
- * @hidden
3
- */
4
- export var packageMetadata = {
5
- name: '@progress/kendo-react-popup',
6
- productName: 'KendoReact',
7
- productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
8
- publishDate: 1700063458,
9
- version: '',
10
- 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'
11
- };
package/dist/es/util.d.ts DELETED
@@ -1,17 +0,0 @@
1
- import { OffsetPosition } from '@progress/kendo-popup-common';
2
- /**
3
- * @hidden
4
- */
5
- export declare const isDifferentOffset: (oldOffset: OffsetPosition, newOffset: OffsetPosition) => boolean;
6
- /**
7
- * @hidden
8
- */
9
- export declare const hasBoundingRect: (elem: HTMLElement) => boolean;
10
- /**
11
- * @hidden
12
- */
13
- export declare const FRAME_DURATION: number;
14
- /**
15
- * @hidden
16
- */
17
- export declare const throttle: (func: Function, wait: number, options?: any) => () => any;
package/dist/es/util.js DELETED
@@ -1,58 +0,0 @@
1
- /**
2
- * @hidden
3
- */
4
- export var isDifferentOffset = function (oldOffset, newOffset) {
5
- var oldLeft = oldOffset.left, oldTop = oldOffset.top;
6
- var newLeft = newOffset.left, newTop = newOffset.top;
7
- return Math.abs(oldLeft - newLeft) >= 1 || Math.abs(oldTop - newTop) >= 1;
8
- };
9
- /**
10
- * @hidden
11
- */
12
- export var hasBoundingRect = function (elem) { return !!elem.getBoundingClientRect; };
13
- /**
14
- * @hidden
15
- */
16
- export var FRAME_DURATION = 1000 / 60; // 1000ms divided by 60fps
17
- /**
18
- * @hidden
19
- */
20
- export var throttle = function (func, wait, options) {
21
- if (options === void 0) { options = {}; }
22
- var timeout, context, args, result;
23
- var previous = 0;
24
- options = options || {};
25
- var later = function () {
26
- previous = options.leading === false ? 0 : new Date().getTime();
27
- timeout = undefined;
28
- result = func.apply(context, args);
29
- if (!timeout) {
30
- context = args = null;
31
- }
32
- };
33
- var throttled = function () {
34
- var now = new Date().getTime();
35
- if (!previous && options.leading === false) {
36
- previous = now;
37
- }
38
- var remaining = wait - (now - previous);
39
- context = undefined; // this
40
- args = arguments;
41
- if (remaining <= 0 || remaining > wait) {
42
- if (timeout) {
43
- clearTimeout(timeout);
44
- timeout = undefined;
45
- }
46
- previous = now;
47
- result = func.apply(context, args);
48
- if (!timeout) {
49
- context = args = null;
50
- }
51
- }
52
- else if (!timeout && options.trailing !== false) {
53
- timeout = window.setTimeout(later, remaining);
54
- }
55
- return result;
56
- };
57
- return throttled;
58
- };
package/dist/npm/Popup.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.Popup = exports.PopupPropsContext = void 0;
15
- var React = require("react");
16
- var PopupWithoutContext_1 = require("./PopupWithoutContext");
17
- /**
18
- * The PopupPropsContext. It allows to configure the Popup props from a wrapper component.
19
- *
20
- * @example
21
- * ```jsx-no-run
22
- * <PopupPropsContext.Provider value={props => ({ ...props, appendTo: document.querySelector('myPopupsContainer') })}>
23
- * <DropDownList />
24
- * <Editor />
25
- * </PopupPropsContext.Provider>
26
- * ```
27
- */
28
- exports.PopupPropsContext = React.createContext(function (props) { return props; });
29
- /**
30
- * The KendoReact Popup component.
31
- */
32
- exports.Popup = React.forwardRef(function (props, ref) {
33
- var contextPropsCallback = React.useContext(exports.PopupPropsContext);
34
- var popupProps = contextPropsCallback.call(undefined, props);
35
- return (React.createElement(PopupWithoutContext_1.PopupWithoutContext, __assign({ ref: ref }, popupProps)));
36
- });
37
- exports.Popup.displayName = 'Popup';