@progress/kendo-react-dialogs 7.2.4-develop.3 → 7.2.4-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/Dialog.js +8 -0
- package/Dialog.mjs +122 -0
- package/DialogActionsBar.js +8 -0
- package/DialogActionsBar.mjs +32 -0
- package/DialogTitleBar.js +8 -0
- package/DialogTitleBar.mjs +26 -0
- package/MiddleLayerOptimization.js +8 -0
- package/MiddleLayerOptimization.mjs +20 -0
- package/StageEnum.js +8 -0
- package/StageEnum.mjs +12 -0
- package/Window.js +8 -0
- package/Window.mjs +407 -0
- package/WindowActionsBar.js +8 -0
- package/WindowActionsBar.mjs +36 -0
- package/WindowResizeHandlers.js +8 -0
- package/WindowResizeHandlers.mjs +39 -0
- package/WindowTitlebar.js +8 -0
- package/WindowTitlebar.mjs +87 -0
- package/constants.js +8 -0
- package/constants.mjs +15 -0
- package/dist/cdn/js/kendo-react-dialogs.js +8 -5
- package/index.d.mts +599 -5
- package/index.d.ts +599 -13
- package/index.js +8 -5
- package/index.mjs +17 -687
- package/messages/index.js +8 -0
- package/messages/index.mjs +21 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +3 -3
- package/utils.js +8 -0
- package/utils.mjs +26 -0
- package/Dialog.d.ts +0 -94
- package/DialogActionsBar.d.ts +0 -25
- package/DialogProps.d.ts +0 -77
- package/DialogTitleBar.d.ts +0 -30
- package/MiddleLayerOptimization.d.ts +0 -21
- package/StageEnum.d.ts +0 -9
- package/Window.d.ts +0 -179
- package/WindowActionsBar.d.ts +0 -25
- package/WindowProps.d.ts +0 -151
- package/WindowResizeHandlers.d.ts +0 -20
- package/WindowTitlebar.d.ts +0 -67
- package/constants.d.ts +0 -12
- package/events.d.ts +0 -49
- package/messages/index.d.ts +0 -29
- package/models/actions-layout.d.ts +0 -8
- package/package-metadata.d.ts +0 -9
- package/utils.d.ts +0 -6
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(function(d,S){typeof exports=="object"&&typeof module!="undefined"?S(exports,require("react"),require("react-dom"),require("prop-types"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","prop-types","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-common","@progress/kendo-react-intl"],S):(d=typeof globalThis!="undefined"?globalThis:d||self,S(d.KendoReactDialogs={},d.React,d.ReactDOM,d.PropTypes,d.KendoReactButtons,d.KendoSvgIcons,d.KendoReactCommon,d.KendoReactIntl))})(this,function(d,S,$,o,C,b,n,J){"use strict";"use client";function Z(h){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:()=>h[t]})}}return i.default=h,Object.freeze(i)}const s=Z(S),R=Z($),Q=({children:h,onCloseButtonClick:i,id:t,closeIcon:e})=>s.createElement("div",{className:"k-window-titlebar k-dialog-titlebar",id:t},s.createElement("span",{className:"k-window-title k-dialog-title"},h),s.createElement("div",{className:"k-window-titlebar-actions k-dialog-titlebar-actions"},e&&s.createElement(C.Button,{role:"button","aria-label":"Close",onClick:i,icon:"x",svgIcon:b.xIcon,fillMode:"flat",className:"k-window-titlebar-action k-dialog-titlebar-action"}))),v=h=>{const i={layout:"stretched",...h},{layout:t,children:e}=i,a=n.classNames("k-actions","k-actions-horizontal","k-window-actions k-dialog-actions",{[`k-actions-${t}`]:t});return s.createElement("div",{className:a},e)};v.propTypes={children:o.any,layout:o.oneOf(["start","center","end","stretched"])};const B={name:"@progress/kendo-react-dialogs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},M="data-windowid",z=10002,x=2,P=".k-window:not(.k-dialog), .k-dialog-wrapper",T=(h,i,t)=>{let e=h;if(i&&i.defaultView){let a=i.querySelectorAll(P),c=!1;return a.forEach(p=>{let l=i.defaultView.getComputedStyle(p,null);if(p.getAttribute(M)!==t&&l.zIndex!==null){let f=parseInt(l.zIndex,10);f>=e&&(e=f,c=!0)}}),c?e+x:e}return e};class W extends s.Component{constructor(i){super(i),this.context=0,this.titleId=this.generateTitleId(),this.contentId=this.generateContentId(),this.showLicenseWatermark=!1,this.onCloseDialog=t=>{t.preventDefault(),n.dispatchEvent(this.props.onClose,t,this,void 0)},this.onKeyDown=t=>{t.keyCode===n.Keys.esc&&this.props.onClose&&(t.preventDefault(),this.onCloseDialog(t)),n.keepFocusInContainer(t,this.element)},this.getCurrentZIndex=()=>!this.state||this.context===void 0?this.context?this.context:z:this.state.zIndex>(this.context?this.context+x:0)?this.state.zIndex:this.context+x,this.getDocument=()=>this.props.appendTo?this.props.appendTo.ownerDocument:document,n.validatePackage(B),this.showLicenseWatermark=n.shouldShowValidationUI(B)}get _id(){return this.props.id+"-accessibility-id"}componentDidMount(){this.element&&(this.props.autoFocus&&this.element.focus(),this.setState({zIndex:T(this.getCurrentZIndex(),this.getDocument(),this._id)}))}render(){const i=this.props.id!==void 0?this.props.id:this.titleId,{title:t,width:e,height:a,children:c,minWidth:p,dir:l,style:m,contentStyle:f}=this.props,w=s.Children.toArray(c),E=this.getContent(w),I=this.getActionBar(w),D=t?{"aria-labelledby":i}:null,g=this.props.closeIcon!==void 0?this.props.closeIcon:!0,X=this.getCurrentZIndex(),Y=s.createElement(n.ZIndexContext.Provider,{value:X},s.createElement("div",{[M]:this._id,className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.onKeyDown,tabIndex:0,dir:l,style:{zIndex:X,...m},ref:ot=>this.element=ot},s.createElement("div",{className:"k-overlay"}),s.createElement("div",{...D,className:n.classNames("k-window k-dialog",{[`k-window-${this.props.themeColor}`]:this.props.themeColor}),role:"dialog","aria-labelledby":i,"aria-modal":!0,"aria-describedby":this.contentId,style:{width:e,height:a,minWidth:p}},this.props.title&&s.createElement(Q,{closeIcon:g,onCloseButtonClick:this.onCloseDialog,id:i},t),s.createElement("div",{className:"k-window-content k-dialog-content",style:f,id:this.contentId},E),I,this.showLicenseWatermark&&s.createElement(n.WatermarkOverlay,null))));return n.canUseDOM?this.props.appendTo!==null?R.createPortal(Y,this.props.appendTo||document.body):Y:null}getActionBar(i){return i.filter(t=>t&&t.type===v)}getContent(i){return i.filter(t=>t&&t.type!==v)}generateTitleId(){return"dialog-title-"+this._id}generateContentId(){return"dialog-content-"+this._id}}W.displayName="Dialog",W.propTypes={title:o.any,id:o.string,dir:o.string,style:o.object,closeIcon:o.bool,width:o.oneOfType([o.number,o.string]),height:o.oneOfType([o.number,o.string]),minWidth:o.oneOfType([o.number,o.string]),autoFocus:o.bool},W.defaultProps={autoFocus:!1},W.contextType=n.ZIndexContext;const j=n.createPropsContext(),q=n.withIdHOC(n.withPropsContext(j,W));q.displayName="KendoReactDialog";var r=(h=>(h.DEFAULT="DEFAULT",h.FULLSCREEN="FULLSCREEN",h.MINIMIZED="MINIMIZED",h))(r||{});const A="dialogs.windowMaximizeButton",k="dialogs.windowMinimizeButton",F="dialogs.windowRestoreButton",U="dialogs.windowCloseButton",y={[A]:"maximize",[k]:"minimize",[F]:"restore",[U]:"close"},tt=h=>{const{children:i,onCloseButtonClick:t,onMinimizeButtonClick:e,onFullScreenButtonClick:a,onRestoreButtonClick:c,onDoubleClick:p,stage:l,forwardedRef:m,id:f}=h,w=J.useLocalization(),E=h.minimizeButton?s.createElement(h.minimizeButton,{onClick:e,stage:l}):s.createElement(C.Button,{fillMode:"flat",icon:"window-minimize",svgIcon:b.windowMinimizeIcon,className:"k-window-titlebar-action",onClick:e,"aria-label":w.toLanguageString(k,y[k])}),I=h.maximizeButton?s.createElement(h.maximizeButton,{onClick:a,stage:l}):s.createElement(C.Button,{fillMode:"flat",icon:"window-maximize",svgIcon:b.windowIcon,className:"k-window-titlebar-action",onClick:a,"aria-label":w.toLanguageString(A,y[A])}),D=h.restoreButton?s.createElement(h.restoreButton,{onClick:c,stage:l}):s.createElement(C.Button,{fillMode:"flat",icon:"window-restore",svgIcon:b.windowRestoreIcon,className:"k-window-titlebar-action",onClick:c,"aria-label":w.toLanguageString(F,y[F])}),g=h.closeButton?s.createElement(h.closeButton,{onClick:t,stage:l}):s.createElement(C.Button,{fillMode:"flat",icon:"x",svgIcon:b.xIcon,className:"k-window-titlebar-action",onClick:t,"aria-label":w.toLanguageString(U,y[U])});return s.createElement("div",{className:"k-window-titlebar",style:{touchAction:"none"},ref:m,onDoubleClick:p},s.createElement("span",{className:"k-window-title",id:f},i||""),s.createElement("div",{className:"k-window-titlebar-actions"},l===r.DEFAULT&&E,l===r.DEFAULT&&I,l!==r.DEFAULT&&D,g))},et=s.forwardRef((h,i)=>s.createElement(tt,{...h,forwardedRef:i})),it=["n","e","s","w","se","sw","ne","nw"];class st extends s.Component{render(){return s.createElement("div",{className:"k-resize-handles-wrapper"}," ",it.map((i,t)=>s.createElement(n.Draggable,{key:t,onDrag:e=>{const{event:a}=e;a.originalEvent.preventDefault(),this.props.onResize(a,{end:!1,direction:i})},onRelease:e=>{const{event:a}=e;a.originalEvent.preventDefault(),this.props.onResize(a,{end:!0,direction:i})}},s.createElement("div",{className:"k-resize-handle k-resize-"+i,style:{display:"block",touchAction:"none"}}))))}}class nt extends s.Component{shouldComponentUpdate(i){return i.shouldUpdateOnDrag||!i.isDragging}render(){return this.props.children}}const N=h=>{const i={layout:"end",...h},{layout:t,children:e}=i,a=n.classNames("k-actions","k-window-actions","k-actions-horizontal","k-hstack",{"k-justify-content-start":t==="start","k-justify-content-center":t==="center","k-justify-content-end":t==="end","k-justify-content-stretch":t==="stretched"});return s.createElement("div",{className:a},e)};N.propTypes={children:o.any,layout:o.oneOf(["start","center","end","stretched"])};const O=300,H=300,_=120,K=100,u=5;class L extends s.Component{constructor(i){super(i),this.context=0,this.draggable=null,this.offSetCoordinates={x:0,y:0},this.titleId=this.generateTitleId(),this.mounted=!1,this.showLicenseWatermark=!1,this.onKeyDown=t=>{if(t.target!==t.currentTarget)return;const e=this.props.minWidth||_,a=this.props.minHeight||K;if(t.ctrlKey&&this.props.resizable){switch(t.keyCode){case n.Keys.up:t.preventDefault(),a<=this.height-u&&this.setState({height:this.height-u});break;case n.Keys.down:t.preventDefault(),this.setState({height:this.height+u});break;case n.Keys.left:e<=this.width-u&&this.setState({width:this.width-u});break;case n.Keys.right:this.setState({width:this.width+u});break;default:return}this.dispatchMoveEvent(this.props.onResize,t,!1,void 0);return}if(t.altKey){switch(t.keyCode){case n.Keys.up:this.windowStage===r.MINIMIZED?(this.handleRestore(t),n.dispatchEvent(this.props.onStageChange,t,this,{state:r.DEFAULT})):this.windowStage===r.DEFAULT&&(this.handleFullscreen(t),n.dispatchEvent(this.props.onStageChange,t,this,{state:r.FULLSCREEN}));break;case n.Keys.down:this.windowStage===r.FULLSCREEN?(this.handleRestore(t),n.dispatchEvent(this.props.onStageChange,t,this,{state:r.DEFAULT})):this.windowStage===r.DEFAULT&&(this.handleMinimize(t),n.dispatchEvent(this.props.onStageChange,t,this,{state:r.MINIMIZED}));break}return}if(!t.ctrlKey)switch(t.keyCode){case n.Keys.esc:this.props.onClose&&this.handleCloseWindow(t);return;case n.Keys.up:this.setState({top:this.state.top-u});break;case n.Keys.down:this.setState({top:this.state.top+u});break;case n.Keys.left:this.setState({left:this.state.left-u});break;case n.Keys.right:this.setState({left:this.state.left+u});break;default:return}this.dispatchMoveEvent(this.props.onMove,t,!1,void 0)},this.onPress=t=>{const e=t.event;this.windowCoordinatesState.differenceLeft=e.pageX-this.left,this.windowCoordinatesState.differenceTop=e.pageY-this.top},this.onDrag=t=>{const e=t.event;e.originalEvent.preventDefault(),this.windowStage!==r.FULLSCREEN&&this.props.draggable&&(this.setState({top:Math.max(e.pageY-this.windowCoordinatesState.differenceTop,0),left:e.pageX-this.windowCoordinatesState.differenceLeft,isDragging:!0}),this.props.onMove&&this.dispatchMoveEvent(this.props.onMove,e,!0,!1))},this.onRelease=t=>{const e=t.event;this.windowStage!==r.FULLSCREEN&&this.props.draggable&&this.props.onMove&&this.dispatchMoveEvent(this.props.onMove,e,!0,!0),this.setState({isDragging:!1})},this.onFocus=()=>{this._blurTimeout?(clearTimeout(this._blurTimeout),this._blurTimeout=void 0):this.setState({focused:!0,zIndex:T(this.getCurrentZIndex(),this.getDocument(),this._id)})},this.onBlur=()=>{clearTimeout(this._blurTimeout);const t=this.getWindow();t&&(this._blurTimeout=t.setTimeout(()=>{this.mounted&&this.setState({focused:!1}),this._blurTimeout=void 0}))},this.getInitialTop=()=>{if(this.props.top!==void 0)return this.props.top;if(this.props.initialTop!==void 0)return this.props.initialTop;let t=H;if(this.props.height!==void 0?t=this.props.height:this.props.initialHeight!==void 0&&(t=this.props.initialHeight),this.props.appendTo)return this.props.appendTo.offsetHeight/2-t/2;const e=this.getWindow();return e?e.innerHeight/2-t/2:0},this.getInitialLeft=()=>{if(this.props.left!==void 0)return this.props.left;if(this.props.initialLeft!==void 0)return this.props.initialLeft;let t=O;if(this.props.width!==void 0?t=this.props.width:this.props.initialWidth!==void 0&&(t=this.props.initialWidth),this.props.appendTo)return this.props.appendTo.offsetWidth/2-t/2;const e=this.getWindow();return e?e.innerWidth/2-t/2:0},this.getInitialWidth=()=>{let t=O;return this.props.width!==void 0?t=this.props.width:this.props.initialWidth!==void 0&&(t=this.props.initialWidth),t},this.getInitialHeight=()=>{let t=H;return this.props.height!==void 0?t=this.props.height:this.props.initialHeight!==void 0&&(t=this.props.initialHeight),t},this.handleMinimize=t=>{t.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.left,this.windowCoordinatesState.topBeforeAction=this.top,this.windowCoordinatesState.widthBeforeAction=this.width,this.windowCoordinatesState.heightBeforeAction=this.height,this.setState({stage:r.MINIMIZED,height:0}),n.dispatchEvent(this.props.onStageChange,t,this,{state:r.MINIMIZED})},this.handleFullscreen=t=>{t.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.left,this.windowCoordinatesState.topBeforeAction=this.top,this.windowCoordinatesState.widthBeforeAction=this.width,this.windowCoordinatesState.heightBeforeAction=this.height;const e=this.getWindow(),a=e?e.innerWidth:0,c=e?e.innerHeight:0;this.setState({left:0,top:0,width:this.props.appendTo?this.props.appendTo.offsetWidth:a,height:this.props.appendTo?this.props.appendTo.offsetHeight:c,stage:r.FULLSCREEN}),n.dispatchEvent(this.props.onStageChange,t,this,{state:r.FULLSCREEN})},this.handleRestore=t=>{t.preventDefault(),this.windowStage===r.FULLSCREEN?this.setState({stage:r.DEFAULT,left:this.windowCoordinatesState.leftBeforeAction,top:this.windowCoordinatesState.topBeforeAction,width:this.windowCoordinatesState.widthBeforeAction,height:this.windowCoordinatesState.heightBeforeAction}):this.windowStage===r.MINIMIZED&&this.setState({stage:r.DEFAULT,height:this.windowCoordinatesState.heightBeforeAction}),n.dispatchEvent(this.props.onStageChange,t,this,{state:r.DEFAULT})},this.handleCloseWindow=t=>{t.preventDefault(),n.dispatchEvent(this.props.onClose,t,this,{state:void 0})},this.handleDoubleClick=t=>{this.windowStage===r.FULLSCREEN||this.windowStage===r.MINIMIZED?this.handleRestore(t):this.handleFullscreen(t)},this.handleResize=(t,e)=>{const a=this.props.appendTo?t.pageX-this.offSetCoordinates.x:t.pageX,c=this.props.appendTo?t.pageY-this.offSetCoordinates.y:t.pageY,p=this.width,l=this.height,m=this.props.minWidth||_,f=this.props.minHeight||K,w=this.top-c,E=this.left-a;let I=a-this.left,D=c-this.top;const g=Object.assign({},this.state,{isDragging:!e.end});e.direction.indexOf("n")>=0&&f-(l+w)<0&&(this.top>0&&(g.height=l+w),g.top=c),e.direction.indexOf("s")>=0&&f-D<0&&(g.height=D),e.direction.indexOf("w")>=0&&m-(p+E)<0&&(this.left>0&&(g.width=p+E),g.left=a),e.direction.indexOf("e")>=0&&m-I<0&&(g.width=I),this.setState(g),this.dispatchMoveEvent(this.props.onResize,t,!0,e.end)},this.dispatchMoveEvent=(t,e,a,c)=>{t&&t.call(void 0,{nativeEvent:e.nativeEvent?e.nativeEvent:e.originalEvent,drag:a,end:c,target:this,left:this.state.left,top:this.state.top,width:this.state.width,hight:this.state.height,height:this.state.height})},this.handleBrowserWindowResize=()=>{if(this.windowStage===r.FULLSCREEN){const t=this.getWindow(),e=t?t.innerWidth:0,a=t?t.innerHeight:0;this.setState({width:this.props.appendTo?this.props.appendTo.offsetWidth:e,height:this.props.appendTo?this.props.appendTo.offsetHeight:a})}},this.getCurrentZIndex=()=>!this.state||this.context===void 0?this.context?this.context:z:this.state.zIndex>(this.context?this.context+x:0)?this.state.zIndex:this.context+x,this.getDocument=()=>this.props.appendTo?this.props.appendTo.ownerDocument:document,this.getWindow=()=>{const t=this.getDocument();return t&&t.defaultView},n.validatePackage(B),this.showLicenseWatermark=n.shouldShowValidationUI(B),this.state={stage:this.props.stage||r.DEFAULT,isDragging:!1,top:0,left:0,width:O,height:H,focused:!0,zIndex:z}}get _id(){return this.props.id+"-accessibility-id"}componentDidMount(){const i=this.getWindow();i&&i.addEventListener("resize",this.handleBrowserWindowResize),this.setState({stage:this.props.stage||r.DEFAULT,isDragging:!1,top:this.getInitialTop(),left:this.getInitialLeft(),width:this.getInitialWidth(),height:this.getInitialHeight(),focused:!0,zIndex:T(this.getCurrentZIndex(),this.getDocument(),this._id)}),this.windowCoordinatesState={leftBeforeAction:this.getInitialLeft(),topBeforeAction:this.getInitialTop(),widthBeforeAction:this.getInitialWidth(),heightBeforeAction:this.getInitialHeight()};const t=this.getDocument();if(this.props.appendTo&&t){let e=this.props.appendTo.getBoundingClientRect(),a=t.body.getBoundingClientRect();this.offSetCoordinates.x=e.left-a.left,this.offSetCoordinates.y=e.top-a.top}this.mounted=!0}componentWillUnmount(){const i=this.getWindow();i&&i.removeEventListener("resize",this.handleBrowserWindowResize),this.mounted=!1}componentDidUpdate(){const i=this.getDocument();if(this.props.appendTo&&i){let t=this.props.appendTo.getBoundingClientRect(),e=i.body.getBoundingClientRect();this.offSetCoordinates.x=t.left-e.left,this.offSetCoordinates.y=t.top-e.top}this.mounted=!0}render(){const i=s.Children.toArray(this.props.children),t=this.getContent(i),e=this.getActionBar(i),a=this.getCurrentZIndex(),c=n.classNames("k-window",this.props.className,{[`k-window-${this.props.themeColor}`]:this.props.themeColor,"k-window-minimized":this.state.stage==="MINIMIZED","k-window-focused":this.state.focused}),p=s.createElement(n.ZIndexContext.Provider,{value:a},s.createElement(s.Fragment,null,this.props.modal&&s.createElement("div",{className:"k-overlay",style:{zIndex:a,...this.props.overlayStyle}}),s.createElement("div",{id:this.props.id,[M]:this._id,tabIndex:0,role:"dialog","aria-labelledby":this.titleId,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,ref:l=>{this.windowElement=l,this.element=l},className:c,style:{top:this.top,left:this.left,width:this.width,height:this.height||"",zIndex:a,...this.props.style}},s.createElement(nt,{shouldUpdateOnDrag:this.props.shouldUpdateOnDrag||!1,isDragging:this.state.isDragging},s.createElement(n.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:l=>this.draggable=l},s.createElement(et,{stage:this.windowStage,onDoubleClick:this.props.doubleClickStageChange?this.handleDoubleClick:void 0,onMinimizeButtonClick:this.handleMinimize,onFullScreenButtonClick:this.handleFullscreen,onRestoreButtonClick:this.handleRestore,onCloseButtonClick:this.handleCloseWindow,closeButton:this.props.closeButton,minimizeButton:this.props.minimizeButton,maximizeButton:this.props.maximizeButton,restoreButton:this.props.restoreButton,id:this.titleId},this.props.title)),this.windowStage!==r.MINIMIZED?s.createElement(s.Fragment,null,s.createElement("div",{className:"k-window-content"},t),e):null,this.windowStage===r.DEFAULT&&this.props.resizable?s.createElement(st,{onResize:this.handleResize}):null),this.showLicenseWatermark&&s.createElement(n.WatermarkOverlay,null))));return n.canUseDOM?this.props.appendTo!==null?R.createPortal(p,this.props.appendTo||document.body):p:null}get top(){return this.windowStage!==r.FULLSCREEN?Math.max(this.props.top||this.state.top,0):0}get left(){return this.windowStage!==r.FULLSCREEN?Math.max(this.props.left||this.state.left,0):0}get width(){let i=this.props.width||this.state.width;if(this.windowStage===r.FULLSCREEN){if(this.props.appendTo)return i=this.props.appendTo.offsetWidth,i;const t=this.getWindow();i=t?t.innerWidth:0}return i}get height(){let i=this.props.height||this.state.height;if(this.windowStage===r.FULLSCREEN){if(this.props.appendTo)return i=this.props.appendTo.offsetHeight,i;const t=this.getWindow();i=t?t.innerHeight:0}else this.windowStage===r.MINIMIZED&&(i=0);return i}get windowStage(){return this.props.stage||this.state.stage}getActionBar(i){return i.filter(t=>t&&t.type===N)}getContent(i){return i.filter(t=>t&&t.type!==N)}generateTitleId(){return"window-title-"+this._id}}L.displayName="Window",L.propTypes={width:o.number,height:o.number,left:o.number,top:o.number,initialWidth:o.number,initialHeight:o.number,initialLeft:o.number,initialTop:o.number,minWidth:o.number,minHeight:o.number,resizable:o.bool,draggable:o.bool,title:o.any,shouldUpdateOnDrag:o.bool,stage:o.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),className:o.string,id:o.string,style:o.object,overlayStyle:o.object},L.defaultProps={minWidth:_,minHeight:K,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0},L.contextType=n.ZIndexContext;const G=n.createPropsContext(),V=n.withIdHOC(n.withPropsContext(G,L));V.displayName="KendoReactWindow",d.Dialog=q,d.DialogActionsBar=v,d.DialogPropsContext=j,d.Window=V,d.WindowActionsBar=N,d.WindowPropsContext=G,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
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-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","prop-types","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-common","@progress/kendo-react-intl"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).KendoReactDialogs={},t.React,t.ReactDOM,t.PropTypes,t.KendoReactButtons,t.KendoSvgIcons,t.KendoReactCommon,t.KendoReactIntl)}(this,(function(t,e,i,s,o,n,a,r){"use strict";function h(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var d=h(e),l=h(i);const p=({children:t,onCloseButtonClick:e,id:i,closeIcon:s})=>d.createElement("div",{className:"k-window-titlebar k-dialog-titlebar",id:i},d.createElement("span",{className:"k-window-title k-dialog-title"},t),d.createElement("div",{className:"k-window-titlebar-actions k-dialog-titlebar-actions"},s&&d.createElement(o.Button,{role:"button","aria-label":"Close",onClick:e,icon:"x",svgIcon:n.xIcon,fillMode:"flat",className:"k-window-titlebar-action k-dialog-titlebar-action"}))),c=t=>{const e={layout:"stretched",...t},{layout:i,children:s}=e,o=a.classNames("k-actions","k-actions-horizontal","k-window-actions k-dialog-actions",{[`k-actions-${i}`]:i});return d.createElement("div",{className:o},s)};c.propTypes={children:s.any,layout:s.oneOf(["start","center","end","stretched"])};const g={name:"@progress/kendo-react-dialogs",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},u="data-windowid",w=10002,m=(t,e,i)=>{let s=t;if(e&&e.defaultView){let t=e.querySelectorAll(".k-window:not(.k-dialog), .k-dialog-wrapper"),o=!1;return t.forEach((t=>{let n=e.defaultView.getComputedStyle(t,null);if(t.getAttribute(u)!==i&&null!==n.zIndex){let t=parseInt(n.zIndex,10);t>=s&&(s=t,o=!0)}})),o?s+2:s}return s},f=class extends d.Component{constructor(t){super(t),this.context=0,this.titleId=this.generateTitleId(),this.contentId=this.generateContentId(),this.showLicenseWatermark=!1,this.onCloseDialog=t=>{t.preventDefault(),a.dispatchEvent(this.props.onClose,t,this,void 0)},this.onKeyDown=t=>{t.keyCode===a.Keys.esc&&this.props.onClose&&(t.preventDefault(),this.onCloseDialog(t)),a.keepFocusInContainer(t,this.element)},this.getCurrentZIndex=()=>this.state&&void 0!==this.context?this.state.zIndex>(this.context?this.context+2:0)?this.state.zIndex:this.context+2:this.context?this.context:w,this.getDocument=()=>this.props.appendTo?this.props.appendTo.ownerDocument:document,a.validatePackage(g),this.showLicenseWatermark=a.shouldShowValidationUI(g)}get _id(){return this.props.id+"-accessibility-id"}componentDidMount(){this.element&&(this.props.autoFocus&&this.element.focus(),this.setState({zIndex:m(this.getCurrentZIndex(),this.getDocument(),this._id)}))}render(){const t=void 0!==this.props.id?this.props.id:this.titleId,{title:e,width:i,height:s,children:o,minWidth:n,dir:r,style:h,contentStyle:c}=this.props,g=d.Children.toArray(o),w=this.getContent(g),m=this.getActionBar(g),f=e?{"aria-labelledby":t}:null,C=void 0===this.props.closeIcon||this.props.closeIcon,E=this.getCurrentZIndex(),v=d.createElement(a.ZIndexContext.Provider,{value:E},d.createElement("div",{[u]:this._id,className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.onKeyDown,tabIndex:0,dir:r,style:{zIndex:E,...h},ref:t=>this.element=t},d.createElement("div",{className:"k-overlay"}),d.createElement("div",{...f,className:a.classNames("k-window k-dialog",{[`k-window-${this.props.themeColor}`]:this.props.themeColor}),role:"dialog","aria-labelledby":t,"aria-modal":!0,"aria-describedby":this.contentId,style:{width:i,height:s,minWidth:n}},this.props.title&&d.createElement(p,{closeIcon:C,onCloseButtonClick:this.onCloseDialog,id:t},e),d.createElement("div",{className:"k-window-content k-dialog-content",style:c,id:this.contentId},w),m,this.showLicenseWatermark&&d.createElement(a.WatermarkOverlay,null))));return a.canUseDOM?null!==this.props.appendTo?l.createPortal(v,this.props.appendTo||document.body):v:null}getActionBar(t){return t.filter((t=>t&&t.type===c))}getContent(t){return t.filter((t=>t&&t.type!==c))}generateTitleId(){return"dialog-title-"+this._id}generateContentId(){return"dialog-content-"+this._id}};f.displayName="Dialog",f.propTypes={title:s.any,id:s.string,dir:s.string,style:s.object,closeIcon:s.bool,width:s.oneOfType([s.number,s.string]),height:s.oneOfType([s.number,s.string]),minWidth:s.oneOfType([s.number,s.string]),autoFocus:s.bool},f.defaultProps={autoFocus:!1},f.contextType=a.ZIndexContext;let C=f;const E=a.createPropsContext(),v=a.withIdHOC(a.withPropsContext(E,C));v.displayName="KendoReactDialog";var I=(t=>(t.DEFAULT="DEFAULT",t.FULLSCREEN="FULLSCREEN",t.MINIMIZED="MINIMIZED",t))(I||{});const k="dialogs.windowMaximizeButton",y="dialogs.windowMinimizeButton",b="dialogs.windowRestoreButton",S="dialogs.windowCloseButton",D={[k]:"maximize",[y]:"minimize",[b]:"restore",[S]:"close"},T=t=>{const{children:e,onCloseButtonClick:i,onMinimizeButtonClick:s,onFullScreenButtonClick:a,onRestoreButtonClick:h,onDoubleClick:l,stage:p,forwardedRef:c,id:g}=t,u=r.useLocalization(),w=t.minimizeButton?d.createElement(t.minimizeButton,{onClick:s,stage:p}):d.createElement(o.Button,{fillMode:"flat",icon:"window-minimize",svgIcon:n.windowMinimizeIcon,className:"k-window-titlebar-action",onClick:s,"aria-label":u.toLanguageString(y,D[y])}),m=t.maximizeButton?d.createElement(t.maximizeButton,{onClick:a,stage:p}):d.createElement(o.Button,{fillMode:"flat",icon:"window-maximize",svgIcon:n.windowIcon,className:"k-window-titlebar-action",onClick:a,"aria-label":u.toLanguageString(k,D[k])}),f=t.restoreButton?d.createElement(t.restoreButton,{onClick:h,stage:p}):d.createElement(o.Button,{fillMode:"flat",icon:"window-restore",svgIcon:n.windowRestoreIcon,className:"k-window-titlebar-action",onClick:h,"aria-label":u.toLanguageString(b,D[b])}),C=t.closeButton?d.createElement(t.closeButton,{onClick:i,stage:p}):d.createElement(o.Button,{fillMode:"flat",icon:"x",svgIcon:n.xIcon,className:"k-window-titlebar-action",onClick:i,"aria-label":u.toLanguageString(S,D[S])});return d.createElement("div",{className:"k-window-titlebar",style:{touchAction:"none"},ref:c,onDoubleClick:l},d.createElement("span",{className:"k-window-title",id:g},e||""),d.createElement("div",{className:"k-window-titlebar-actions"},p===I.DEFAULT&&w,p===I.DEFAULT&&m,p!==I.DEFAULT&&f,C))},x=d.forwardRef(((t,e)=>d.createElement(T,{...t,forwardedRef:e}))),L=["n","e","s","w","se","sw","ne","nw"];let B=class extends d.Component{render(){return d.createElement("div",{className:"k-resize-handles-wrapper"}," ",L.map(((t,e)=>d.createElement(a.Draggable,{key:e,onDrag:e=>{const{event:i}=e;i.originalEvent.preventDefault(),this.props.onResize(i,{end:!1,direction:t})},onRelease:e=>{const{event:i}=e;i.originalEvent.preventDefault(),this.props.onResize(i,{end:!0,direction:t})}},d.createElement("div",{className:"k-resize-handle k-resize-"+t,style:{display:"block",touchAction:"none"}})))))}};class N extends d.Component{shouldComponentUpdate(t){return t.shouldUpdateOnDrag||!t.isDragging}render(){return this.props.children}}const z=t=>{const e={layout:"end",...t},{layout:i,children:s}=e,o=a.classNames("k-actions","k-window-actions","k-actions-horizontal","k-hstack",{"k-justify-content-start":"start"===i,"k-justify-content-center":"center"===i,"k-justify-content-end":"end"===i,"k-justify-content-stretch":"stretched"===i});return d.createElement("div",{className:o},s)};z.propTypes={children:s.any,layout:s.oneOf(["start","center","end","stretched"])};const M=class extends d.Component{constructor(t){super(t),this.context=0,this.draggable=null,this.offSetCoordinates={x:0,y:0},this.titleId=this.generateTitleId(),this.mounted=!1,this.showLicenseWatermark=!1,this.onKeyDown=t=>{if(t.target!==t.currentTarget)return;const e=this.props.minWidth||120,i=this.props.minHeight||100;if(t.ctrlKey&&this.props.resizable){switch(t.keyCode){case a.Keys.up:t.preventDefault(),i<=this.height-5&&this.setState({height:this.height-5});break;case a.Keys.down:t.preventDefault(),this.setState({height:this.height+5});break;case a.Keys.left:e<=this.width-5&&this.setState({width:this.width-5});break;case a.Keys.right:this.setState({width:this.width+5});break;default:return}this.dispatchMoveEvent(this.props.onResize,t,!1,void 0)}else if(t.altKey)switch(t.keyCode){case a.Keys.up:this.windowStage===I.MINIMIZED?(this.handleRestore(t),a.dispatchEvent(this.props.onStageChange,t,this,{state:I.DEFAULT})):this.windowStage===I.DEFAULT&&(this.handleFullscreen(t),a.dispatchEvent(this.props.onStageChange,t,this,{state:I.FULLSCREEN}));break;case a.Keys.down:this.windowStage===I.FULLSCREEN?(this.handleRestore(t),a.dispatchEvent(this.props.onStageChange,t,this,{state:I.DEFAULT})):this.windowStage===I.DEFAULT&&(this.handleMinimize(t),a.dispatchEvent(this.props.onStageChange,t,this,{state:I.MINIMIZED}))}else{if(!t.ctrlKey)switch(t.keyCode){case a.Keys.esc:return void(this.props.onClose&&this.handleCloseWindow(t));case a.Keys.up:this.setState({top:this.state.top-5});break;case a.Keys.down:this.setState({top:this.state.top+5});break;case a.Keys.left:this.setState({left:this.state.left-5});break;case a.Keys.right:this.setState({left:this.state.left+5});break;default:return}this.dispatchMoveEvent(this.props.onMove,t,!1,void 0)}},this.onPress=t=>{const e=t.event;this.windowCoordinatesState.differenceLeft=e.pageX-this.left,this.windowCoordinatesState.differenceTop=e.pageY-this.top},this.onDrag=t=>{const e=t.event;e.originalEvent.preventDefault(),this.windowStage!==I.FULLSCREEN&&this.props.draggable&&(this.setState({top:Math.max(e.pageY-this.windowCoordinatesState.differenceTop,0),left:e.pageX-this.windowCoordinatesState.differenceLeft,isDragging:!0}),this.props.onMove&&this.dispatchMoveEvent(this.props.onMove,e,!0,!1))},this.onRelease=t=>{const e=t.event;this.windowStage!==I.FULLSCREEN&&this.props.draggable&&this.props.onMove&&this.dispatchMoveEvent(this.props.onMove,e,!0,!0),this.setState({isDragging:!1})},this.onFocus=()=>{this._blurTimeout?(clearTimeout(this._blurTimeout),this._blurTimeout=void 0):this.setState({focused:!0,zIndex:m(this.getCurrentZIndex(),this.getDocument(),this._id)})},this.onBlur=()=>{clearTimeout(this._blurTimeout);const t=this.getWindow();t&&(this._blurTimeout=t.setTimeout((()=>{this.mounted&&this.setState({focused:!1}),this._blurTimeout=void 0})))},this.getInitialTop=()=>{if(void 0!==this.props.top)return this.props.top;if(void 0!==this.props.initialTop)return this.props.initialTop;let t=300;if(void 0!==this.props.height?t=this.props.height:void 0!==this.props.initialHeight&&(t=this.props.initialHeight),this.props.appendTo)return this.props.appendTo.offsetHeight/2-t/2;const e=this.getWindow();return e?e.innerHeight/2-t/2:0},this.getInitialLeft=()=>{if(void 0!==this.props.left)return this.props.left;if(void 0!==this.props.initialLeft)return this.props.initialLeft;let t=300;if(void 0!==this.props.width?t=this.props.width:void 0!==this.props.initialWidth&&(t=this.props.initialWidth),this.props.appendTo)return this.props.appendTo.offsetWidth/2-t/2;const e=this.getWindow();return e?e.innerWidth/2-t/2:0},this.getInitialWidth=()=>{let t=300;return void 0!==this.props.width?t=this.props.width:void 0!==this.props.initialWidth&&(t=this.props.initialWidth),t},this.getInitialHeight=()=>{let t=300;return void 0!==this.props.height?t=this.props.height:void 0!==this.props.initialHeight&&(t=this.props.initialHeight),t},this.handleMinimize=t=>{t.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.left,this.windowCoordinatesState.topBeforeAction=this.top,this.windowCoordinatesState.widthBeforeAction=this.width,this.windowCoordinatesState.heightBeforeAction=this.height,this.setState({stage:I.MINIMIZED,height:0}),a.dispatchEvent(this.props.onStageChange,t,this,{state:I.MINIMIZED})},this.handleFullscreen=t=>{t.preventDefault(),this.windowCoordinatesState.leftBeforeAction=this.left,this.windowCoordinatesState.topBeforeAction=this.top,this.windowCoordinatesState.widthBeforeAction=this.width,this.windowCoordinatesState.heightBeforeAction=this.height;const e=this.getWindow(),i=e?e.innerWidth:0,s=e?e.innerHeight:0;this.setState({left:0,top:0,width:this.props.appendTo?this.props.appendTo.offsetWidth:i,height:this.props.appendTo?this.props.appendTo.offsetHeight:s,stage:I.FULLSCREEN}),a.dispatchEvent(this.props.onStageChange,t,this,{state:I.FULLSCREEN})},this.handleRestore=t=>{t.preventDefault(),this.windowStage===I.FULLSCREEN?this.setState({stage:I.DEFAULT,left:this.windowCoordinatesState.leftBeforeAction,top:this.windowCoordinatesState.topBeforeAction,width:this.windowCoordinatesState.widthBeforeAction,height:this.windowCoordinatesState.heightBeforeAction}):this.windowStage===I.MINIMIZED&&this.setState({stage:I.DEFAULT,height:this.windowCoordinatesState.heightBeforeAction}),a.dispatchEvent(this.props.onStageChange,t,this,{state:I.DEFAULT})},this.handleCloseWindow=t=>{t.preventDefault(),a.dispatchEvent(this.props.onClose,t,this,{state:void 0})},this.handleDoubleClick=t=>{this.windowStage===I.FULLSCREEN||this.windowStage===I.MINIMIZED?this.handleRestore(t):this.handleFullscreen(t)},this.handleResize=(t,e)=>{const i=this.props.appendTo?t.pageX-this.offSetCoordinates.x:t.pageX,s=this.props.appendTo?t.pageY-this.offSetCoordinates.y:t.pageY,o=this.width,n=this.height,a=this.props.minWidth||120,r=this.props.minHeight||100,h=this.top-s,d=this.left-i;let l=i-this.left,p=s-this.top;const c=Object.assign({},this.state,{isDragging:!e.end});e.direction.indexOf("n")>=0&&r-(n+h)<0&&(this.top>0&&(c.height=n+h),c.top=s),e.direction.indexOf("s")>=0&&r-p<0&&(c.height=p),e.direction.indexOf("w")>=0&&a-(o+d)<0&&(this.left>0&&(c.width=o+d),c.left=i),e.direction.indexOf("e")>=0&&a-l<0&&(c.width=l),this.setState(c),this.dispatchMoveEvent(this.props.onResize,t,!0,e.end)},this.dispatchMoveEvent=(t,e,i,s)=>{t&&t.call(void 0,{nativeEvent:e.nativeEvent?e.nativeEvent:e.originalEvent,drag:i,end:s,target:this,left:this.state.left,top:this.state.top,width:this.state.width,hight:this.state.height,height:this.state.height})},this.handleBrowserWindowResize=()=>{if(this.windowStage===I.FULLSCREEN){const t=this.getWindow(),e=t?t.innerWidth:0,i=t?t.innerHeight:0;this.setState({width:this.props.appendTo?this.props.appendTo.offsetWidth:e,height:this.props.appendTo?this.props.appendTo.offsetHeight:i})}},this.getCurrentZIndex=()=>this.state&&void 0!==this.context?this.state.zIndex>(this.context?this.context+2:0)?this.state.zIndex:this.context+2:this.context?this.context:w,this.getDocument=()=>this.props.appendTo?this.props.appendTo.ownerDocument:document,this.getWindow=()=>{const t=this.getDocument();return t&&t.defaultView},a.validatePackage(g),this.showLicenseWatermark=a.shouldShowValidationUI(g),this.state={stage:this.props.stage||I.DEFAULT,isDragging:!1,top:0,left:0,width:300,height:300,focused:!0,zIndex:w}}get _id(){return this.props.id+"-accessibility-id"}componentDidMount(){const t=this.getWindow();t&&t.addEventListener("resize",this.handleBrowserWindowResize),this.setState({stage:this.props.stage||I.DEFAULT,isDragging:!1,top:this.getInitialTop(),left:this.getInitialLeft(),width:this.getInitialWidth(),height:this.getInitialHeight(),focused:!0,zIndex:m(this.getCurrentZIndex(),this.getDocument(),this._id)}),this.windowCoordinatesState={leftBeforeAction:this.getInitialLeft(),topBeforeAction:this.getInitialTop(),widthBeforeAction:this.getInitialWidth(),heightBeforeAction:this.getInitialHeight()};const e=this.getDocument();if(this.props.appendTo&&e){let t=this.props.appendTo.getBoundingClientRect(),i=e.body.getBoundingClientRect();this.offSetCoordinates.x=t.left-i.left,this.offSetCoordinates.y=t.top-i.top}this.mounted=!0}componentWillUnmount(){const t=this.getWindow();t&&t.removeEventListener("resize",this.handleBrowserWindowResize),this.mounted=!1}componentDidUpdate(){const t=this.getDocument();if(this.props.appendTo&&t){let e=this.props.appendTo.getBoundingClientRect(),i=t.body.getBoundingClientRect();this.offSetCoordinates.x=e.left-i.left,this.offSetCoordinates.y=e.top-i.top}this.mounted=!0}render(){const t=d.Children.toArray(this.props.children),e=this.getContent(t),i=this.getActionBar(t),s=this.getCurrentZIndex(),o=a.classNames("k-window",this.props.className,{[`k-window-${this.props.themeColor}`]:this.props.themeColor,"k-window-minimized":"MINIMIZED"===this.state.stage,"k-window-focused":this.state.focused}),n=d.createElement(a.ZIndexContext.Provider,{value:s},d.createElement(d.Fragment,null,this.props.modal&&d.createElement("div",{className:"k-overlay",style:{zIndex:s,...this.props.overlayStyle}}),d.createElement("div",{id:this.props.id,[u]:this._id,tabIndex:0,role:"dialog","aria-labelledby":this.titleId,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,ref:t=>{this.windowElement=t,this.element=t},className:o,style:{top:this.top,left:this.left,width:this.width,height:this.height||"",zIndex:s,...this.props.style}},d.createElement(N,{shouldUpdateOnDrag:this.props.shouldUpdateOnDrag||!1,isDragging:this.state.isDragging},d.createElement(a.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:t=>this.draggable=t},d.createElement(x,{stage:this.windowStage,onDoubleClick:this.props.doubleClickStageChange?this.handleDoubleClick:void 0,onMinimizeButtonClick:this.handleMinimize,onFullScreenButtonClick:this.handleFullscreen,onRestoreButtonClick:this.handleRestore,onCloseButtonClick:this.handleCloseWindow,closeButton:this.props.closeButton,minimizeButton:this.props.minimizeButton,maximizeButton:this.props.maximizeButton,restoreButton:this.props.restoreButton,id:this.titleId},this.props.title)),this.windowStage!==I.MINIMIZED?d.createElement(d.Fragment,null,d.createElement("div",{className:"k-window-content"},e),i):null,this.windowStage===I.DEFAULT&&this.props.resizable?d.createElement(B,{onResize:this.handleResize}):null),this.showLicenseWatermark&&d.createElement(a.WatermarkOverlay,null))));return a.canUseDOM?null!==this.props.appendTo?l.createPortal(n,this.props.appendTo||document.body):n:null}get top(){return this.windowStage!==I.FULLSCREEN?Math.max(this.props.top||this.state.top,0):0}get left(){return this.windowStage!==I.FULLSCREEN?Math.max(this.props.left||this.state.left,0):0}get width(){let t=this.props.width||this.state.width;if(this.windowStage===I.FULLSCREEN){if(this.props.appendTo)return t=this.props.appendTo.offsetWidth,t;const e=this.getWindow();t=e?e.innerWidth:0}return t}get height(){let t=this.props.height||this.state.height;if(this.windowStage===I.FULLSCREEN){if(this.props.appendTo)return t=this.props.appendTo.offsetHeight,t;const e=this.getWindow();t=e?e.innerHeight:0}else this.windowStage===I.MINIMIZED&&(t=0);return t}get windowStage(){return this.props.stage||this.state.stage}getActionBar(t){return t.filter((t=>t&&t.type===z))}getContent(t){return t.filter((t=>t&&t.type!==z))}generateTitleId(){return"window-title-"+this._id}};M.displayName="Window",M.propTypes={width:s.number,height:s.number,left:s.number,top:s.number,initialWidth:s.number,initialHeight:s.number,initialLeft:s.number,initialTop:s.number,minWidth:s.number,minHeight:s.number,resizable:s.bool,draggable:s.bool,title:s.any,shouldUpdateOnDrag:s.bool,stage:s.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),className:s.string,id:s.string,style:s.object,overlayStyle:s.object},M.defaultProps={minWidth:120,minHeight:100,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0},M.contextType=a.ZIndexContext;let R=M;const W=a.createPropsContext(),F=a.withIdHOC(a.withPropsContext(W,R));F.displayName="KendoReactWindow",t.Dialog=v,t.DialogActionsBar=c,t.DialogPropsContext=E,t.Window=F,t.WindowActionsBar=z,t.WindowPropsContext=W}));
|