@progress/kendo-react-popup 4.13.0-dev.202111300702 → 4.13.0

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 (47) hide show
  1. package/dist/cdn/js/kendo-react-popup.js +1 -1
  2. package/dist/es/Popup.d.ts +16 -3
  3. package/dist/es/Popup.js +51 -39
  4. package/dist/es/models/Align.d.ts +2 -1
  5. package/dist/es/models/Margin.d.ts +14 -0
  6. package/dist/es/models/{AlignElementSettings.js → Margin.js} +0 -0
  7. package/dist/es/models/Offset.d.ts +2 -1
  8. package/dist/es/models/PopupSettings.d.ts +37 -13
  9. package/dist/es/models/PositionMode.d.ts +5 -0
  10. package/dist/es/models/{Position.js → PositionMode.js} +0 -0
  11. package/dist/es/package-metadata.js +1 -1
  12. package/dist/es/util.d.ts +1 -39
  13. package/dist/es/util.js +0 -102
  14. package/dist/npm/Popup.d.ts +16 -3
  15. package/dist/npm/Popup.js +66 -54
  16. package/dist/npm/models/Align.d.ts +2 -1
  17. package/dist/npm/models/Margin.d.ts +14 -0
  18. package/dist/npm/models/{AlignElementSettings.js → Margin.js} +0 -0
  19. package/dist/npm/models/Offset.d.ts +2 -1
  20. package/dist/npm/models/PopupSettings.d.ts +37 -13
  21. package/dist/npm/models/PositionMode.d.ts +5 -0
  22. package/dist/npm/models/{Position.js → PositionMode.js} +0 -0
  23. package/dist/npm/package-metadata.js +1 -1
  24. package/dist/npm/util.d.ts +1 -39
  25. package/dist/npm/util.js +0 -102
  26. package/dist/systemjs/kendo-react-popup.js +1 -1
  27. package/package.json +3 -3
  28. package/dist/es/models/AlignElementSettings.d.ts +0 -11
  29. package/dist/es/models/Position.d.ts +0 -8
  30. package/dist/es/models/positionElementSettings.d.ts +0 -13
  31. package/dist/es/models/positionElementSettings.js +0 -0
  32. package/dist/es/services/alignService.d.ts +0 -14
  33. package/dist/es/services/alignService.js +0 -43
  34. package/dist/es/services/domService.d.ts +0 -34
  35. package/dist/es/services/domService.js +0 -140
  36. package/dist/es/services/positionService.d.ts +0 -12
  37. package/dist/es/services/positionService.js +0 -34
  38. package/dist/npm/models/AlignElementSettings.d.ts +0 -11
  39. package/dist/npm/models/Position.d.ts +0 -8
  40. package/dist/npm/models/positionElementSettings.d.ts +0 -13
  41. package/dist/npm/models/positionElementSettings.js +0 -2
  42. package/dist/npm/services/alignService.d.ts +0 -14
  43. package/dist/npm/services/alignService.js +0 -45
  44. package/dist/npm/services/domService.d.ts +0 -34
  45. package/dist/npm/services/domService.js +0 -142
  46. package/dist/npm/services/positionService.d.ts +0 -12
  47. package/dist/npm/services/positionService.js +0 -36
@@ -0,0 +1,5 @@
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;
File without changes
@@ -7,7 +7,7 @@ exports.packageMetadata = {
7
7
  name: '@progress/kendo-react-popup',
8
8
  productName: 'KendoReact',
9
9
  productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
10
- publishDate: 1638254077,
10
+ publishDate: 1638879960,
11
11
  version: '',
12
12
  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'
13
13
  };
@@ -1,16 +1,4 @@
1
- import { ElementRect, OffsetPosition } from '@progress/kendo-popup-common';
2
- /**
3
- * @hidden
4
- */
5
- export declare const eitherRect: (rect: ElementRect, offset: OffsetPosition) => ElementRect;
6
- /**
7
- * @hidden
8
- */
9
- export declare const replaceOffset: (rect: ElementRect, offset: OffsetPosition) => ElementRect;
10
- /**
11
- * @hidden
12
- */
13
- export declare const removeStackingOffset: (rect: ElementRect, stackingOffset: ElementRect) => ElementRect;
1
+ import { OffsetPosition } from '@progress/kendo-popup-common';
14
2
  /**
15
3
  * @hidden
16
4
  */
@@ -19,26 +7,10 @@ export declare const isDifferentOffset: (oldOffset: OffsetPosition, newOffset: O
19
7
  * @hidden
20
8
  */
21
9
  export declare const hasBoundingRect: (elem: HTMLElement) => boolean;
22
- /**
23
- * @hidden
24
- */
25
- export declare const OVERFLOW_REGEXP: RegExp;
26
- /**
27
- * @hidden
28
- */
29
- export declare const scrollableParents: (element: HTMLElement) => any[];
30
10
  /**
31
11
  * @hidden
32
12
  */
33
13
  export declare const FRAME_DURATION: number;
34
- /**
35
- * @hidden
36
- */
37
- export declare const HAS_RELATIVE_STACKING_CONTEXT: boolean;
38
- /**
39
- * @hidden
40
- */
41
- export declare const zIndex: (anchor: HTMLElement, container: HTMLElement) => number;
42
14
  /**
43
15
  * @hidden
44
16
  */
@@ -46,16 +18,6 @@ export declare const CollisionType: {
46
18
  fit: string;
47
19
  flip: string;
48
20
  };
49
- /**
50
- * @hidden
51
- */
52
- export declare const AlignPoint: {
53
- left: string;
54
- center: string;
55
- right: string;
56
- bottom: string;
57
- top: string;
58
- };
59
21
  /**
60
22
  * @hidden
61
23
  */
package/dist/npm/util.js CHANGED
@@ -1,46 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var kendo_popup_common_1 = require("@progress/kendo-popup-common");
4
- var kendo_react_common_1 = require("@progress/kendo-react-common");
5
- /**
6
- * @hidden
7
- */
8
- exports.eitherRect = function (rect, offset) {
9
- if (!rect) {
10
- return { height: 0, left: offset.left, top: offset.top, width: 0 };
11
- }
12
- return rect;
13
- };
14
- /**
15
- * @hidden
16
- */
17
- exports.replaceOffset = function (rect, offset) {
18
- if (!offset) {
19
- return rect;
20
- }
21
- var result = {
22
- height: rect.height,
23
- left: offset.left,
24
- top: offset.top,
25
- width: rect.width
26
- };
27
- return result;
28
- };
29
- /**
30
- * @hidden
31
- */
32
- exports.removeStackingOffset = function (rect, stackingOffset) {
33
- if (!stackingOffset) {
34
- return rect;
35
- }
36
- var result = {
37
- height: rect.height,
38
- left: rect.left - stackingOffset.left,
39
- top: rect.top - stackingOffset.top,
40
- width: rect.width
41
- };
42
- return result;
43
- };
44
3
  /**
45
4
  * @hidden
46
5
  */
@@ -53,61 +12,10 @@ exports.isDifferentOffset = function (oldOffset, newOffset) {
53
12
  * @hidden
54
13
  */
55
14
  exports.hasBoundingRect = function (elem) { return !!elem.getBoundingClientRect; };
56
- /**
57
- * @hidden
58
- */
59
- exports.OVERFLOW_REGEXP = /auto|scroll/;
60
- /**
61
- * @hidden
62
- */
63
- var overflowStyle = function (element) {
64
- var styles = window.getComputedStyle(element);
65
- return "" + styles.overflow + styles.overflowX + styles.overflowY;
66
- };
67
- /**
68
- * @hidden
69
- */
70
- exports.scrollableParents = function (element) {
71
- var parentElements = [];
72
- if (!kendo_react_common_1.canUseDOM) {
73
- return parentElements;
74
- }
75
- var parent = element.parentElement;
76
- while (parent) {
77
- if (exports.OVERFLOW_REGEXP.test(overflowStyle(parent))) {
78
- parentElements.push(parent);
79
- }
80
- parent = parent.parentElement;
81
- }
82
- parentElements.push(window);
83
- return parentElements;
84
- };
85
15
  /**
86
16
  * @hidden
87
17
  */
88
18
  exports.FRAME_DURATION = 1000 / 60; // 1000ms divided by 60fps
89
- /**
90
- * @hidden
91
- */
92
- exports.HAS_RELATIVE_STACKING_CONTEXT = kendo_react_common_1.hasRelativeStackingContext();
93
- /**
94
- * @hidden
95
- */
96
- exports.zIndex = function (anchor, container) {
97
- if (!anchor || !kendo_react_common_1.canUseDOM) {
98
- return null;
99
- }
100
- var sibling = kendo_popup_common_1.siblingContainer(anchor, container);
101
- if (!sibling) {
102
- return null;
103
- }
104
- var result = [anchor].concat(kendo_popup_common_1.parents(anchor, sibling)).reduce(function (index, p) {
105
- var zIndexStyle = p.style.zIndex || window.getComputedStyle(p).zIndex;
106
- var current = parseInt(zIndexStyle, 10);
107
- return current > index ? current : index;
108
- }, 0);
109
- return result ? (result + 1) : null;
110
- };
111
19
  /**
112
20
  * @hidden
113
21
  */
@@ -115,16 +23,6 @@ exports.CollisionType = {
115
23
  fit: 'fit',
116
24
  flip: 'flip'
117
25
  };
118
- /**
119
- * @hidden
120
- */
121
- exports.AlignPoint = {
122
- left: 'left',
123
- center: 'center',
124
- right: 'right',
125
- bottom: 'bottom',
126
- top: 'top'
127
- };
128
26
  /**
129
27
  * @hidden
130
28
  */
@@ -1 +1 @@
1
- System.register("@progress/kendo-react-popup",["react","react-dom","prop-types","@progress/kendo-react-common","@progress/kendo-popup-common"],function(r){var s,p,l,a,c;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){s=e(t)},function(t){p=e(t)},function(t){l=e(t)},function(t){a=e(t)},function(t){c=e(t)}],execute:function(){function i(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}var n,o;n=[function(t,e){t.exports=a},function(t,o,e){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=e(3),i=e(0);o.eitherRect=function(t,e){return t||{height:0,left:e.left,top:e.top,width:0}},o.replaceOffset=function(t,e){return e?{height:t.height,left:e.left,top:e.top,width:t.width}:t},o.removeStackingOffset=function(t,e){return e?{height:t.height,left:t.left-e.left,top:t.top-e.top,width:t.width}:t},o.isDifferentOffset=function(t,e){var n=t.left,o=t.top,t=e.left,e=e.top;return 1<=Math.abs(n-t)||1<=Math.abs(o-e)},o.hasBoundingRect=function(t){return!!t.getBoundingClientRect},o.OVERFLOW_REGEXP=/auto|scroll/;o.scrollableParents=function(t){var e=[];if(!i.canUseDOM)return e;for(var n=t.parentElement;n;)o.OVERFLOW_REGEXP.test(function(t){t=window.getComputedStyle(t);return""+t.overflow+t.overflowX+t.overflowY}(n))&&e.push(n),n=n.parentElement;return e.push(window),e},o.FRAME_DURATION=1e3/60,o.HAS_RELATIVE_STACKING_CONTEXT=i.hasRelativeStackingContext(),o.zIndex=function(t,e){if(!t||!i.canUseDOM)return null;e=n.siblingContainer(t,e);if(!e)return null;e=[t].concat(n.parents(t,e)).reduce(function(t,e){e=e.style.zIndex||window.getComputedStyle(e).zIndex,e=parseInt(e,10);return t<e?e:t},0);return e?e+1:null},o.CollisionType={fit:"fit",flip:"flip"},o.AlignPoint={left:"left",center:"center",right:"right",bottom:"bottom",top:"top"},o.throttle=function(n,o,i){var r,s,p,l,a=0;i=(i=void 0===i?{}:i)||{};function c(){a=!1===i.leading?0:(new Date).getTime(),r=null,l=n.apply(s,p),r||(s=p=null)}return function(){var t=(new Date).getTime();a||!1!==i.leading||(a=t);var e=o-(t-a);return s=this,p=arguments,e<=0||o<e?(r&&(clearTimeout(r),r=null),a=t,l=n.apply(s,p),r||(s=p=null)):r||!1===i.trailing||(r=window.setTimeout(c,e)),l}}},function(t,e){t.exports=s},function(t,e){t.exports=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n=n(5);e.Popup=n.Popup,e.PopupPropsContext=n.PopupPropsContext,function(t){for(var e in t)r(e,t[e])}(e)},function(t,n,e){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(n,"__esModule",{value:!0});var i=e(2),r=e(6);n.PopupPropsContext=i.createContext(function(t){return t}),n.Popup=i.forwardRef(function(t,e){t=i.useContext(n.PopupPropsContext).call(void 0,t);return i.createElement(r.Popup,o({ref:e},t))})},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=this&&this.__assign||function(){return(d=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var a=n(2),c=n(7),r=n(8),s=n(9),u=n(0),p=n(1),l=n(10),f=n(11),h=n(12),m=n(0),g=n(13);function v(t,e){if(t===e)return 1;if(!!t==!!e){var n=Object.getOwnPropertyNames(t),o=Object.getOwnPropertyNames(e);if(n.length===o.length){for(var i=0;i<n.length;i++){var r=n[i];if(t[r]!==e[r])return}return 1}}}var y,w={left:-1e3,top:0};(n=y=y||{}).hiding="hiding",n.hidden="hidden",n.showing="showing",n.shown="shown",n.reposition="reposition";var _,w=(_=a.Component,i(P,_),P.getDerivedStateFromProps=function(t,e){var n=t.show,o=t.anchor,i=t.anchorAlign,r=t.appendTo,s=t.collision,p=t.popupAlign,l=t.className,a=t.popupClass,c=t.style,u=t.offset,f=t.contentKey,f=d({},e,{props:{show:n,anchor:o,anchorAlign:i,appendTo:r,collision:s,popupAlign:p,className:l,popupClass:a,style:c,offset:u,contentKey:f}});return t.show?e.current===y.hidden||e.current===y.hiding?d({},f,{current:y.showing,previous:e.current}):e.current===y.showing?d({},f,{current:y.shown,previous:e.current}):e.current!==y.shown||v(u,e.props.offset)&&v(i,e.props.anchorAlign)&&v(r,e.props.appendTo)&&v(s,e.props.collision)&&v(p,e.props.popupAlign)&&v(c,e.props.style)&&o===e.props.anchor&&a===e.props.popupClass&&l===e.props.className?f:d({},f,{current:y.reposition,previous:e.current}):e.current===y.hiding||e.current===y.hidden?d({},f,{current:y.hidden,previous:e.current}):d({},f,{current:y.hiding,previous:e.current})},P.prototype.componentDidUpdate=function(t){this.state.current===y.showing&&this._popup?this.show(this._popup):this.state.current===y.hiding&&this._popup?(this.onClosing(this._popup),this.animate(this._popup.firstChild,"exit",this.onClosed)):this.state.current===y.reposition&&this.state.previous===y.shown?this.setState({current:y.shown,previous:this.state.current}):this.state.current===y.shown&&t.contentKey!==this.props.contentKey&&this._popup&&this.setPosition(this._popup)},P.prototype.componentDidMount=function(){this.state.current===y.showing&&this._popup&&this.show(this._popup)},P.prototype.componentWillUnmount=function(){this.detachRepositionHandlers()},P.prototype.render=function(){var e=this,t=this.props,n=t.children,o=t.className,i=t.popupClass,r=t.show,s=t.id,p=this.props.appendTo||(u.canUseDOM?(this.props.anchor&&this.props.anchor.ownerDocument?this.props.anchor.ownerDocument:document).body:void 0);this.state.current===y.reposition&&this.state.previous===y.shown&&this._popup&&this.setPosition(this._popup);var l=Object.assign({},{position:"absolute"},this.props.style||{}),t=this.state.current===y.hiding;if((r||t)&&p){n=a.createElement("div",{className:u.classNames("k-animation-container","k-animation-container-relative",o),id:s,ref:function(t){return e._popup=t},style:l},a.createElement("div",{className:u.classNames(i,"k-popup","k-child-animation-container"),style:{transitionDelay:"0ms"}},n));return c.createPortal(n,p)}return null},Object.defineProperty(P.prototype,"animationDuration",{get:function(){var t=this.props.animate,e=0,n=0;return t&&(!0===t?e=n=300:(e=t.openDuration||0,n=t.closeDuration||0)),{enter:e,exit:n}},enumerable:!0,configurable:!0}),P.prototype.attachRepositionHandlers=function(t){var e=this;this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.props.anchor||t),this._scrollableParents.map(function(t){return t.addEventListener("scroll",e.reposition)}),window.addEventListener("resize",this.reposition)},P.prototype.detachRepositionHandlers=function(){var e=this;this._scrollableParents&&(this._scrollableParents.map(function(t){return t.removeEventListener("scroll",e.reposition)}),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)},P.prototype.reposition=function(){this.setState({current:y.reposition,previous:this.state.current})},P.propTypes={anchor:function(t){t=t.anchor;return t&&"number"!=typeof t.nodeType?new Error("Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."):null},appendTo:function(t){t=t.appendTo;return t&&"number"!=typeof t.nodeType?new Error("Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."):null},className:r.string,id:r.string,popupClass:r.string,collision:r.shape({horizontal:r.oneOf([p.CollisionType.fit,p.CollisionType.flip]),vertical:r.oneOf([p.CollisionType.fit,p.CollisionType.flip])}),anchorAlign:r.shape({horizontal:r.oneOf([p.AlignPoint.left,p.AlignPoint.center,p.AlignPoint.right]),vertical:r.oneOf([p.AlignPoint.top,p.AlignPoint.center,p.AlignPoint.bottom])}),popupAlign:r.shape({horizontal:r.oneOf([p.AlignPoint.left,p.AlignPoint.center,p.AlignPoint.right]),vertical:r.oneOf([p.AlignPoint.top,p.AlignPoint.center,p.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})])},P.defaultProps={collision:{horizontal:p.CollisionType.fit,vertical:p.CollisionType.flip},anchorAlign:{horizontal:p.AlignPoint.left,vertical:p.AlignPoint.bottom},popupAlign:{horizontal:p.AlignPoint.left,vertical:p.AlignPoint.top},offset:w,animate:!0,show:!1},P);function P(t){var a=_.call(this,t)||this;return a.state={current:y.hidden,previous:y.hidden,props:{}},a._popup=null,a.show=function(t){a.setPosition(t),a.animate(t.firstChild,"enter",a.onOpened),a.setState({current:y.shown,previous:a.state.current})},a.setPosition=function(t){var e=a.props,n=e.anchorAlign,o=e.popupAlign,i=e.collision,r=e.offset,s=e.anchor,p=t.firstElementChild,l=getComputedStyle(p),e=l.width,l=l.height;p.style.position="absolute",p.style.width=e,p.style.height=l;r=a._alignService.alignElement({anchor:s,element:p,elementAlign:o,anchorAlign:n,offset:r}),o=a._positionService.positionElement({anchor:s,anchorAlign:n,collisions:i,element:p,currentLocation:r,elementAlign:o});o.offset&&(t.style.top=o.offset.top+"px",t.style.left=o.offset.left+"px",p.style.position="",p.style.width="",p.style.height=""),a._flipped=o.flipped},a.onOpened=function(){var t=a._popup;t&&(a.props.show&&t.classList.add("k-animation-container-shown"),a.attachRepositionHandlers(t),a.props.onOpen&&a.props.onOpen.call(void 0,{target:a}))},a.animate=function(t,e,n){s.slide(t,a._flipped?"up":"down",a.animationDuration[e],e,n)},a.onClosing=function(t){a.props.show||t.classList.remove("k-animation-container-shown"),a.detachRepositionHandlers()},a.onClosed=function(){a.state.current===y.hiding&&a.state.previous===y.shown&&a.setState({current:y.hidden,previous:a.state.current}),a.props.onClose&&a.props.onClose.call(void 0,{target:a})},m.validatePackage(g.packageMetadata),a._domService=new f.DOMService,a._alignService=new l.AlignService(a._domService),a._positionService=new h.PositionService(a._domService),a.reposition=p.throttle(a.reposition.bind(a),p.FRAME_DURATION),a}e.Popup=w},function(t,e){t.exports=p},function(t,e){t.exports=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});function a(t){t.style.transitionDuration="",t.classList.remove("k-slide-down-appear","k-slide-down-appear-active","k-slide-down-exit","k-slide-down-exit-active","k-slide-up-appear","k-slide-up-appear-active","k-slide-up-exit","k-slide-up-exit-active")}var c="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);e.slide=function(t,e,n,o,i){if(0===n)return i();function r(){t.removeEventListener("transitionend",r),a(t),i()}var s="k-slide-"+e+"-"+o,p=s+"-active";t.addEventListener("transitionend",r);var l,o=t.ownerDocument;!o||(l=o.defaultView)&&(o=function(){a(t),t.classList.add(s),l.requestAnimationFrame(function(){t.style.transitionDuration=n+"ms",t.classList.add(p)})},c?l.requestAnimationFrame(o):o())}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),n=(o.prototype.alignElement=function(t){var e=t.anchor,n=t.element,o=t.anchorAlign,i=t.elementAlign,t=t.offset,t=this._dom.hasOffsetParent(n)?this.relativeRect(e,n,t):this.absoluteRect(e,n,t);return this._dom.align({anchorAlign:o,anchorRect:t,elementAlign:i,elementRect:this._dom.offset(n)})},o.prototype.absoluteRect=function(t,e,n){var o=this._dom,i=r.eitherRect(o.offset(t),n),n=o.stackingElementOffset(e),i=r.removeStackingOffset(i,n),n=o.stackingElementScroll(e),n=o.addScroll(i,n),e=this.elementScrollPosition(t,e),e=o.removeScroll(n,e);return e.left+=window.scrollX||window.pageXOffset,e.top+=window.scrollY||window.pageYOffset,e},o.prototype.elementScrollPosition=function(t,e){return t?{x:0,y:0}:this._dom.scrollPosition(e)},o.prototype.relativeRect=function(t,e,n){return r.eitherRect(this._dom.position(t,e),n)},o);function o(t){this._dom=t}e.AlignService=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(1),r=n(0),n=(s.prototype.addOffset=function(t,e){return{left:t.left+e.left,top:t.top+e.top}},s.prototype.align=function(t){return i.align(t)},s.prototype.boundingOffset=function(t){return i.boundingOffset(t)},s.prototype.getWindow=function(){return r.canUseDOM?window:null},s.prototype.isBodyOffset=function(t){return i.isBodyOffset(t)},s.prototype.hasOffsetParent=function(t){if(!t)return!1;t=t.offsetParent;return t&&!("BODY"===t.nodeName&&"static"===window.getComputedStyle(t).position)},s.prototype.offset=function(t){return t?i.offset(t):null},s.prototype.staticOffset=function(t){if(!t)return null;var e=t.style,n=e.left,o=e.top;t.style.left="0px",t.style.top="0px";e=i.offset(t);return t.style.left=n,t.style.top=o,e},s.prototype.position=function(t,e){if(!t||!e)return null;e=i.siblingContainer(t,e);return i.positionWithScroll(t,e)},s.prototype.relativeOffset=function(t,e){return i.applyLocationOffset(this.offset(t),e,this.isBodyOffset(t))},s.prototype.addScroll=function(t,e){return i.addScroll(t,e)},s.prototype.removeScroll=function(t,e){return i.removeScroll(t,e)},s.prototype.restrictToView=function(t){return i.restrictToView(t)},s.prototype.scrollPosition=function(t){return i.scrollPosition(t)},s.prototype.scrollableParents=function(t){return o.scrollableParents(t)},s.prototype.stackingElementOffset=function(t){t=this.getRelativeContextElement(t);return t?i.offset(t):null},s.prototype.stackingElementScroll=function(t){t=this.getRelativeContextElement(t);return t?{x:t.scrollLeft,y:t.scrollTop}:{x:0,y:0}},s.prototype.stackingElementViewPort=function(t){t=this.getRelativeContextElement(t);return t?{height:t.scrollHeight,width:t.scrollWidth}:null},s.prototype.getRelativeContextElement=function(t){if(!t||!o.HAS_RELATIVE_STACKING_CONTEXT)return null;for(var e=t.parentElement;e;){if("none"!==window.getComputedStyle(e).transform)return e;e=e.parentElement}return null},s.prototype.useRelativePosition=function(t){return!!this.getRelativeContextElement(t)},s.prototype.windowViewPort=function(t){return i.getWindowViewPort(t)},s.prototype.zIndex=function(t,e){return o.zIndex(t,e)},s.prototype.zoomLevel=function(){return r.canUseDOM?parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2)):1},s.prototype.isZoomed=function(){return 1<this.zoomLevel()},s);function s(){}e.DOMService=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=n(1),n=(o.prototype.positionElement=function(t){var e=t.anchor,n=t.currentLocation,o=t.element,i=t.anchorAlign,r=t.elementAlign,s=t.collisions,p=this._dom,t=t.viewPort||p.stackingElementViewPort(o)||p.windowViewPort(o),e=l.eitherRect(p.offset(e),n),n=l.replaceOffset(p.staticOffset(o),n),o=this.elementRect(o,n),t=p.restrictToView({anchorAlign:i,anchorRect:e,collisions:s,elementAlign:r,elementRect:o,viewPort:t});return{flipped:t.flipped,offset:p.addOffset(n,t.offset)}},o.prototype.elementRect=function(t,e){return this._dom.removeScroll(e,this._dom.scrollPosition(t))},o);function o(t){this._dom=t}e.PositionService=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.packageMetadata={name:"@progress/kendo-react-popup",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1638254077,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"}}],o={},i.m=n,i.c=o,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=4)}}});
1
+ System.register("@progress/kendo-react-popup",["react","prop-types","@progress/kendo-react-common","react-dom","@progress/kendo-popup-common"],function(r){var s,p,a,l,u;function t(e){return e.__useDefault?e.default:e}return{setters:[function(e){s=t(e)},function(e){p=t(e)},function(e){a=t(e)},function(e){l=t(e)},function(e){u=t(e)}],execute:function(){function i(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var n,o;o={},i.m=n=[function(e,t){e.exports=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n=n(2);t.Popup=n.Popup,t.PopupPropsContext=n.PopupPropsContext,function(e){for(var t in e)r(t,e[t])}(t)},function(e,n,t){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(n,"__esModule",{value:!0});var i=t(0),r=t(3);n.PopupPropsContext=i.createContext(function(e){return e}),n.Popup=i.forwardRef(function(e,t){e=i.useContext(n.PopupPropsContext).call(void 0,e);return i.createElement(r.Popup,o({ref:t},e))})},function(e,t,n){"use strict";var o,i=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f=this&&this.__assign||function(){return(f=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),u=n(4),r=n(5),s=n(6),c=n(7),d=n(8),p=n(9),a=n(10);function h(e,t){if(e===t)return 1;if(!!e==!!t){var n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);if(n.length===o.length){for(var i=0;i<n.length;i++){var r=n[i];if(e[r]!==t[r])return}return 1}}}var g,m={left:-1e3,top:0};(n=g=g||{}).hiding="hiding",n.hidden="hidden",n.showing="showing",n.shown="shown",n.reposition="reposition";var v,m=(v=l.Component,i(y,v),y.getDerivedStateFromProps=function(e,t){var n=e.show,o=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,d=f({},t,{props:{show:n,anchor:o,anchorAlign:i,appendTo:r,collision:s,popupAlign:p,className:a,popupClass:l,style:u,offset:c,contentKey:d}});return e.show?t.current===g.hidden||t.current===g.hiding?f({},d,{current:g.showing,previous:t.current}):t.current===g.showing?f({},d,{current:g.shown,previous:t.current}):t.current!==g.shown||h(c,t.props.offset)&&h(i,t.props.anchorAlign)&&h(r,t.props.appendTo)&&h(s,t.props.collision)&&h(p,t.props.popupAlign)&&h(u,t.props.style)&&o===t.props.anchor&&l===t.props.popupClass&&a===t.props.className?d:f({},d,{current:g.reposition,previous:t.current}):t.current===g.hiding||t.current===g.hidden?f({},d,{current:g.hidden,previous:t.current}):f({},d,{current:g.hiding,previous:t.current})},y.prototype.componentDidUpdate=function(e){this.state.current===g.showing&&this._popup?this.show(this._popup):this.state.current===g.hiding&&this._popup?(this.onClosing(this._popup),this.animate(this._popup.firstChild,"exit",this.onClosed)):this.state.current===g.reposition&&this.state.previous===g.shown?this.setState({current:g.shown,previous:this.state.current}):this.state.current===g.shown&&e.contentKey!==this.props.contentKey&&this._popup&&this.setPosition(this._popup)},y.prototype.componentDidMount=function(){this.state.current===g.showing&&this._popup&&this.show(this._popup)},y.prototype.componentWillUnmount=function(){this.detachRepositionHandlers()},y.prototype.render=function(){var t=this,e=this.props,n=e.children,o=e.className,i=e.popupClass,r=e.show,s=e.id,p=e.positionMode,a=this.props.appendTo||(c.canUseDOM?(this.props.anchor&&this.props.anchor.ownerDocument?this.props.anchor.ownerDocument:document).body:void 0);this.state.current===g.reposition&&this.state.previous===g.shown&&this._popup&&this.setPosition(this._popup);e=Object.assign({},{position:p},this.props.style||{}),p=this.state.current===g.hiding;if((r||p)&&a){p=this.getCurrentZIndex(),n=l.createElement(c.ZIndexContext.Provider,{value:p},l.createElement("div",{className:c.classNames("k-animation-container","k-animation-container-relative",o),id:s,ref:function(e){return t._popup=e},style:f({zIndex:p},e)},l.createElement("div",{className:c.classNames(i,"k-popup","k-child-animation-container"),style:{transitionDelay:"0ms"}},n)));return u.createPortal(n,a)}return null},Object.defineProperty(y.prototype,"animationDuration",{get:function(){var e=this.props.animate,t=0,n=0;return e&&(!0===e?t=n=300:(t=e.openDuration||0,n=e.closeDuration||0)),{enter:t,exit:n}},enumerable:!0,configurable:!0}),y.prototype.attachRepositionHandlers=function(e){var t=this;this.detachRepositionHandlers(),this._scrollableParents=d.domUtils.scrollableParents(this.props.anchor||e),this._scrollableParents.map(function(e){return e.addEventListener("scroll",t.reposition)}),window.addEventListener("resize",this.reposition)},y.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)},y.prototype.reposition=function(){this.setState({current:g.reposition,previous:this.state.current})},y.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.string,id:r.string,popupClass:r.string,collision:r.shape({horizontal:r.oneOf([p.CollisionType.fit,p.CollisionType.flip]),vertical:r.oneOf([p.CollisionType.fit,p.CollisionType.flip])}),anchorAlign:r.shape({horizontal:r.oneOf([d.AlignPoint.left,d.AlignPoint.center,d.AlignPoint.right]),vertical:r.oneOf([d.AlignPoint.top,d.AlignPoint.center,d.AlignPoint.bottom])}),popupAlign:r.shape({horizontal:r.oneOf([d.AlignPoint.left,d.AlignPoint.center,d.AlignPoint.right]),vertical:r.oneOf([d.AlignPoint.top,d.AlignPoint.center,d.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},y.defaultProps={collision:{horizontal:p.CollisionType.fit,vertical:p.CollisionType.flip},anchorAlign:{horizontal:d.AlignPoint.left,vertical:d.AlignPoint.bottom},popupAlign:{horizontal:d.AlignPoint.left,vertical:d.AlignPoint.top},offset:m,animate:!0,show:!1,margin:{horizontal:0,vertical:0},positionMode:"absolute"},y.contextType=c.ZIndexContext,y);function y(e){var l=v.call(this,e)||this;return l.state={current:g.hidden,previous:g.hidden,props:{}},l._popup=null,l.show=function(e){l.setPosition(e),l.animate(e.firstChild,"enter",l.onOpened),l.setState({current:g.shown,previous:l.state.current})},l.setPosition=function(e){var t=l.props,n=t.anchorAlign,o=t.popupAlign,i=t.collision,r=t.offset,s=t.anchor,p=t.margin,a=t.scale,t=t.positionMode;e.style.top="0px",e.style.left="-10000px";a=d.alignElement({anchor:s,element:e,elementAlign:o,anchorAlign:n,offset:r,margin:p,positionMode:t,scale:a}),o=d.positionElement({anchor:s,anchorAlign:n,collisions:i,element:e,currentLocation:a,elementAlign:o,margin:l.props.margin});e.style.top=o.offset.top+"px",e.style.left=o.offset.left+"px",l._flipped=o.flipped},l.onOpened=function(){var e=l._popup;e&&(l.props.show&&e.classList.add("k-animation-container-shown"),l.attachRepositionHandlers(e),l.props.onOpen&&l.props.onOpen.call(void 0,{target:l}))},l.animate=function(e,t,n){s.slide(e,l._flipped?"up":"down",l.animationDuration[t],t,n)},l.onClosing=function(e){l.props.show||e.classList.remove("k-animation-container-shown"),l.detachRepositionHandlers()},l.onClosed=function(){l.state.current===g.hiding&&l.state.previous===g.shown&&l.setState({current:g.hidden,previous:l.state.current}),l.props.onClose&&l.props.onClose.call(void 0,{target:l})},l.getCurrentZIndex=function(){return l.context?l.context+1:100},c.validatePackage(a.packageMetadata),l.reposition=p.throttle(l.reposition.bind(l),p.FRAME_DURATION),l}t.Popup=m},function(e,t){e.exports=l},function(e,t){e.exports=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function l(e){e.style.transitionDuration="",e.classList.remove("k-slide-down-appear","k-slide-down-appear-active","k-slide-down-exit","k-slide-down-exit-active","k-slide-up-appear","k-slide-up-appear-active","k-slide-up-exit","k-slide-up-exit-active")}var u="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent);t.slide=function(e,t,n,o,i){if(0===n)return i();function r(){e.removeEventListener("transitionend",r),l(e),i()}var s="k-slide-"+t+"-"+o,p=s+"-active";e.addEventListener("transitionend",r);var a,o=e.ownerDocument;!o||(a=o.defaultView)&&(o=function(){l(e),e.classList.add(s),a.requestAnimationFrame(function(){e.style.transitionDuration=n+"ms",e.classList.add(p)})},u?a.requestAnimationFrame(o):o())}},function(e,t){e.exports=a},function(e,t){e.exports=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDifferentOffset=function(e,t){var n=e.left,o=e.top,e=t.left,t=t.top;return 1<=Math.abs(n-e)||1<=Math.abs(o-t)},t.hasBoundingRect=function(e){return!!e.getBoundingClientRect},t.FRAME_DURATION=1e3/60,t.CollisionType={fit:"fit",flip:"flip"},t.throttle=function(n,o,i){var r,s,p,a,l=0;i=(i=void 0===i?{}:i)||{};function u(){l=!1===i.leading?0:(new Date).getTime(),r=null,a=n.apply(s,p),r||(s=p=null)}return function(){var e=(new Date).getTime();l||!1!==i.leading||(l=e);var t=o-(e-l);return s=this,p=arguments,t<=0||o<t?(r&&(clearTimeout(r),r=null),l=e,a=n.apply(s,p),r||(s=p=null)):r||!1===i.trailing||(r=window.setTimeout(u,t)),a}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata={name:"@progress/kendo-react-popup",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1638879960,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"}}],i.c=o,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}}});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-popup",
3
3
  "description": "KendoReact Popup package",
4
- "version": "4.13.0-dev.202111300702",
4
+ "version": "4.13.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/telerik/kendo-react.git"
@@ -35,8 +35,8 @@
35
35
  "react-dom": "^16.8.2 || ^17.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@progress/kendo-popup-common": "^1.2.2",
39
- "@progress/kendo-react-common": "4.13.0-dev.202111300702",
38
+ "@progress/kendo-popup-common": "1.9.0-dev.202111301350",
39
+ "@progress/kendo-react-common": "4.13.0",
40
40
  "prop-types": "^15.6.0"
41
41
  },
42
42
  "@progress": {
@@ -1,11 +0,0 @@
1
- import { AlignStrategy, OffsetPosition } from '@progress/kendo-popup-common';
2
- /**
3
- * @hidden
4
- */
5
- export interface AlignElementSettings {
6
- anchor?: HTMLElement | null;
7
- anchorAlign: AlignStrategy;
8
- element: HTMLElement;
9
- elementAlign: AlignStrategy;
10
- offset?: OffsetPosition;
11
- }
@@ -1,8 +0,0 @@
1
- import { OffsetPosition as Offset } from '@progress/kendo-popup-common';
2
- /**
3
- * @hidden
4
- */
5
- export interface Position {
6
- flipped?: boolean;
7
- offset?: Offset;
8
- }
@@ -1,13 +0,0 @@
1
- import { AlignStrategy, CollisionStrategy, OffsetPosition, ViewPort } from '@progress/kendo-popup-common';
2
- /**
3
- * @hidden
4
- */
5
- export interface PositionElementSettings {
6
- anchor?: HTMLElement | null;
7
- anchorAlign: AlignStrategy;
8
- collisions: CollisionStrategy;
9
- currentLocation: OffsetPosition;
10
- element: HTMLElement;
11
- elementAlign: AlignStrategy;
12
- viewPort?: ViewPort;
13
- }
File without changes
@@ -1,14 +0,0 @@
1
- import { DOMService } from './domService';
2
- import { OffsetPosition as Offset } from '@progress/kendo-popup-common';
3
- import { AlignElementSettings } from '../models/AlignElementSettings';
4
- /**
5
- * @hidden
6
- */
7
- export declare class AlignService {
8
- private _dom;
9
- constructor(_dom: DOMService);
10
- alignElement(settings: AlignElementSettings): Offset;
11
- private absoluteRect;
12
- private elementScrollPosition;
13
- private relativeRect;
14
- }
@@ -1,43 +0,0 @@
1
- import { eitherRect, removeStackingOffset } from '../util';
2
- /**
3
- * @hidden
4
- */
5
- var AlignService = /** @class */ (function () {
6
- function AlignService(_dom) {
7
- this._dom = _dom;
8
- }
9
- AlignService.prototype.alignElement = function (settings) {
10
- var anchor = settings.anchor, element = settings.element, anchorAlign = settings.anchorAlign, elementAlign = settings.elementAlign, offset = settings.offset;
11
- var fixedMode = !this._dom.hasOffsetParent(element);
12
- var anchorRect = fixedMode ?
13
- this.absoluteRect(anchor, element, offset) :
14
- this.relativeRect(anchor, element, offset);
15
- return this._dom.align({
16
- anchorAlign: anchorAlign,
17
- anchorRect: anchorRect,
18
- elementAlign: elementAlign,
19
- elementRect: this._dom.offset(element)
20
- });
21
- };
22
- AlignService.prototype.absoluteRect = function (anchor, element, offset) {
23
- var dom = this._dom;
24
- var rect = eitherRect(dom.offset(anchor), offset);
25
- var stackingOffset = dom.stackingElementOffset(element);
26
- var removedOffset = removeStackingOffset(rect, stackingOffset);
27
- var stackingScroll = dom.stackingElementScroll(element);
28
- var withScroll = dom.addScroll(removedOffset, stackingScroll);
29
- var scrollPosition = this.elementScrollPosition(anchor, element);
30
- var result = dom.removeScroll(withScroll, scrollPosition);
31
- result.left += window.scrollX || window.pageXOffset;
32
- result.top += window.scrollY || window.pageYOffset;
33
- return result;
34
- };
35
- AlignService.prototype.elementScrollPosition = function (anchor, element) {
36
- return anchor ? { x: 0, y: 0 } : this._dom.scrollPosition(element);
37
- };
38
- AlignService.prototype.relativeRect = function (anchor, element, offset) {
39
- return eitherRect(this._dom.position(anchor, element), offset);
40
- };
41
- return AlignService;
42
- }());
43
- export { AlignService };
@@ -1,34 +0,0 @@
1
- import { AlignSettings, BoundingRect, ElementRect, OffsetPosition, PositionSettings, ScrollInfo, ViewPort } from '@progress/kendo-popup-common';
2
- import { Position } from '../models/Position';
3
- /**
4
- * @hidden
5
- */
6
- export declare class DOMService {
7
- addOffset(current: OffsetPosition, addition: OffsetPosition): OffsetPosition;
8
- align(settings: AlignSettings): OffsetPosition;
9
- boundingOffset(el: HTMLElement): BoundingRect;
10
- getWindow(): Window;
11
- isBodyOffset(el: HTMLElement): boolean;
12
- hasOffsetParent(el: HTMLElement): boolean | null;
13
- offset(el: HTMLElement): ElementRect;
14
- staticOffset(element: HTMLElement): ElementRect;
15
- position(element: HTMLElement, popup: HTMLElement): ElementRect;
16
- relativeOffset(el: HTMLElement, currentLocation: OffsetPosition): ElementRect;
17
- addScroll(rect: ElementRect, scroll: ScrollInfo): ElementRect;
18
- removeScroll(rect: ElementRect, scroll: ScrollInfo): ElementRect;
19
- restrictToView(settings: PositionSettings): Position;
20
- scrollPosition(el: HTMLElement): ScrollInfo;
21
- scrollableParents(el: HTMLElement): Array<HTMLElement>;
22
- stackingElementOffset(el: HTMLElement): ElementRect;
23
- stackingElementScroll(el: HTMLElement): ScrollInfo;
24
- stackingElementViewPort(el: HTMLElement): {
25
- height: number;
26
- width: number;
27
- };
28
- getRelativeContextElement(el: HTMLElement): HTMLElement;
29
- useRelativePosition(el: HTMLElement): boolean;
30
- windowViewPort(el: HTMLElement): ViewPort;
31
- zIndex(anchor: HTMLElement, container: HTMLElement): number;
32
- zoomLevel(): number;
33
- isZoomed(): boolean;
34
- }
@@ -1,140 +0,0 @@
1
- import { align, applyLocationOffset, boundingOffset, getWindowViewPort, isBodyOffset, offset, positionWithScroll, restrictToView, addScroll, removeScroll, scrollPosition, siblingContainer } from '@progress/kendo-popup-common';
2
- import { HAS_RELATIVE_STACKING_CONTEXT, scrollableParents, zIndex } from '../util';
3
- import { canUseDOM } from '@progress/kendo-react-common';
4
- /**
5
- * @hidden
6
- */
7
- var DOMService = /** @class */ (function () {
8
- function DOMService() {
9
- }
10
- DOMService.prototype.addOffset = function (current, addition) {
11
- return {
12
- left: current.left + addition.left,
13
- top: current.top + addition.top
14
- };
15
- };
16
- DOMService.prototype.align = function (settings) {
17
- return align(settings);
18
- };
19
- DOMService.prototype.boundingOffset = function (el) {
20
- return boundingOffset(el);
21
- };
22
- DOMService.prototype.getWindow = function () {
23
- return canUseDOM ? window : null;
24
- };
25
- DOMService.prototype.isBodyOffset = function (el) {
26
- return isBodyOffset(el);
27
- };
28
- DOMService.prototype.hasOffsetParent = function (el) {
29
- if (!el) {
30
- return false;
31
- }
32
- var offsetParentEl = el.offsetParent;
33
- return offsetParentEl &&
34
- !(offsetParentEl.nodeName === 'BODY' &&
35
- window.getComputedStyle(offsetParentEl).position === 'static');
36
- };
37
- DOMService.prototype.offset = function (el) {
38
- if (!el) {
39
- return null;
40
- }
41
- return offset(el);
42
- };
43
- DOMService.prototype.staticOffset = function (element) {
44
- if (!element) {
45
- return null;
46
- }
47
- var _a = element.style, left = _a.left, top = _a.top;
48
- element.style.left = '0px';
49
- element.style.top = '0px';
50
- var currentOffset = offset(element);
51
- element.style.left = left;
52
- element.style.top = top;
53
- return currentOffset;
54
- };
55
- DOMService.prototype.position = function (element, popup) {
56
- if (!element || !popup) {
57
- return null;
58
- }
59
- var parentSibling = siblingContainer(element, popup);
60
- return positionWithScroll(element, parentSibling);
61
- };
62
- DOMService.prototype.relativeOffset = function (el, currentLocation) {
63
- return applyLocationOffset(this.offset(el), currentLocation, this.isBodyOffset(el));
64
- };
65
- DOMService.prototype.addScroll = function (rect, scroll) {
66
- return addScroll(rect, scroll);
67
- };
68
- DOMService.prototype.removeScroll = function (rect, scroll) {
69
- return removeScroll(rect, scroll);
70
- };
71
- DOMService.prototype.restrictToView = function (settings) {
72
- return restrictToView(settings);
73
- };
74
- DOMService.prototype.scrollPosition = function (el) {
75
- return scrollPosition(el);
76
- };
77
- DOMService.prototype.scrollableParents = function (el) {
78
- return scrollableParents(el);
79
- };
80
- DOMService.prototype.stackingElementOffset = function (el) {
81
- var relativeContextElement = this.getRelativeContextElement(el);
82
- if (!relativeContextElement) {
83
- return null;
84
- }
85
- return offset(relativeContextElement);
86
- };
87
- DOMService.prototype.stackingElementScroll = function (el) {
88
- var relativeContextElement = this.getRelativeContextElement(el);
89
- if (!relativeContextElement) {
90
- return { x: 0, y: 0 };
91
- }
92
- return {
93
- x: relativeContextElement.scrollLeft,
94
- y: relativeContextElement.scrollTop
95
- };
96
- };
97
- DOMService.prototype.stackingElementViewPort = function (el) {
98
- var relativeContextElement = this.getRelativeContextElement(el);
99
- if (!relativeContextElement) {
100
- return null;
101
- }
102
- return {
103
- height: relativeContextElement.scrollHeight,
104
- width: relativeContextElement.scrollWidth
105
- };
106
- };
107
- DOMService.prototype.getRelativeContextElement = function (el) {
108
- if (!el || !HAS_RELATIVE_STACKING_CONTEXT) {
109
- return null;
110
- }
111
- var parent = el.parentElement;
112
- while (parent) {
113
- if (window.getComputedStyle(parent).transform !== 'none') {
114
- return parent;
115
- }
116
- parent = parent.parentElement;
117
- }
118
- return null;
119
- };
120
- DOMService.prototype.useRelativePosition = function (el) {
121
- return !!this.getRelativeContextElement(el);
122
- };
123
- DOMService.prototype.windowViewPort = function (el) {
124
- return getWindowViewPort(el);
125
- };
126
- DOMService.prototype.zIndex = function (anchor, container) {
127
- return zIndex(anchor, container);
128
- };
129
- DOMService.prototype.zoomLevel = function () {
130
- if (!canUseDOM) {
131
- return 1;
132
- }
133
- return parseFloat((document.documentElement.clientWidth / window.innerWidth).toFixed(2));
134
- };
135
- DOMService.prototype.isZoomed = function () {
136
- return this.zoomLevel() > 1;
137
- };
138
- return DOMService;
139
- }());
140
- export { DOMService };
@@ -1,12 +0,0 @@
1
- import { PositionElementSettings } from '../models/positionElementSettings';
2
- import { Position } from '../models/Position';
3
- import { DOMService } from './domService';
4
- /**
5
- * @hidden
6
- */
7
- export declare class PositionService {
8
- private _dom;
9
- constructor(_dom: DOMService);
10
- positionElement(settings: PositionElementSettings): Position;
11
- private elementRect;
12
- }
@@ -1,34 +0,0 @@
1
- import { eitherRect, replaceOffset } from '../util';
2
- /**
3
- * @hidden
4
- */
5
- var PositionService = /** @class */ (function () {
6
- function PositionService(_dom) {
7
- this._dom = _dom;
8
- }
9
- PositionService.prototype.positionElement = function (settings) {
10
- var anchor = settings.anchor, currentLocation = settings.currentLocation, element = settings.element, anchorAlign = settings.anchorAlign, elementAlign = settings.elementAlign, collisions = settings.collisions;
11
- var dom = this._dom;
12
- var viewPort = settings.viewPort || dom.stackingElementViewPort(element) || dom.windowViewPort(element);
13
- var anchorRect = eitherRect(dom.offset(anchor), currentLocation);
14
- var initialElementRect = replaceOffset(dom.staticOffset(element), currentLocation);
15
- var elementRect = this.elementRect(element, initialElementRect);
16
- var result = dom.restrictToView({
17
- anchorAlign: anchorAlign,
18
- anchorRect: anchorRect,
19
- collisions: collisions,
20
- elementAlign: elementAlign,
21
- elementRect: elementRect,
22
- viewPort: viewPort
23
- });
24
- return {
25
- flipped: result.flipped,
26
- offset: dom.addOffset(initialElementRect, result.offset)
27
- };
28
- };
29
- PositionService.prototype.elementRect = function (element, rect) {
30
- return this._dom.removeScroll(rect, this._dom.scrollPosition(element));
31
- };
32
- return PositionService;
33
- }());
34
- export { PositionService };
@@ -1,11 +0,0 @@
1
- import { AlignStrategy, OffsetPosition } from '@progress/kendo-popup-common';
2
- /**
3
- * @hidden
4
- */
5
- export interface AlignElementSettings {
6
- anchor?: HTMLElement | null;
7
- anchorAlign: AlignStrategy;
8
- element: HTMLElement;
9
- elementAlign: AlignStrategy;
10
- offset?: OffsetPosition;
11
- }
@@ -1,8 +0,0 @@
1
- import { OffsetPosition as Offset } from '@progress/kendo-popup-common';
2
- /**
3
- * @hidden
4
- */
5
- export interface Position {
6
- flipped?: boolean;
7
- offset?: Offset;
8
- }
@@ -1,13 +0,0 @@
1
- import { AlignStrategy, CollisionStrategy, OffsetPosition, ViewPort } from '@progress/kendo-popup-common';
2
- /**
3
- * @hidden
4
- */
5
- export interface PositionElementSettings {
6
- anchor?: HTMLElement | null;
7
- anchorAlign: AlignStrategy;
8
- collisions: CollisionStrategy;
9
- currentLocation: OffsetPosition;
10
- element: HTMLElement;
11
- elementAlign: AlignStrategy;
12
- viewPort?: ViewPort;
13
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });