@progress/kendo-react-popup 7.0.3-develop.1 → 7.0.3-develop.11
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/NOTICE.txt +1 -1
- package/Popup.d.ts +1 -1
- package/PopupWithoutContext.d.ts +2 -1
- package/README.md +1 -1
- package/animation.d.ts +1 -1
- package/dist/cdn/js/kendo-react-popup.js +2 -2
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/index.mjs +16 -13
- package/models/Align.d.ts +1 -1
- package/models/Collision.d.ts +1 -1
- package/models/CollisionType.d.ts +1 -1
- package/models/Events.d.ts +1 -1
- package/models/Margin.d.ts +1 -1
- package/models/Offset.d.ts +1 -1
- package/models/PopupAnimation.d.ts +1 -1
- package/models/PopupProps.d.ts +1 -1
- package/models/PositionMode.d.ts +1 -1
- package/package-metadata.d.ts +1 -1
- package/package.json +2 -2
- package/util.d.ts +1 -1
package/LICENSE.md
CHANGED
|
@@ -8,4 +8,4 @@ This is commercial software. To use it, you need to agree to the [**End User Lic
|
|
|
8
8
|
|
|
9
9
|
All available KendoReact commercial licenses may be obtained at the [KendoReact website](https://www.telerik.com/kendo-react-ui/pricing).
|
|
10
10
|
|
|
11
|
-
*Copyright ©
|
|
11
|
+
*Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
|
package/NOTICE.txt
CHANGED
package/Popup.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
package/PopupWithoutContext.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from 'react';
|
|
@@ -157,6 +157,7 @@ export declare class PopupWithoutContext extends React.Component<PopupProps, Pop
|
|
|
157
157
|
previous: Status;
|
|
158
158
|
};
|
|
159
159
|
/**
|
|
160
|
+
*
|
|
160
161
|
* @hidden
|
|
161
162
|
*/
|
|
162
163
|
componentDidUpdate(prevProps: PopupProps): void;
|
package/README.md
CHANGED
|
@@ -47,6 +47,6 @@ High-level component overview pages
|
|
|
47
47
|
|
|
48
48
|
* [React Popup Component](https://www.telerik.com/kendo-react-ui/popup)
|
|
49
49
|
|
|
50
|
-
*Copyright ©
|
|
50
|
+
*Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
|
|
51
51
|
|
|
52
52
|
*Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.*
|
package/animation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
(function(u,_){typeof exports=="object"&&typeof module
|
|
5
|
+
(function(u,_){typeof exports=="object"&&typeof module!="undefined"?_(exports,require("react"),require("react-dom"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-popup-common")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","prop-types","@progress/kendo-react-common","@progress/kendo-popup-common"],_):(u=typeof globalThis!="undefined"?globalThis:u||self,_(u.KendoReactPopup={},u.React,u.ReactDOM,u.PropTypes,u.KendoReactCommon,u.KendoPopupCommon))})(this,function(u,_,L,i,w,o){"use strict";"use client";function N(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const v=N(_),M=N(L),D=n=>{n.style.transitionDuration="",Array.from(n.classList).forEach(e=>{e.startsWith("k-slide-")&&n.classList.remove(e)})},R=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),y=(n,e,t,s,l)=>{if(t===0)return l();const r="k-slide-"+e+"-"+s,c=r+"-active",a=d=>{d.target===n&&(n.removeEventListener("transitionend",a),D(n),s==="exit"?n.style.display="none":n.style.display="",l())};n.addEventListener("transitionend",a);const f=n.ownerDocument;if(!f)return;const g=f.defaultView;if(!g)return;const p=()=>{D(n),n.classList.add(r),g.requestAnimationFrame(()=>{n.style.transitionDuration=t+"ms",n.classList.add(c)})};R?g.requestAnimationFrame(p):p()},C=1e3/60,S=function(n,e,t={}){let s,l,r,c,a=0;t=t||{};const f=function(){a=t.leading===!1?0:new Date().getTime(),s=void 0,c=n.apply(l,r),s||(l=r=null)};return function(){const p=new Date().getTime();!a&&t.leading===!1&&(a=p);const d=e-(p-a);return l=void 0,r=arguments,d<=0||d>e?(s&&(clearTimeout(s),s=void 0),a=p,c=n.apply(l,r),s||(l=r=null)):!s&&t.trailing!==!1&&(s=window.setTimeout(f,d)),c}},z={name:"@progress/kendo-react-popup",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},U=100,j=1;function A(n,e){if(n===e)return!0;if(!!n!=!!e)return!1;const t=Object.getOwnPropertyNames(n),s=Object.getOwnPropertyNames(e);if(t.length!==s.length)return!1;for(let l=0;l<t.length;l++){let r=t[l];if(n[r]!==e[r])return!1}return!0}const K={left:-1e3,top:0},F="k-animation-container",x="k-animation-container-shown",H="k-child-animation-container",q="k-popup";class m extends v.Component{constructor(e){super(e),this.context=0,this.state={current:"hidden",previous:"hidden",props:{}},this._popup=null,this.show=t=>{this.setPosition(t),this.animate(t.firstChild,"enter",this.onOpened),this.setState({current:"shown",previous:this.state.current})},this.setPosition=t=>{let{anchorAlign:s,popupAlign:l,collision:r,offset:c,anchor:a,margin:f,scale:g,positionMode:p}=this.props;const{width:d,height:O}=t.style;t.style.width=t.offsetWidth+"px",t.style.height=t.offsetHeight+"px";const b=o.alignElement({anchor:a,anchorAlign:s,element:t,elementAlign:l,offset:c,margin:f,positionMode:p,scale:g}),h=o.positionElement({anchor:a,anchorAlign:s,element:t,elementAlign:l,collisions:r,currentLocation:b,margin:this.props.margin});if(t.style.top=h.offset.top+"px",t.style.left=h.offset.left+"px",t.style.width=d,t.style.height=O,this._collisions={fit:h.fit,fitted:h.fitted,flip:h.flip,flipped:h.flipped},this.props.onPosition){const Z={target:this,flipped:h.flipped,fitted:h.fitted};this.props.onPosition.call(void 0,Z)}},this.onOpened=()=>{const t=this._popup;t&&(this.props.show&&t.classList.add(x),this.attachRepositionHandlers(t),this.props.onOpen&&this.props.onOpen.call(void 0,{target:this}))},this.animate=(t,s,l)=>{if(!this.props.popupAlign)return;let r;const{horizontal:c,vertical:a}=this.props.popupAlign;c==="left"&&a==="center"?r="right":c==="right"&&a==="center"?r="left":a==="top"?r="down":r="up";const f={down:"up",up:"down",left:"right",right:"left"};this._collisions&&this._collisions.flipped&&(r=f[r]),y(t,r,this.animationDuration[s],s,l)},this.onClosing=t=>{this.props.show||t.classList.remove(x),this.detachRepositionHandlers()},this.onClosed=()=>{this.state.current==="hiding"&&this.state.previous==="shown"&&this.setState({current:"hidden",previous:this.state.current}),this.props.onClose&&this.props.onClose.call(void 0,{target:this})},this.getCurrentZIndex=()=>this.context?this.context+j:U,w.validatePackage(z),this.reposition=S(this.reposition.bind(this),C)}get element(){return this._popup}static getDerivedStateFromProps(e,t){const{show:s,anchor:l,anchorAlign:r,appendTo:c,collision:a,popupAlign:f,className:g,popupClass:p,style:d,offset:O,contentKey:b}=e,h={...t,props:{show:s,anchor:l,anchorAlign:r,appendTo:c,collision:a,popupAlign:f,className:g,popupClass:p,style:d,offset:O,contentKey:b}};return e.show?t.current==="hidden"||t.current==="hiding"?{...h,current:"showing",previous:t.current}:t.current==="showing"?{...h,current:"shown",previous:t.current}:t.current==="shown"&&(!A(O,t.props.offset)||!A(r,t.props.anchorAlign)||!A(c,t.props.appendTo)||!A(a,t.props.collision)||!A(f,t.props.popupAlign)||!A(d,t.props.style)||l!==t.props.anchor||p!==t.props.popupClass||g!==t.props.className)?{...h,current:"reposition",previous:t.current}:h:t.current==="hiding"||t.current==="hidden"?{...h,current:"hidden",previous:t.current}:{...h,current:"hiding",previous:t.current}}componentDidUpdate(e){this.state.current==="showing"&&this._popup?this.show(this._popup):this.state.current==="hiding"&&this._popup?(this.onClosing(this._popup),this.animate(this._popup.firstChild,"exit",this.onClosed)):this.state.current==="reposition"&&this.state.previous==="shown"?setTimeout(()=>{this.setState({current:"shown",previous:this.state.current})},0):this.state.current==="shown"&&e.contentKey!==this.props.contentKey&&this._popup&&this.setPosition(this._popup)}componentDidMount(){this.state.current==="showing"&&this._popup&&this.show(this._popup)}componentWillUnmount(){this.detachRepositionHandlers()}render(){const{children:e,className:t,popupClass:s,show:l,id:r,positionMode:c}=this.props,a=this.props.appendTo?this.props.appendTo:w.canUseDOM?this.props.anchor&&this.props.anchor.ownerDocument?this.props.anchor.ownerDocument.body:document.body:void 0;this.state.current==="reposition"&&this.state.previous==="shown"&&this._popup&&this.setPosition(this._popup);const f=Object.assign({},{position:c,top:0,left:-1e4},this.props.style||{}),g=this.state.current==="hiding";if((l||g)&&a){const p=this.getCurrentZIndex(),d=v.createElement(w.ZIndexContext.Provider,{value:p},v.createElement("div",{className:w.classNames(F,t),id:r,ref:O=>this._popup=O,style:{zIndex:p,...f}},v.createElement("div",{className:w.classNames(H),style:{transitionDelay:"0ms"}},v.createElement("div",{role:this.props.role,className:w.classNames(q,s)},e))));return this.props.appendTo!==null?M.createPortal(d,a):d}return null}get animationDuration(){const e=this.props.animate;let t=0,s=0;return e&&(e===!0?t=s=300:(t=e.openDuration||0,s=e.closeDuration||0)),{enter:t,exit:s}}attachRepositionHandlers(e){this.detachRepositionHandlers(),this._scrollableParents=o.domUtils.scrollableParents(this.props.anchor||e),this._scrollableParents&&this._scrollableParents.map(t=>t.addEventListener("scroll",this.reposition)),window.addEventListener("resize",this.reposition)}detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(e=>e.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)}reposition(){this.setState({current:"reposition",previous:this.state.current})}}m.propTypes={anchor:function(n){const e=n.anchor;return e&&typeof e.nodeType!="number"?new Error("Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."):null},appendTo:function(n){const e=n.appendTo;return e&&typeof e.nodeType!="number"?new Error("Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."):null},className:i.oneOfType([i.string,i.arrayOf(i.string),i.object]),id:i.string,popupClass:i.oneOfType([i.string,i.arrayOf(i.string),i.object]),collision:i.shape({horizontal:i.oneOf([o.Collision.fit,o.Collision.flip,o.Collision.none]),vertical:i.oneOf([o.Collision.fit,o.Collision.flip,o.Collision.none])}),anchorAlign:i.shape({horizontal:i.oneOf([o.AlignPoint.left,o.AlignPoint.center,o.AlignPoint.right]),vertical:i.oneOf([o.AlignPoint.top,o.AlignPoint.center,o.AlignPoint.bottom])}),popupAlign:i.shape({horizontal:i.oneOf([o.AlignPoint.left,o.AlignPoint.center,o.AlignPoint.right]),vertical:i.oneOf([o.AlignPoint.top,o.AlignPoint.center,o.AlignPoint.bottom])}),offset:i.shape({left:i.number,top:i.number}),children:i.oneOfType([i.element,i.node]),show:i.bool,animate:i.oneOfType([i.bool,i.shape({openDuration:i.number,closeDuration:i.number})]),margin:i.shape({horizontal:i.number,vertical:i.number}),positionMode:i.oneOf(["fixed","absolute"]),scale:i.number,style:i.object,onClose:i.func,onPosition:i.func,onOpen:i.func},m.defaultProps={collision:{horizontal:o.Collision.fit,vertical:o.Collision.flip},anchorAlign:{horizontal:o.AlignPoint.left,vertical:o.AlignPoint.bottom},popupAlign:{horizontal:o.AlignPoint.left,vertical:o.AlignPoint.top},offset:K,animate:!0,show:!1,margin:{horizontal:0,vertical:0},positionMode:"absolute"},m.contextType=w.ZIndexContext,m.displayName="PopupComponent";const E=v.createContext(n=>n),I=v.forwardRef((n,e)=>{const s=v.useContext(E).call(void 0,n);return v.createElement(m,{ref:e,...s})});I.displayName="Popup",u.Popup=I,u.PopupPropsContext=E,u.PopupWithoutContext=m,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
package/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
export * from './index';
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Popup, PopupPropsContext } from './Popup';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),D=require("react-dom"),o=require("prop-types"),m=require("@progress/kendo-react-common"),s=require("@progress/kendo-popup-common");function C(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const g=C(N),x=C(D),A=n=>{n.style.transitionDuration="",Array.from(n.classList).forEach(e=>{e.startsWith("k-slide-")&&n.classList.remove(e)})},E=typeof window
|
|
5
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),D=require("react-dom"),o=require("prop-types"),m=require("@progress/kendo-react-common"),s=require("@progress/kendo-popup-common");function C(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const g=C(N),x=C(D),A=n=>{n.style.transitionDuration="",Array.from(n.classList).forEach(e=>{e.startsWith("k-slide-")&&n.classList.remove(e)})},E=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),I=(n,e,t,i,l)=>{if(t===0)return l();const r="k-slide-"+e+"-"+i,a=r+"-active",p=d=>{d.target===n&&(n.removeEventListener("transitionend",p),A(n),i==="exit"?n.style.display="none":n.style.display="",l())};n.addEventListener("transitionend",p);const u=n.ownerDocument;if(!u)return;const f=u.defaultView;if(!f)return;const h=()=>{A(n),n.classList.add(r),f.requestAnimationFrame(()=>{n.style.transitionDuration=t+"ms",n.classList.add(a)})};E?f.requestAnimationFrame(h):h()},R=1e3/60,L=function(n,e,t={}){let i,l,r,a,p=0;t=t||{};const u=function(){p=t.leading===!1?0:new Date().getTime(),i=void 0,a=n.apply(l,r),i||(l=r=null)};return function(){const h=new Date().getTime();!p&&t.leading===!1&&(p=h);const d=e-(h-p);return l=void 0,r=arguments,d<=0||d>e?(i&&(clearTimeout(i),i=void 0),p=h,a=n.apply(l,r),i||(l=r=null)):!i&&t.trailing!==!1&&(i=window.setTimeout(u,d)),a}},M={name:"@progress/kendo-react-popup",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},k=100,S=1;function v(n,e){if(n===e)return!0;if(!!n!=!!e)return!1;const t=Object.getOwnPropertyNames(n),i=Object.getOwnPropertyNames(e);if(t.length!==i.length)return!1;for(let l=0;l<t.length;l++){let r=t[l];if(n[r]!==e[r])return!1}return!0}const z={left:-1e3,top:0},U="k-animation-container",O="k-animation-container-shown",j="k-child-animation-container",F="k-popup";class w extends g.Component{constructor(e){super(e),this.context=0,this.state={current:"hidden",previous:"hidden",props:{}},this._popup=null,this.show=t=>{this.setPosition(t),this.animate(t.firstChild,"enter",this.onOpened),this.setState({current:"shown",previous:this.state.current})},this.setPosition=t=>{let{anchorAlign:i,popupAlign:l,collision:r,offset:a,anchor:p,margin:u,scale:f,positionMode:h}=this.props;const{width:d,height:P}=t.style;t.style.width=t.offsetWidth+"px",t.style.height=t.offsetHeight+"px";const y=s.alignElement({anchor:p,anchorAlign:i,element:t,elementAlign:l,offset:a,margin:u,positionMode:h,scale:f}),c=s.positionElement({anchor:p,anchorAlign:i,element:t,elementAlign:l,collisions:r,currentLocation:y,margin:this.props.margin});if(t.style.top=c.offset.top+"px",t.style.left=c.offset.left+"px",t.style.width=d,t.style.height=P,this._collisions={fit:c.fit,fitted:c.fitted,flip:c.flip,flipped:c.flipped},this.props.onPosition){const T={target:this,flipped:c.flipped,fitted:c.fitted};this.props.onPosition.call(void 0,T)}},this.onOpened=()=>{const t=this._popup;t&&(this.props.show&&t.classList.add(O),this.attachRepositionHandlers(t),this.props.onOpen&&this.props.onOpen.call(void 0,{target:this}))},this.animate=(t,i,l)=>{if(!this.props.popupAlign)return;let r;const{horizontal:a,vertical:p}=this.props.popupAlign;a==="left"&&p==="center"?r="right":a==="right"&&p==="center"?r="left":p==="top"?r="down":r="up";const u={down:"up",up:"down",left:"right",right:"left"};this._collisions&&this._collisions.flipped&&(r=u[r]),I(t,r,this.animationDuration[i],i,l)},this.onClosing=t=>{this.props.show||t.classList.remove(O),this.detachRepositionHandlers()},this.onClosed=()=>{this.state.current==="hiding"&&this.state.previous==="shown"&&this.setState({current:"hidden",previous:this.state.current}),this.props.onClose&&this.props.onClose.call(void 0,{target:this})},this.getCurrentZIndex=()=>this.context?this.context+S:k,m.validatePackage(M),this.reposition=L(this.reposition.bind(this),R)}get element(){return this._popup}static getDerivedStateFromProps(e,t){const{show:i,anchor:l,anchorAlign:r,appendTo:a,collision:p,popupAlign:u,className:f,popupClass:h,style:d,offset:P,contentKey:y}=e,c={...t,props:{show:i,anchor:l,anchorAlign:r,appendTo:a,collision:p,popupAlign:u,className:f,popupClass:h,style:d,offset:P,contentKey:y}};return e.show?t.current==="hidden"||t.current==="hiding"?{...c,current:"showing",previous:t.current}:t.current==="showing"?{...c,current:"shown",previous:t.current}:t.current==="shown"&&(!v(P,t.props.offset)||!v(r,t.props.anchorAlign)||!v(a,t.props.appendTo)||!v(p,t.props.collision)||!v(u,t.props.popupAlign)||!v(d,t.props.style)||l!==t.props.anchor||h!==t.props.popupClass||f!==t.props.className)?{...c,current:"reposition",previous:t.current}:c:t.current==="hiding"||t.current==="hidden"?{...c,current:"hidden",previous:t.current}:{...c,current:"hiding",previous:t.current}}componentDidUpdate(e){this.state.current==="showing"&&this._popup?this.show(this._popup):this.state.current==="hiding"&&this._popup?(this.onClosing(this._popup),this.animate(this._popup.firstChild,"exit",this.onClosed)):this.state.current==="reposition"&&this.state.previous==="shown"?setTimeout(()=>{this.setState({current:"shown",previous:this.state.current})},0):this.state.current==="shown"&&e.contentKey!==this.props.contentKey&&this._popup&&this.setPosition(this._popup)}componentDidMount(){this.state.current==="showing"&&this._popup&&this.show(this._popup)}componentWillUnmount(){this.detachRepositionHandlers()}render(){const{children:e,className:t,popupClass:i,show:l,id:r,positionMode:a}=this.props,p=this.props.appendTo?this.props.appendTo:m.canUseDOM?this.props.anchor&&this.props.anchor.ownerDocument?this.props.anchor.ownerDocument.body:document.body:void 0;this.state.current==="reposition"&&this.state.previous==="shown"&&this._popup&&this.setPosition(this._popup);const u=Object.assign({},{position:a,top:0,left:-1e4},this.props.style||{}),f=this.state.current==="hiding";if((l||f)&&p){const h=this.getCurrentZIndex(),d=g.createElement(m.ZIndexContext.Provider,{value:h},g.createElement("div",{className:m.classNames(U,t),id:r,ref:P=>this._popup=P,style:{zIndex:h,...u}},g.createElement("div",{className:m.classNames(j),style:{transitionDelay:"0ms"}},g.createElement("div",{role:this.props.role,className:m.classNames(F,i)},e))));return this.props.appendTo!==null?x.createPortal(d,p):d}return null}get animationDuration(){const e=this.props.animate;let t=0,i=0;return e&&(e===!0?t=i=300:(t=e.openDuration||0,i=e.closeDuration||0)),{enter:t,exit:i}}attachRepositionHandlers(e){this.detachRepositionHandlers(),this._scrollableParents=s.domUtils.scrollableParents(this.props.anchor||e),this._scrollableParents&&this._scrollableParents.map(t=>t.addEventListener("scroll",this.reposition)),window.addEventListener("resize",this.reposition)}detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(e=>e.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)}reposition(){this.setState({current:"reposition",previous:this.state.current})}}w.propTypes={anchor:function(n){const e=n.anchor;return e&&typeof e.nodeType!="number"?new Error("Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."):null},appendTo:function(n){const e=n.appendTo;return e&&typeof e.nodeType!="number"?new Error("Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."):null},className:o.oneOfType([o.string,o.arrayOf(o.string),o.object]),id:o.string,popupClass:o.oneOfType([o.string,o.arrayOf(o.string),o.object]),collision:o.shape({horizontal:o.oneOf([s.Collision.fit,s.Collision.flip,s.Collision.none]),vertical:o.oneOf([s.Collision.fit,s.Collision.flip,s.Collision.none])}),anchorAlign:o.shape({horizontal:o.oneOf([s.AlignPoint.left,s.AlignPoint.center,s.AlignPoint.right]),vertical:o.oneOf([s.AlignPoint.top,s.AlignPoint.center,s.AlignPoint.bottom])}),popupAlign:o.shape({horizontal:o.oneOf([s.AlignPoint.left,s.AlignPoint.center,s.AlignPoint.right]),vertical:o.oneOf([s.AlignPoint.top,s.AlignPoint.center,s.AlignPoint.bottom])}),offset:o.shape({left:o.number,top:o.number}),children:o.oneOfType([o.element,o.node]),show:o.bool,animate:o.oneOfType([o.bool,o.shape({openDuration:o.number,closeDuration:o.number})]),margin:o.shape({horizontal:o.number,vertical:o.number}),positionMode:o.oneOf(["fixed","absolute"]),scale:o.number,style:o.object,onClose:o.func,onPosition:o.func,onOpen:o.func};w.defaultProps={collision:{horizontal:s.Collision.fit,vertical:s.Collision.flip},anchorAlign:{horizontal:s.AlignPoint.left,vertical:s.AlignPoint.bottom},popupAlign:{horizontal:s.AlignPoint.left,vertical:s.AlignPoint.top},offset:z,animate:!0,show:!1,margin:{horizontal:0,vertical:0},positionMode:"absolute"};w.contextType=m.ZIndexContext;w.displayName="PopupComponent";const _=g.createContext(n=>n),b=g.forwardRef((n,e)=>{const i=g.useContext(_).call(void 0,n);return g.createElement(w,{ref:e,...i})});b.displayName="Popup";exports.Popup=b;exports.PopupPropsContext=_;exports.PopupWithoutContext=w;
|
package/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
"use client";
|
|
6
6
|
import * as m from "react";
|
|
7
7
|
import * as E from "react-dom";
|
|
8
8
|
import e from "prop-types";
|
|
9
|
-
import { validatePackage as b, canUseDOM as N, ZIndexContext as
|
|
9
|
+
import { validatePackage as b, canUseDOM as N, ZIndexContext as A, classNames as O } from "@progress/kendo-react-common";
|
|
10
10
|
import { alignElement as D, positionElement as x, domUtils as I, Collision as g, AlignPoint as l } from "@progress/kendo-popup-common";
|
|
11
|
-
const
|
|
11
|
+
const T = (i) => {
|
|
12
12
|
i.style.transitionDuration = "", Array.from(i.classList).forEach((o) => {
|
|
13
13
|
o.startsWith("k-slide-") && i.classList.remove(o);
|
|
14
14
|
});
|
|
15
|
-
}, R = typeof window
|
|
15
|
+
}, R = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), L = (i, o, t, n, r) => {
|
|
16
16
|
if (t === 0)
|
|
17
17
|
return r();
|
|
18
18
|
const s = "k-slide-" + o + "-" + n, a = s + "-active", p = (d) => {
|
|
19
|
-
d.target === i && (i.removeEventListener("transitionend", p),
|
|
19
|
+
d.target === i && (i.removeEventListener("transitionend", p), T(i), n === "exit" ? i.style.display = "none" : i.style.display = "", r());
|
|
20
20
|
};
|
|
21
21
|
i.addEventListener("transitionend", p);
|
|
22
22
|
const u = i.ownerDocument;
|
|
@@ -26,7 +26,7 @@ const _ = (i) => {
|
|
|
26
26
|
if (!f)
|
|
27
27
|
return;
|
|
28
28
|
const h = () => {
|
|
29
|
-
|
|
29
|
+
T(i), i.classList.add(s), f.requestAnimationFrame(() => {
|
|
30
30
|
i.style.transitionDuration = t + "ms", i.classList.add(a);
|
|
31
31
|
});
|
|
32
32
|
};
|
|
@@ -47,7 +47,7 @@ const _ = (i) => {
|
|
|
47
47
|
name: "@progress/kendo-react-popup",
|
|
48
48
|
productName: "KendoReact",
|
|
49
49
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
50
|
-
publishDate:
|
|
50
|
+
publishDate: 1705076869,
|
|
51
51
|
version: "",
|
|
52
52
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
53
53
|
}, z = 100, S = 1;
|
|
@@ -69,7 +69,7 @@ function w(i, o) {
|
|
|
69
69
|
const F = {
|
|
70
70
|
left: -1e3,
|
|
71
71
|
top: 0
|
|
72
|
-
}, H = "k-animation-container",
|
|
72
|
+
}, H = "k-animation-container", _ = "k-animation-container-shown", K = "k-child-animation-container", j = "k-popup";
|
|
73
73
|
class P extends m.Component {
|
|
74
74
|
constructor(o) {
|
|
75
75
|
super(o), this.context = 0, this.state = { current: "hidden", previous: "hidden", props: {} }, this._popup = null, this.show = (t) => {
|
|
@@ -111,7 +111,7 @@ class P extends m.Component {
|
|
|
111
111
|
}
|
|
112
112
|
}, this.onOpened = () => {
|
|
113
113
|
const t = this._popup;
|
|
114
|
-
t && (this.props.show && t.classList.add(
|
|
114
|
+
t && (this.props.show && t.classList.add(_), this.attachRepositionHandlers(t), this.props.onOpen && this.props.onOpen.call(void 0, { target: this }));
|
|
115
115
|
}, this.animate = (t, n, r) => {
|
|
116
116
|
if (!this.props.popupAlign)
|
|
117
117
|
return;
|
|
@@ -132,7 +132,7 @@ class P extends m.Component {
|
|
|
132
132
|
r
|
|
133
133
|
);
|
|
134
134
|
}, this.onClosing = (t) => {
|
|
135
|
-
this.props.show || t.classList.remove(
|
|
135
|
+
this.props.show || t.classList.remove(_), this.detachRepositionHandlers();
|
|
136
136
|
}, this.onClosed = () => {
|
|
137
137
|
this.state.current === "hiding" && this.state.previous === "shown" && this.setState({ current: "hidden", previous: this.state.current }), this.props.onClose && this.props.onClose.call(void 0, { target: this });
|
|
138
138
|
}, this.getCurrentZIndex = () => this.context ? this.context + S : z, b(k), this.reposition = U(this.reposition.bind(this), M);
|
|
@@ -166,10 +166,13 @@ class P extends m.Component {
|
|
|
166
166
|
return o.show ? t.current === "hidden" || t.current === "hiding" ? { ...c, current: "showing", previous: t.current } : t.current === "showing" ? { ...c, current: "shown", previous: t.current } : t.current === "shown" && (!w(v, t.props.offset) || !w(s, t.props.anchorAlign) || !w(a, t.props.appendTo) || !w(p, t.props.collision) || !w(u, t.props.popupAlign) || !w(d, t.props.style) || r !== t.props.anchor || h !== t.props.popupClass || f !== t.props.className) ? { ...c, current: "reposition", previous: t.current } : c : t.current === "hiding" || t.current === "hidden" ? { ...c, current: "hidden", previous: t.current } : { ...c, current: "hiding", previous: t.current };
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
|
+
*
|
|
169
170
|
* @hidden
|
|
170
171
|
*/
|
|
171
172
|
componentDidUpdate(o) {
|
|
172
|
-
this.state.current === "showing" && this._popup ? this.show(this._popup) : this.state.current === "hiding" && this._popup ? (this.onClosing(this._popup), this.animate(this._popup.firstChild, "exit", this.onClosed)) : this.state.current === "reposition" && this.state.previous === "shown" ?
|
|
173
|
+
this.state.current === "showing" && this._popup ? this.show(this._popup) : this.state.current === "hiding" && this._popup ? (this.onClosing(this._popup), this.animate(this._popup.firstChild, "exit", this.onClosed)) : this.state.current === "reposition" && this.state.previous === "shown" ? setTimeout(() => {
|
|
174
|
+
this.setState({ current: "shown", previous: this.state.current });
|
|
175
|
+
}, 0) : this.state.current === "shown" && o.contentKey !== this.props.contentKey && this._popup && this.setPosition(this._popup);
|
|
173
176
|
}
|
|
174
177
|
/**
|
|
175
178
|
* @hidden
|
|
@@ -202,7 +205,7 @@ class P extends m.Component {
|
|
|
202
205
|
this.props.style || {}
|
|
203
206
|
), f = this.state.current === "hiding";
|
|
204
207
|
if ((r || f) && p) {
|
|
205
|
-
const h = this.getCurrentZIndex(), d = /* @__PURE__ */ m.createElement(
|
|
208
|
+
const h = this.getCurrentZIndex(), d = /* @__PURE__ */ m.createElement(A.Provider, { value: h }, /* @__PURE__ */ m.createElement(
|
|
206
209
|
"div",
|
|
207
210
|
{
|
|
208
211
|
className: O(H, t),
|
|
@@ -353,7 +356,7 @@ P.defaultProps = {
|
|
|
353
356
|
},
|
|
354
357
|
positionMode: "absolute"
|
|
355
358
|
};
|
|
356
|
-
P.contextType =
|
|
359
|
+
P.contextType = A;
|
|
357
360
|
P.displayName = "PopupComponent";
|
|
358
361
|
const Z = m.createContext((i) => i), W = m.forwardRef((i, o) => {
|
|
359
362
|
const n = m.useContext(Z).call(void 0, i);
|
package/models/Align.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { AlignStrategy } from '@progress/kendo-popup-common';
|
package/models/Collision.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { CollisionType } from './CollisionType';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { CollisionType as CollisionTypeBase } from '@progress/kendo-popup-common';
|
package/models/Events.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Popup } from '../Popup';
|
package/models/Margin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { MarginSettings } from '@progress/kendo-popup-common';
|
package/models/Offset.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { OffsetPosition } from '@progress/kendo-popup-common';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
package/models/PopupProps.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { Collision } from './Collision';
|
package/models/PositionMode.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PositionMode as PositionModeBase } from '@progress/kendo-popup-common';
|
package/package-metadata.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PackageMetadata } from '@progress/kendo-licensing';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-popup",
|
|
3
|
-
"version": "7.0.3-develop.
|
|
3
|
+
"version": "7.0.3-develop.11",
|
|
4
4
|
"description": "React Popup positions a piece of content next to a specific anchor component. KendoReact Popup package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-licensing": "^1.3.4",
|
|
26
26
|
"@progress/kendo-popup-common": "^1.9.0",
|
|
27
|
-
"@progress/kendo-react-common": "7.0.3-develop.
|
|
27
|
+
"@progress/kendo-react-common": "7.0.3-develop.11",
|
|
28
28
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
29
29
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
30
30
|
},
|
package/util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { OffsetPosition } from '@progress/kendo-popup-common';
|