@progress/kendo-react-popup 8.3.0-develop.1 → 8.3.0-develop.10

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/Popup.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),a=require("./PopupWithoutContext.js");function s(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,n.get?n:{enumerable:!0,get:()=>t[o]})}}return e.default=t,Object.freeze(e)}const r=s(u),c=r.createContext(t=>t),p=r.forwardRef((t,e)=>{const n=r.useContext(c).call(void 0,t);return r.createElement(a.PopupWithoutContext,{ref:e,...n})});p.displayName="Popup";exports.Popup=p;exports.PopupPropsContext=c;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),a=require("./PopupWithoutContext.js"),l=require("@progress/kendo-react-common");function i(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const r=i(s),c=r.createContext(e=>e),u=r.forwardRef((e,o)=>{const t=r.useContext(c),n=l.useUnstyled(),p=t.call(void 0,e);return r.createElement(a.PopupWithoutContext,{ref:o,unstyled:n,...p})});u.displayName="Popup";exports.Popup=u;exports.PopupPropsContext=c;
package/Popup.mjs CHANGED
@@ -6,20 +6,22 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as o from "react";
10
- import { PopupWithoutContext as r } from "./PopupWithoutContext.mjs";
11
- const c = o.createContext((t) => t), n = o.forwardRef((t, e) => {
12
- const p = o.useContext(c).call(void 0, t);
13
- return /* @__PURE__ */ o.createElement(
14
- r,
9
+ import * as t from "react";
10
+ import { PopupWithoutContext as s } from "./PopupWithoutContext.mjs";
11
+ import { useUnstyled as c } from "@progress/kendo-react-common";
12
+ const u = t.createContext((o) => o), a = t.forwardRef((o, e) => {
13
+ const p = t.useContext(u), r = c(), n = p.call(void 0, o);
14
+ return /* @__PURE__ */ t.createElement(
15
+ s,
15
16
  {
16
17
  ref: e,
17
- ...p
18
+ unstyled: r,
19
+ ...n
18
20
  }
19
21
  );
20
22
  });
21
- n.displayName = "Popup";
23
+ a.displayName = "Popup";
22
24
  export {
23
- n as Popup,
24
- c as PopupPropsContext
25
+ a as Popup,
26
+ u as PopupPropsContext
25
27
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),C=require("react-dom"),e=require("prop-types"),D=require("./animation.js"),f=require("@progress/kendo-react-common"),n=require("@progress/kendo-popup-common"),w=require("./util.js"),E=require("./package-metadata.js");function _(a){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(i,t,o.get?o:{enumerable:!0,get:()=>a[t]})}}return i.default=a,Object.freeze(i)}const O=_(N),I=_(C),R=100,x=1;function P(a,i){if(a===i)return!0;if(!!a!=!!i)return!1;const t=Object.getOwnPropertyNames(a),o=Object.getOwnPropertyNames(i);if(t.length!==o.length)return!1;for(let l=0;l<t.length;l++){let s=t[l];if(a[s]!==i[s])return!1}return!0}const M={left:-1e3,top:0},z="k-animation-container",b="k-animation-container-shown",S="k-child-animation-container",j="k-popup",v=class v extends O.Component{constructor(i){super(i),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:o,popupAlign:l,collision:s,offset:c,anchor:p,margin:h,scale:g,positionMode:u}=this.props;const{width:d,height:m}=t.style;t.style.width=t.offsetWidth+"px",t.style.height=t.offsetHeight+"px";const A=n.alignElement({anchor:p,anchorAlign:o,element:t,elementAlign:l,offset:c,margin:h,positionMode:u,scale:g}),r=n.positionElement({anchor:p,anchorAlign:o,element:t,elementAlign:l,collisions:s,currentLocation:A,margin:this.props.margin});if(t.style.top=r.offset.top+"px",t.style.left=r.offset.left+"px",t.style.width=d,t.style.height=m,this._collisions={fit:r.fit,fitted:r.fitted,flip:r.flip,flipped:r.flipped},this.props.onPosition){const T={target:this,flipped:r.flipped,fitted:r.fitted};this.props.onPosition.call(void 0,T)}},this.onOpened=()=>{const t=this._popup;t&&(this.props.show&&t.classList.add(b),this.attachRepositionHandlers(t),this.props.onOpen&&this.props.onOpen.call(void 0,{target:this}))},this.animate=(t,o,l)=>{if(!this.props.popupAlign)return;let s;const{horizontal:c,vertical:p}=this.props.popupAlign;c==="left"&&p==="center"?s="right":c==="right"&&p==="center"?s="left":p==="top"?s="down":s="up";const h={down:"up",up:"down",left:"right",right:"left"};this._collisions&&this._collisions.flipped&&(s=h[s]),D.slide(t,s,this.animationDuration[o],o,l)},this.onClosing=t=>{this.props.show||t.classList.remove(b),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+x:R,f.validatePackage(E.packageMetadata),this.reposition=w.throttle(this.reposition.bind(this),w.FRAME_DURATION)}get element(){return this._popup}static getDerivedStateFromProps(i,t){const{show:o,anchor:l,anchorAlign:s,appendTo:c,collision:p,popupAlign:h,className:g,popupClass:u,style:d,offset:m,contentKey:A}=i,r={...t,props:{show:o,anchor:l,anchorAlign:s,appendTo:c,collision:p,popupAlign:h,className:g,popupClass:u,style:d,offset:m,contentKey:A}};return i.show?t.current==="hidden"||t.current==="hiding"?{...r,current:"showing",previous:t.current}:t.current==="showing"?{...r,current:"shown",previous:t.current}:t.current==="shown"&&(!P(m,t.props.offset)||!P(s,t.props.anchorAlign)||!P(c,t.props.appendTo)||!P(p,t.props.collision)||!P(h,t.props.popupAlign)||!P(d,t.props.style)||l!==t.props.anchor||u!==t.props.popupClass||g!==t.props.className)?{...r,current:"reposition",previous:t.current}:r:t.current==="hiding"||t.current==="hidden"?{...r,current:"hidden",previous:t.current}:{...r,current:"hiding",previous:t.current}}componentDidUpdate(i){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"&&i.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:i,className:t,popupClass:o,show:l,id:s,positionMode:c}=this.props,p=this.props.appendTo?this.props.appendTo:f.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 h=Object.assign({},{position:c,top:0,left:-1e4},this.props.style||{}),g=this.state.current==="hiding";if((l||g)&&p){const u=this.getCurrentZIndex(),d=O.createElement(f.ZIndexContext.Provider,{value:u},O.createElement("div",{onKeyDown:this.props.onKeyDown,className:f.classNames(z,t),id:s,ref:m=>this._popup=m,style:{zIndex:u,...h}},O.createElement("div",{className:f.classNames(S),style:{transitionDelay:"0ms"}},O.createElement("div",{role:this.props.role,className:f.classNames(j,o)},i))));return this.props.appendTo!==null?I.createPortal(d,p):d}return null}get animationDuration(){const i=this.props.animate;let t=0,o=0;return i&&(i===!0?t=o=300:(t=i.openDuration||0,o=i.closeDuration||0)),{enter:t,exit:o}}attachRepositionHandlers(i){this.detachRepositionHandlers(),this._scrollableParents=n.domUtils.scrollableParents(this.props.anchor||i),this._scrollableParents&&this._scrollableParents.map(t=>t.addEventListener("scroll",this.reposition)),window.addEventListener("resize",this.reposition)}detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(i=>i.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)}reposition(){this.setState({current:"reposition",previous:this.state.current})}};v.propTypes={anchor:function(i){const t=i.anchor;return t&&typeof t.nodeType!="number"?new Error("Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."):null},appendTo:function(i){const t=i.appendTo;return t&&typeof t.nodeType!="number"?new Error("Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."):null},className:e.oneOfType([e.string,e.arrayOf(e.string),e.object]),id:e.string,popupClass:e.oneOfType([e.string,e.arrayOf(e.string),e.object]),collision:e.shape({horizontal:e.oneOf([n.Collision.fit,n.Collision.flip,n.Collision.none]),vertical:e.oneOf([n.Collision.fit,n.Collision.flip,n.Collision.none])}),anchorAlign:e.shape({horizontal:e.oneOf([n.AlignPoint.left,n.AlignPoint.center,n.AlignPoint.right]),vertical:e.oneOf([n.AlignPoint.top,n.AlignPoint.center,n.AlignPoint.bottom])}),popupAlign:e.shape({horizontal:e.oneOf([n.AlignPoint.left,n.AlignPoint.center,n.AlignPoint.right]),vertical:e.oneOf([n.AlignPoint.top,n.AlignPoint.center,n.AlignPoint.bottom])}),offset:e.shape({left:e.number,top:e.number}),children:e.oneOfType([e.element,e.node]),show:e.bool,animate:e.oneOfType([e.bool,e.shape({openDuration:e.number,closeDuration:e.number})]),margin:e.shape({horizontal:e.number,vertical:e.number}),positionMode:e.oneOf(["fixed","absolute"]),scale:e.number,style:e.object,onClose:e.func,onPosition:e.func,onOpen:e.func,onKeyPress:e.func},v.defaultProps={collision:{horizontal:n.Collision.fit,vertical:n.Collision.flip},anchorAlign:{horizontal:n.AlignPoint.left,vertical:n.AlignPoint.bottom},popupAlign:{horizontal:n.AlignPoint.left,vertical:n.AlignPoint.top},offset:M,animate:!0,show:!1,margin:{horizontal:0,vertical:0},positionMode:"absolute"},v.contextType=f.ZIndexContext,v.displayName="PopupComponent";let y=v;exports.PopupWithoutContext=y;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("react"),_=require("react-dom"),e=require("prop-types"),T=require("./animation.js"),l=require("@progress/kendo-react-common"),i=require("@progress/kendo-popup-common"),b=require("./util.js"),E=require("./package-metadata.js");function A(h){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>h[t]})}}return o.default=h,Object.freeze(o)}const O=A(D),N=A(_),M=100,x=1;function w(h,o){if(h===o)return!0;if(!!h!=!!o)return!1;const t=Object.getOwnPropertyNames(h),n=Object.getOwnPropertyNames(o);if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++){let s=t[r];if(h[s]!==o[s])return!1}return!0}const R={left:-1e3,top:0},y=class y extends O.Component{constructor(o){super(o),this.context=0,this.state={current:"hidden",previous:"hidden",props:{}},this._popup=null,this.show=t=>{window==null||window.addEventListener("mousedown",this.handleMouseDown),this.setPosition(t),this.animate(t.firstChild,"enter",this.onOpened),this.setState({current:"shown",previous:this.state.current})},this.setPosition=t=>{let{anchorAlign:n,popupAlign:r,collision:s,offset:c,anchor:a,margin:u,scale:d,positionMode:f}=this.props;const{width:g,height:m}=t.style;t.style.width=t.offsetWidth+"px",t.style.height=t.offsetHeight+"px";const P=i.alignElement({anchor:a,anchorAlign:n,element:t,elementAlign:r,offset:c,margin:u,positionMode:f,scale:d}),p=i.positionElement({anchor:a,anchorAlign:n,element:t,elementAlign:r,collisions:s,currentLocation:P,margin:this.props.margin});if(t.style.top=p.offset.top+"px",t.style.left=p.offset.left+"px",t.style.width=g,t.style.height=m,this._collisions={fit:p.fit,fitted:p.fitted,flip:p.flip,flipped:p.flipped},this.props.onPosition){const C={target:this,flipped:p.flipped,fitted:p.fitted};this.props.onPosition.call(void 0,C)}},this.onOpened=()=>{const t=this._popup;if(t){if(this.props.show){const{unstyled:n}=this.props,r=n&&n.uPopup;t.classList.add(...l.classNames(l.uPopup.animationContainerShown({c:r})).split(" ").filter(s=>s))}this.attachRepositionHandlers(t),this.props.onOpen&&this.props.onOpen.call(void 0,{target:this})}},this.animate=(t,n,r)=>{if(!this.props.popupAlign)return;let s;const{horizontal:c,vertical:a}=this.props.popupAlign;c==="left"&&a==="center"?s="right":c==="right"&&a==="center"?s="left":a==="top"?s="down":s="up";const u={down:"up",up:"down",left:"right",right:"left"};this._collisions&&this._collisions.flipped&&(s=u[s]);const{unstyled:d}=this.props,f=d&&d.uPopup;T.slide(t,s,this.animationDuration[n],n,r,f)},this.handleMouseDown=t=>{var s,c;const n=((s=t==null?void 0:t.target)==null?void 0:s.closest(".k-animation-container"))===null,r=((c=this.props.anchor)==null?void 0:c.contains(t==null?void 0:t.target))||!1;if(n){if(this.props.onMouseDownOutside){const a={target:this,event:t,state:this.state,isAnchorClicked:r};this.props.onMouseDownOutside.call(void 0,a)}window==null||window.removeEventListener("mousedown",this.handleMouseDown)}},this.onClosing=t=>{if(!this.props.show){const{unstyled:n}=this.props,r=n&&n.uPopup;t.classList.remove(...l.classNames(l.uPopup.animationContainerShown({c:r})).split(" ").filter(s=>s))}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+x:M,l.validatePackage(E.packageMetadata),this.reposition=b.throttle(this.reposition.bind(this),b.FRAME_DURATION)}get element(){return this._popup}static getDerivedStateFromProps(o,t){const{show:n,anchor:r,anchorAlign:s,appendTo:c,collision:a,popupAlign:u,className:d,popupClass:f,style:g,offset:m,contentKey:P}=o,p={...t,props:{show:n,anchor:r,anchorAlign:s,appendTo:c,collision:a,popupAlign:u,className:d,popupClass:f,style:g,offset:m,contentKey:P}};return o.show?t.current==="hidden"||t.current==="hiding"?{...p,current:"showing",previous:t.current}:t.current==="showing"?{...p,current:"shown",previous:t.current}:t.current==="shown"&&(!w(m,t.props.offset)||!w(s,t.props.anchorAlign)||!w(c,t.props.appendTo)||!w(a,t.props.collision)||!w(u,t.props.popupAlign)||!w(g,t.props.style)||r!==t.props.anchor||f!==t.props.popupClass||d!==t.props.className)?{...p,current:"reposition",previous:t.current}:p:t.current==="hiding"||t.current==="hidden"?{...p,current:"hidden",previous:t.current}:{...p,current:"hiding",previous:t.current}}componentDidUpdate(o){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"&&o.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:o,className:t,popupClass:n,unstyled:r,show:s,id:c,positionMode:a}=this.props,u=r&&r.uPopup,d=this.props.appendTo?this.props.appendTo:l.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:a,top:0,left:-1e4},this.props.style||{}),g=this.state.current==="hiding";if((s||g)&&d){const m=this.getCurrentZIndex(),P=O.createElement(l.ZIndexContext.Provider,{value:m},O.createElement("div",{onKeyDown:this.props.onKeyDown,className:l.classNames(l.uPopup.animationContainer({c:u}),t),id:c,ref:p=>this._popup=p,style:{zIndex:m,...f}},O.createElement("div",{className:l.classNames(l.uPopup.animationChild({c:u})),style:{transitionDelay:"0ms"}},O.createElement("div",{role:this.props.role,className:l.classNames(l.uPopup.popup({c:u}),n)},o))));return this.props.appendTo!==null?N.createPortal(P,d):P}return null}get animationDuration(){const o=this.props.animate;let t=0,n=0;return o&&(o===!0?t=n=300:(t=o.openDuration||0,n=o.closeDuration||0)),{enter:t,exit:n}}attachRepositionHandlers(o){this.detachRepositionHandlers(),this._scrollableParents=i.domUtils.scrollableParents(this.props.anchor||o),this._scrollableParents&&this._scrollableParents.map(t=>t.addEventListener("scroll",this.reposition)),window.addEventListener("resize",this.reposition)}detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(o=>o.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)}reposition(){this.setState({current:"reposition",previous:this.state.current})}};y.propTypes={anchor:function(o){const t=o.anchor;return t&&typeof t.nodeType!="number"?new Error("Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."):null},appendTo:function(o){const t=o.appendTo;return t&&typeof t.nodeType!="number"?new Error("Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."):null},className:e.oneOfType([e.string,e.arrayOf(e.string),e.object]),id:e.string,popupClass:e.oneOfType([e.string,e.arrayOf(e.string),e.object]),collision:e.shape({horizontal:e.oneOf([i.Collision.fit,i.Collision.flip,i.Collision.none]),vertical:e.oneOf([i.Collision.fit,i.Collision.flip,i.Collision.none])}),anchorAlign:e.shape({horizontal:e.oneOf([i.AlignPoint.left,i.AlignPoint.center,i.AlignPoint.right]),vertical:e.oneOf([i.AlignPoint.top,i.AlignPoint.center,i.AlignPoint.bottom])}),popupAlign:e.shape({horizontal:e.oneOf([i.AlignPoint.left,i.AlignPoint.center,i.AlignPoint.right]),vertical:e.oneOf([i.AlignPoint.top,i.AlignPoint.center,i.AlignPoint.bottom])}),offset:e.shape({left:e.number,top:e.number}),children:e.oneOfType([e.element,e.node]),show:e.bool,animate:e.oneOfType([e.bool,e.shape({openDuration:e.number,closeDuration:e.number})]),margin:e.shape({horizontal:e.number,vertical:e.number}),positionMode:e.oneOf(["fixed","absolute"]),scale:e.number,style:e.object,onClose:e.func,onPosition:e.func,onOpen:e.func,onKeyPress:e.func,onMouseDownOutside:e.func},y.defaultProps={collision:{horizontal:i.Collision.fit,vertical:i.Collision.flip},anchorAlign:{horizontal:i.AlignPoint.left,vertical:i.AlignPoint.bottom},popupAlign:{horizontal:i.AlignPoint.left,vertical:i.AlignPoint.top},offset:R,animate:!0,show:!1,margin:{horizontal:0,vertical:0},positionMode:"absolute"},y.contextType=l.ZIndexContext,y.displayName="PopupComponent";let v=y;exports.PopupWithoutContext=v;
@@ -6,26 +6,26 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as w from "react";
10
- import * as N from "react-dom";
9
+ import * as v from "react";
10
+ import * as A from "react-dom";
11
11
  import e from "prop-types";
12
- import { slide as E } from "./animation.mjs";
13
- import { validatePackage as D, ZIndexContext as _, canUseDOM as I, classNames as P } from "@progress/kendo-react-common";
14
- import { alignElement as C, positionElement as x, Collision as c, AlignPoint as n, domUtils as R } from "@progress/kendo-popup-common";
15
- import { throttle as z, FRAME_DURATION as M } from "./util.mjs";
16
- import { packageMetadata as L } from "./package-metadata.mjs";
17
- const U = 100, H = 1;
18
- function g(y, i) {
19
- if (y === i)
12
+ import { slide as C } from "./animation.mjs";
13
+ import { classNames as P, uPopup as O, validatePackage as E, ZIndexContext as D, canUseDOM as x } from "@progress/kendo-react-common";
14
+ import { alignElement as M, positionElement as N, Collision as d, AlignPoint as p, domUtils as z } from "@progress/kendo-popup-common";
15
+ import { throttle as R, FRAME_DURATION as L } from "./util.mjs";
16
+ import { packageMetadata as I } from "./package-metadata.mjs";
17
+ const S = 100, U = 1;
18
+ function w(b, o) {
19
+ if (b === o)
20
20
  return !0;
21
- if (!!y != !!i)
21
+ if (!!b != !!o)
22
22
  return !1;
23
- const t = Object.getOwnPropertyNames(y), s = Object.getOwnPropertyNames(i);
23
+ const t = Object.getOwnPropertyNames(b), s = Object.getOwnPropertyNames(o);
24
24
  if (t.length !== s.length)
25
25
  return !1;
26
- for (let p = 0; p < t.length; p++) {
27
- let o = t[p];
28
- if (y[o] !== i[o])
26
+ for (let n = 0; n < t.length; n++) {
27
+ let i = t[n];
28
+ if (b[i] !== o[i])
29
29
  return !1;
30
30
  }
31
31
  return !0;
@@ -33,72 +33,100 @@ function g(y, i) {
33
33
  const K = {
34
34
  left: -1e3,
35
35
  top: 0
36
- }, S = "k-animation-container", b = "k-animation-container-shown", j = "k-child-animation-container", k = "k-popup", v = class v extends w.Component {
37
- constructor(i) {
38
- super(i), this.context = 0, this.state = { current: "hidden", previous: "hidden", props: {} }, this._popup = null, this.show = (t) => {
39
- this.setPosition(t), this.animate(t.firstChild, "enter", this.onOpened), this.setState({ current: "shown", previous: this.state.current });
36
+ }, y = class y extends v.Component {
37
+ constructor(o) {
38
+ super(o), this.context = 0, this.state = { current: "hidden", previous: "hidden", props: {} }, this._popup = null, this.show = (t) => {
39
+ window == null || window.addEventListener("mousedown", this.handleMouseDown), this.setPosition(t), this.animate(t.firstChild, "enter", this.onOpened), this.setState({ current: "shown", previous: this.state.current });
40
40
  }, this.setPosition = (t) => {
41
- let { anchorAlign: s, popupAlign: p, collision: o, offset: a, anchor: l, margin: h, scale: d, positionMode: u } = this.props;
42
- const { width: f, height: m } = t.style;
41
+ let { anchorAlign: s, popupAlign: n, collision: i, offset: a, anchor: l, margin: h, scale: c, positionMode: u } = this.props;
42
+ const { width: m, height: f } = t.style;
43
43
  t.style.width = t.offsetWidth + "px", t.style.height = t.offsetHeight + "px";
44
- const O = C({
44
+ const g = M({
45
45
  anchor: l,
46
46
  anchorAlign: s,
47
47
  element: t,
48
- elementAlign: p,
48
+ elementAlign: n,
49
49
  offset: a,
50
50
  margin: h,
51
51
  positionMode: u,
52
- scale: d
53
- }), r = x({
52
+ scale: c
53
+ }), r = N({
54
54
  anchor: l,
55
55
  anchorAlign: s,
56
56
  element: t,
57
- elementAlign: p,
58
- collisions: o,
59
- currentLocation: O,
57
+ elementAlign: n,
58
+ collisions: i,
59
+ currentLocation: g,
60
60
  margin: this.props.margin
61
61
  });
62
- if (t.style.top = r.offset.top + "px", t.style.left = r.offset.left + "px", t.style.width = f, t.style.height = m, this._collisions = {
62
+ if (t.style.top = r.offset.top + "px", t.style.left = r.offset.left + "px", t.style.width = m, t.style.height = f, this._collisions = {
63
63
  fit: r.fit,
64
64
  fitted: r.fitted,
65
65
  flip: r.flip,
66
66
  flipped: r.flipped
67
67
  }, this.props.onPosition) {
68
- const A = {
68
+ const T = {
69
69
  target: this,
70
70
  flipped: r.flipped,
71
71
  fitted: r.fitted
72
72
  };
73
- this.props.onPosition.call(void 0, A);
73
+ this.props.onPosition.call(void 0, T);
74
74
  }
75
75
  }, this.onOpened = () => {
76
76
  const t = this._popup;
77
- t && (this.props.show && t.classList.add(b), this.attachRepositionHandlers(t), this.props.onOpen && this.props.onOpen.call(void 0, { target: this }));
78
- }, this.animate = (t, s, p) => {
77
+ if (t) {
78
+ if (this.props.show) {
79
+ const { unstyled: s } = this.props, n = s && s.uPopup;
80
+ t.classList.add(...P(O.animationContainerShown({ c: n })).split(" ").filter((i) => i));
81
+ }
82
+ this.attachRepositionHandlers(t), this.props.onOpen && this.props.onOpen.call(void 0, { target: this });
83
+ }
84
+ }, this.animate = (t, s, n) => {
79
85
  if (!this.props.popupAlign)
80
86
  return;
81
- let o;
87
+ let i;
82
88
  const { horizontal: a, vertical: l } = this.props.popupAlign;
83
- a === "left" && l === "center" ? o = "right" : a === "right" && l === "center" ? o = "left" : l === "top" ? o = "down" : o = "up";
89
+ a === "left" && l === "center" ? i = "right" : a === "right" && l === "center" ? i = "left" : l === "top" ? i = "down" : i = "up";
84
90
  const h = {
85
91
  down: "up",
86
92
  up: "down",
87
93
  left: "right",
88
94
  right: "left"
89
95
  };
90
- this._collisions && this._collisions.flipped && (o = h[o]), E(
96
+ this._collisions && this._collisions.flipped && (i = h[i]);
97
+ const { unstyled: c } = this.props, u = c && c.uPopup;
98
+ C(
91
99
  t,
92
- o,
100
+ i,
93
101
  this.animationDuration[s],
94
102
  s,
95
- p
103
+ n,
104
+ u
96
105
  );
106
+ }, this.handleMouseDown = (t) => {
107
+ var i, a;
108
+ const s = ((i = t == null ? void 0 : t.target) == null ? void 0 : i.closest(".k-animation-container")) === null, n = ((a = this.props.anchor) == null ? void 0 : a.contains(t == null ? void 0 : t.target)) || !1;
109
+ if (s) {
110
+ if (this.props.onMouseDownOutside) {
111
+ const l = {
112
+ target: this,
113
+ event: t,
114
+ state: this.state,
115
+ isAnchorClicked: n
116
+ };
117
+ this.props.onMouseDownOutside.call(void 0, l);
118
+ }
119
+ window == null || window.removeEventListener("mousedown", this.handleMouseDown);
120
+ }
97
121
  }, this.onClosing = (t) => {
98
- this.props.show || t.classList.remove(b), this.detachRepositionHandlers();
122
+ if (!this.props.show) {
123
+ const { unstyled: s } = this.props, n = s && s.uPopup;
124
+ t.classList.remove(...P(O.animationContainerShown({ c: n })).split(" ").filter((i) => i));
125
+ }
126
+ this.detachRepositionHandlers();
99
127
  }, this.onClosed = () => {
100
128
  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 });
101
- }, this.getCurrentZIndex = () => this.context ? this.context + H : U, D(L), this.reposition = z(this.reposition.bind(this), M);
129
+ }, this.getCurrentZIndex = () => this.context ? this.context + U : S, E(I), this.reposition = R(this.reposition.bind(this), L);
102
130
  }
103
131
  /**
104
132
  * Represents the Popup DOM element.
@@ -109,33 +137,33 @@ const K = {
109
137
  /**
110
138
  * @hidden
111
139
  */
112
- static getDerivedStateFromProps(i, t) {
113
- const { show: s, anchor: p, anchorAlign: o, appendTo: a, collision: l, popupAlign: h, className: d, popupClass: u, style: f, offset: m, contentKey: O } = i, r = {
140
+ static getDerivedStateFromProps(o, t) {
141
+ const { show: s, anchor: n, anchorAlign: i, appendTo: a, collision: l, popupAlign: h, className: c, popupClass: u, style: m, offset: f, contentKey: g } = o, r = {
114
142
  ...t,
115
143
  props: {
116
144
  show: s,
117
- anchor: p,
118
- anchorAlign: o,
145
+ anchor: n,
146
+ anchorAlign: i,
119
147
  appendTo: a,
120
148
  collision: l,
121
149
  popupAlign: h,
122
- className: d,
150
+ className: c,
123
151
  popupClass: u,
124
- style: f,
125
- offset: m,
126
- contentKey: O
152
+ style: m,
153
+ offset: f,
154
+ contentKey: g
127
155
  }
128
156
  };
129
- return i.show ? t.current === "hidden" || t.current === "hiding" ? { ...r, current: "showing", previous: t.current } : t.current === "showing" ? { ...r, current: "shown", previous: t.current } : t.current === "shown" && (!g(m, t.props.offset) || !g(o, t.props.anchorAlign) || !g(a, t.props.appendTo) || !g(l, t.props.collision) || !g(h, t.props.popupAlign) || !g(f, t.props.style) || p !== t.props.anchor || u !== t.props.popupClass || d !== t.props.className) ? { ...r, current: "reposition", previous: t.current } : r : t.current === "hiding" || t.current === "hidden" ? { ...r, current: "hidden", previous: t.current } : { ...r, current: "hiding", previous: t.current };
157
+ return o.show ? t.current === "hidden" || t.current === "hiding" ? { ...r, current: "showing", previous: t.current } : t.current === "showing" ? { ...r, current: "shown", previous: t.current } : t.current === "shown" && (!w(f, t.props.offset) || !w(i, t.props.anchorAlign) || !w(a, t.props.appendTo) || !w(l, t.props.collision) || !w(h, t.props.popupAlign) || !w(m, t.props.style) || n !== t.props.anchor || u !== t.props.popupClass || c !== t.props.className) ? { ...r, current: "reposition", previous: t.current } : r : t.current === "hiding" || t.current === "hidden" ? { ...r, current: "hidden", previous: t.current } : { ...r, current: "hiding", previous: t.current };
130
158
  }
131
159
  /**
132
160
  *
133
161
  * @hidden
134
162
  */
135
- componentDidUpdate(i) {
163
+ componentDidUpdate(o) {
136
164
  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(() => {
137
165
  this.setState({ current: "shown", previous: this.state.current });
138
- }, 0) : this.state.current === "shown" && i.contentKey !== this.props.contentKey && this._popup && this.setPosition(this._popup);
166
+ }, 0) : this.state.current === "shown" && o.contentKey !== this.props.contentKey && this._popup && this.setPosition(this._popup);
139
167
  }
140
168
  /**
141
169
  * @hidden
@@ -154,69 +182,70 @@ const K = {
154
182
  */
155
183
  render() {
156
184
  const {
157
- children: i,
185
+ children: o,
158
186
  className: t,
159
187
  popupClass: s,
160
- show: p,
161
- id: o,
162
- positionMode: a
163
- } = this.props, l = this.props.appendTo ? this.props.appendTo : I ? this.props.anchor && this.props.anchor.ownerDocument ? this.props.anchor.ownerDocument.body : document.body : void 0;
188
+ unstyled: n,
189
+ show: i,
190
+ id: a,
191
+ positionMode: l
192
+ } = this.props, h = n && n.uPopup, c = this.props.appendTo ? this.props.appendTo : x ? this.props.anchor && this.props.anchor.ownerDocument ? this.props.anchor.ownerDocument.body : document.body : void 0;
164
193
  this.state.current === "reposition" && this.state.previous === "shown" && this._popup && this.setPosition(this._popup);
165
- const h = Object.assign(
194
+ const u = Object.assign(
166
195
  {},
167
- { position: a, top: 0, left: -1e4 },
196
+ { position: l, top: 0, left: -1e4 },
168
197
  this.props.style || {}
169
- ), d = this.state.current === "hiding";
170
- if ((p || d) && l) {
171
- const u = this.getCurrentZIndex(), f = /* @__PURE__ */ w.createElement(_.Provider, { value: u }, /* @__PURE__ */ w.createElement(
198
+ ), m = this.state.current === "hiding";
199
+ if ((i || m) && c) {
200
+ const f = this.getCurrentZIndex(), g = /* @__PURE__ */ v.createElement(D.Provider, { value: f }, /* @__PURE__ */ v.createElement(
172
201
  "div",
173
202
  {
174
203
  onKeyDown: this.props.onKeyDown,
175
- className: P(S, t),
176
- id: o,
177
- ref: (m) => this._popup = m,
204
+ className: P(O.animationContainer({ c: h }), t),
205
+ id: a,
206
+ ref: (r) => this._popup = r,
178
207
  style: {
179
- zIndex: u,
180
- ...h
208
+ zIndex: f,
209
+ ...u
181
210
  }
182
211
  },
183
- /* @__PURE__ */ w.createElement("div", { className: P(j), style: { transitionDelay: "0ms" } }, /* @__PURE__ */ w.createElement(
212
+ /* @__PURE__ */ v.createElement("div", { className: P(O.animationChild({ c: h })), style: { transitionDelay: "0ms" } }, /* @__PURE__ */ v.createElement(
184
213
  "div",
185
214
  {
186
215
  role: this.props.role,
187
- className: P(k, s)
216
+ className: P(O.popup({ c: h }), s)
188
217
  },
189
- i
218
+ o
190
219
  ))
191
220
  ));
192
- return this.props.appendTo !== null ? N.createPortal(f, l) : f;
221
+ return this.props.appendTo !== null ? A.createPortal(g, c) : g;
193
222
  }
194
223
  return null;
195
224
  }
196
225
  get animationDuration() {
197
- const i = this.props.animate;
226
+ const o = this.props.animate;
198
227
  let t = 0, s = 0;
199
- return i && (i === !0 ? t = s = 300 : (t = i.openDuration || 0, s = i.closeDuration || 0)), { enter: t, exit: s };
228
+ return o && (o === !0 ? t = s = 300 : (t = o.openDuration || 0, s = o.closeDuration || 0)), { enter: t, exit: s };
200
229
  }
201
- attachRepositionHandlers(i) {
202
- this.detachRepositionHandlers(), this._scrollableParents = R.scrollableParents(this.props.anchor || i), this._scrollableParents && this._scrollableParents.map((t) => t.addEventListener("scroll", this.reposition)), window.addEventListener("resize", this.reposition);
230
+ attachRepositionHandlers(o) {
231
+ this.detachRepositionHandlers(), this._scrollableParents = z.scrollableParents(this.props.anchor || o), this._scrollableParents && this._scrollableParents.map((t) => t.addEventListener("scroll", this.reposition)), window.addEventListener("resize", this.reposition);
203
232
  }
204
233
  detachRepositionHandlers() {
205
- this._scrollableParents && (this._scrollableParents.map((i) => i.removeEventListener("scroll", this.reposition)), this._scrollableParents = void 0), window.removeEventListener("resize", this.reposition);
234
+ this._scrollableParents && (this._scrollableParents.map((o) => o.removeEventListener("scroll", this.reposition)), this._scrollableParents = void 0), window.removeEventListener("resize", this.reposition);
206
235
  }
207
236
  reposition() {
208
237
  this.setState({ current: "reposition", previous: this.state.current });
209
238
  }
210
239
  };
211
- v.propTypes = {
212
- anchor: function(i) {
213
- const t = i.anchor;
240
+ y.propTypes = {
241
+ anchor: function(o) {
242
+ const t = o.anchor;
214
243
  return t && typeof t.nodeType != "number" ? new Error(
215
244
  "Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."
216
245
  ) : null;
217
246
  },
218
- appendTo: function(i) {
219
- const t = i.appendTo;
247
+ appendTo: function(o) {
248
+ const t = o.appendTo;
220
249
  return t && typeof t.nodeType != "number" ? new Error(
221
250
  "Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."
222
251
  ) : null;
@@ -234,38 +263,38 @@ v.propTypes = {
234
263
  ]),
235
264
  collision: e.shape({
236
265
  horizontal: e.oneOf([
237
- c.fit,
238
- c.flip,
239
- c.none
266
+ d.fit,
267
+ d.flip,
268
+ d.none
240
269
  ]),
241
270
  vertical: e.oneOf([
242
- c.fit,
243
- c.flip,
244
- c.none
271
+ d.fit,
272
+ d.flip,
273
+ d.none
245
274
  ])
246
275
  }),
247
276
  anchorAlign: e.shape({
248
277
  horizontal: e.oneOf([
249
- n.left,
250
- n.center,
251
- n.right
278
+ p.left,
279
+ p.center,
280
+ p.right
252
281
  ]),
253
282
  vertical: e.oneOf([
254
- n.top,
255
- n.center,
256
- n.bottom
283
+ p.top,
284
+ p.center,
285
+ p.bottom
257
286
  ])
258
287
  }),
259
288
  popupAlign: e.shape({
260
289
  horizontal: e.oneOf([
261
- n.left,
262
- n.center,
263
- n.right
290
+ p.left,
291
+ p.center,
292
+ p.right
264
293
  ]),
265
294
  vertical: e.oneOf([
266
- n.top,
267
- n.center,
268
- n.bottom
295
+ p.top,
296
+ p.center,
297
+ p.bottom
269
298
  ])
270
299
  }),
271
300
  offset: e.shape({
@@ -297,19 +326,20 @@ v.propTypes = {
297
326
  onClose: e.func,
298
327
  onPosition: e.func,
299
328
  onOpen: e.func,
300
- onKeyPress: e.func
301
- }, v.defaultProps = {
329
+ onKeyPress: e.func,
330
+ onMouseDownOutside: e.func
331
+ }, y.defaultProps = {
302
332
  collision: {
303
- horizontal: c.fit,
304
- vertical: c.flip
333
+ horizontal: d.fit,
334
+ vertical: d.flip
305
335
  },
306
336
  anchorAlign: {
307
- horizontal: n.left,
308
- vertical: n.bottom
337
+ horizontal: p.left,
338
+ vertical: p.bottom
309
339
  },
310
340
  popupAlign: {
311
- horizontal: n.left,
312
- vertical: n.top
341
+ horizontal: p.left,
342
+ vertical: p.top
313
343
  },
314
344
  offset: K,
315
345
  animate: !0,
@@ -319,8 +349,8 @@ v.propTypes = {
319
349
  vertical: 0
320
350
  },
321
351
  positionMode: "absolute"
322
- }, v.contextType = _, v.displayName = "PopupComponent";
323
- let T = v;
352
+ }, y.contextType = D, y.displayName = "PopupComponent";
353
+ let _ = y;
324
354
  export {
325
- T as PopupWithoutContext
355
+ _ as PopupWithoutContext
326
356
  };
package/animation.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=s=>{s.style.transitionDuration="",Array.from(s.classList).forEach(i=>{i.startsWith("k-slide-")&&s.classList.remove(i)})},y=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),v=(s,i,n,r,o)=>{if(n===0)return o();const a="k-slide-"+i+"-"+r,u=a+"-active",e=l=>{l.target===s&&(s.removeEventListener("transitionend",e),f(s),r==="exit"?s.style.display="none":s.style.display="",o())};s.addEventListener("transitionend",e);const d=s.ownerDocument;if(!d)return;const t=d.defaultView;if(!t)return;const c=()=>{f(s),s.classList.add(a),t.requestAnimationFrame(()=>{s.style.transitionDuration=n+"ms",s.classList.add(u)})};y?t.requestAnimationFrame(c):c()};exports.slide=v;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@progress/kendo-react-common"),w=(i,s,n)=>{i.style.transitionDuration="",s&&i.classList.remove(...s.split(" ")),s&&i.classList.remove(...n.split(" "))},p=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),y=(i,s,n,r,d,u)=>{if(n===0)return d();const o=e.classNames(e.uPopup.slide({direction:s,type:r,c:u})),a=e.classNames(e.uPopup.slideActive({direction:s,type:r,c:u})),f=t=>{t.target===i&&(i.removeEventListener("transitionend",f),w(i,o,a),r==="exit"?i.style.display="none":i.style.display="",d())};i.addEventListener("transitionend",f);const l=i.ownerDocument;if(!l)return;const c=l.defaultView;if(!c)return;const v=()=>{w(i,o,a),o&&i.classList.add(...o.split(" ").filter(t=>t)),c.requestAnimationFrame(()=>{i.style.transitionDuration=n+"ms",i.classList.add(...a.split(" ").filter(t=>t))})};p?c.requestAnimationFrame(v):v()};exports.slide=y;
package/animation.mjs CHANGED
@@ -6,30 +6,29 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- const f = (s) => {
10
- s.style.transitionDuration = "", Array.from(s.classList).forEach((i) => {
11
- i.startsWith("k-slide-") && s.classList.remove(i);
12
- });
13
- }, w = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), v = (s, i, n, r, o) => {
9
+ import { classNames as v, uPopup as w } from "@progress/kendo-react-common";
10
+ const p = (i, s, n) => {
11
+ i.style.transitionDuration = "", s && i.classList.remove(...s.split(" ")), s && i.classList.remove(...n.split(" "));
12
+ }, L = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), A = (i, s, n, r, c, d) => {
14
13
  if (n === 0)
15
- return o();
16
- const a = "k-slide-" + i + "-" + r, u = a + "-active", e = (l) => {
17
- l.target === s && (s.removeEventListener("transitionend", e), f(s), r === "exit" ? s.style.display = "none" : s.style.display = "", o());
14
+ return c();
15
+ const o = v(w.slide({ direction: s, type: r, c: d })), a = v(w.slideActive({ direction: s, type: r, c: d })), f = (t) => {
16
+ t.target === i && (i.removeEventListener("transitionend", f), p(i, o, a), r === "exit" ? i.style.display = "none" : i.style.display = "", c());
18
17
  };
19
- s.addEventListener("transitionend", e);
20
- const d = s.ownerDocument;
21
- if (!d)
18
+ i.addEventListener("transitionend", f);
19
+ const u = i.ownerDocument;
20
+ if (!u)
22
21
  return;
23
- const t = d.defaultView;
24
- if (!t)
22
+ const e = u.defaultView;
23
+ if (!e)
25
24
  return;
26
- const c = () => {
27
- f(s), s.classList.add(a), t.requestAnimationFrame(() => {
28
- s.style.transitionDuration = n + "ms", s.classList.add(u);
25
+ const l = () => {
26
+ p(i, o, a), o && i.classList.add(...o.split(" ").filter((t) => t)), e.requestAnimationFrame(() => {
27
+ i.style.transitionDuration = n + "ms", i.classList.add(...a.split(" ").filter((t) => t));
29
28
  });
30
29
  };
31
- w ? t.requestAnimationFrame(c) : c();
30
+ L ? e.requestAnimationFrame(l) : l();
32
31
  };
33
32
  export {
34
- v as slide
33
+ A as slide
35
34
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-dom"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-popup-common")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","prop-types","@progress/kendo-react-common","@progress/kendo-popup-common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).KendoReactPopup={},t.React,t.ReactDOM,t.PropTypes,t.KendoReactCommon,t.KendoPopupCommon)}(this,(function(t,e,o,n,i,s){"use strict";function r(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,n.get?n:{enumerable:!0,get:function(){return t[o]}})}})),e.default=t,Object.freeze(e)}var p=r(e),l=r(o);const a=t=>{t.style.transitionDuration="",Array.from(t.classList).forEach((e=>{e.startsWith("k-slide-")&&t.classList.remove(e)}))},c="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent),h={name:"@progress/kendo-react-popup",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};function u(t,e){if(t===e)return!0;if(!!t!=!!e)return!1;const o=Object.getOwnPropertyNames(t),n=Object.getOwnPropertyNames(e);if(o.length!==n.length)return!1;for(let n=0;n<o.length;n++){let i=o[n];if(t[i]!==e[i])return!1}return!0}const d="k-animation-container-shown",f=class extends p.Component{constructor(t){super(t),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:e,popupAlign:o,collision:n,offset:i,anchor:r,margin:p,scale:l,positionMode:a}=this.props;const{width:c,height:h}=t.style;t.style.width=t.offsetWidth+"px",t.style.height=t.offsetHeight+"px";const u=s.alignElement({anchor:r,anchorAlign:e,element:t,elementAlign:o,offset:i,margin:p,positionMode:a,scale:l}),d=s.positionElement({anchor:r,anchorAlign:e,element:t,elementAlign:o,collisions:n,currentLocation:u,margin:this.props.margin});if(t.style.top=d.offset.top+"px",t.style.left=d.offset.left+"px",t.style.width=c,t.style.height=h,this._collisions={fit:d.fit,fitted:d.fitted,flip:d.flip,flipped:d.flipped},this.props.onPosition){const t={target:this,flipped:d.flipped,fitted:d.fitted};this.props.onPosition.call(void 0,t)}},this.onOpened=()=>{const t=this._popup;t&&(this.props.show&&t.classList.add(d),this.attachRepositionHandlers(t),this.props.onOpen&&this.props.onOpen.call(void 0,{target:this}))},this.animate=(t,e,o)=>{if(!this.props.popupAlign)return;let n;const{horizontal:i,vertical:s}=this.props.popupAlign;n="left"===i&&"center"===s?"right":"right"===i&&"center"===s?"left":"top"===s?"down":"up";this._collisions&&this._collisions.flipped&&(n={down:"up",up:"down",left:"right",right:"left"}[n]),((t,e,o,n,i)=>{if(0===o)return i();const s="k-slide-"+e+"-"+n,r=s+"-active",p=e=>{e.target===t&&(t.removeEventListener("transitionend",p),a(t),t.style.display="exit"===n?"none":"",i())};t.addEventListener("transitionend",p);const l=t.ownerDocument;if(!l)return;const h=l.defaultView;if(!h)return;const u=()=>{a(t),t.classList.add(s),h.requestAnimationFrame((()=>{t.style.transitionDuration=o+"ms",t.classList.add(r)}))};c?h.requestAnimationFrame(u):u()})(t,n,this.animationDuration[e],e,o)},this.onClosing=t=>{this.props.show||t.classList.remove(d),this.detachRepositionHandlers()},this.onClosed=()=>{"hiding"===this.state.current&&"shown"===this.state.previous&&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+1:100,i.validatePackage(h),this.reposition=function(t,e,o={}){let n,i,s,r,p=0;o=o||{};const l=function(){p=!1===o.leading?0:(new Date).getTime(),n=void 0,r=t.apply(i,s),n||(i=s=null)};return function(){const a=(new Date).getTime();!p&&!1===o.leading&&(p=a);const c=e-(a-p);return i=void 0,s=arguments,c<=0||c>e?(n&&(clearTimeout(n),n=void 0),p=a,r=t.apply(i,s),n||(i=s=null)):!n&&!1!==o.trailing&&(n=window.setTimeout(l,c)),r}}(this.reposition.bind(this),16.666666666666668)}get element(){return this._popup}static getDerivedStateFromProps(t,e){const{show:o,anchor:n,anchorAlign:i,appendTo:s,collision:r,popupAlign:p,className:l,popupClass:a,style:c,offset:h,contentKey:d}=t,f={...e,props:{show:o,anchor:n,anchorAlign:i,appendTo:s,collision:r,popupAlign:p,className:l,popupClass:a,style:c,offset:h,contentKey:d}};return t.show?"hidden"===e.current||"hiding"===e.current?{...f,current:"showing",previous:e.current}:"showing"===e.current?{...f,current:"shown",previous:e.current}:"shown"!==e.current||u(h,e.props.offset)&&u(i,e.props.anchorAlign)&&u(s,e.props.appendTo)&&u(r,e.props.collision)&&u(p,e.props.popupAlign)&&u(c,e.props.style)&&n===e.props.anchor&&a===e.props.popupClass&&l===e.props.className?f:{...f,current:"reposition",previous:e.current}:"hiding"===e.current||"hidden"===e.current?{...f,current:"hidden",previous:e.current}:{...f,current:"hiding",previous:e.current}}componentDidUpdate(t){"showing"===this.state.current&&this._popup?this.show(this._popup):"hiding"===this.state.current&&this._popup?(this.onClosing(this._popup),this.animate(this._popup.firstChild,"exit",this.onClosed)):"reposition"===this.state.current&&"shown"===this.state.previous?setTimeout((()=>{this.setState({current:"shown",previous:this.state.current})}),0):"shown"===this.state.current&&t.contentKey!==this.props.contentKey&&this._popup&&this.setPosition(this._popup)}componentDidMount(){"showing"===this.state.current&&this._popup&&this.show(this._popup)}componentWillUnmount(){this.detachRepositionHandlers()}render(){const{children:t,className:e,popupClass:o,show:n,id:s,positionMode:r}=this.props,a=this.props.appendTo?this.props.appendTo:i.canUseDOM?this.props.anchor&&this.props.anchor.ownerDocument?this.props.anchor.ownerDocument.body:document.body:void 0;"reposition"===this.state.current&&"shown"===this.state.previous&&this._popup&&this.setPosition(this._popup);const c=Object.assign({},{position:r,top:0,left:-1e4},this.props.style||{}),h="hiding"===this.state.current;if((n||h)&&a){const n=this.getCurrentZIndex(),r=p.createElement(i.ZIndexContext.Provider,{value:n},p.createElement("div",{onKeyDown:this.props.onKeyDown,className:i.classNames("k-animation-container",e),id:s,ref:t=>this._popup=t,style:{zIndex:n,...c}},p.createElement("div",{className:i.classNames("k-child-animation-container"),style:{transitionDelay:"0ms"}},p.createElement("div",{role:this.props.role,className:i.classNames("k-popup",o)},t))));return null!==this.props.appendTo?l.createPortal(r,a):r}return null}get animationDuration(){const t=this.props.animate;let e=0,o=0;return t&&(!0===t?e=o=300:(e=t.openDuration||0,o=t.closeDuration||0)),{enter:e,exit:o}}attachRepositionHandlers(t){this.detachRepositionHandlers(),this._scrollableParents=s.domUtils.scrollableParents(this.props.anchor||t),this._scrollableParents&&this._scrollableParents.map((t=>t.addEventListener("scroll",this.reposition))),window.addEventListener("resize",this.reposition)}detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map((t=>t.removeEventListener("scroll",this.reposition))),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)}reposition(){this.setState({current:"reposition",previous:this.state.current})}};f.propTypes={anchor:function(t){const e=t.anchor;return e&&"number"!=typeof e.nodeType?new Error("Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."):null},appendTo:function(t){const e=t.appendTo;return e&&"number"!=typeof e.nodeType?new Error("Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."):null},className:n.oneOfType([n.string,n.arrayOf(n.string),n.object]),id:n.string,popupClass:n.oneOfType([n.string,n.arrayOf(n.string),n.object]),collision:n.shape({horizontal:n.oneOf([s.Collision.fit,s.Collision.flip,s.Collision.none]),vertical:n.oneOf([s.Collision.fit,s.Collision.flip,s.Collision.none])}),anchorAlign:n.shape({horizontal:n.oneOf([s.AlignPoint.left,s.AlignPoint.center,s.AlignPoint.right]),vertical:n.oneOf([s.AlignPoint.top,s.AlignPoint.center,s.AlignPoint.bottom])}),popupAlign:n.shape({horizontal:n.oneOf([s.AlignPoint.left,s.AlignPoint.center,s.AlignPoint.right]),vertical:n.oneOf([s.AlignPoint.top,s.AlignPoint.center,s.AlignPoint.bottom])}),offset:n.shape({left:n.number,top:n.number}),children:n.oneOfType([n.element,n.node]),show:n.bool,animate:n.oneOfType([n.bool,n.shape({openDuration:n.number,closeDuration:n.number})]),margin:n.shape({horizontal:n.number,vertical:n.number}),positionMode:n.oneOf(["fixed","absolute"]),scale:n.number,style:n.object,onClose:n.func,onPosition:n.func,onOpen:n.func,onKeyPress:n.func},f.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:{left:-1e3,top:0},animate:!0,show:!1,margin:{horizontal:0,vertical:0},positionMode:"absolute"},f.contextType=i.ZIndexContext,f.displayName="PopupComponent";let m=f;const g=p.createContext((t=>t)),y=p.forwardRef(((t,e)=>{const o=p.useContext(g).call(void 0,t);return p.createElement(m,{ref:e,...o})}));y.displayName="Popup",t.Popup=y,t.PopupPropsContext=g,t.PopupWithoutContext=m}));
8
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-dom"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-popup-common")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","prop-types","@progress/kendo-react-common","@progress/kendo-popup-common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).KendoReactPopup={},t.React,t.ReactDOM,t.PropTypes,t.KendoReactCommon,t.KendoPopupCommon)}(this,(function(t,e,o,n,i,s){"use strict";function r(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,n.get?n:{enumerable:!0,get:function(){return t[o]}})}})),e.default=t,Object.freeze(e)}var p=r(e),l=r(o);const a=(t,e,o)=>{t.style.transitionDuration="",e&&t.classList.remove(...e.split(" ")),e&&t.classList.remove(...o.split(" "))},c="undefined"!=typeof window&&/Firefox/.test(window.navigator.userAgent),u={name:"@progress/kendo-react-popup",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};function h(t,e){if(t===e)return!0;if(!!t!=!!e)return!1;const o=Object.getOwnPropertyNames(t),n=Object.getOwnPropertyNames(e);if(o.length!==n.length)return!1;for(let n=0;n<o.length;n++){let i=o[n];if(t[i]!==e[i])return!1}return!0}const d=class extends p.Component{constructor(t){super(t),this.context=0,this.state={current:"hidden",previous:"hidden",props:{}},this._popup=null,this.show=t=>{null==window||window.addEventListener("mousedown",this.handleMouseDown),this.setPosition(t),this.animate(t.firstChild,"enter",this.onOpened),this.setState({current:"shown",previous:this.state.current})},this.setPosition=t=>{let{anchorAlign:e,popupAlign:o,collision:n,offset:i,anchor:r,margin:p,scale:l,positionMode:a}=this.props;const{width:c,height:u}=t.style;t.style.width=t.offsetWidth+"px",t.style.height=t.offsetHeight+"px";const h=s.alignElement({anchor:r,anchorAlign:e,element:t,elementAlign:o,offset:i,margin:p,positionMode:a,scale:l}),d=s.positionElement({anchor:r,anchorAlign:e,element:t,elementAlign:o,collisions:n,currentLocation:h,margin:this.props.margin});if(t.style.top=d.offset.top+"px",t.style.left=d.offset.left+"px",t.style.width=c,t.style.height=u,this._collisions={fit:d.fit,fitted:d.fitted,flip:d.flip,flipped:d.flipped},this.props.onPosition){const t={target:this,flipped:d.flipped,fitted:d.fitted};this.props.onPosition.call(void 0,t)}},this.onOpened=()=>{const t=this._popup;if(t){if(this.props.show){const{unstyled:e}=this.props,o=e&&e.uPopup;t.classList.add(...i.classNames(i.uPopup.animationContainerShown({c:o})).split(" ").filter((t=>t)))}this.attachRepositionHandlers(t),this.props.onOpen&&this.props.onOpen.call(void 0,{target:this})}},this.animate=(t,e,o)=>{if(!this.props.popupAlign)return;let n;const{horizontal:s,vertical:r}=this.props.popupAlign;n="left"===s&&"center"===r?"right":"right"===s&&"center"===r?"left":"top"===r?"down":"up";this._collisions&&this._collisions.flipped&&(n={down:"up",up:"down",left:"right",right:"left"}[n]);const{unstyled:p}=this.props,l=p&&p.uPopup;((t,e,o,n,s,r)=>{if(0===o)return s();const p=i.classNames(i.uPopup.slide({direction:e,type:n,c:r})),l=i.classNames(i.uPopup.slideActive({direction:e,type:n,c:r})),u=e=>{e.target===t&&(t.removeEventListener("transitionend",u),a(t,p,l),t.style.display="exit"===n?"none":"",s())};t.addEventListener("transitionend",u);const h=t.ownerDocument;if(!h)return;const d=h.defaultView;if(!d)return;const f=()=>{a(t,p,l),p&&t.classList.add(...p.split(" ").filter((t=>t))),d.requestAnimationFrame((()=>{t.style.transitionDuration=o+"ms",t.classList.add(...l.split(" ").filter((t=>t)))}))};c?d.requestAnimationFrame(f):f()})(t,n,this.animationDuration[e],e,o,l)},this.handleMouseDown=t=>{var e,o;const n=null===(null==(e=null==t?void 0:t.target)?void 0:e.closest(".k-animation-container")),i=(null==(o=this.props.anchor)?void 0:o.contains(null==t?void 0:t.target))||!1;if(n){if(this.props.onMouseDownOutside){const e={target:this,event:t,state:this.state,isAnchorClicked:i};this.props.onMouseDownOutside.call(void 0,e)}null==window||window.removeEventListener("mousedown",this.handleMouseDown)}},this.onClosing=t=>{if(!this.props.show){const{unstyled:e}=this.props,o=e&&e.uPopup;t.classList.remove(...i.classNames(i.uPopup.animationContainerShown({c:o})).split(" ").filter((t=>t)))}this.detachRepositionHandlers()},this.onClosed=()=>{"hiding"===this.state.current&&"shown"===this.state.previous&&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+1:100,i.validatePackage(u),this.reposition=function(t,e,o={}){let n,i,s,r,p=0;o=o||{};const l=function(){p=!1===o.leading?0:(new Date).getTime(),n=void 0,r=t.apply(i,s),n||(i=s=null)};return function(){const a=(new Date).getTime();!p&&!1===o.leading&&(p=a);const c=e-(a-p);return i=void 0,s=arguments,c<=0||c>e?(n&&(clearTimeout(n),n=void 0),p=a,r=t.apply(i,s),n||(i=s=null)):!n&&!1!==o.trailing&&(n=window.setTimeout(l,c)),r}}(this.reposition.bind(this),16.666666666666668)}get element(){return this._popup}static getDerivedStateFromProps(t,e){const{show:o,anchor:n,anchorAlign:i,appendTo:s,collision:r,popupAlign:p,className:l,popupClass:a,style:c,offset:u,contentKey:d}=t,f={...e,props:{show:o,anchor:n,anchorAlign:i,appendTo:s,collision:r,popupAlign:p,className:l,popupClass:a,style:c,offset:u,contentKey:d}};return t.show?"hidden"===e.current||"hiding"===e.current?{...f,current:"showing",previous:e.current}:"showing"===e.current?{...f,current:"shown",previous:e.current}:"shown"!==e.current||h(u,e.props.offset)&&h(i,e.props.anchorAlign)&&h(s,e.props.appendTo)&&h(r,e.props.collision)&&h(p,e.props.popupAlign)&&h(c,e.props.style)&&n===e.props.anchor&&a===e.props.popupClass&&l===e.props.className?f:{...f,current:"reposition",previous:e.current}:"hiding"===e.current||"hidden"===e.current?{...f,current:"hidden",previous:e.current}:{...f,current:"hiding",previous:e.current}}componentDidUpdate(t){"showing"===this.state.current&&this._popup?this.show(this._popup):"hiding"===this.state.current&&this._popup?(this.onClosing(this._popup),this.animate(this._popup.firstChild,"exit",this.onClosed)):"reposition"===this.state.current&&"shown"===this.state.previous?setTimeout((()=>{this.setState({current:"shown",previous:this.state.current})}),0):"shown"===this.state.current&&t.contentKey!==this.props.contentKey&&this._popup&&this.setPosition(this._popup)}componentDidMount(){"showing"===this.state.current&&this._popup&&this.show(this._popup)}componentWillUnmount(){this.detachRepositionHandlers()}render(){const{children:t,className:e,popupClass:o,unstyled:n,show:s,id:r,positionMode:a}=this.props,c=n&&n.uPopup,u=this.props.appendTo?this.props.appendTo:i.canUseDOM?this.props.anchor&&this.props.anchor.ownerDocument?this.props.anchor.ownerDocument.body:document.body:void 0;"reposition"===this.state.current&&"shown"===this.state.previous&&this._popup&&this.setPosition(this._popup);const h=Object.assign({},{position:a,top:0,left:-1e4},this.props.style||{}),d="hiding"===this.state.current;if((s||d)&&u){const n=this.getCurrentZIndex(),s=p.createElement(i.ZIndexContext.Provider,{value:n},p.createElement("div",{onKeyDown:this.props.onKeyDown,className:i.classNames(i.uPopup.animationContainer({c:c}),e),id:r,ref:t=>this._popup=t,style:{zIndex:n,...h}},p.createElement("div",{className:i.classNames(i.uPopup.animationChild({c:c})),style:{transitionDelay:"0ms"}},p.createElement("div",{role:this.props.role,className:i.classNames(i.uPopup.popup({c:c}),o)},t))));return null!==this.props.appendTo?l.createPortal(s,u):s}return null}get animationDuration(){const t=this.props.animate;let e=0,o=0;return t&&(!0===t?e=o=300:(e=t.openDuration||0,o=t.closeDuration||0)),{enter:e,exit:o}}attachRepositionHandlers(t){this.detachRepositionHandlers(),this._scrollableParents=s.domUtils.scrollableParents(this.props.anchor||t),this._scrollableParents&&this._scrollableParents.map((t=>t.addEventListener("scroll",this.reposition))),window.addEventListener("resize",this.reposition)}detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map((t=>t.removeEventListener("scroll",this.reposition))),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)}reposition(){this.setState({current:"reposition",previous:this.state.current})}};d.propTypes={anchor:function(t){const e=t.anchor;return e&&"number"!=typeof e.nodeType?new Error("Invalid prop `anchor` supplied to `Kendo React Popup`. Validation failed."):null},appendTo:function(t){const e=t.appendTo;return e&&"number"!=typeof e.nodeType?new Error("Invalid prop `appendTo` supplied to `Kendo React Popup`. Validation failed."):null},className:n.oneOfType([n.string,n.arrayOf(n.string),n.object]),id:n.string,popupClass:n.oneOfType([n.string,n.arrayOf(n.string),n.object]),collision:n.shape({horizontal:n.oneOf([s.Collision.fit,s.Collision.flip,s.Collision.none]),vertical:n.oneOf([s.Collision.fit,s.Collision.flip,s.Collision.none])}),anchorAlign:n.shape({horizontal:n.oneOf([s.AlignPoint.left,s.AlignPoint.center,s.AlignPoint.right]),vertical:n.oneOf([s.AlignPoint.top,s.AlignPoint.center,s.AlignPoint.bottom])}),popupAlign:n.shape({horizontal:n.oneOf([s.AlignPoint.left,s.AlignPoint.center,s.AlignPoint.right]),vertical:n.oneOf([s.AlignPoint.top,s.AlignPoint.center,s.AlignPoint.bottom])}),offset:n.shape({left:n.number,top:n.number}),children:n.oneOfType([n.element,n.node]),show:n.bool,animate:n.oneOfType([n.bool,n.shape({openDuration:n.number,closeDuration:n.number})]),margin:n.shape({horizontal:n.number,vertical:n.number}),positionMode:n.oneOf(["fixed","absolute"]),scale:n.number,style:n.object,onClose:n.func,onPosition:n.func,onOpen:n.func,onKeyPress:n.func,onMouseDownOutside:n.func},d.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:{left:-1e3,top:0},animate:!0,show:!1,margin:{horizontal:0,vertical:0},positionMode:"absolute"},d.contextType=i.ZIndexContext,d.displayName="PopupComponent";let f=d;const m=p.createContext((t=>t)),g=p.forwardRef(((t,e)=>{const o=p.useContext(m),n=i.useUnstyled(),s=o.call(void 0,t);return p.createElement(f,{ref:e,unstyled:n,...s})}));g.displayName="Popup",t.Popup=g,t.PopupPropsContext=m,t.PopupWithoutContext=f}));
package/index.d.mts CHANGED
@@ -10,6 +10,7 @@ import { CollisionType as CollisionType_2 } from '@progress/kendo-popup-common';
10
10
  import { JSX as JSX_2 } from 'react/jsx-runtime';
11
11
  import { MarginSettings } from '@progress/kendo-popup-common';
12
12
  import { OffsetPosition } from '@progress/kendo-popup-common';
13
+ import { PopupClassStructure } from '@progress/kendo-react-common';
13
14
  import { PopupSettings } from '@progress/kendo-popup-common';
14
15
  import { PositionMode as PositionMode_2 } from '@progress/kendo-popup-common';
15
16
  import PropTypes from 'prop-types';
@@ -79,6 +80,28 @@ export declare interface Margin extends MarginSettings {
79
80
  vertical: number;
80
81
  }
81
82
 
83
+ /**
84
+ * Represents the object of the `MouseDownOutside` Popup event.
85
+ */
86
+ export declare interface MouseDownOutsideEvent {
87
+ /**
88
+ * An event target.
89
+ */
90
+ target: Popup;
91
+ /**
92
+ * The event object.
93
+ */
94
+ event: MouseEvent;
95
+ /**
96
+ * The state of the Popup.
97
+ */
98
+ state: PopupState;
99
+ /**
100
+ * Indicates if the MouseDown event is triggered over the anchor of the Popup.
101
+ */
102
+ isAnchorClicked: boolean;
103
+ }
104
+
82
105
  /**
83
106
  * The offset position of the Popup.
84
107
  */
@@ -226,6 +249,10 @@ export declare interface PopupProps extends PopupSettings {
226
249
  * Fires after the Popup position is set.
227
250
  */
228
251
  onPosition?: (event: PositionEvent) => void;
252
+ /**
253
+ * Fires when the mousedown event is triggered outside the Popup.
254
+ */
255
+ onMouseDownOutside?: (event: MouseDownOutsideEvent) => void;
229
256
  /**
230
257
  * Controls the Popup visibility ([see example]({% slug hidden_popup %})). Defaults to `false`.
231
258
  */
@@ -252,6 +279,10 @@ export declare interface PopupProps extends PopupSettings {
252
279
  * @hidden
253
280
  */
254
281
  onKeyDown?: (event: React.KeyboardEvent) => void;
282
+ /**
283
+ * @hidden
284
+ */
285
+ unstyled?: PopupClassStructure;
255
286
  }
256
287
 
257
288
  /**
@@ -334,6 +365,7 @@ export declare class PopupWithoutContext extends React_2.Component<PopupProps, P
334
365
  onPosition: PropTypes.Requireable<(...args: any[]) => any>;
335
366
  onOpen: PropTypes.Requireable<(...args: any[]) => any>;
336
367
  onKeyPress: PropTypes.Requireable<(...args: any[]) => any>;
368
+ onMouseDownOutside: PropTypes.Requireable<(...args: any[]) => any>;
337
369
  };
338
370
  /**
339
371
  * @hidden
@@ -430,6 +462,7 @@ export declare class PopupWithoutContext extends React_2.Component<PopupProps, P
430
462
  private setPosition;
431
463
  private onOpened;
432
464
  private animate;
465
+ private handleMouseDown;
433
466
  private onClosing;
434
467
  private onClosed;
435
468
  private get animationDuration();
@@ -442,7 +475,7 @@ export declare class PopupWithoutContext extends React_2.Component<PopupProps, P
442
475
  /**
443
476
  * Represents the object of the `Position` Popup event.
444
477
  */
445
- declare interface PositionEvent {
478
+ export declare interface PositionEvent {
446
479
  /**
447
480
  * An event target.
448
481
  */
package/index.d.ts CHANGED
@@ -10,6 +10,7 @@ import { CollisionType as CollisionType_2 } from '@progress/kendo-popup-common';
10
10
  import { JSX as JSX_2 } from 'react/jsx-runtime';
11
11
  import { MarginSettings } from '@progress/kendo-popup-common';
12
12
  import { OffsetPosition } from '@progress/kendo-popup-common';
13
+ import { PopupClassStructure } from '@progress/kendo-react-common';
13
14
  import { PopupSettings } from '@progress/kendo-popup-common';
14
15
  import { PositionMode as PositionMode_2 } from '@progress/kendo-popup-common';
15
16
  import PropTypes from 'prop-types';
@@ -79,6 +80,28 @@ export declare interface Margin extends MarginSettings {
79
80
  vertical: number;
80
81
  }
81
82
 
83
+ /**
84
+ * Represents the object of the `MouseDownOutside` Popup event.
85
+ */
86
+ export declare interface MouseDownOutsideEvent {
87
+ /**
88
+ * An event target.
89
+ */
90
+ target: Popup;
91
+ /**
92
+ * The event object.
93
+ */
94
+ event: MouseEvent;
95
+ /**
96
+ * The state of the Popup.
97
+ */
98
+ state: PopupState;
99
+ /**
100
+ * Indicates if the MouseDown event is triggered over the anchor of the Popup.
101
+ */
102
+ isAnchorClicked: boolean;
103
+ }
104
+
82
105
  /**
83
106
  * The offset position of the Popup.
84
107
  */
@@ -226,6 +249,10 @@ export declare interface PopupProps extends PopupSettings {
226
249
  * Fires after the Popup position is set.
227
250
  */
228
251
  onPosition?: (event: PositionEvent) => void;
252
+ /**
253
+ * Fires when the mousedown event is triggered outside the Popup.
254
+ */
255
+ onMouseDownOutside?: (event: MouseDownOutsideEvent) => void;
229
256
  /**
230
257
  * Controls the Popup visibility ([see example]({% slug hidden_popup %})). Defaults to `false`.
231
258
  */
@@ -252,6 +279,10 @@ export declare interface PopupProps extends PopupSettings {
252
279
  * @hidden
253
280
  */
254
281
  onKeyDown?: (event: React.KeyboardEvent) => void;
282
+ /**
283
+ * @hidden
284
+ */
285
+ unstyled?: PopupClassStructure;
255
286
  }
256
287
 
257
288
  /**
@@ -334,6 +365,7 @@ export declare class PopupWithoutContext extends React_2.Component<PopupProps, P
334
365
  onPosition: PropTypes.Requireable<(...args: any[]) => any>;
335
366
  onOpen: PropTypes.Requireable<(...args: any[]) => any>;
336
367
  onKeyPress: PropTypes.Requireable<(...args: any[]) => any>;
368
+ onMouseDownOutside: PropTypes.Requireable<(...args: any[]) => any>;
337
369
  };
338
370
  /**
339
371
  * @hidden
@@ -430,6 +462,7 @@ export declare class PopupWithoutContext extends React_2.Component<PopupProps, P
430
462
  private setPosition;
431
463
  private onOpened;
432
464
  private animate;
465
+ private handleMouseDown;
433
466
  private onClosing;
434
467
  private onClosed;
435
468
  private get animationDuration();
@@ -442,7 +475,7 @@ export declare class PopupWithoutContext extends React_2.Component<PopupProps, P
442
475
  /**
443
476
  * Represents the object of the `Position` Popup event.
444
477
  */
445
- declare interface PositionEvent {
478
+ export declare interface PositionEvent {
446
479
  /**
447
480
  * An event target.
448
481
  */
@@ -10,7 +10,7 @@ const e = {
10
10
  name: "@progress/kendo-react-popup",
11
11
  productName: "KendoReact",
12
12
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
- publishDate: 1723203364,
13
+ publishDate: 1724427373,
14
14
  version: "",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-popup",
3
- "version": "8.3.0-develop.1",
3
+ "version": "8.3.0-develop.10",
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": "8.3.0-develop.1",
27
+ "@progress/kendo-react-common": "8.3.0-develop.10",
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
  },