@progress/kendo-react-dialogs 15.0.1-develop.3 → 15.0.1-develop.4
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/Window.js +1 -1
- package/Window.mjs +174 -171
- package/dist/cdn/js/kendo-react-dialogs.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +5 -5
package/Window.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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const lt=require("react"),ut=require("react-dom"),i=require("prop-types"),ft=require("./WindowTitlebar.js"),o=require("@progress/kendo-react-common"),gt=require("./WindowResizeHandlers.js"),ht=require("./MiddleLayerOptimization.js"),a=require("./StageEnum.js"),_e=require("./WindowActionsBar.js"),p=require("./constants.js"),Ze=require("./utils.js");function Ke(e){const D=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const y in e)if(y!=="default"){const x=Object.getOwnPropertyDescriptor(e,y);Object.defineProperty(D,y,x.get?x:{enumerable:!0,get:()=>e[y]})}}return D.default=e,Object.freeze(D)}const m=Ke(lt),st=Ke(ut),{useState:U,useEffect:z,useCallback:f,useMemo:X,useRef:H,useImperativeHandle:wt,useContext:Et,forwardRef:Tt}=m,ee=300,te=300,he=120,se=100,W=5,_={minWidth:he,minHeight:se,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0,autoFocus:!0},we=Tt((e,D)=>{var Me;const{minWidth:y=_.minWidth,minHeight:x=_.minHeight,resizable:le=_.resizable,draggable:Te=_.draggable,modal:ue=_.modal,doubleClickStageChange:qe=_.doubleClickStageChange,autoFocus:je=_.autoFocus}=e,[Xe,G]=U(e.stage||a.windowStage.DEFAULT),[V,ne]=U(!1),[ie,v]=U(0),[oe,A]=U(0),[ae,k]=U(ee),[ce,R]=U(te),[Ge,fe]=U(!0),[ge,me]=U(p.DEFAULT_DIALOGS_ZINDEX),r=(Me=e.stage)!=null?Me:Xe,F=Et(o.ZIndexContext),M=H(null),Se=H(null),h=H({leftBeforeAction:0,topBeforeAction:0,widthBeforeAction:ee,heightBeforeAction:te}),Z=H({x:0,y:0}),K=H(void 0),Ve=H(o.canUseDOM?document.activeElement:null),De=H("window-title-"+(e.id?e.id+"-accessibility-id":"")),O=H({left:0,top:0,width:ee,height:te,internalLeft:oe,internalTop:ie,internalWidth:ae,internalHeight:ce,stage:r,draggable:Te,props:e}),N=f(()=>{const t=o.canUseDOM?document:null;return e.appendTo?e.appendTo.ownerDocument:t},[e.appendTo]),s=f(()=>{const t=N();return t==null?void 0:t.defaultView},[N]),P=X(()=>{var t;return r!==a.windowStage.FULLSCREEN?Math.max((t=e.top)!=null?t:ie,0):0},[r,e.top,ie]),q=X(()=>{var t;return r!==a.windowStage.FULLSCREEN?Math.max((t=e.left)!=null?t:oe,0):0},[r,e.left,oe]),b=X(()=>{var n;const t=(n=e.width)!=null?n:ae;if(r===a.windowStage.FULLSCREEN){if(e.appendTo)return e.appendTo.offsetWidth;const c=s();return c?c.innerWidth:0}return t},[r,e.width,e.appendTo,ae,s]),C=X(()=>{const t=e.height===void 0?ce:e.height;if(r===a.windowStage.FULLSCREEN){if(e.appendTo)return e.appendTo.offsetHeight;const n=s();return n?n.innerHeight:0}else if(r===a.windowStage.MINIMIZED)return 0;return t},[r,e.height,e.appendTo,ce,s]),re=X(()=>e.id?e.id+"-accessibility-id":void 0,[e.id]);z(()=>{O.current={left:q,top:P,width:b,height:C,internalLeft:oe,internalTop:ie,internalWidth:ae,internalHeight:ce,stage:r,draggable:Te,props:e}});const j=X(()=>{if(F===void 0)return F!=null?F:p.DEFAULT_DIALOGS_ZINDEX;const t=F?F+p.ZINDEX_DIALOGS_STEP:0;return ge>t?ge:F+p.ZINDEX_DIALOGS_STEP},[ge,F]),Le=f(()=>{var c,u;if(e.top!==void 0)return e.top;if(e.initialTop!==void 0)return e.initialTop;let t=te;if(e.height!==void 0?t=e.height:e.initialHeight!==void 0&&(t=e.initialHeight),e.appendTo&&t)return e.appendTo.offsetHeight/2-t/2;const n=s();return n?n.innerHeight/2-((u=t!=null?t:(c=M.current)==null?void 0:c.clientHeight)!=null?u:0)/2:0},[e.top,e.initialTop,e.height,e.initialHeight,e.appendTo,s]),be=f(()=>{if(e.left!==void 0)return e.left;if(e.initialLeft!==void 0)return e.initialLeft;let t=ee;if(e.width!==void 0?t=e.width:e.initialWidth!==void 0&&(t=e.initialWidth),e.appendTo)return e.appendTo.offsetWidth/2-t/2;const n=s();return n?n.innerWidth/2-t/2:0},[e.left,e.initialLeft,e.width,e.initialWidth,e.appendTo,s]),Ce=f(()=>{let t=ee;return e.width!==void 0?t=e.width:e.initialWidth!==void 0&&(t=e.initialWidth),t},[e.width,e.initialWidth]),Ie=f(()=>{let t=te;return e.height!==void 0?t=e.height:e.initialHeight!==void 0&&(t=e.initialHeight),t},[e.height,e.initialHeight]),Ye=f(t=>t.filter(n=>(n==null?void 0:n.type)===_e.WindowActionsBar),[]),Je=f(t=>t.filter(n=>n&&n.type!==_e.WindowActionsBar),[]),w=f(()=>typeof D=="object"&&D!==null&&"current"in D?D.current:null,[D]),B=f((t,n,c,u,d,l)=>{var L,J,Q;if(!t)return;const{internalLeft:S,internalTop:E,internalWidth:T,internalHeight:I}=O.current;t({nativeEvent:n.nativeEvent?n.nativeEvent:n.originalEvent,drag:c,end:u,target:w(),left:(L=d==null?void 0:d.left)!=null?L:S,top:(J=d==null?void 0:d.top)!=null?J:E,width:(Q=l==null?void 0:l.width)!=null?Q:T,height:(l==null?void 0:l.height)===void 0?I:l==null?void 0:l.height})},[w]),Qe=f(t=>{var l,S;if(ue&&o.keepFocusInContainer(t,M.current),t.target!==t.currentTarget)return;const n=y||he,c=x||se,u=t.metaKey||t.ctrlKey,d=(S=C!=null?C:(l=M.current)==null?void 0:l.clientHeight)!=null?S:0;if(u&&le){switch(t.keyCode){case o.Keys.up:t.preventDefault(),c<=d-W&&R(d-W);break;case o.Keys.down:t.preventDefault(),R(d+W);break;case o.Keys.left:n<=b-W&&k(b-W);break;case o.Keys.right:k(b+W);break;default:return}B(e.onResize,t,!1,void 0);return}if(t.altKey){switch(t.keyCode){case o.Keys.up:r===a.windowStage.MINIMIZED?(Y(t),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.DEFAULT})):r===a.windowStage.DEFAULT&&(de(t),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.FULLSCREEN}));break;case o.Keys.down:r===a.windowStage.FULLSCREEN?(Y(t),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.DEFAULT})):r===a.windowStage.DEFAULT&&(We(t),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.MINIMIZED}));break}return}if(!t.ctrlKey){const{internalLeft:E,internalTop:T}=O.current;let I=E,L=T;switch(t.keyCode){case o.Keys.esc:e.onClose&&ye(t);return;case o.Keys.up:L=T-W,v(L);break;case o.Keys.down:L=T+W,v(L);break;case o.Keys.left:I=E-W,A(I);break;case o.Keys.right:I=E+W,A(I);break;default:return}B(e.onMove,t,!1,void 0,{left:I,top:L})}},[ue,y,x,le,e.onResize,e.onStageChange,e.onClose,e.onMove,C,b,r,B,w]),$e=f(t=>{const n=t.event,{left:c,top:u}=O.current;h.current.differenceLeft=n.pageX-c,h.current.differenceTop=n.pageY-u},[]),pe=f(t=>{const n=t.event;n.originalEvent.preventDefault();const{stage:c,draggable:u,props:d,width:l,height:S}=O.current;if(c!==a.windowStage.FULLSCREEN&&u){const E=Math.max(n.pageY-(h.current.differenceTop||0),0),T=n.pageX-(h.current.differenceLeft||0);v(E),A(T),ne(!0),d.onMove&&B(d.onMove,n,!0,!1,{left:T,top:E},{width:l,height:S})}},[B]),et=f(t=>{const n=t.event,{stage:c,draggable:u,props:d,left:l,top:S,width:E,height:T}=O.current;c!==a.windowStage.FULLSCREEN&&u&&d.onMove&&B(d.onMove,n,!0,!0,{left:l,top:S},{width:E,height:T}),ne(!1)},[B]),tt=f(()=>{K.current?(clearTimeout(K.current),K.current=void 0):(fe(!0),me(Ze.getMaxZIndex(j,N(),re)))},[j,N,re]),nt=f(()=>{clearTimeout(K.current);const t=s();t&&(K.current=t.setTimeout(()=>{fe(!1),K.current=void 0}))},[s]),We=f(t=>{t.preventDefault(),h.current.leftBeforeAction=q,h.current.topBeforeAction=P,h.current.widthBeforeAction=b,h.current.heightBeforeAction=C,G(a.windowStage.MINIMIZED),R(0),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.MINIMIZED})},[q,P,b,C,e.onStageChange,w]),de=f(t=>{t.preventDefault(),h.current.leftBeforeAction=q,h.current.topBeforeAction=P,h.current.widthBeforeAction=b,h.current.heightBeforeAction=C;const n=s(),c=n?n.innerWidth:0,u=n?n.innerHeight:0;A(0),v(0),k(e.appendTo?e.appendTo.offsetWidth:c),R(e.appendTo?e.appendTo.offsetHeight:u),G(a.windowStage.FULLSCREEN),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.FULLSCREEN})},[q,P,b,C,e.appendTo,e.onStageChange,s,w]),Y=f(t=>{t.preventDefault(),r===a.windowStage.FULLSCREEN?(G(a.windowStage.DEFAULT),A(h.current.leftBeforeAction),v(h.current.topBeforeAction),k(h.current.widthBeforeAction),R(h.current.heightBeforeAction)):r===a.windowStage.MINIMIZED&&(G(a.windowStage.DEFAULT),R(h.current.heightBeforeAction)),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.DEFAULT})},[r,e.onStageChange,w]),ye=f(t=>{t.preventDefault(),o.dispatchEvent(e.onClose,t,w(),{state:void 0})},[e.onClose,w]),it=f(t=>{r===a.windowStage.FULLSCREEN||r===a.windowStage.MINIMIZED?Y(t):de(t)},[r,Y,de]),ot=f((t,n)=>{var Ne,Ue,xe,ke,Oe,ze;const{props:c,width:u,height:d,top:l,left:S}=O.current,E=c.appendTo?t.pageX-Z.current.x:t.pageX,T=c.appendTo?t.pageY-Z.current.y:t.pageY,I=(Ue=d!=null?d:(Ne=M.current)==null?void 0:Ne.clientHeight)!=null?Ue:0,L=y||he,J=x||se,Q=l-T,Be=S-E,He=E-S,Fe=T-l;let $=!1;const g={isDragging:!n.end};n.direction.indexOf("n")>=0&&J-(I+Q)<0&&(l>0&&(g.height=I+Q),g.top=T,$=!0),n.direction.indexOf("s")>=0&&J-Fe<0&&(g.height=Fe,$=!0),n.direction.indexOf("w")>=0&&L-(u+Be)<0&&(S>0&&(g.width=u+Be),g.left=E,$=!0),n.direction.indexOf("e")>=0&&L-He<0&&(g.width=He,$=!0),$&&(g.height!==void 0&&R(g.height),g.top!==void 0&&v(g.top),g.width!==void 0&&k(g.width),g.left!==void 0&&A(g.left),g.isDragging!==void 0&&ne(g.isDragging)),B(c.onResize,t,!0,n.end,{left:(xe=g.left)!=null?xe:S,top:(ke=g.top)!=null?ke:l},{width:(Oe=g.width)!=null?Oe:u,height:(ze=g.height)!=null?ze:d})},[B,x,y]),ve=f(()=>{if(r===a.windowStage.FULLSCREEN){const t=s(),n=t?t.innerWidth:0,c=t?t.innerHeight:0;k(e.appendTo?e.appendTo.offsetWidth:n),R(e.appendTo?e.appendTo.offsetHeight:c)}},[r,e.appendTo,s]);z(()=>{const t=M.current;t&&je&&t.focus({preventScroll:!0});const n=s();n&&n.addEventListener("resize",ve),G(e.stage||a.windowStage.DEFAULT),ne(!1),v(Le()),A(be()),k(Ce()),R(Ie()),fe(!0),me(Ze.getMaxZIndex(j,N(),re)),h.current={leftBeforeAction:be(),topBeforeAction:Le(),widthBeforeAction:Ce(),heightBeforeAction:Ie()};const c=N();if(e.appendTo&&c){const d=e.appendTo.getBoundingClientRect(),l=c.body.getBoundingClientRect();Z.current.x=d.left-l.left,Z.current.y=d.top-l.top}const u=Ve.current;return()=>{var l;const d=s();d&&d.removeEventListener("resize",ve),u&&o.canUseDOM&&(document.contains(u)?u.focus({preventScroll:!0}):u.id&&((l=document.getElementById(u.id))==null||l.focus({preventScroll:!0})))}},[]),z(()=>{e.left!==void 0&&!V&&A(e.left)},[e.left,V]),z(()=>{e.top!==void 0&&!V&&v(e.top)},[e.top,V]),z(()=>{e.initialLeft!==void 0&&A(e.initialLeft)},[e.initialLeft]),z(()=>{e.initialTop!==void 0&&v(e.initialTop)},[e.initialTop]),z(()=>{const t=N();if(e.appendTo&&t){const n=e.appendTo.getBoundingClientRect(),c=t.body.getBoundingClientRect();Z.current.x=n.left-c.left,Z.current.y=n.top-c.top}},[e.appendTo,N]);const at=H(null);wt(D,()=>({get element(){return M.current},get windowElement(){return M.current},get draggable(){return Se.current},props:e}),[e]),at.current=M.current,o.useWebMcpRegister("window",D,e,e.webMcp);const Ae=m.Children.toArray(e.children),ct=Je(Ae),rt=Ye(Ae),dt=o.classNames("k-window",e.className,{"k-window-minimized":r==="MINIMIZED","k-focus":Ge}),Re=m.createElement(o.ZIndexContext.Provider,{value:j},m.createElement(m.Fragment,null,ue&&m.createElement("div",{className:"k-overlay",style:{zIndex:j,...e.overlayStyle}}),m.createElement("div",{id:e.id,[p.DATA_DIALOGS_ID]:re,tabIndex:0,role:"dialog","aria-labelledby":De.current,onFocus:tt,onBlur:nt,onKeyDown:Qe,ref:M,className:dt,style:{top:P,left:q,width:b,height:C||"",zIndex:j,...e.style}},m.createElement(ht.MiddleLayerOptimization,{shouldUpdateOnDrag:e.shouldUpdateOnDrag||!1,isDragging:V},m.createElement(o.Draggable,{onPress:$e,onDrag:pe,onRelease:et,autoScroll:!1,ref:Se},m.createElement(ft.WindowTitleBar,{stage:r,onDoubleClick:qe?it:void 0,onMinimizeButtonClick:We,onFullScreenButtonClick:de,onRestoreButtonClick:Y,onCloseButtonClick:ye,closeButton:e.closeButton,minimizeButton:e.minimizeButton,maximizeButton:e.maximizeButton,restoreButton:e.restoreButton,id:De.current},e.title)),r===a.windowStage.MINIMIZED?null:m.createElement(m.Fragment,null,m.createElement("div",{className:"k-window-content"},ct),rt),r===a.windowStage.DEFAULT&&le?m.createElement(gt.ResizeHandlers,{onResize:ot}):null))));return o.canUseDOM?e.appendTo===null?Re:st.createPortal(Re,e.appendTo||document.body):null});we.displayName="Window";const Pe=o.createPropsContext(),Ee=o.withIdHOC(o.withPropsContext(Pe,we));Ee.displayName="KendoReactWindow";const mt={autoFocus:i.bool,title:i.any,className:i.string,closeButton:i.func,minimizeButton:i.func,maximizeButton:i.func,restoreButton:i.func,modal:i.bool,overlayStyle:i.object,width:i.number,height:i.number,minWidth:i.number,minHeight:i.number,left:i.number,top:i.number,initialLeft:i.number,initialTop:i.number,initialWidth:i.number,initialHeight:i.number,resizable:i.bool,draggable:i.bool,doubleClickStageChange:i.bool,stage:i.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),onClose:i.func,onMove:i.func,onResize:i.func,onStageChange:i.func,children:i.node,id:i.string,dir:i.string,style:i.object,appendTo:i.any,shouldUpdateOnDrag:i.bool};Ee.propTypes=mt;exports.Window=Ee;exports.WindowPropsContext=Pe;exports.WindowWithoutContext=we;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ut=require("react"),ft=require("react-dom"),i=require("prop-types"),gt=require("./WindowTitlebar.js"),o=require("@progress/kendo-react-common"),ht=require("./WindowResizeHandlers.js"),st=require("./MiddleLayerOptimization.js"),a=require("./StageEnum.js"),Ze=require("./WindowActionsBar.js"),p=require("./constants.js"),Ke=require("./utils.js");function Pe(e){const L=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const v in e)if(v!=="default"){const x=Object.getOwnPropertyDescriptor(e,v);Object.defineProperty(L,v,x.get?x:{enumerable:!0,get:()=>e[v]})}}return L.default=e,Object.freeze(L)}const m=Pe(ut),wt=Pe(ft),{useState:U,useEffect:z,useCallback:f,useMemo:X,useRef:W,useImperativeHandle:Et,useContext:Tt,forwardRef:mt}=m,ee=300,te=300,he=120,se=100,y=5,_={minWidth:he,minHeight:se,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0,autoFocus:!0},we=mt((e,L)=>{var Be;const{minWidth:v=_.minWidth,minHeight:x=_.minHeight,resizable:le=_.resizable,draggable:Te=_.draggable,modal:ue=_.modal,doubleClickStageChange:je=_.doubleClickStageChange,autoFocus:Xe=_.autoFocus}=e,[Ge,G]=U(e.stage||a.windowStage.DEFAULT),[V,ne]=U(!1),[ie,A]=U(0),[oe,R]=U(0),[ae,k]=U(ee),[ce,M]=U(te),[Ve,fe]=U(!0),[ge,me]=U(p.DEFAULT_DIALOGS_ZINDEX),r=(Be=e.stage)!=null?Be:Ge,F=Tt(o.ZIndexContext),B=W(null),Se=W(null),h=W({leftBeforeAction:0,topBeforeAction:0,widthBeforeAction:ee,heightBeforeAction:te}),Z=W({x:0,y:0}),K=W(void 0),Ye=W(o.canUseDOM?document.activeElement:null),De=W("window-title-"+(e.id?e.id+"-accessibility-id":"")),O=W({left:0,top:0,width:ee,height:te,internalLeft:oe,internalTop:ie,internalWidth:ae,internalHeight:ce,stage:r,draggable:Te,props:e}),N=f(()=>{const t=o.canUseDOM?document:null;return e.appendTo?e.appendTo.ownerDocument:t},[e.appendTo]),s=f(()=>{const t=N();return t==null?void 0:t.defaultView},[N]),P=X(()=>{var t;return r!==a.windowStage.FULLSCREEN?Math.max((t=e.top)!=null?t:ie,0):0},[r,e.top,ie]),q=X(()=>{var t;return r!==a.windowStage.FULLSCREEN?Math.max((t=e.left)!=null?t:oe,0):0},[r,e.left,oe]),b=X(()=>{var n;const t=(n=e.width)!=null?n:ae;if(r===a.windowStage.FULLSCREEN){if(e.appendTo)return e.appendTo.offsetWidth;const c=s();return c?c.innerWidth:0}return t},[r,e.width,e.appendTo,ae,s]),C=X(()=>{const t=e.height===void 0?ce:e.height;if(r===a.windowStage.FULLSCREEN){if(e.appendTo)return e.appendTo.offsetHeight;const n=s();return n?n.innerHeight:0}else if(r===a.windowStage.MINIMIZED)return 0;return t},[r,e.height,e.appendTo,ce,s]),re=X(()=>e.id?e.id+"-accessibility-id":void 0,[e.id]);z(()=>{O.current={left:q,top:P,width:b,height:C,internalLeft:oe,internalTop:ie,internalWidth:ae,internalHeight:ce,stage:r,draggable:Te,props:e}});const j=X(()=>{if(F===void 0)return F!=null?F:p.DEFAULT_DIALOGS_ZINDEX;const t=F?F+p.ZINDEX_DIALOGS_STEP:0;return ge>t?ge:F+p.ZINDEX_DIALOGS_STEP},[ge,F]),Le=f(()=>{var c,u;if(e.top!==void 0)return e.top;if(e.initialTop!==void 0)return e.initialTop;let t=te;if(e.height!==void 0?t=e.height:e.initialHeight!==void 0&&(t=e.initialHeight),e.appendTo&&t)return e.appendTo.offsetHeight/2-t/2;const n=s();return n?n.innerHeight/2-((u=t!=null?t:(c=B.current)==null?void 0:c.clientHeight)!=null?u:0)/2:0},[e.top,e.initialTop,e.height,e.initialHeight,e.appendTo,s]),be=f(()=>{if(e.left!==void 0)return e.left;if(e.initialLeft!==void 0)return e.initialLeft;let t=ee;if(e.width!==void 0?t=e.width:e.initialWidth!==void 0&&(t=e.initialWidth),e.appendTo)return e.appendTo.offsetWidth/2-t/2;const n=s();return n?n.innerWidth/2-t/2:0},[e.left,e.initialLeft,e.width,e.initialWidth,e.appendTo,s]),Ce=f(()=>{let t=ee;return e.width!==void 0?t=e.width:e.initialWidth!==void 0&&(t=e.initialWidth),t},[e.width,e.initialWidth]),Ie=f(()=>{let t=te;return e.height!==void 0?t=e.height:e.initialHeight!==void 0&&(t=e.initialHeight),t},[e.height,e.initialHeight]),Je=f(t=>t.filter(n=>(n==null?void 0:n.type)===Ze.WindowActionsBar),[]),Qe=f(t=>t.filter(n=>n&&n.type!==Ze.WindowActionsBar),[]),w=f(()=>typeof L=="object"&&L!==null&&"current"in L?L.current:null,[L]),H=f((t,n,c,u,d,l)=>{var D,J,Q;if(!t)return;const{internalLeft:S,internalTop:E,internalWidth:T,internalHeight:I}=O.current;t({nativeEvent:n.nativeEvent?n.nativeEvent:n.originalEvent,drag:c,end:u,target:w(),left:(D=d==null?void 0:d.left)!=null?D:S,top:(J=d==null?void 0:d.top)!=null?J:E,width:(Q=l==null?void 0:l.width)!=null?Q:T,height:(l==null?void 0:l.height)===void 0?I:l==null?void 0:l.height})},[w]),$e=f(t=>{var l,S;if(ue&&o.keepFocusInContainer(t,B.current),t.target!==t.currentTarget)return;const n=v||he,c=x||se,u=t.metaKey||t.ctrlKey,d=(S=C!=null?C:(l=B.current)==null?void 0:l.clientHeight)!=null?S:0;if(u&&le){switch(t.keyCode){case o.Keys.up:t.preventDefault(),c<=d-y&&M(d-y);break;case o.Keys.down:t.preventDefault(),M(d+y);break;case o.Keys.left:n<=b-y&&k(b-y);break;case o.Keys.right:k(b+y);break;default:return}H(e.onResize,t,!1,void 0);return}if(t.altKey){switch(t.keyCode){case o.Keys.up:r===a.windowStage.MINIMIZED?(Y(t),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.DEFAULT})):r===a.windowStage.DEFAULT&&(de(t),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.FULLSCREEN}));break;case o.Keys.down:r===a.windowStage.FULLSCREEN?(Y(t),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.DEFAULT})):r===a.windowStage.DEFAULT&&(We(t),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.MINIMIZED}));break}return}if(!t.ctrlKey){const{internalLeft:E,internalTop:T}=O.current;let I=E,D=T;switch(t.keyCode){case o.Keys.esc:e.onClose&&ye(t);return;case o.Keys.up:D=T-y,A(D);break;case o.Keys.down:D=T+y,A(D);break;case o.Keys.left:I=E-y,R(I);break;case o.Keys.right:I=E+y,R(I);break;default:return}H(e.onMove,t,!1,void 0,{left:I,top:D})}},[ue,v,x,le,e.onResize,e.onStageChange,e.onClose,e.onMove,C,b,r,H,w]),pe=f(t=>{const n=t.event,{left:c,top:u}=O.current;h.current.differenceLeft=n.pageX-c,h.current.differenceTop=n.pageY-u},[]),et=f(t=>{const n=t.event;n.originalEvent.preventDefault();const{stage:c,draggable:u,props:d,width:l,height:S}=O.current;if(c!==a.windowStage.FULLSCREEN&&u){const E=Math.max(n.pageY-(h.current.differenceTop||0),0),T=n.pageX-(h.current.differenceLeft||0);A(E),R(T),ne(!0),d.onMove&&H(d.onMove,n,!0,!1,{left:T,top:E},{width:l,height:S})}},[H]),tt=f(t=>{const n=t.event,{stage:c,draggable:u,props:d,left:l,top:S,width:E,height:T}=O.current;c!==a.windowStage.FULLSCREEN&&u&&d.onMove&&H(d.onMove,n,!0,!0,{left:l,top:S},{width:E,height:T}),ne(!1)},[H]),nt=f(()=>{K.current?(clearTimeout(K.current),K.current=void 0):(fe(!0),me(Ke.getMaxZIndex(j,N(),re)))},[j,N,re]),it=f(()=>{clearTimeout(K.current);const t=s();t&&(K.current=t.setTimeout(()=>{fe(!1),K.current=void 0}))},[s]),We=f(t=>{t.preventDefault(),h.current.leftBeforeAction=q,h.current.topBeforeAction=P,h.current.widthBeforeAction=b,h.current.heightBeforeAction=C,G(a.windowStage.MINIMIZED),M(0),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.MINIMIZED})},[q,P,b,C,e.onStageChange,w]),de=f(t=>{t.preventDefault(),h.current.leftBeforeAction=q,h.current.topBeforeAction=P,h.current.widthBeforeAction=b,h.current.heightBeforeAction=C;const n=s(),c=n?n.innerWidth:0,u=n?n.innerHeight:0;R(0),A(0),k(e.appendTo?e.appendTo.offsetWidth:c),M(e.appendTo?e.appendTo.offsetHeight:u),G(a.windowStage.FULLSCREEN),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.FULLSCREEN})},[q,P,b,C,e.appendTo,e.onStageChange,s,w]),Y=f(t=>{t.preventDefault(),r===a.windowStage.FULLSCREEN?(G(a.windowStage.DEFAULT),R(h.current.leftBeforeAction),A(h.current.topBeforeAction),k(h.current.widthBeforeAction),M(h.current.heightBeforeAction)):r===a.windowStage.MINIMIZED&&(G(a.windowStage.DEFAULT),M(h.current.heightBeforeAction)),o.dispatchEvent(e.onStageChange,t,w(),{state:a.windowStage.DEFAULT})},[r,e.onStageChange,w]),ye=f(t=>{t.preventDefault(),o.dispatchEvent(e.onClose,t,w(),{state:void 0})},[e.onClose,w]),ot=f(t=>{r===a.windowStage.FULLSCREEN||r===a.windowStage.MINIMIZED?Y(t):de(t)},[r,Y,de]),at=f((t,n)=>{var Ue,xe,ke,Oe,ze,_e;const{props:c,width:u,height:d,top:l,left:S}=O.current,E=c.appendTo?t.pageX-Z.current.x:t.pageX,T=c.appendTo?t.pageY-Z.current.y:t.pageY,I=(xe=d!=null?d:(Ue=B.current)==null?void 0:Ue.clientHeight)!=null?xe:0,D=v||he,J=x||se,Q=l-T,He=S-E,Fe=E-S,Ne=T-l;let $=!1;const g={isDragging:!n.end};n.direction.indexOf("n")>=0&&J-(I+Q)<0&&(l>0&&(g.height=I+Q),g.top=T,$=!0),n.direction.indexOf("s")>=0&&J-Ne<0&&(g.height=Ne,$=!0),n.direction.indexOf("w")>=0&&D-(u+He)<0&&(S>0&&(g.width=u+He),g.left=E,$=!0),n.direction.indexOf("e")>=0&&D-Fe<0&&(g.width=Fe,$=!0),$&&(g.height!==void 0&&M(g.height),g.top!==void 0&&A(g.top),g.width!==void 0&&k(g.width),g.left!==void 0&&R(g.left),g.isDragging!==void 0&&ne(g.isDragging)),H(c.onResize,t,!0,n.end,{left:(ke=g.left)!=null?ke:S,top:(Oe=g.top)!=null?Oe:l},{width:(ze=g.width)!=null?ze:u,height:(_e=g.height)!=null?_e:d})},[H,x,v]),ve=f(()=>{if(r===a.windowStage.FULLSCREEN){const t=s(),n=t?t.innerWidth:0,c=t?t.innerHeight:0;k(e.appendTo?e.appendTo.offsetWidth:n),M(e.appendTo?e.appendTo.offsetHeight:c)}},[r,e.appendTo,s]);z(()=>{const t=B.current;t&&Xe&&t.focus({preventScroll:!0});const n=s();n&&n.addEventListener("resize",ve),G(e.stage||a.windowStage.DEFAULT),ne(!1),A(Le()),R(be()),k(Ce()),M(Ie()),fe(!0),me(Ke.getMaxZIndex(j,N(),re)),h.current={leftBeforeAction:be(),topBeforeAction:Le(),widthBeforeAction:Ce(),heightBeforeAction:Ie()};const c=N();if(e.appendTo&&c){const d=e.appendTo.getBoundingClientRect(),l=c.body.getBoundingClientRect();Z.current.x=d.left-l.left,Z.current.y=d.top-l.top}const u=Ye.current;return()=>{var l;const d=s();d&&d.removeEventListener("resize",ve),u&&o.canUseDOM&&(document.contains(u)?u.focus({preventScroll:!0}):u.id&&((l=document.getElementById(u.id))==null||l.focus({preventScroll:!0})))}},[]),z(()=>{e.left!==void 0&&!V&&R(e.left)},[e.left,V]),z(()=>{e.top!==void 0&&!V&&A(e.top)},[e.top,V]),z(()=>{e.initialLeft!==void 0&&R(e.initialLeft)},[e.initialLeft]),z(()=>{e.initialTop!==void 0&&A(e.initialTop)},[e.initialTop]),z(()=>{const t=N();if(e.appendTo&&t){const n=e.appendTo.getBoundingClientRect(),c=t.body.getBoundingClientRect();Z.current.x=n.left-c.left,Z.current.y=n.top-c.top}},[e.appendTo,N]);const ct=W(null),Ae=W(null);Et(L,()=>{const t={get element(){return B.current},get windowElement(){return B.current},get draggable(){return Se.current},props:e};return Ae.current=t,t},[e]),ct.current=B.current,o.useWebMcpRegister("window",Ae,e,e.webMcp);const Re=m.Children.toArray(e.children),rt=Qe(Re),dt=Je(Re),lt=o.classNames("k-window",e.className,{"k-window-minimized":r==="MINIMIZED","k-focus":Ve}),Me=m.createElement(o.ZIndexContext.Provider,{value:j},m.createElement(m.Fragment,null,ue&&m.createElement("div",{className:"k-overlay",style:{zIndex:j,...e.overlayStyle}}),m.createElement("div",{id:e.id,[p.DATA_DIALOGS_ID]:re,tabIndex:0,role:"dialog","aria-labelledby":De.current,onFocus:nt,onBlur:it,onKeyDown:$e,ref:B,className:lt,style:{top:P,left:q,width:b,height:C||"",zIndex:j,...e.style}},m.createElement(st.MiddleLayerOptimization,{shouldUpdateOnDrag:e.shouldUpdateOnDrag||!1,isDragging:V},m.createElement(o.Draggable,{onPress:pe,onDrag:et,onRelease:tt,autoScroll:!1,ref:Se},m.createElement(gt.WindowTitleBar,{stage:r,onDoubleClick:je?ot:void 0,onMinimizeButtonClick:We,onFullScreenButtonClick:de,onRestoreButtonClick:Y,onCloseButtonClick:ye,closeButton:e.closeButton,minimizeButton:e.minimizeButton,maximizeButton:e.maximizeButton,restoreButton:e.restoreButton,id:De.current},e.title)),r===a.windowStage.MINIMIZED?null:m.createElement(m.Fragment,null,m.createElement("div",{className:"k-window-content"},rt),dt),r===a.windowStage.DEFAULT&&le?m.createElement(ht.ResizeHandlers,{onResize:at}):null))));return o.canUseDOM?e.appendTo===null?Me:wt.createPortal(Me,e.appendTo||document.body):null});we.displayName="Window";const qe=o.createPropsContext(),Ee=o.withIdHOC(o.withPropsContext(qe,we));Ee.displayName="KendoReactWindow";const St={autoFocus:i.bool,title:i.any,className:i.string,closeButton:i.func,minimizeButton:i.func,maximizeButton:i.func,restoreButton:i.func,modal:i.bool,overlayStyle:i.object,width:i.number,height:i.number,minWidth:i.number,minHeight:i.number,left:i.number,top:i.number,initialLeft:i.number,initialTop:i.number,initialWidth:i.number,initialHeight:i.number,resizable:i.bool,draggable:i.bool,doubleClickStageChange:i.bool,stage:i.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),onClose:i.func,onMove:i.func,onResize:i.func,onStageChange:i.func,children:i.node,id:i.string,dir:i.string,style:i.object,appendTo:i.any,shouldUpdateOnDrag:i.bool};Ee.propTypes=St;exports.Window=Ee;exports.WindowPropsContext=qe;exports.WindowWithoutContext=we;
|
package/Window.mjs
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as T from "react";
|
|
9
|
-
import * as
|
|
9
|
+
import * as ht from "react-dom";
|
|
10
10
|
import i from "prop-types";
|
|
11
|
-
import { WindowTitleBar as
|
|
12
|
-
import { withIdHOC as
|
|
13
|
-
import { ResizeHandlers as
|
|
14
|
-
import { MiddleLayerOptimization as
|
|
11
|
+
import { WindowTitleBar as gt } from "./WindowTitlebar.mjs";
|
|
12
|
+
import { withIdHOC as st, withPropsContext as mt, createPropsContext as wt, ZIndexContext as Ze, canUseDOM as de, keepFocusInContainer as Tt, Keys as C, dispatchEvent as M, useWebMcpRegister as Et, classNames as Lt, Draggable as Ct } from "@progress/kendo-react-common";
|
|
13
|
+
import { ResizeHandlers as Dt } from "./WindowResizeHandlers.mjs";
|
|
14
|
+
import { MiddleLayerOptimization as bt } from "./MiddleLayerOptimization.mjs";
|
|
15
15
|
import { windowStage as o } from "./StageEnum.mjs";
|
|
16
|
-
import { WindowActionsBar as
|
|
17
|
-
import { DEFAULT_DIALOGS_ZINDEX as
|
|
18
|
-
import { getMaxZIndex as
|
|
19
|
-
const { useState: N, useEffect:
|
|
16
|
+
import { WindowActionsBar as _e } from "./WindowActionsBar.mjs";
|
|
17
|
+
import { DEFAULT_DIALOGS_ZINDEX as Pe, ZINDEX_DIALOGS_STEP as Ke, DATA_DIALOGS_ID as It } from "./constants.mjs";
|
|
18
|
+
import { getMaxZIndex as Xe } from "./utils.mjs";
|
|
19
|
+
const { useState: N, useEffect: k, useCallback: u, useMemo: G, useRef: W, useImperativeHandle: Wt, useContext: St, forwardRef: Rt } = T, $ = 300, p = 300, se = 120, me = 100, S = 5, z = {
|
|
20
20
|
minWidth: se,
|
|
21
21
|
minHeight: me,
|
|
22
22
|
resizable: !0,
|
|
@@ -24,33 +24,33 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
24
24
|
modal: !1,
|
|
25
25
|
doubleClickStageChange: !0,
|
|
26
26
|
autoFocus: !0
|
|
27
|
-
},
|
|
28
|
-
var
|
|
27
|
+
}, Ge = Rt((e, O) => {
|
|
28
|
+
var ve;
|
|
29
29
|
const {
|
|
30
|
-
minWidth: ee =
|
|
31
|
-
minHeight: te =
|
|
32
|
-
resizable: ue =
|
|
33
|
-
draggable: we =
|
|
34
|
-
modal: fe =
|
|
35
|
-
doubleClickStageChange:
|
|
36
|
-
autoFocus:
|
|
37
|
-
} = e, [
|
|
30
|
+
minWidth: ee = z.minWidth,
|
|
31
|
+
minHeight: te = z.minHeight,
|
|
32
|
+
resizable: ue = z.resizable,
|
|
33
|
+
draggable: we = z.draggable,
|
|
34
|
+
modal: fe = z.modal,
|
|
35
|
+
doubleClickStageChange: Ye = z.doubleClickStageChange,
|
|
36
|
+
autoFocus: je = z.autoFocus
|
|
37
|
+
} = e, [qe, V] = N(e.stage || o.DEFAULT), [Y, ne] = N(!1), [ie, R] = N(0), [oe, A] = N(0), [re, U] = N($), [ae, B] = N(p), [Je, he] = N(!0), [ge, Te] = N(Pe), a = (ve = e.stage) != null ? ve : qe, H = St(Ze), y = W(null), Ee = W(null), h = W({
|
|
38
38
|
leftBeforeAction: 0,
|
|
39
39
|
topBeforeAction: 0,
|
|
40
40
|
widthBeforeAction: $,
|
|
41
41
|
heightBeforeAction: p
|
|
42
|
-
}), Z =
|
|
42
|
+
}), Z = W({ x: 0, y: 0 }), _ = W(void 0), Qe = W(
|
|
43
43
|
de ? document.activeElement : null
|
|
44
|
-
), Le =
|
|
44
|
+
), Le = W("window-title-" + (e.id ? e.id + "-accessibility-id" : "")), x = W({
|
|
45
45
|
left: 0,
|
|
46
46
|
top: 0,
|
|
47
47
|
width: $,
|
|
48
48
|
height: p,
|
|
49
49
|
internalLeft: oe,
|
|
50
50
|
internalTop: ie,
|
|
51
|
-
internalWidth:
|
|
52
|
-
internalHeight:
|
|
53
|
-
stage:
|
|
51
|
+
internalWidth: re,
|
|
52
|
+
internalHeight: ae,
|
|
53
|
+
stage: a,
|
|
54
54
|
draggable: we,
|
|
55
55
|
props: e
|
|
56
56
|
}), F = u(() => {
|
|
@@ -61,53 +61,53 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
61
61
|
return t == null ? void 0 : t.defaultView;
|
|
62
62
|
}, [F]), P = G(() => {
|
|
63
63
|
var t;
|
|
64
|
-
return
|
|
65
|
-
}, [
|
|
64
|
+
return a !== o.FULLSCREEN ? Math.max((t = e.top) != null ? t : ie, 0) : 0;
|
|
65
|
+
}, [a, e.top, ie]), K = G(() => {
|
|
66
66
|
var t;
|
|
67
|
-
return
|
|
68
|
-
}, [
|
|
67
|
+
return a !== o.FULLSCREEN ? Math.max((t = e.left) != null ? t : oe, 0) : 0;
|
|
68
|
+
}, [a, e.left, oe]), D = G(() => {
|
|
69
69
|
var n;
|
|
70
|
-
const t = (n = e.width) != null ? n :
|
|
71
|
-
if (
|
|
70
|
+
const t = (n = e.width) != null ? n : re;
|
|
71
|
+
if (a === o.FULLSCREEN) {
|
|
72
72
|
if (e.appendTo)
|
|
73
73
|
return e.appendTo.offsetWidth;
|
|
74
|
-
const
|
|
75
|
-
return
|
|
74
|
+
const r = g();
|
|
75
|
+
return r ? r.innerWidth : 0;
|
|
76
76
|
}
|
|
77
77
|
return t;
|
|
78
|
-
}, [
|
|
79
|
-
const t = e.height === void 0 ?
|
|
80
|
-
if (
|
|
78
|
+
}, [a, e.width, e.appendTo, re, g]), b = G(() => {
|
|
79
|
+
const t = e.height === void 0 ? ae : e.height;
|
|
80
|
+
if (a === o.FULLSCREEN) {
|
|
81
81
|
if (e.appendTo)
|
|
82
82
|
return e.appendTo.offsetHeight;
|
|
83
83
|
const n = g();
|
|
84
84
|
return n ? n.innerHeight : 0;
|
|
85
|
-
} else if (
|
|
85
|
+
} else if (a === o.MINIMIZED)
|
|
86
86
|
return 0;
|
|
87
87
|
return t;
|
|
88
|
-
}, [
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
}, [a, e.height, e.appendTo, ae, g]), ce = G(() => e.id ? e.id + "-accessibility-id" : void 0, [e.id]);
|
|
89
|
+
k(() => {
|
|
90
|
+
x.current = {
|
|
91
91
|
left: K,
|
|
92
92
|
top: P,
|
|
93
93
|
width: D,
|
|
94
94
|
height: b,
|
|
95
95
|
internalLeft: oe,
|
|
96
96
|
internalTop: ie,
|
|
97
|
-
internalWidth:
|
|
98
|
-
internalHeight:
|
|
99
|
-
stage:
|
|
97
|
+
internalWidth: re,
|
|
98
|
+
internalHeight: ae,
|
|
99
|
+
stage: a,
|
|
100
100
|
draggable: we,
|
|
101
101
|
props: e
|
|
102
102
|
};
|
|
103
103
|
});
|
|
104
104
|
const X = G(() => {
|
|
105
105
|
if (H === void 0)
|
|
106
|
-
return H != null ? H :
|
|
107
|
-
const t = H ? H +
|
|
108
|
-
return ge > t ? ge : H +
|
|
106
|
+
return H != null ? H : Pe;
|
|
107
|
+
const t = H ? H + Ke : 0;
|
|
108
|
+
return ge > t ? ge : H + Ke;
|
|
109
109
|
}, [ge, H]), Ce = u(() => {
|
|
110
|
-
var
|
|
110
|
+
var r, d;
|
|
111
111
|
if (e.top !== void 0)
|
|
112
112
|
return e.top;
|
|
113
113
|
if (e.initialTop !== void 0)
|
|
@@ -116,7 +116,7 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
116
116
|
if (e.height !== void 0 ? t = e.height : e.initialHeight !== void 0 && (t = e.initialHeight), e.appendTo && t)
|
|
117
117
|
return e.appendTo.offsetHeight / 2 - t / 2;
|
|
118
118
|
const n = g();
|
|
119
|
-
return n ? n.innerHeight / 2 - ((d = t != null ? t : (
|
|
119
|
+
return n ? n.innerHeight / 2 - ((d = t != null ? t : (r = y.current) == null ? void 0 : r.clientHeight) != null ? d : 0) / 2 : 0;
|
|
120
120
|
}, [e.top, e.initialTop, e.height, e.initialHeight, e.appendTo, g]), De = u(() => {
|
|
121
121
|
if (e.left !== void 0)
|
|
122
122
|
return e.left;
|
|
@@ -133,8 +133,8 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
133
133
|
}, [e.width, e.initialWidth]), Ie = u(() => {
|
|
134
134
|
let t = p;
|
|
135
135
|
return e.height !== void 0 ? t = e.height : e.initialHeight !== void 0 && (t = e.initialHeight), t;
|
|
136
|
-
}, [e.height, e.initialHeight]),
|
|
137
|
-
(t, n,
|
|
136
|
+
}, [e.height, e.initialHeight]), $e = u((t) => t.filter((n) => (n == null ? void 0 : n.type) === _e), []), pe = u((t) => t.filter((n) => n && n.type !== _e), []), s = u(() => typeof O == "object" && O !== null && "current" in O ? O.current : null, [O]), v = u(
|
|
137
|
+
(t, n, r, d, c, l) => {
|
|
138
138
|
var L, q, J;
|
|
139
139
|
if (!t)
|
|
140
140
|
return;
|
|
@@ -143,10 +143,10 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
143
143
|
internalTop: m,
|
|
144
144
|
internalWidth: w,
|
|
145
145
|
internalHeight: I
|
|
146
|
-
} =
|
|
146
|
+
} = x.current;
|
|
147
147
|
t({
|
|
148
148
|
nativeEvent: n.nativeEvent ? n.nativeEvent : n.originalEvent,
|
|
149
|
-
drag:
|
|
149
|
+
drag: r,
|
|
150
150
|
end: d,
|
|
151
151
|
target: s(),
|
|
152
152
|
left: (L = c == null ? void 0 : c.left) != null ? L : E,
|
|
@@ -156,45 +156,45 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
156
156
|
});
|
|
157
157
|
},
|
|
158
158
|
[s]
|
|
159
|
-
),
|
|
159
|
+
), et = u(
|
|
160
160
|
(t) => {
|
|
161
161
|
var l, E;
|
|
162
|
-
if (fe &&
|
|
162
|
+
if (fe && Tt(t, y.current), t.target !== t.currentTarget)
|
|
163
163
|
return;
|
|
164
|
-
const n = ee || se,
|
|
164
|
+
const n = ee || se, r = te || me, d = t.metaKey || t.ctrlKey, c = (E = b != null ? b : (l = y.current) == null ? void 0 : l.clientHeight) != null ? E : 0;
|
|
165
165
|
if (d && ue) {
|
|
166
166
|
switch (t.keyCode) {
|
|
167
167
|
case C.up:
|
|
168
|
-
t.preventDefault(),
|
|
168
|
+
t.preventDefault(), r <= c - S && B(c - S);
|
|
169
169
|
break;
|
|
170
170
|
case C.down:
|
|
171
|
-
t.preventDefault(), B(c +
|
|
171
|
+
t.preventDefault(), B(c + S);
|
|
172
172
|
break;
|
|
173
173
|
case C.left:
|
|
174
|
-
n <= D -
|
|
174
|
+
n <= D - S && U(D - S);
|
|
175
175
|
break;
|
|
176
176
|
case C.right:
|
|
177
|
-
|
|
177
|
+
U(D + S);
|
|
178
178
|
break;
|
|
179
179
|
default:
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
v(e.onResize, t, !1, void 0);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
if (t.altKey) {
|
|
186
186
|
switch (t.keyCode) {
|
|
187
187
|
case C.up:
|
|
188
|
-
|
|
188
|
+
a === o.MINIMIZED ? (j(t), M(e.onStageChange, t, s(), {
|
|
189
189
|
state: o.DEFAULT
|
|
190
|
-
})) :
|
|
190
|
+
})) : a === o.DEFAULT && (le(t), M(e.onStageChange, t, s(), {
|
|
191
191
|
state: o.FULLSCREEN
|
|
192
192
|
}));
|
|
193
193
|
break;
|
|
194
194
|
case C.down:
|
|
195
|
-
|
|
195
|
+
a === o.FULLSCREEN ? (j(t), M(e.onStageChange, t, s(), {
|
|
196
196
|
state: o.DEFAULT
|
|
197
|
-
})) :
|
|
197
|
+
})) : a === o.DEFAULT && (We(t), M(e.onStageChange, t, s(), {
|
|
198
198
|
state: o.MINIMIZED
|
|
199
199
|
}));
|
|
200
200
|
break;
|
|
@@ -202,28 +202,28 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
if (!t.ctrlKey) {
|
|
205
|
-
const { internalLeft: m, internalTop: w } =
|
|
205
|
+
const { internalLeft: m, internalTop: w } = x.current;
|
|
206
206
|
let I = m, L = w;
|
|
207
207
|
switch (t.keyCode) {
|
|
208
208
|
case C.esc:
|
|
209
209
|
e.onClose && Se(t);
|
|
210
210
|
return;
|
|
211
211
|
case C.up:
|
|
212
|
-
L = w -
|
|
212
|
+
L = w - S, R(L);
|
|
213
213
|
break;
|
|
214
214
|
case C.down:
|
|
215
|
-
L = w +
|
|
215
|
+
L = w + S, R(L);
|
|
216
216
|
break;
|
|
217
217
|
case C.left:
|
|
218
|
-
I = m -
|
|
218
|
+
I = m - S, A(I);
|
|
219
219
|
break;
|
|
220
220
|
case C.right:
|
|
221
|
-
I = m +
|
|
221
|
+
I = m + S, A(I);
|
|
222
222
|
break;
|
|
223
223
|
default:
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
v(e.onMove, t, !1, void 0, { left: I, top: L });
|
|
227
227
|
}
|
|
228
228
|
},
|
|
229
229
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -238,27 +238,27 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
238
238
|
e.onMove,
|
|
239
239
|
b,
|
|
240
240
|
D,
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
a,
|
|
242
|
+
v,
|
|
243
243
|
s
|
|
244
244
|
]
|
|
245
|
-
),
|
|
246
|
-
const n = t.event, { left:
|
|
247
|
-
h.current.differenceLeft = n.pageX -
|
|
248
|
-
}, []),
|
|
245
|
+
), tt = u((t) => {
|
|
246
|
+
const n = t.event, { left: r, top: d } = x.current;
|
|
247
|
+
h.current.differenceLeft = n.pageX - r, h.current.differenceTop = n.pageY - d;
|
|
248
|
+
}, []), nt = u(
|
|
249
249
|
(t) => {
|
|
250
250
|
const n = t.event;
|
|
251
251
|
n.originalEvent.preventDefault();
|
|
252
252
|
const {
|
|
253
|
-
stage:
|
|
253
|
+
stage: r,
|
|
254
254
|
draggable: d,
|
|
255
255
|
props: c,
|
|
256
256
|
width: l,
|
|
257
257
|
height: E
|
|
258
|
-
} =
|
|
259
|
-
if (
|
|
258
|
+
} = x.current;
|
|
259
|
+
if (r !== o.FULLSCREEN && d) {
|
|
260
260
|
const m = Math.max(n.pageY - (h.current.differenceTop || 0), 0), w = n.pageX - (h.current.differenceLeft || 0);
|
|
261
|
-
|
|
261
|
+
R(m), A(w), ne(!0), c.onMove && v(
|
|
262
262
|
c.onMove,
|
|
263
263
|
n,
|
|
264
264
|
!0,
|
|
@@ -268,19 +268,19 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
268
268
|
);
|
|
269
269
|
}
|
|
270
270
|
},
|
|
271
|
-
[
|
|
272
|
-
),
|
|
271
|
+
[v]
|
|
272
|
+
), it = u(
|
|
273
273
|
(t) => {
|
|
274
274
|
const n = t.event, {
|
|
275
|
-
stage:
|
|
275
|
+
stage: r,
|
|
276
276
|
draggable: d,
|
|
277
277
|
props: c,
|
|
278
278
|
left: l,
|
|
279
279
|
top: E,
|
|
280
280
|
width: m,
|
|
281
281
|
height: w
|
|
282
|
-
} =
|
|
283
|
-
|
|
282
|
+
} = x.current;
|
|
283
|
+
r !== o.FULLSCREEN && d && c.onMove && v(
|
|
284
284
|
c.onMove,
|
|
285
285
|
n,
|
|
286
286
|
!0,
|
|
@@ -289,10 +289,10 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
289
289
|
{ width: m, height: w }
|
|
290
290
|
), ne(!1);
|
|
291
291
|
},
|
|
292
|
-
[
|
|
293
|
-
),
|
|
294
|
-
_.current ? (clearTimeout(_.current), _.current = void 0) : (he(!0), Te(
|
|
295
|
-
}, [X, F, ce]),
|
|
292
|
+
[v]
|
|
293
|
+
), ot = u(() => {
|
|
294
|
+
_.current ? (clearTimeout(_.current), _.current = void 0) : (he(!0), Te(Xe(X, F(), ce)));
|
|
295
|
+
}, [X, F, ce]), rt = u(() => {
|
|
296
296
|
clearTimeout(_.current);
|
|
297
297
|
const t = g();
|
|
298
298
|
t && (_.current = t.setTimeout(() => {
|
|
@@ -306,15 +306,15 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
306
306
|
), le = u(
|
|
307
307
|
(t) => {
|
|
308
308
|
t.preventDefault(), h.current.leftBeforeAction = K, h.current.topBeforeAction = P, h.current.widthBeforeAction = D, h.current.heightBeforeAction = b;
|
|
309
|
-
const n = g(),
|
|
310
|
-
A(0),
|
|
309
|
+
const n = g(), r = n ? n.innerWidth : 0, d = n ? n.innerHeight : 0;
|
|
310
|
+
A(0), R(0), U(e.appendTo ? e.appendTo.offsetWidth : r), B(e.appendTo ? e.appendTo.offsetHeight : d), V(o.FULLSCREEN), M(e.onStageChange, t, s(), { state: o.FULLSCREEN });
|
|
311
311
|
},
|
|
312
312
|
[K, P, D, b, e.appendTo, e.onStageChange, g, s]
|
|
313
313
|
), j = u(
|
|
314
314
|
(t) => {
|
|
315
|
-
t.preventDefault(),
|
|
315
|
+
t.preventDefault(), a === o.FULLSCREEN ? (V(o.DEFAULT), A(h.current.leftBeforeAction), R(h.current.topBeforeAction), U(h.current.widthBeforeAction), B(h.current.heightBeforeAction)) : a === o.MINIMIZED && (V(o.DEFAULT), B(h.current.heightBeforeAction)), M(e.onStageChange, t, s(), { state: o.DEFAULT });
|
|
316
316
|
},
|
|
317
|
-
[
|
|
317
|
+
[a, e.onStageChange, s]
|
|
318
318
|
), Se = u(
|
|
319
319
|
(t) => {
|
|
320
320
|
t.preventDefault(), M(e.onClose, t, s(), { state: void 0 });
|
|
@@ -322,96 +322,99 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
322
322
|
[e.onClose, s]
|
|
323
323
|
), at = u(
|
|
324
324
|
(t) => {
|
|
325
|
-
|
|
325
|
+
a === o.FULLSCREEN || a === o.MINIMIZED ? j(t) : le(t);
|
|
326
326
|
},
|
|
327
|
-
[
|
|
328
|
-
),
|
|
327
|
+
[a, j, le]
|
|
328
|
+
), ct = u(
|
|
329
329
|
(t, n) => {
|
|
330
|
-
var
|
|
330
|
+
var Ne, Ue, xe, ke, ze, Oe;
|
|
331
331
|
const {
|
|
332
|
-
props:
|
|
332
|
+
props: r,
|
|
333
333
|
width: d,
|
|
334
334
|
height: c,
|
|
335
335
|
top: l,
|
|
336
336
|
left: E
|
|
337
|
-
} =
|
|
337
|
+
} = x.current, m = r.appendTo ? t.pageX - Z.current.x : t.pageX, w = r.appendTo ? t.pageY - Z.current.y : t.pageY, I = (Ue = c != null ? c : (Ne = y.current) == null ? void 0 : Ne.clientHeight) != null ? Ue : 0, L = ee || se, q = te || me, J = l - w, He = E - m, Fe = m - E, Me = w - l;
|
|
338
338
|
let Q = !1;
|
|
339
339
|
const f = {
|
|
340
340
|
isDragging: !n.end
|
|
341
341
|
};
|
|
342
|
-
n.direction.indexOf("n") >= 0 && q - (I + J) < 0 && (l > 0 && (f.height = I + J), f.top = w, Q = !0), n.direction.indexOf("s") >= 0 && q -
|
|
343
|
-
|
|
342
|
+
n.direction.indexOf("n") >= 0 && q - (I + J) < 0 && (l > 0 && (f.height = I + J), f.top = w, Q = !0), n.direction.indexOf("s") >= 0 && q - Me < 0 && (f.height = Me, Q = !0), n.direction.indexOf("w") >= 0 && L - (d + He) < 0 && (E > 0 && (f.width = d + He), f.left = m, Q = !0), n.direction.indexOf("e") >= 0 && L - Fe < 0 && (f.width = Fe, Q = !0), Q && (f.height !== void 0 && B(f.height), f.top !== void 0 && R(f.top), f.width !== void 0 && U(f.width), f.left !== void 0 && A(f.left), f.isDragging !== void 0 && ne(f.isDragging)), v(
|
|
343
|
+
r.onResize,
|
|
344
344
|
t,
|
|
345
345
|
!0,
|
|
346
346
|
n.end,
|
|
347
|
-
{ left: (
|
|
348
|
-
{ width: (
|
|
347
|
+
{ left: (xe = f.left) != null ? xe : E, top: (ke = f.top) != null ? ke : l },
|
|
348
|
+
{ width: (ze = f.width) != null ? ze : d, height: (Oe = f.height) != null ? Oe : c }
|
|
349
349
|
);
|
|
350
350
|
},
|
|
351
|
-
[
|
|
352
|
-
),
|
|
353
|
-
if (
|
|
354
|
-
const t = g(), n = t ? t.innerWidth : 0,
|
|
355
|
-
|
|
351
|
+
[v, te, ee]
|
|
352
|
+
), Re = u(() => {
|
|
353
|
+
if (a === o.FULLSCREEN) {
|
|
354
|
+
const t = g(), n = t ? t.innerWidth : 0, r = t ? t.innerHeight : 0;
|
|
355
|
+
U(e.appendTo ? e.appendTo.offsetWidth : n), B(e.appendTo ? e.appendTo.offsetHeight : r);
|
|
356
356
|
}
|
|
357
|
-
}, [
|
|
358
|
-
|
|
359
|
-
const t =
|
|
360
|
-
t &&
|
|
357
|
+
}, [a, e.appendTo, g]);
|
|
358
|
+
k(() => {
|
|
359
|
+
const t = y.current;
|
|
360
|
+
t && je && t.focus({ preventScroll: !0 });
|
|
361
361
|
const n = g();
|
|
362
|
-
n && n.addEventListener("resize",
|
|
362
|
+
n && n.addEventListener("resize", Re), V(e.stage || o.DEFAULT), ne(!1), R(Ce()), A(De()), U(be()), B(Ie()), he(!0), Te(Xe(X, F(), ce)), h.current = {
|
|
363
363
|
leftBeforeAction: De(),
|
|
364
364
|
topBeforeAction: Ce(),
|
|
365
365
|
widthBeforeAction: be(),
|
|
366
366
|
heightBeforeAction: Ie()
|
|
367
367
|
};
|
|
368
|
-
const
|
|
369
|
-
if (e.appendTo &&
|
|
370
|
-
const c = e.appendTo.getBoundingClientRect(), l =
|
|
368
|
+
const r = F();
|
|
369
|
+
if (e.appendTo && r) {
|
|
370
|
+
const c = e.appendTo.getBoundingClientRect(), l = r.body.getBoundingClientRect();
|
|
371
371
|
Z.current.x = c.left - l.left, Z.current.y = c.top - l.top;
|
|
372
372
|
}
|
|
373
|
-
const d =
|
|
373
|
+
const d = Qe.current;
|
|
374
374
|
return () => {
|
|
375
375
|
var l;
|
|
376
376
|
const c = g();
|
|
377
|
-
c && c.removeEventListener("resize",
|
|
377
|
+
c && c.removeEventListener("resize", Re), d && de && (document.contains(d) ? d.focus({ preventScroll: !0 }) : d.id && ((l = document.getElementById(d.id)) == null || l.focus({ preventScroll: !0 })));
|
|
378
378
|
};
|
|
379
|
-
}, []),
|
|
379
|
+
}, []), k(() => {
|
|
380
380
|
e.left !== void 0 && !Y && A(e.left);
|
|
381
|
-
}, [e.left, Y]),
|
|
382
|
-
e.top !== void 0 && !Y &&
|
|
383
|
-
}, [e.top, Y]),
|
|
381
|
+
}, [e.left, Y]), k(() => {
|
|
382
|
+
e.top !== void 0 && !Y && R(e.top);
|
|
383
|
+
}, [e.top, Y]), k(() => {
|
|
384
384
|
e.initialLeft !== void 0 && A(e.initialLeft);
|
|
385
|
-
}, [e.initialLeft]),
|
|
386
|
-
e.initialTop !== void 0 &&
|
|
387
|
-
}, [e.initialTop]),
|
|
385
|
+
}, [e.initialLeft]), k(() => {
|
|
386
|
+
e.initialTop !== void 0 && R(e.initialTop);
|
|
387
|
+
}, [e.initialTop]), k(() => {
|
|
388
388
|
const t = F();
|
|
389
389
|
if (e.appendTo && t) {
|
|
390
|
-
const n = e.appendTo.getBoundingClientRect(),
|
|
391
|
-
Z.current.x = n.left -
|
|
390
|
+
const n = e.appendTo.getBoundingClientRect(), r = t.body.getBoundingClientRect();
|
|
391
|
+
Z.current.x = n.left - r.left, Z.current.y = n.top - r.top;
|
|
392
392
|
}
|
|
393
393
|
}, [e.appendTo, F]);
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
() =>
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
394
|
+
const lt = W(null), Ae = W(null);
|
|
395
|
+
Wt(
|
|
396
|
+
O,
|
|
397
|
+
() => {
|
|
398
|
+
const t = {
|
|
399
|
+
get element() {
|
|
400
|
+
return y.current;
|
|
401
|
+
},
|
|
402
|
+
get windowElement() {
|
|
403
|
+
return y.current;
|
|
404
|
+
},
|
|
405
|
+
get draggable() {
|
|
406
|
+
return Ee.current;
|
|
407
|
+
},
|
|
408
|
+
props: e
|
|
409
|
+
};
|
|
410
|
+
return Ae.current = t, t;
|
|
411
|
+
},
|
|
409
412
|
[e]
|
|
410
|
-
),
|
|
411
|
-
const Be = T.Children.toArray(e.children),
|
|
412
|
-
"k-window-minimized":
|
|
413
|
-
"k-focus":
|
|
414
|
-
}),
|
|
413
|
+
), lt.current = y.current, Et("window", Ae, e, e.webMcp);
|
|
414
|
+
const Be = T.Children.toArray(e.children), dt = pe(Be), ut = $e(Be), ft = Lt("k-window", e.className, {
|
|
415
|
+
"k-window-minimized": a === "MINIMIZED",
|
|
416
|
+
"k-focus": Je
|
|
417
|
+
}), ye = /* @__PURE__ */ T.createElement(Ze.Provider, { value: X }, /* @__PURE__ */ T.createElement(T.Fragment, null, fe && /* @__PURE__ */ T.createElement(
|
|
415
418
|
"div",
|
|
416
419
|
{
|
|
417
420
|
className: "k-overlay",
|
|
@@ -424,15 +427,15 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
424
427
|
"div",
|
|
425
428
|
{
|
|
426
429
|
id: e.id,
|
|
427
|
-
[
|
|
430
|
+
[It]: ce,
|
|
428
431
|
tabIndex: 0,
|
|
429
432
|
role: "dialog",
|
|
430
433
|
"aria-labelledby": Le.current,
|
|
431
|
-
onFocus:
|
|
432
|
-
onBlur:
|
|
433
|
-
onKeyDown:
|
|
434
|
-
ref:
|
|
435
|
-
className:
|
|
434
|
+
onFocus: ot,
|
|
435
|
+
onBlur: rt,
|
|
436
|
+
onKeyDown: et,
|
|
437
|
+
ref: y,
|
|
438
|
+
className: ft,
|
|
436
439
|
style: {
|
|
437
440
|
top: P,
|
|
438
441
|
left: K,
|
|
@@ -443,25 +446,25 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
443
446
|
}
|
|
444
447
|
},
|
|
445
448
|
/* @__PURE__ */ T.createElement(
|
|
446
|
-
|
|
449
|
+
bt,
|
|
447
450
|
{
|
|
448
451
|
shouldUpdateOnDrag: e.shouldUpdateOnDrag || !1,
|
|
449
452
|
isDragging: Y
|
|
450
453
|
},
|
|
451
454
|
/* @__PURE__ */ T.createElement(
|
|
452
|
-
|
|
455
|
+
Ct,
|
|
453
456
|
{
|
|
454
|
-
onPress:
|
|
455
|
-
onDrag:
|
|
456
|
-
onRelease:
|
|
457
|
+
onPress: tt,
|
|
458
|
+
onDrag: nt,
|
|
459
|
+
onRelease: it,
|
|
457
460
|
autoScroll: !1,
|
|
458
461
|
ref: Ee
|
|
459
462
|
},
|
|
460
463
|
/* @__PURE__ */ T.createElement(
|
|
461
|
-
|
|
464
|
+
gt,
|
|
462
465
|
{
|
|
463
|
-
stage:
|
|
464
|
-
onDoubleClick:
|
|
466
|
+
stage: a,
|
|
467
|
+
onDoubleClick: Ye ? at : void 0,
|
|
465
468
|
onMinimizeButtonClick: We,
|
|
466
469
|
onFullScreenButtonClick: le,
|
|
467
470
|
onRestoreButtonClick: j,
|
|
@@ -475,20 +478,20 @@ const { useState: N, useEffect: z, useCallback: u, useMemo: G, useRef: v, useImp
|
|
|
475
478
|
e.title
|
|
476
479
|
)
|
|
477
480
|
),
|
|
478
|
-
|
|
479
|
-
|
|
481
|
+
a === o.MINIMIZED ? null : /* @__PURE__ */ T.createElement(T.Fragment, null, /* @__PURE__ */ T.createElement("div", { className: "k-window-content" }, dt), ut),
|
|
482
|
+
a === o.DEFAULT && ue ? /* @__PURE__ */ T.createElement(Dt, { onResize: ct }) : null
|
|
480
483
|
)
|
|
481
484
|
)));
|
|
482
|
-
return de ? e.appendTo === null ?
|
|
485
|
+
return de ? e.appendTo === null ? ye : ht.createPortal(ye, e.appendTo || document.body) : null;
|
|
483
486
|
});
|
|
484
|
-
|
|
485
|
-
const At =
|
|
486
|
-
|
|
487
|
+
Ge.displayName = "Window";
|
|
488
|
+
const At = wt(), Ve = st(
|
|
489
|
+
mt(
|
|
487
490
|
At,
|
|
488
|
-
|
|
491
|
+
Ge
|
|
489
492
|
)
|
|
490
493
|
);
|
|
491
|
-
|
|
494
|
+
Ve.displayName = "KendoReactWindow";
|
|
492
495
|
const Bt = {
|
|
493
496
|
autoFocus: i.bool,
|
|
494
497
|
title: i.any,
|
|
@@ -524,9 +527,9 @@ const Bt = {
|
|
|
524
527
|
appendTo: i.any,
|
|
525
528
|
shouldUpdateOnDrag: i.bool
|
|
526
529
|
};
|
|
527
|
-
|
|
530
|
+
Ve.propTypes = Bt;
|
|
528
531
|
export {
|
|
529
|
-
|
|
532
|
+
Ve as Window,
|
|
530
533
|
At as WindowPropsContext,
|
|
531
|
-
|
|
534
|
+
Ge as WindowWithoutContext
|
|
532
535
|
};
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("prop-types"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-intl"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-common")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","prop-types","@progress/kendo-react-buttons","@progress/kendo-react-intl","@progress/kendo-svg-icons","@progress/kendo-react-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactDialogs={},e.React,e.ReactDOM,e.PropTypes,e.KendoReactButtons,e.KendoReactIntl,e.KendoSvgIcons,e.KendoReactCommon)}(this,function(e,t,n,o,i,r,a,l){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var s=c(t),d=c(n);const u="dialogs.windowMaximizeButton",g="dialogs.windowMinimizeButton",p="dialogs.windowRestoreButton",h="dialogs.windowCloseButton",f={[u]:"maximize",[g]:"minimize",[p]:"restore",[h]:"close"},m=({children:e,onCloseButtonClick:t,id:n,closeIcon:o})=>{const l=r.useLocalization();return s.createElement("div",{className:"k-window-titlebar k-dialog-titlebar",id:n},s.createElement("span",{className:"k-window-title k-dialog-title"},e),o&&s.createElement("div",{className:"k-window-titlebar-actions k-dialog-titlebar-actions"},s.createElement(i.Button,{"aria-label":l.toLanguageString(h,f[h]),size:"xs",onClick:t,icon:"x",svgIcon:a.xIcon,fillMode:"flat",className:"k-window-titlebar-action k-dialog-titlebar-action"})))},v=e=>{const t={layout:"stretched",...e},{layout:n,children:o}=t,i=l.classNames("k-actions","k-actions-horizontal","k-window-actions k-dialog-actions",{[`k-actions-${n}`]:n});return s.createElement("div",{className:i},o)};v.propTypes={children:o.any,layout:o.oneOf(["start","center","end","stretched"])};const w="data-windowid",E=10002,b=l.createPropsContext(),y=s.forwardRef((e,t)=>{const n=l.useZIndexContext(),o=n?n+2:E,i=s.useRef(null),r=s.useRef(null),a=s.useRef(l.getActiveElement(document)),c=l.usePropsContext(b,e),u=s.useMemo(()=>({...C,...c}),[c]),{title:g,width:p,height:h,children:f,minWidth:y,dir:k,style:T,contentStyle:I,autoFocusedElement:D,appendTo:L,className:B,overlayStyle:M,modal:N=C.modal,closeIcon:S=C.closeIcon,autoFocus:x=C.autoFocus}=u,F=s.useCallback(()=>({props:u,element:r.current}),[u]);s.useImperativeHandle(i,F),s.useImperativeHandle(t,()=>i.current),l.useWebMcpRegister("dialog",i,c,c.webMcp);const R=s.useMemo(()=>s.Children.toArray(f).filter(e=>!s.isValidElement(e)||e.type!==v),[f]),z=s.useMemo(()=>s.Children.toArray(f).filter(e=>s.isValidElement(e)&&e.type===v),[f]),{_id:A,contentId:U,id:W}=s.useMemo(()=>{const e=u.id,t=`${null!=e?e:"accessibility"}-id`;return{_id:t,contentId:`dialog-content-${t}`,id:e||`dialog-title-${t}`}},[u.id]),H=s.useCallback(()=>{if(r.current)if(x&&!D)r.current.focus();else if(!x&&D&&r.current){const e=r.current.querySelector(D);null==e||e.focus()}else{const e=[...l.FOCUSABLE_ELEMENTS].map(e=>e+":not(.k-dialog-titlebar *)");l.focusFirstFocusableChild(r.current,e)}},[x,D]);s.useEffect(()=>(H(),()=>{setTimeout(()=>{var e;!r.current&&a.current&&l.canUseDOM&&(document.contains(a.current)?a.current.focus():a.current.id&&(null==(e=document.getElementById(a.current.id))||e.focus()))})}),[H]);const O=s.useCallback(e=>{e.preventDefault(),l.dispatchEvent(u.onClose,e,F(),void 0)},[u.onClose]),K=s.useCallback(e=>{e.keyCode===l.Keys.esc&&u.onClose&&(e.preventDefault(),O(e)),l.keepFocusInContainer(e,r.current)},[u.onClose,O]),j=s.useMemo(()=>s.createElement(l.ZIndexContext.Provider,{value:o},s.createElement("div",{ref:r,[w]:A,className:"k-dialog-wrapper"+(B?" "+B:""),onKeyDown:K,tabIndex:0,dir:k,style:{zIndex:o,...T}},N&&s.createElement("div",{className:"k-overlay",style:M}),s.createElement("div",{className:l.classNames("k-window k-dialog"),role:"dialog","aria-labelledby":W,"aria-modal":N||void 0,"aria-describedby":U,style:{width:p,height:h,minWidth:y}},g&&s.createElement(m,{closeIcon:S,onCloseButtonClick:O,id:W},g),s.createElement("div",{className:"k-window-content k-dialog-content",style:I,id:U},R),z))),[o,A,B,K,T,k,M,W,U,p,h,y,S,O,I,g,R,z,N]);return l.canUseDOM?null!==L?d.createPortal(j,L||document.body):j:null}),C={autoFocus:!1,modal:!0,closeIcon:!0},k={autoFocus:o.bool,autoFocusedElement:o.string,title:o.any,className:o.string,closeIcon:o.bool,modal:o.bool,overlayStyle:o.object,width:o.oneOfType([o.number,o.string]),height:o.oneOfType([o.number,o.string]),minWidth:o.oneOfType([o.number,o.string]),onClose:o.func,children:o.node,id:o.string,dir:o.string,style:o.object,contentStyle:o.object,appendTo:o.any};y.displayName="KendoReactDialog",y.propTypes=k;var T=(e=>(e.DEFAULT="DEFAULT",e.FULLSCREEN="FULLSCREEN",e.MINIMIZED="MINIMIZED",e))(T||{});const I=e=>{const{children:t,onCloseButtonClick:n,onMinimizeButtonClick:o,onFullScreenButtonClick:l,onRestoreButtonClick:c,onDoubleClick:d,stage:m,forwardedRef:v,id:w}=e,E=r.useLocalization(),b=e.minimizeButton?s.createElement(e.minimizeButton,{onClick:o,stage:m}):s.createElement(i.Button,{fillMode:"flat",size:"xs",icon:"window-minimize",svgIcon:a.windowMinimizeIcon,className:"k-window-titlebar-action",onClick:o,"aria-label":E.toLanguageString(g,f[g])}),y=e.maximizeButton?s.createElement(e.maximizeButton,{onClick:l,stage:m}):s.createElement(i.Button,{fillMode:"flat",size:"xs",icon:"window-maximize",svgIcon:a.windowIcon,className:"k-window-titlebar-action",onClick:l,"aria-label":E.toLanguageString(u,f[u])}),C=e.restoreButton?s.createElement(e.restoreButton,{onClick:c,stage:m}):s.createElement(i.Button,{fillMode:"flat",size:"xs",icon:"window-restore",svgIcon:a.windowRestoreIcon,className:"k-window-titlebar-action",onClick:c,"aria-label":E.toLanguageString(p,f[p])}),k=e.closeButton?s.createElement(e.closeButton,{onClick:n,stage:m}):s.createElement(i.Button,{fillMode:"flat",size:"xs",icon:"x",svgIcon:a.xIcon,className:"k-window-titlebar-action",onClick:n,"aria-label":E.toLanguageString(h,f[h])});return s.createElement("div",{className:"k-window-titlebar",style:{touchAction:"none"},ref:v,onDoubleClick:d},s.createElement("span",{className:"k-window-title",id:w},t||""),s.createElement("div",{className:"k-window-titlebar-actions"},m===T.DEFAULT&&b,m===T.DEFAULT&&y,m!==T.DEFAULT&&C,k))},D=s.forwardRef((e,t)=>s.createElement(I,{...e,forwardedRef:t})),L=["n","e","s","w","se","sw","ne","nw"];class B extends s.Component{constructor(){super(...arguments),this.isDragging=!1}render(){return s.createElement("div",{className:"k-resize-handles-wrapper"}," ",L.map((e,t)=>s.createElement(l.Draggable,{key:t,onDrag:t=>{const{event:n}=t;this.isDragging=!0,n.originalEvent.preventDefault(),this.props.onResize(n,{end:!1,direction:e})},onRelease:t=>{const{event:n}=t;n.originalEvent.preventDefault(),this.isDragging&&(this.isDragging=!1,this.props.onResize(n,{end:!0,direction:e}))}},s.createElement("div",{className:"k-resize-handle k-resize-"+e,style:{display:"block",touchAction:"none",userSelect:"none"}}))))}}class M extends s.Component{shouldComponentUpdate(e){return e.shouldUpdateOnDrag||!e.isDragging}render(){return this.props.children}}const N=e=>{const t={layout:"end",...e},{layout:n,children:o}=t,i=l.classNames("k-actions","k-window-actions","k-actions-horizontal","k-hstack",{"k-justify-content-start":"start"===n,"k-justify-content-center":"center"===n,"k-justify-content-end":"end"===n,"k-justify-content-stretch":"stretched"===n});return s.createElement("div",{className:i},o)};N.propTypes={children:o.any,layout:o.oneOf(["start","center","end","stretched"])};const S=(e,t,n)=>{let o=e;if(t&&t.defaultView){const e=t.querySelectorAll(".k-window:not(.k-dialog), .k-dialog-wrapper");let i=!1;return e.forEach(e=>{const r=t.defaultView.getComputedStyle(e,null);if(e.getAttribute(w)!==n&&null!==r.zIndex){const e=parseInt(r.zIndex,10);e>=o&&(o=e,i=!0)}}),i?o+2:o}return o},{useState:x,useEffect:F,useCallback:R,useMemo:z,useRef:A,useImperativeHandle:U,useContext:W,forwardRef:H}=s,O=300,K=300,j={minWidth:120,minHeight:100,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0,autoFocus:!0},Z=H((e,t)=>{var n;const{minWidth:o=j.minWidth,minHeight:i=j.minHeight,resizable:r=j.resizable,draggable:a=j.draggable,modal:c=j.modal,doubleClickStageChange:u=j.doubleClickStageChange,autoFocus:g=j.autoFocus}=e,[p,h]=x(e.stage||T.DEFAULT),[f,m]=x(!1),[v,b]=x(0),[y,C]=x(0),[k,I]=x(O),[L,H]=x(K),[Z,P]=x(!0),[q,V]=x(E),X=null!=(n=e.stage)?n:p,Y=W(l.ZIndexContext),$=A(null),_=A(null),G=A({leftBeforeAction:0,topBeforeAction:0,widthBeforeAction:O,heightBeforeAction:K}),J=A({x:0,y:0}),Q=A(void 0),ee=A(l.canUseDOM?document.activeElement:null),te=A("window-title-"+(e.id?e.id+"-accessibility-id":"")),ne=A({left:0,top:0,width:O,height:K,internalLeft:y,internalTop:v,internalWidth:k,internalHeight:L,stage:X,draggable:a,props:e}),oe=R(()=>{const t=l.canUseDOM?document:null;return e.appendTo?e.appendTo.ownerDocument:t},[e.appendTo]),ie=R(()=>{const e=oe();return null==e?void 0:e.defaultView},[oe]),re=z(()=>{var t;return X!==T.FULLSCREEN?Math.max(null!=(t=e.top)?t:v,0):0},[X,e.top,v]),ae=z(()=>{var t;return X!==T.FULLSCREEN?Math.max(null!=(t=e.left)?t:y,0):0},[X,e.left,y]),le=z(()=>{var t;const n=null!=(t=e.width)?t:k;if(X===T.FULLSCREEN){if(e.appendTo)return e.appendTo.offsetWidth;const t=ie();return t?t.innerWidth:0}return n},[X,e.width,e.appendTo,k,ie]),ce=z(()=>{const t=void 0===e.height?L:e.height;if(X===T.FULLSCREEN){if(e.appendTo)return e.appendTo.offsetHeight;const t=ie();return t?t.innerHeight:0}return X===T.MINIMIZED?0:t},[X,e.height,e.appendTo,L,ie]),se=z(()=>e.id?e.id+"-accessibility-id":void 0,[e.id]);F(()=>{ne.current={left:ae,top:re,width:le,height:ce,internalLeft:y,internalTop:v,internalWidth:k,internalHeight:L,stage:X,draggable:a,props:e}});const de=z(()=>{if(void 0===Y)return null!=Y?Y:E;return q>(Y?Y+2:0)?q:Y+2},[q,Y]),ue=R(()=>{var t,n;if(void 0!==e.top)return e.top;if(void 0!==e.initialTop)return e.initialTop;let o=K;if(void 0!==e.height?o=e.height:void 0!==e.initialHeight&&(o=e.initialHeight),e.appendTo&&o)return e.appendTo.offsetHeight/2-o/2;const i=ie();return i?i.innerHeight/2-(null!=(n=null!=o?o:null==(t=$.current)?void 0:t.clientHeight)?n:0)/2:0},[e.top,e.initialTop,e.height,e.initialHeight,e.appendTo,ie]),ge=R(()=>{if(void 0!==e.left)return e.left;if(void 0!==e.initialLeft)return e.initialLeft;let t=O;if(void 0!==e.width?t=e.width:void 0!==e.initialWidth&&(t=e.initialWidth),e.appendTo)return e.appendTo.offsetWidth/2-t/2;const n=ie();return n?n.innerWidth/2-t/2:0},[e.left,e.initialLeft,e.width,e.initialWidth,e.appendTo,ie]),pe=R(()=>{let t=O;return void 0!==e.width?t=e.width:void 0!==e.initialWidth&&(t=e.initialWidth),t},[e.width,e.initialWidth]),he=R(()=>{let t=K;return void 0!==e.height?t=e.height:void 0!==e.initialHeight&&(t=e.initialHeight),t},[e.height,e.initialHeight]),fe=R(e=>e.filter(e=>(null==e?void 0:e.type)===N),[]),me=R(e=>e.filter(e=>e&&e.type!==N),[]),ve=R(()=>"object"==typeof t&&null!==t&&"current"in t?t.current:null,[t]),we=R((e,t,n,o,i,r)=>{var a,l,c;if(!e)return;const{internalLeft:s,internalTop:d,internalWidth:u,internalHeight:g}=ne.current;e({nativeEvent:t.nativeEvent?t.nativeEvent:t.originalEvent,drag:n,end:o,target:ve(),left:null!=(a=null==i?void 0:i.left)?a:s,top:null!=(l=null==i?void 0:i.top)?l:d,width:null!=(c=null==r?void 0:r.width)?c:u,height:void 0===(null==r?void 0:r.height)?g:null==r?void 0:r.height})},[ve]),Ee=R(t=>{var n,a;if(c&&l.keepFocusInContainer(t,$.current),t.target!==t.currentTarget)return;const s=o||120,d=i||100,u=t.metaKey||t.ctrlKey,g=null!=(a=null!=ce?ce:null==(n=$.current)?void 0:n.clientHeight)?a:0;if(u&&r){switch(t.keyCode){case l.Keys.up:t.preventDefault(),d<=g-5&&H(g-5);break;case l.Keys.down:t.preventDefault(),H(g+5);break;case l.Keys.left:s<=le-5&&I(le-5);break;case l.Keys.right:I(le+5);break;default:return}we(e.onResize,t,!1,void 0)}else if(t.altKey)switch(t.keyCode){case l.Keys.up:X===T.MINIMIZED?(Le(t),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.DEFAULT})):X===T.DEFAULT&&(De(t),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.FULLSCREEN}));break;case l.Keys.down:X===T.FULLSCREEN?(Le(t),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.DEFAULT})):X===T.DEFAULT&&(Ie(t),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.MINIMIZED}))}else if(!t.ctrlKey){const{internalLeft:n,internalTop:o}=ne.current;let i=n,r=o;switch(t.keyCode){case l.Keys.esc:return void(e.onClose&&Be(t));case l.Keys.up:r=o-5,b(r);break;case l.Keys.down:r=o+5,b(r);break;case l.Keys.left:i=n-5,C(i);break;case l.Keys.right:i=n+5,C(i);break;default:return}we(e.onMove,t,!1,void 0,{left:i,top:r})}},[c,o,i,r,e.onResize,e.onStageChange,e.onClose,e.onMove,ce,le,X,we,ve]),be=R(e=>{const t=e.event,{left:n,top:o}=ne.current;G.current.differenceLeft=t.pageX-n,G.current.differenceTop=t.pageY-o},[]),ye=R(e=>{const t=e.event;t.originalEvent.preventDefault();const{stage:n,draggable:o,props:i,width:r,height:a}=ne.current;if(n!==T.FULLSCREEN&&o){const e=Math.max(t.pageY-(G.current.differenceTop||0),0),n=t.pageX-(G.current.differenceLeft||0);b(e),C(n),m(!0),i.onMove&&we(i.onMove,t,!0,!1,{left:n,top:e},{width:r,height:a})}},[we]),Ce=R(e=>{const t=e.event,{stage:n,draggable:o,props:i,left:r,top:a,width:l,height:c}=ne.current;n!==T.FULLSCREEN&&o&&i.onMove&&we(i.onMove,t,!0,!0,{left:r,top:a},{width:l,height:c}),m(!1)},[we]),ke=R(()=>{Q.current?(clearTimeout(Q.current),Q.current=void 0):(P(!0),V(S(de,oe(),se)))},[de,oe,se]),Te=R(()=>{clearTimeout(Q.current);const e=ie();e&&(Q.current=e.setTimeout(()=>{P(!1),Q.current=void 0}))},[ie]),Ie=R(t=>{t.preventDefault(),G.current.leftBeforeAction=ae,G.current.topBeforeAction=re,G.current.widthBeforeAction=le,G.current.heightBeforeAction=ce,h(T.MINIMIZED),H(0),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.MINIMIZED})},[ae,re,le,ce,e.onStageChange,ve]),De=R(t=>{t.preventDefault(),G.current.leftBeforeAction=ae,G.current.topBeforeAction=re,G.current.widthBeforeAction=le,G.current.heightBeforeAction=ce;const n=ie(),o=n?n.innerWidth:0,i=n?n.innerHeight:0;C(0),b(0),I(e.appendTo?e.appendTo.offsetWidth:o),H(e.appendTo?e.appendTo.offsetHeight:i),h(T.FULLSCREEN),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.FULLSCREEN})},[ae,re,le,ce,e.appendTo,e.onStageChange,ie,ve]),Le=R(t=>{t.preventDefault(),X===T.FULLSCREEN?(h(T.DEFAULT),C(G.current.leftBeforeAction),b(G.current.topBeforeAction),I(G.current.widthBeforeAction),H(G.current.heightBeforeAction)):X===T.MINIMIZED&&(h(T.DEFAULT),H(G.current.heightBeforeAction)),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.DEFAULT})},[X,e.onStageChange,ve]),Be=R(t=>{t.preventDefault(),l.dispatchEvent(e.onClose,t,ve(),{state:void 0})},[e.onClose,ve]),Me=R(e=>{X===T.FULLSCREEN||X===T.MINIMIZED?Le(e):De(e)},[X,Le,De]),Ne=R((e,t)=>{var n,r,a,l,c,s;const{props:d,width:u,height:g,top:p,left:h}=ne.current,f=d.appendTo?e.pageX-J.current.x:e.pageX,v=d.appendTo?e.pageY-J.current.y:e.pageY,w=null!=(r=null!=g?g:null==(n=$.current)?void 0:n.clientHeight)?r:0,E=o||120,y=i||100,k=p-v,T=h-f,D=f-h,L=v-p;let B=!1;const M={isDragging:!t.end};t.direction.indexOf("n")>=0&&y-(w+k)<0&&(p>0&&(M.height=w+k),M.top=v,B=!0),t.direction.indexOf("s")>=0&&y-L<0&&(M.height=L,B=!0),t.direction.indexOf("w")>=0&&E-(u+T)<0&&(h>0&&(M.width=u+T),M.left=f,B=!0),t.direction.indexOf("e")>=0&&E-D<0&&(M.width=D,B=!0),B&&(void 0!==M.height&&H(M.height),void 0!==M.top&&b(M.top),void 0!==M.width&&I(M.width),void 0!==M.left&&C(M.left),void 0!==M.isDragging&&m(M.isDragging)),we(d.onResize,e,!0,t.end,{left:null!=(a=M.left)?a:h,top:null!=(l=M.top)?l:p},{width:null!=(c=M.width)?c:u,height:null!=(s=M.height)?s:g})},[we,i,o]),Se=R(()=>{if(X===T.FULLSCREEN){const t=ie(),n=t?t.innerWidth:0,o=t?t.innerHeight:0;I(e.appendTo?e.appendTo.offsetWidth:n),H(e.appendTo?e.appendTo.offsetHeight:o)}},[X,e.appendTo,ie]);F(()=>{const t=$.current;t&&g&&t.focus({preventScroll:!0});const n=ie();n&&n.addEventListener("resize",Se),h(e.stage||T.DEFAULT),m(!1),b(ue()),C(ge()),I(pe()),H(he()),P(!0),V(S(de,oe(),se)),G.current={leftBeforeAction:ge(),topBeforeAction:ue(),widthBeforeAction:pe(),heightBeforeAction:he()};const o=oe();if(e.appendTo&&o){const t=e.appendTo.getBoundingClientRect(),n=o.body.getBoundingClientRect();J.current.x=t.left-n.left,J.current.y=t.top-n.top}const i=ee.current;return()=>{var e;const t=ie();t&&t.removeEventListener("resize",Se),i&&l.canUseDOM&&(document.contains(i)?i.focus({preventScroll:!0}):i.id&&(null==(e=document.getElementById(i.id))||e.focus({preventScroll:!0})))}},[]),F(()=>{void 0!==e.left&&!f&&C(e.left)},[e.left,f]),F(()=>{void 0!==e.top&&!f&&b(e.top)},[e.top,f]),F(()=>{void 0!==e.initialLeft&&C(e.initialLeft)},[e.initialLeft]),F(()=>{void 0!==e.initialTop&&b(e.initialTop)},[e.initialTop]),F(()=>{const t=oe();if(e.appendTo&&t){const n=e.appendTo.getBoundingClientRect(),o=t.body.getBoundingClientRect();J.current.x=n.left-o.left,J.current.y=n.top-o.top}},[e.appendTo,oe]);const xe=A(null);U(t,()=>({get element(){return $.current},get windowElement(){return $.current},get draggable(){return _.current},props:e}),[e]),xe.current=$.current,l.useWebMcpRegister("window",t,e,e.webMcp);const Fe=s.Children.toArray(e.children),Re=me(Fe),ze=fe(Fe),Ae=l.classNames("k-window",e.className,{"k-window-minimized":"MINIMIZED"===X,"k-focus":Z}),Ue=s.createElement(l.ZIndexContext.Provider,{value:de},s.createElement(s.Fragment,null,c&&s.createElement("div",{className:"k-overlay",style:{zIndex:de,...e.overlayStyle}}),s.createElement("div",{id:e.id,[w]:se,tabIndex:0,role:"dialog","aria-labelledby":te.current,onFocus:ke,onBlur:Te,onKeyDown:Ee,ref:$,className:Ae,style:{top:re,left:ae,width:le,height:ce||"",zIndex:de,...e.style}},s.createElement(M,{shouldUpdateOnDrag:e.shouldUpdateOnDrag||!1,isDragging:f},s.createElement(l.Draggable,{onPress:be,onDrag:ye,onRelease:Ce,autoScroll:!1,ref:_},s.createElement(D,{stage:X,onDoubleClick:u?Me:void 0,onMinimizeButtonClick:Ie,onFullScreenButtonClick:De,onRestoreButtonClick:Le,onCloseButtonClick:Be,closeButton:e.closeButton,minimizeButton:e.minimizeButton,maximizeButton:e.maximizeButton,restoreButton:e.restoreButton,id:te.current},e.title)),X===T.MINIMIZED?null:s.createElement(s.Fragment,null,s.createElement("div",{className:"k-window-content"},Re),ze),X===T.DEFAULT&&r?s.createElement(B,{onResize:Ne}):null))));return l.canUseDOM?null===e.appendTo?Ue:d.createPortal(Ue,e.appendTo||document.body):null});Z.displayName="Window";const P=l.createPropsContext(),q=l.withIdHOC(l.withPropsContext(P,Z));q.displayName="KendoReactWindow";const V={autoFocus:o.bool,title:o.any,className:o.string,closeButton:o.func,minimizeButton:o.func,maximizeButton:o.func,restoreButton:o.func,modal:o.bool,overlayStyle:o.object,width:o.number,height:o.number,minWidth:o.number,minHeight:o.number,left:o.number,top:o.number,initialLeft:o.number,initialTop:o.number,initialWidth:o.number,initialHeight:o.number,resizable:o.bool,draggable:o.bool,doubleClickStageChange:o.bool,stage:o.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),onClose:o.func,onMove:o.func,onResize:o.func,onStageChange:o.func,children:o.node,id:o.string,dir:o.string,style:o.object,appendTo:o.any,shouldUpdateOnDrag:o.bool};q.propTypes=V,e.Dialog=y,e.DialogActionsBar=v,e.DialogPropsContext=b,e.Window=q,e.WindowActionsBar=N,e.WindowPropsContext=P,e.WindowWithoutContext=Z});
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom"),require("prop-types"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-intl"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-common")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","prop-types","@progress/kendo-react-buttons","@progress/kendo-react-intl","@progress/kendo-svg-icons","@progress/kendo-react-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactDialogs={},e.React,e.ReactDOM,e.PropTypes,e.KendoReactButtons,e.KendoReactIntl,e.KendoSvgIcons,e.KendoReactCommon)}(this,function(e,t,n,o,i,r,a,l){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var s=c(t),d=c(n);const u="dialogs.windowMaximizeButton",g="dialogs.windowMinimizeButton",p="dialogs.windowRestoreButton",h="dialogs.windowCloseButton",f={[u]:"maximize",[g]:"minimize",[p]:"restore",[h]:"close"},m=({children:e,onCloseButtonClick:t,id:n,closeIcon:o})=>{const l=r.useLocalization();return s.createElement("div",{className:"k-window-titlebar k-dialog-titlebar",id:n},s.createElement("span",{className:"k-window-title k-dialog-title"},e),o&&s.createElement("div",{className:"k-window-titlebar-actions k-dialog-titlebar-actions"},s.createElement(i.Button,{"aria-label":l.toLanguageString(h,f[h]),size:"xs",onClick:t,icon:"x",svgIcon:a.xIcon,fillMode:"flat",className:"k-window-titlebar-action k-dialog-titlebar-action"})))},v=e=>{const t={layout:"stretched",...e},{layout:n,children:o}=t,i=l.classNames("k-actions","k-actions-horizontal","k-window-actions k-dialog-actions",{[`k-actions-${n}`]:n});return s.createElement("div",{className:i},o)};v.propTypes={children:o.any,layout:o.oneOf(["start","center","end","stretched"])};const w="data-windowid",E=10002,b=l.createPropsContext(),y=s.forwardRef((e,t)=>{const n=l.useZIndexContext(),o=n?n+2:E,i=s.useRef(null),r=s.useRef(null),a=s.useRef(l.getActiveElement(document)),c=l.usePropsContext(b,e),u=s.useMemo(()=>({...C,...c}),[c]),{title:g,width:p,height:h,children:f,minWidth:y,dir:k,style:T,contentStyle:I,autoFocusedElement:D,appendTo:L,className:B,overlayStyle:M,modal:N=C.modal,closeIcon:S=C.closeIcon,autoFocus:x=C.autoFocus}=u,F=s.useCallback(()=>({props:u,element:r.current}),[u]);s.useImperativeHandle(i,F),s.useImperativeHandle(t,()=>i.current),l.useWebMcpRegister("dialog",i,c,c.webMcp);const R=s.useMemo(()=>s.Children.toArray(f).filter(e=>!s.isValidElement(e)||e.type!==v),[f]),z=s.useMemo(()=>s.Children.toArray(f).filter(e=>s.isValidElement(e)&&e.type===v),[f]),{_id:A,contentId:U,id:W}=s.useMemo(()=>{const e=u.id,t=`${null!=e?e:"accessibility"}-id`;return{_id:t,contentId:`dialog-content-${t}`,id:e||`dialog-title-${t}`}},[u.id]),H=s.useCallback(()=>{if(r.current)if(x&&!D)r.current.focus();else if(!x&&D&&r.current){const e=r.current.querySelector(D);null==e||e.focus()}else{const e=[...l.FOCUSABLE_ELEMENTS].map(e=>e+":not(.k-dialog-titlebar *)");l.focusFirstFocusableChild(r.current,e)}},[x,D]);s.useEffect(()=>(H(),()=>{setTimeout(()=>{var e;!r.current&&a.current&&l.canUseDOM&&(document.contains(a.current)?a.current.focus():a.current.id&&(null==(e=document.getElementById(a.current.id))||e.focus()))})}),[H]);const O=s.useCallback(e=>{e.preventDefault(),l.dispatchEvent(u.onClose,e,F(),void 0)},[u.onClose]),K=s.useCallback(e=>{e.keyCode===l.Keys.esc&&u.onClose&&(e.preventDefault(),O(e)),l.keepFocusInContainer(e,r.current)},[u.onClose,O]),j=s.useMemo(()=>s.createElement(l.ZIndexContext.Provider,{value:o},s.createElement("div",{ref:r,[w]:A,className:"k-dialog-wrapper"+(B?" "+B:""),onKeyDown:K,tabIndex:0,dir:k,style:{zIndex:o,...T}},N&&s.createElement("div",{className:"k-overlay",style:M}),s.createElement("div",{className:l.classNames("k-window k-dialog"),role:"dialog","aria-labelledby":W,"aria-modal":N||void 0,"aria-describedby":U,style:{width:p,height:h,minWidth:y}},g&&s.createElement(m,{closeIcon:S,onCloseButtonClick:O,id:W},g),s.createElement("div",{className:"k-window-content k-dialog-content",style:I,id:U},R),z))),[o,A,B,K,T,k,M,W,U,p,h,y,S,O,I,g,R,z,N]);return l.canUseDOM?null!==L?d.createPortal(j,L||document.body):j:null}),C={autoFocus:!1,modal:!0,closeIcon:!0},k={autoFocus:o.bool,autoFocusedElement:o.string,title:o.any,className:o.string,closeIcon:o.bool,modal:o.bool,overlayStyle:o.object,width:o.oneOfType([o.number,o.string]),height:o.oneOfType([o.number,o.string]),minWidth:o.oneOfType([o.number,o.string]),onClose:o.func,children:o.node,id:o.string,dir:o.string,style:o.object,contentStyle:o.object,appendTo:o.any};y.displayName="KendoReactDialog",y.propTypes=k;var T=(e=>(e.DEFAULT="DEFAULT",e.FULLSCREEN="FULLSCREEN",e.MINIMIZED="MINIMIZED",e))(T||{});const I=e=>{const{children:t,onCloseButtonClick:n,onMinimizeButtonClick:o,onFullScreenButtonClick:l,onRestoreButtonClick:c,onDoubleClick:d,stage:m,forwardedRef:v,id:w}=e,E=r.useLocalization(),b=e.minimizeButton?s.createElement(e.minimizeButton,{onClick:o,stage:m}):s.createElement(i.Button,{fillMode:"flat",size:"xs",icon:"window-minimize",svgIcon:a.windowMinimizeIcon,className:"k-window-titlebar-action",onClick:o,"aria-label":E.toLanguageString(g,f[g])}),y=e.maximizeButton?s.createElement(e.maximizeButton,{onClick:l,stage:m}):s.createElement(i.Button,{fillMode:"flat",size:"xs",icon:"window-maximize",svgIcon:a.windowIcon,className:"k-window-titlebar-action",onClick:l,"aria-label":E.toLanguageString(u,f[u])}),C=e.restoreButton?s.createElement(e.restoreButton,{onClick:c,stage:m}):s.createElement(i.Button,{fillMode:"flat",size:"xs",icon:"window-restore",svgIcon:a.windowRestoreIcon,className:"k-window-titlebar-action",onClick:c,"aria-label":E.toLanguageString(p,f[p])}),k=e.closeButton?s.createElement(e.closeButton,{onClick:n,stage:m}):s.createElement(i.Button,{fillMode:"flat",size:"xs",icon:"x",svgIcon:a.xIcon,className:"k-window-titlebar-action",onClick:n,"aria-label":E.toLanguageString(h,f[h])});return s.createElement("div",{className:"k-window-titlebar",style:{touchAction:"none"},ref:v,onDoubleClick:d},s.createElement("span",{className:"k-window-title",id:w},t||""),s.createElement("div",{className:"k-window-titlebar-actions"},m===T.DEFAULT&&b,m===T.DEFAULT&&y,m!==T.DEFAULT&&C,k))},D=s.forwardRef((e,t)=>s.createElement(I,{...e,forwardedRef:t})),L=["n","e","s","w","se","sw","ne","nw"];class B extends s.Component{constructor(){super(...arguments),this.isDragging=!1}render(){return s.createElement("div",{className:"k-resize-handles-wrapper"}," ",L.map((e,t)=>s.createElement(l.Draggable,{key:t,onDrag:t=>{const{event:n}=t;this.isDragging=!0,n.originalEvent.preventDefault(),this.props.onResize(n,{end:!1,direction:e})},onRelease:t=>{const{event:n}=t;n.originalEvent.preventDefault(),this.isDragging&&(this.isDragging=!1,this.props.onResize(n,{end:!0,direction:e}))}},s.createElement("div",{className:"k-resize-handle k-resize-"+e,style:{display:"block",touchAction:"none",userSelect:"none"}}))))}}class M extends s.Component{shouldComponentUpdate(e){return e.shouldUpdateOnDrag||!e.isDragging}render(){return this.props.children}}const N=e=>{const t={layout:"end",...e},{layout:n,children:o}=t,i=l.classNames("k-actions","k-window-actions","k-actions-horizontal","k-hstack",{"k-justify-content-start":"start"===n,"k-justify-content-center":"center"===n,"k-justify-content-end":"end"===n,"k-justify-content-stretch":"stretched"===n});return s.createElement("div",{className:i},o)};N.propTypes={children:o.any,layout:o.oneOf(["start","center","end","stretched"])};const S=(e,t,n)=>{let o=e;if(t&&t.defaultView){const e=t.querySelectorAll(".k-window:not(.k-dialog), .k-dialog-wrapper");let i=!1;return e.forEach(e=>{const r=t.defaultView.getComputedStyle(e,null);if(e.getAttribute(w)!==n&&null!==r.zIndex){const e=parseInt(r.zIndex,10);e>=o&&(o=e,i=!0)}}),i?o+2:o}return o},{useState:x,useEffect:F,useCallback:R,useMemo:z,useRef:A,useImperativeHandle:U,useContext:W,forwardRef:H}=s,O=300,K=300,j={minWidth:120,minHeight:100,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0,autoFocus:!0},Z=H((e,t)=>{var n;const{minWidth:o=j.minWidth,minHeight:i=j.minHeight,resizable:r=j.resizable,draggable:a=j.draggable,modal:c=j.modal,doubleClickStageChange:u=j.doubleClickStageChange,autoFocus:g=j.autoFocus}=e,[p,h]=x(e.stage||T.DEFAULT),[f,m]=x(!1),[v,b]=x(0),[y,C]=x(0),[k,I]=x(O),[L,H]=x(K),[Z,P]=x(!0),[q,V]=x(E),X=null!=(n=e.stage)?n:p,Y=W(l.ZIndexContext),$=A(null),_=A(null),G=A({leftBeforeAction:0,topBeforeAction:0,widthBeforeAction:O,heightBeforeAction:K}),J=A({x:0,y:0}),Q=A(void 0),ee=A(l.canUseDOM?document.activeElement:null),te=A("window-title-"+(e.id?e.id+"-accessibility-id":"")),ne=A({left:0,top:0,width:O,height:K,internalLeft:y,internalTop:v,internalWidth:k,internalHeight:L,stage:X,draggable:a,props:e}),oe=R(()=>{const t=l.canUseDOM?document:null;return e.appendTo?e.appendTo.ownerDocument:t},[e.appendTo]),ie=R(()=>{const e=oe();return null==e?void 0:e.defaultView},[oe]),re=z(()=>{var t;return X!==T.FULLSCREEN?Math.max(null!=(t=e.top)?t:v,0):0},[X,e.top,v]),ae=z(()=>{var t;return X!==T.FULLSCREEN?Math.max(null!=(t=e.left)?t:y,0):0},[X,e.left,y]),le=z(()=>{var t;const n=null!=(t=e.width)?t:k;if(X===T.FULLSCREEN){if(e.appendTo)return e.appendTo.offsetWidth;const t=ie();return t?t.innerWidth:0}return n},[X,e.width,e.appendTo,k,ie]),ce=z(()=>{const t=void 0===e.height?L:e.height;if(X===T.FULLSCREEN){if(e.appendTo)return e.appendTo.offsetHeight;const t=ie();return t?t.innerHeight:0}return X===T.MINIMIZED?0:t},[X,e.height,e.appendTo,L,ie]),se=z(()=>e.id?e.id+"-accessibility-id":void 0,[e.id]);F(()=>{ne.current={left:ae,top:re,width:le,height:ce,internalLeft:y,internalTop:v,internalWidth:k,internalHeight:L,stage:X,draggable:a,props:e}});const de=z(()=>{if(void 0===Y)return null!=Y?Y:E;return q>(Y?Y+2:0)?q:Y+2},[q,Y]),ue=R(()=>{var t,n;if(void 0!==e.top)return e.top;if(void 0!==e.initialTop)return e.initialTop;let o=K;if(void 0!==e.height?o=e.height:void 0!==e.initialHeight&&(o=e.initialHeight),e.appendTo&&o)return e.appendTo.offsetHeight/2-o/2;const i=ie();return i?i.innerHeight/2-(null!=(n=null!=o?o:null==(t=$.current)?void 0:t.clientHeight)?n:0)/2:0},[e.top,e.initialTop,e.height,e.initialHeight,e.appendTo,ie]),ge=R(()=>{if(void 0!==e.left)return e.left;if(void 0!==e.initialLeft)return e.initialLeft;let t=O;if(void 0!==e.width?t=e.width:void 0!==e.initialWidth&&(t=e.initialWidth),e.appendTo)return e.appendTo.offsetWidth/2-t/2;const n=ie();return n?n.innerWidth/2-t/2:0},[e.left,e.initialLeft,e.width,e.initialWidth,e.appendTo,ie]),pe=R(()=>{let t=O;return void 0!==e.width?t=e.width:void 0!==e.initialWidth&&(t=e.initialWidth),t},[e.width,e.initialWidth]),he=R(()=>{let t=K;return void 0!==e.height?t=e.height:void 0!==e.initialHeight&&(t=e.initialHeight),t},[e.height,e.initialHeight]),fe=R(e=>e.filter(e=>(null==e?void 0:e.type)===N),[]),me=R(e=>e.filter(e=>e&&e.type!==N),[]),ve=R(()=>"object"==typeof t&&null!==t&&"current"in t?t.current:null,[t]),we=R((e,t,n,o,i,r)=>{var a,l,c;if(!e)return;const{internalLeft:s,internalTop:d,internalWidth:u,internalHeight:g}=ne.current;e({nativeEvent:t.nativeEvent?t.nativeEvent:t.originalEvent,drag:n,end:o,target:ve(),left:null!=(a=null==i?void 0:i.left)?a:s,top:null!=(l=null==i?void 0:i.top)?l:d,width:null!=(c=null==r?void 0:r.width)?c:u,height:void 0===(null==r?void 0:r.height)?g:null==r?void 0:r.height})},[ve]),Ee=R(t=>{var n,a;if(c&&l.keepFocusInContainer(t,$.current),t.target!==t.currentTarget)return;const s=o||120,d=i||100,u=t.metaKey||t.ctrlKey,g=null!=(a=null!=ce?ce:null==(n=$.current)?void 0:n.clientHeight)?a:0;if(u&&r){switch(t.keyCode){case l.Keys.up:t.preventDefault(),d<=g-5&&H(g-5);break;case l.Keys.down:t.preventDefault(),H(g+5);break;case l.Keys.left:s<=le-5&&I(le-5);break;case l.Keys.right:I(le+5);break;default:return}we(e.onResize,t,!1,void 0)}else if(t.altKey)switch(t.keyCode){case l.Keys.up:X===T.MINIMIZED?(Le(t),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.DEFAULT})):X===T.DEFAULT&&(De(t),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.FULLSCREEN}));break;case l.Keys.down:X===T.FULLSCREEN?(Le(t),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.DEFAULT})):X===T.DEFAULT&&(Ie(t),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.MINIMIZED}))}else if(!t.ctrlKey){const{internalLeft:n,internalTop:o}=ne.current;let i=n,r=o;switch(t.keyCode){case l.Keys.esc:return void(e.onClose&&Be(t));case l.Keys.up:r=o-5,b(r);break;case l.Keys.down:r=o+5,b(r);break;case l.Keys.left:i=n-5,C(i);break;case l.Keys.right:i=n+5,C(i);break;default:return}we(e.onMove,t,!1,void 0,{left:i,top:r})}},[c,o,i,r,e.onResize,e.onStageChange,e.onClose,e.onMove,ce,le,X,we,ve]),be=R(e=>{const t=e.event,{left:n,top:o}=ne.current;G.current.differenceLeft=t.pageX-n,G.current.differenceTop=t.pageY-o},[]),ye=R(e=>{const t=e.event;t.originalEvent.preventDefault();const{stage:n,draggable:o,props:i,width:r,height:a}=ne.current;if(n!==T.FULLSCREEN&&o){const e=Math.max(t.pageY-(G.current.differenceTop||0),0),n=t.pageX-(G.current.differenceLeft||0);b(e),C(n),m(!0),i.onMove&&we(i.onMove,t,!0,!1,{left:n,top:e},{width:r,height:a})}},[we]),Ce=R(e=>{const t=e.event,{stage:n,draggable:o,props:i,left:r,top:a,width:l,height:c}=ne.current;n!==T.FULLSCREEN&&o&&i.onMove&&we(i.onMove,t,!0,!0,{left:r,top:a},{width:l,height:c}),m(!1)},[we]),ke=R(()=>{Q.current?(clearTimeout(Q.current),Q.current=void 0):(P(!0),V(S(de,oe(),se)))},[de,oe,se]),Te=R(()=>{clearTimeout(Q.current);const e=ie();e&&(Q.current=e.setTimeout(()=>{P(!1),Q.current=void 0}))},[ie]),Ie=R(t=>{t.preventDefault(),G.current.leftBeforeAction=ae,G.current.topBeforeAction=re,G.current.widthBeforeAction=le,G.current.heightBeforeAction=ce,h(T.MINIMIZED),H(0),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.MINIMIZED})},[ae,re,le,ce,e.onStageChange,ve]),De=R(t=>{t.preventDefault(),G.current.leftBeforeAction=ae,G.current.topBeforeAction=re,G.current.widthBeforeAction=le,G.current.heightBeforeAction=ce;const n=ie(),o=n?n.innerWidth:0,i=n?n.innerHeight:0;C(0),b(0),I(e.appendTo?e.appendTo.offsetWidth:o),H(e.appendTo?e.appendTo.offsetHeight:i),h(T.FULLSCREEN),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.FULLSCREEN})},[ae,re,le,ce,e.appendTo,e.onStageChange,ie,ve]),Le=R(t=>{t.preventDefault(),X===T.FULLSCREEN?(h(T.DEFAULT),C(G.current.leftBeforeAction),b(G.current.topBeforeAction),I(G.current.widthBeforeAction),H(G.current.heightBeforeAction)):X===T.MINIMIZED&&(h(T.DEFAULT),H(G.current.heightBeforeAction)),l.dispatchEvent(e.onStageChange,t,ve(),{state:T.DEFAULT})},[X,e.onStageChange,ve]),Be=R(t=>{t.preventDefault(),l.dispatchEvent(e.onClose,t,ve(),{state:void 0})},[e.onClose,ve]),Me=R(e=>{X===T.FULLSCREEN||X===T.MINIMIZED?Le(e):De(e)},[X,Le,De]),Ne=R((e,t)=>{var n,r,a,l,c,s;const{props:d,width:u,height:g,top:p,left:h}=ne.current,f=d.appendTo?e.pageX-J.current.x:e.pageX,v=d.appendTo?e.pageY-J.current.y:e.pageY,w=null!=(r=null!=g?g:null==(n=$.current)?void 0:n.clientHeight)?r:0,E=o||120,y=i||100,k=p-v,T=h-f,D=f-h,L=v-p;let B=!1;const M={isDragging:!t.end};t.direction.indexOf("n")>=0&&y-(w+k)<0&&(p>0&&(M.height=w+k),M.top=v,B=!0),t.direction.indexOf("s")>=0&&y-L<0&&(M.height=L,B=!0),t.direction.indexOf("w")>=0&&E-(u+T)<0&&(h>0&&(M.width=u+T),M.left=f,B=!0),t.direction.indexOf("e")>=0&&E-D<0&&(M.width=D,B=!0),B&&(void 0!==M.height&&H(M.height),void 0!==M.top&&b(M.top),void 0!==M.width&&I(M.width),void 0!==M.left&&C(M.left),void 0!==M.isDragging&&m(M.isDragging)),we(d.onResize,e,!0,t.end,{left:null!=(a=M.left)?a:h,top:null!=(l=M.top)?l:p},{width:null!=(c=M.width)?c:u,height:null!=(s=M.height)?s:g})},[we,i,o]),Se=R(()=>{if(X===T.FULLSCREEN){const t=ie(),n=t?t.innerWidth:0,o=t?t.innerHeight:0;I(e.appendTo?e.appendTo.offsetWidth:n),H(e.appendTo?e.appendTo.offsetHeight:o)}},[X,e.appendTo,ie]);F(()=>{const t=$.current;t&&g&&t.focus({preventScroll:!0});const n=ie();n&&n.addEventListener("resize",Se),h(e.stage||T.DEFAULT),m(!1),b(ue()),C(ge()),I(pe()),H(he()),P(!0),V(S(de,oe(),se)),G.current={leftBeforeAction:ge(),topBeforeAction:ue(),widthBeforeAction:pe(),heightBeforeAction:he()};const o=oe();if(e.appendTo&&o){const t=e.appendTo.getBoundingClientRect(),n=o.body.getBoundingClientRect();J.current.x=t.left-n.left,J.current.y=t.top-n.top}const i=ee.current;return()=>{var e;const t=ie();t&&t.removeEventListener("resize",Se),i&&l.canUseDOM&&(document.contains(i)?i.focus({preventScroll:!0}):i.id&&(null==(e=document.getElementById(i.id))||e.focus({preventScroll:!0})))}},[]),F(()=>{void 0!==e.left&&!f&&C(e.left)},[e.left,f]),F(()=>{void 0!==e.top&&!f&&b(e.top)},[e.top,f]),F(()=>{void 0!==e.initialLeft&&C(e.initialLeft)},[e.initialLeft]),F(()=>{void 0!==e.initialTop&&b(e.initialTop)},[e.initialTop]),F(()=>{const t=oe();if(e.appendTo&&t){const n=e.appendTo.getBoundingClientRect(),o=t.body.getBoundingClientRect();J.current.x=n.left-o.left,J.current.y=n.top-o.top}},[e.appendTo,oe]);const xe=A(null),Fe=A(null);U(t,()=>{const t={get element(){return $.current},get windowElement(){return $.current},get draggable(){return _.current},props:e};return Fe.current=t,t},[e]),xe.current=$.current,l.useWebMcpRegister("window",Fe,e,e.webMcp);const Re=s.Children.toArray(e.children),ze=me(Re),Ae=fe(Re),Ue=l.classNames("k-window",e.className,{"k-window-minimized":"MINIMIZED"===X,"k-focus":Z}),We=s.createElement(l.ZIndexContext.Provider,{value:de},s.createElement(s.Fragment,null,c&&s.createElement("div",{className:"k-overlay",style:{zIndex:de,...e.overlayStyle}}),s.createElement("div",{id:e.id,[w]:se,tabIndex:0,role:"dialog","aria-labelledby":te.current,onFocus:ke,onBlur:Te,onKeyDown:Ee,ref:$,className:Ue,style:{top:re,left:ae,width:le,height:ce||"",zIndex:de,...e.style}},s.createElement(M,{shouldUpdateOnDrag:e.shouldUpdateOnDrag||!1,isDragging:f},s.createElement(l.Draggable,{onPress:be,onDrag:ye,onRelease:Ce,autoScroll:!1,ref:_},s.createElement(D,{stage:X,onDoubleClick:u?Me:void 0,onMinimizeButtonClick:Ie,onFullScreenButtonClick:De,onRestoreButtonClick:Le,onCloseButtonClick:Be,closeButton:e.closeButton,minimizeButton:e.minimizeButton,maximizeButton:e.maximizeButton,restoreButton:e.restoreButton,id:te.current},e.title)),X===T.MINIMIZED?null:s.createElement(s.Fragment,null,s.createElement("div",{className:"k-window-content"},ze),Ae),X===T.DEFAULT&&r?s.createElement(B,{onResize:Ne}):null))));return l.canUseDOM?null===e.appendTo?We:d.createPortal(We,e.appendTo||document.body):null});Z.displayName="Window";const P=l.createPropsContext(),q=l.withIdHOC(l.withPropsContext(P,Z));q.displayName="KendoReactWindow";const V={autoFocus:o.bool,title:o.any,className:o.string,closeButton:o.func,minimizeButton:o.func,maximizeButton:o.func,restoreButton:o.func,modal:o.bool,overlayStyle:o.object,width:o.number,height:o.number,minWidth:o.number,minHeight:o.number,left:o.number,top:o.number,initialLeft:o.number,initialTop:o.number,initialWidth:o.number,initialHeight:o.number,resizable:o.bool,draggable:o.bool,doubleClickStageChange:o.bool,stage:o.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),onClose:o.func,onMove:o.func,onResize:o.func,onStageChange:o.func,children:o.node,id:o.string,dir:o.string,style:o.object,appendTo:o.any,shouldUpdateOnDrag:o.bool};q.propTypes=V,e.Dialog=y,e.DialogActionsBar=v,e.DialogPropsContext=b,e.Window=q,e.WindowActionsBar=N,e.WindowPropsContext=P,e.WindowWithoutContext=Z});
|
package/package-metadata.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
|
|
|
7
7
|
productName: 'KendoReact',
|
|
8
8
|
productCode: 'KENDOUIREACT',
|
|
9
9
|
productCodes: ['KENDOUIREACT'],
|
|
10
|
-
publishDate:
|
|
11
|
-
version: '15.0.1-develop.
|
|
10
|
+
publishDate: 1780056136,
|
|
11
|
+
version: '15.0.1-develop.4',
|
|
12
12
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
|
|
13
13
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dialogs",
|
|
3
|
-
"version": "15.0.1-develop.
|
|
3
|
+
"version": "15.0.1-develop.4",
|
|
4
4
|
"description": "React Dialogs provide modal and non-modal windows for showing additional information to the user. KendoReact Dialogs package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-licensing": "^1.7.2",
|
|
29
|
-
"@progress/kendo-react-buttons": "15.0.1-develop.
|
|
30
|
-
"@progress/kendo-react-common": "15.0.1-develop.
|
|
31
|
-
"@progress/kendo-react-intl": "15.0.1-develop.
|
|
29
|
+
"@progress/kendo-react-buttons": "15.0.1-develop.4",
|
|
30
|
+
"@progress/kendo-react-common": "15.0.1-develop.4",
|
|
31
|
+
"@progress/kendo-react-intl": "15.0.1-develop.4",
|
|
32
32
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
33
33
|
"react": "^18.0.0 || ^19.0.0",
|
|
34
34
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"package": {
|
|
73
73
|
"productName": "KendoReact",
|
|
74
74
|
"productCode": "KENDOUIREACT",
|
|
75
|
-
"publishDate":
|
|
75
|
+
"publishDate": 1780056136,
|
|
76
76
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
77
77
|
}
|
|
78
78
|
},
|