@progress/kendo-react-dialogs 9.4.0-develop.6 → 9.4.0-develop.7
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 +1 -1
- package/Dialog.mjs +0 -1
- package/DialogActionsBar.js +1 -1
- package/DialogActionsBar.mjs +4 -5
- package/DialogTitleBar.js +1 -1
- package/DialogTitleBar.mjs +2 -3
- package/MiddleLayerOptimization.js +1 -1
- package/MiddleLayerOptimization.mjs +0 -1
- package/StageEnum.js +1 -1
- package/StageEnum.mjs +0 -1
- package/Window.js +1 -1
- package/Window.mjs +0 -1
- package/WindowActionsBar.js +1 -1
- package/WindowActionsBar.mjs +3 -4
- package/WindowResizeHandlers.js +1 -1
- package/WindowResizeHandlers.mjs +0 -1
- package/WindowTitlebar.js +1 -1
- package/WindowTitlebar.mjs +0 -1
- package/constants.js +1 -1
- package/constants.mjs +0 -1
- package/index.js +2 -1
- package/index.mjs +4 -4
- package/messages/index.js +1 -1
- package/messages/index.mjs +0 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -3
- package/package.json +4 -4
- package/utils.js +1 -1
- package/utils.mjs +7 -8
package/Dialog.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react"),F=require("react-dom"),o=require("prop-types"),_=require("./DialogTitleBar.js"),u=require("./DialogActionsBar.js"),s=require("@progress/kendo-react-common"),m=require("./package-metadata.js"),N=require("./utils.js"),c=require("./constants.js");function g(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const i=g(A),P=g(F),n=class n extends i.Component{constructor(t){super(t),this.context=0,this.titleId=this.generateTitleId(),this.contentId=this.generateContentId(),this.showLicenseWatermark=!1,this.activeElement=null,this.onCloseDialog=e=>{e.preventDefault(),s.dispatchEvent(this.props.onClose,e,this,void 0)},this.onKeyDown=e=>{e.keyCode===s.Keys.esc&&this.props.onClose&&(e.preventDefault(),this.onCloseDialog(e)),s.keepFocusInContainer(e,this.element)},this.getCurrentZIndex=()=>!this.state||this.context===void 0?this.context?this.context:c.DEFAULT_DIALOGS_ZINDEX:this.state.zIndex>(this.context?this.context+c.ZINDEX_DIALOGS_STEP:0)?this.state.zIndex:this.context+c.ZINDEX_DIALOGS_STEP,this.getDocument=()=>this.props.appendTo?this.props.appendTo.ownerDocument:document,s.validatePackage(m.packageMetadata),this.showLicenseWatermark=s.shouldShowValidationUI(m.packageMetadata),this.activeElement=s.getActiveElement(document)}get _id(){return this.props.id+"-accessibility-id"}componentDidMount(){if(this.element){if(this.props.autoFocus&&!this.props.autoFocusedElement)this.element.focus();else if(this.props.autoFocus&&this.props.autoFocusedElement)this.element.focus();else if(!this.props.autoFocus&&this.props.autoFocusedElement){const t=this.element.querySelector(this.props.autoFocusedElement);t&&t.focus()}else{const t=[...s.FOCUSABLE_ELEMENTS].map(e=>e+":not(.k-dialog-titlebar *)");s.focusFirstFocusableChild(this.element,t)}this.setState({zIndex:N.getMaxZIndex(this.getCurrentZIndex(),this.getDocument(),this._id)})}}componentWillUnmount(){setTimeout(()=>{var t;!this.element&&this.activeElement&&document&&(document.contains(this.activeElement)?this.activeElement.focus():this.activeElement.id&&((t=document.getElementById(this.activeElement.id))==null||t.focus()))})}render(){const t=this.props.id!==void 0?this.props.id:this.titleId,{title:e,width:a,height:I,children:D,minWidth:E,dir:b,style:C,contentStyle:v,modal:x=!0}=this.props,d=i.Children.toArray(D),T=this.getContent(d),k=this.getActionBar(d),w=e?{"aria-labelledby":t}:null,O=this.props.closeIcon!==void 0?this.props.closeIcon:!0,p=this.getCurrentZIndex(),h=i.createElement(s.ZIndexContext.Provider,{value:p},i.createElement("div",{[c.DATA_DIALOGS_ID]:this._id,className:"k-dialog-wrapper"+(this.props.className?" "+this.props.className:""),onKeyDown:this.onKeyDown,tabIndex:0,dir:b,style:{zIndex:p,...C},ref:S=>this.element=S},x&&i.createElement("div",{className:"k-overlay",style:this.props.overlayStyle}),i.createElement("div",{...w,className:s.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:a,height:I,minWidth:E}},this.props.title&&i.createElement(_.DialogTitleBar,{closeIcon:O,onCloseButtonClick:this.onCloseDialog,id:t},e),i.createElement("div",{className:"k-window-content k-dialog-content",style:v,id:this.contentId},T),k,this.showLicenseWatermark&&i.createElement(s.WatermarkOverlay,null))));return s.canUseDOM?this.props.appendTo!==null?P.createPortal(h,this.props.appendTo||document.body):h:null}getActionBar(t){return t.filter(e=>e&&e.type===u.DialogActionsBar)}getContent(t){return t.filter(e=>e&&e.type!==u.DialogActionsBar)}generateTitleId(){return"dialog-title-"+this._id}generateContentId(){return"dialog-content-"+this._id}};n.displayName="Dialog",n.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},n.defaultProps={autoFocus:!1},n.contextType=s.ZIndexContext;let l=n;const y=s.createPropsContext(),f=s.withIdHOC(s.withPropsContext(y,l));f.displayName="KendoReactDialog";exports.Dialog=f;exports.DialogPropsContext=y;
|
package/Dialog.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as o from "react";
|
|
10
9
|
import * as b from "react-dom";
|
|
11
10
|
import s from "prop-types";
|
package/DialogActionsBar.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),r=require("prop-types"),i=require("@progress/kendo-react-common");function l(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const u=l(s),c=e=>{const o={layout:"stretched",...e},{layout:t,children:n}=o,a=i.classNames("k-actions","k-actions-horizontal","k-window-actions k-dialog-actions",{[`k-actions-${t}`]:t});return u.createElement("div",{className:a},n)};c.propTypes={children:r.any,layout:r.oneOf(["start","center","end","stretched"])};exports.DialogActionsBar=c;
|
package/DialogActionsBar.mjs
CHANGED
|
@@ -5,15 +5,14 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as n from "react";
|
|
10
9
|
import t from "prop-types";
|
|
11
10
|
import { classNames as c } from "@progress/kendo-react-common";
|
|
12
|
-
const i = (
|
|
13
|
-
const
|
|
11
|
+
const i = (s) => {
|
|
12
|
+
const e = {
|
|
14
13
|
layout: "stretched",
|
|
15
|
-
...
|
|
16
|
-
}, { layout: o, children: a } =
|
|
14
|
+
...s
|
|
15
|
+
}, { layout: o, children: a } = e, r = c("k-actions", "k-actions-horizontal", "k-window-actions k-dialog-actions", {
|
|
17
16
|
[`k-actions-${o}`]: o
|
|
18
17
|
});
|
|
19
18
|
return /* @__PURE__ */ n.createElement("div", { className: r }, a);
|
package/DialogTitleBar.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),l=require("@progress/kendo-react-buttons"),r=require("@progress/kendo-svg-icons");function c(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const n=c(i),s=({children:e,onCloseButtonClick:a,id:t,closeIcon:o})=>n.createElement("div",{className:"k-window-titlebar k-dialog-titlebar",id:t},n.createElement("span",{className:"k-window-title k-dialog-title"},e),o&&n.createElement("div",{className:"k-window-titlebar-actions k-dialog-titlebar-actions"},n.createElement(l.Button,{role:"button","aria-label":"Close",onClick:a,icon:"x",svgIcon:r.xIcon,fillMode:"flat",className:"k-window-titlebar-action k-dialog-titlebar-action"})));exports.DialogTitleBar=s;
|
package/DialogTitleBar.mjs
CHANGED
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as t from "react";
|
|
10
9
|
import { Button as o } from "@progress/kendo-react-buttons";
|
|
11
|
-
import { xIcon as
|
|
10
|
+
import { xIcon as r } from "@progress/kendo-svg-icons";
|
|
12
11
|
const s = ({
|
|
13
12
|
children: e,
|
|
14
13
|
onCloseButtonClick: a,
|
|
@@ -21,7 +20,7 @@ const s = ({
|
|
|
21
20
|
"aria-label": "Close",
|
|
22
21
|
onClick: a,
|
|
23
22
|
icon: "x",
|
|
24
|
-
svgIcon:
|
|
23
|
+
svgIcon: r,
|
|
25
24
|
fillMode: "flat",
|
|
26
25
|
className: "k-window-titlebar-action k-dialog-titlebar-action"
|
|
27
26
|
}
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react");function a(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const i=a(o);class c extends i.Component{shouldComponentUpdate(t){return t.shouldUpdateOnDrag||!t.isDragging}render(){return this.props.children}}exports.MiddleLayerOptimization=c;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as r from "react";
|
|
10
9
|
class n extends r.Component {
|
|
11
10
|
shouldComponentUpdate(e) {
|
package/StageEnum.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(E=>(E.DEFAULT="DEFAULT",E.FULLSCREEN="FULLSCREEN",E.MINIMIZED="MINIMIZED",E))(e||{});exports.windowStage=e;
|
package/StageEnum.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
var I = /* @__PURE__ */ ((E) => (E.DEFAULT = "DEFAULT", E.FULLSCREEN = "FULLSCREEN", E.MINIMIZED = "MINIMIZED", E))(I || {});
|
|
10
9
|
export {
|
|
11
10
|
I as windowStage
|
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),x=require("react-dom"),h=require("prop-types"),N=require("./WindowTitlebar.js"),o=require("@progress/kendo-react-common"),U=require("./WindowResizeHandlers.js"),k=require("./MiddleLayerOptimization.js"),s=require("./StageEnum.js"),y=require("./package-metadata.js"),v=require("./WindowActionsBar.js"),u=require("./constants.js"),M=require("./utils.js");function A(w){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(w){for(const t in w)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(w,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:()=>w[t]})}}return i.default=w,Object.freeze(i)}const a=A(R),z=A(x),S=300,m=300,E=120,C=100,p=5,g=class g extends a.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.activeElement=null,this.onKeyDown=t=>{if(this.props.modal&&o.keepFocusInContainer(t,this.element),t.target!==t.currentTarget)return;const e=this.props.minWidth||E,n=this.props.minHeight||C;if((t.metaKey||t.ctrlKey)&&this.props.resizable){switch(t.keyCode){case o.Keys.up:t.preventDefault(),n<=this.height-p&&this.setState({height:this.height-p});break;case o.Keys.down:t.preventDefault(),this.setState({height:this.height+p});break;case o.Keys.left:e<=this.width-p&&this.setState({width:this.width-p});break;case o.Keys.right:this.setState({width:this.width+p});break;default:return}this.dispatchMoveEvent(this.props.onResize,t,!1,void 0);return}if(t.altKey){switch(t.keyCode){case o.Keys.up:this.windowStage===s.windowStage.MINIMIZED?(this.handleRestore(t),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.DEFAULT})):this.windowStage===s.windowStage.DEFAULT&&(this.handleFullscreen(t),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.FULLSCREEN}));break;case o.Keys.down:this.windowStage===s.windowStage.FULLSCREEN?(this.handleRestore(t),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.DEFAULT})):this.windowStage===s.windowStage.DEFAULT&&(this.handleMinimize(t),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.MINIMIZED}));break}return}if(!t.ctrlKey)switch(t.keyCode){case o.Keys.esc:this.props.onClose&&this.handleCloseWindow(t);return;case o.Keys.up:this.setState(r=>({top:r.top-p}));break;case o.Keys.down:this.setState(r=>({top:r.top+p}));break;case o.Keys.left:this.setState(r=>({left:r.left-p}));break;case o.Keys.right:this.setState(r=>({left:r.left+p}));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!==s.windowStage.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!==s.windowStage.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.getMaxZIndex(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=m;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=S;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=S;return this.props.width!==void 0?t=this.props.width:this.props.initialWidth!==void 0&&(t=this.props.initialWidth),t},this.getInitialHeight=()=>{let t=m;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:s.windowStage.MINIMIZED,height:0}),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.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(),n=e?e.innerWidth:0,d=e?e.innerHeight:0;this.setState({left:0,top:0,width:this.props.appendTo?this.props.appendTo.offsetWidth:n,height:this.props.appendTo?this.props.appendTo.offsetHeight:d,stage:s.windowStage.FULLSCREEN}),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.FULLSCREEN})},this.handleRestore=t=>{t.preventDefault(),this.windowStage===s.windowStage.FULLSCREEN?this.setState({stage:s.windowStage.DEFAULT,left:this.windowCoordinatesState.leftBeforeAction,top:this.windowCoordinatesState.topBeforeAction,width:this.windowCoordinatesState.widthBeforeAction,height:this.windowCoordinatesState.heightBeforeAction}):this.windowStage===s.windowStage.MINIMIZED&&this.setState({stage:s.windowStage.DEFAULT,height:this.windowCoordinatesState.heightBeforeAction}),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.DEFAULT})},this.handleCloseWindow=t=>{t.preventDefault(),o.dispatchEvent(this.props.onClose,t,this,{state:void 0})},this.handleDoubleClick=t=>{this.windowStage===s.windowStage.FULLSCREEN||this.windowStage===s.windowStage.MINIMIZED?this.handleRestore(t):this.handleFullscreen(t)},this.handleResize=(t,e)=>{const n=this.props.appendTo?t.pageX-this.offSetCoordinates.x:t.pageX,d=this.props.appendTo?t.pageY-this.offSetCoordinates.y:t.pageY,r=this.width,l=this.height,D=this.props.minWidth||E,I=this.props.minHeight||C,T=this.top-d,b=this.left-n,L=n-this.left,W=d-this.top,c=Object.assign({},this.state,{isDragging:!e.end});e.direction.indexOf("n")>=0&&I-(l+T)<0&&(this.top>0&&(c.height=l+T),c.top=d),e.direction.indexOf("s")>=0&&I-W<0&&(c.height=W),e.direction.indexOf("w")>=0&&D-(r+b)<0&&(this.left>0&&(c.width=r+b),c.left=n),e.direction.indexOf("e")>=0&&D-L<0&&(c.width=L),this.setState(c),this.dispatchMoveEvent(this.props.onResize,t,!0,e.end)},this.dispatchMoveEvent=(t,e,n,d)=>{t&&t.call(void 0,{nativeEvent:e.nativeEvent?e.nativeEvent:e.originalEvent,drag:n,end:d,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===s.windowStage.FULLSCREEN){const t=this.getWindow(),e=t?t.innerWidth:0,n=t?t.innerHeight:0;this.setState({width:this.props.appendTo?this.props.appendTo.offsetWidth:e,height:this.props.appendTo?this.props.appendTo.offsetHeight:n})}},this.getCurrentZIndex=()=>!this.state||this.context===void 0?this.context?this.context:u.DEFAULT_DIALOGS_ZINDEX:this.state.zIndex>(this.context?this.context+u.ZINDEX_DIALOGS_STEP:0)?this.state.zIndex:this.context+u.ZINDEX_DIALOGS_STEP,this.getDocument=()=>this.props.appendTo?this.props.appendTo.ownerDocument:document,this.getWindow=()=>{const t=this.getDocument();return t&&t.defaultView},o.validatePackage(y.packageMetadata),this.showLicenseWatermark=o.shouldShowValidationUI(y.packageMetadata),this.state={stage:this.props.stage||s.windowStage.DEFAULT,isDragging:!1,top:0,left:0,width:S,height:m,focused:!0,zIndex:u.DEFAULT_DIALOGS_ZINDEX},this.activeElement=document.activeElement}get _id(){return this.props.id+"-accessibility-id"}componentDidMount(){this.element&&this.props.autoFocus&&this.element.focus({preventScroll:!0});const i=this.getWindow();i&&i.addEventListener("resize",this.handleBrowserWindowResize),this.setState({stage:this.props.stage||s.windowStage.DEFAULT,isDragging:!1,top:this.getInitialTop(),left:this.getInitialLeft(),width:this.getInitialWidth(),height:this.getInitialHeight(),focused:!0,zIndex:M.getMaxZIndex(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){const e=this.props.appendTo.getBoundingClientRect(),n=t.body.getBoundingClientRect();this.offSetCoordinates.x=e.left-n.left,this.offSetCoordinates.y=e.top-n.top}this.mounted=!0}componentWillUnmount(){const i=this.getWindow();i&&i.removeEventListener("resize",this.handleBrowserWindowResize),this.mounted=!1,setTimeout(()=>{var t;!this.element&&this.activeElement&&document&&(document.contains(this.activeElement)?this.activeElement.focus({preventScroll:!0}):this.activeElement.id&&((t=document.getElementById(this.activeElement.id))==null||t.focus({preventScroll:!0})))})}componentDidUpdate(i){this.props.left&&i.left!==this.props.left&&this.setState({left:this.props.left}),this.props.top&&i.top!==this.props.top&&this.setState({top:this.props.top});const t=this.getDocument();if(this.props.appendTo&&t){const e=this.props.appendTo.getBoundingClientRect(),n=t.body.getBoundingClientRect();this.offSetCoordinates.x=e.left-n.left,this.offSetCoordinates.y=e.top-n.top}this.mounted=!0}render(){const i=a.Children.toArray(this.props.children),t=this.getContent(i),e=this.getActionBar(i),n=this.getCurrentZIndex(),d=o.classNames("k-window",this.props.className,{[`k-window-${this.props.themeColor}`]:this.props.themeColor,"k-window-minimized":this.state.stage==="MINIMIZED","k-focus":this.state.focused}),r=a.createElement(o.ZIndexContext.Provider,{value:n},a.createElement(a.Fragment,null,this.props.modal&&a.createElement("div",{className:"k-overlay",style:{zIndex:n,...this.props.overlayStyle}}),a.createElement("div",{id:this.props.id,[u.DATA_DIALOGS_ID]: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:d,style:{top:this.top,left:this.left,width:this.width,height:this.height||"",zIndex:n,...this.props.style}},a.createElement(k.MiddleLayerOptimization,{shouldUpdateOnDrag:this.props.shouldUpdateOnDrag||!1,isDragging:this.state.isDragging},a.createElement(o.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,autoScroll:!1,ref:l=>this.draggable=l},a.createElement(N.WindowTitleBar,{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!==s.windowStage.MINIMIZED?a.createElement(a.Fragment,null,a.createElement("div",{className:"k-window-content"},t),e):null,this.windowStage===s.windowStage.DEFAULT&&this.props.resizable?a.createElement(U.ResizeHandlers,{onResize:this.handleResize}):null),this.showLicenseWatermark&&a.createElement(o.WatermarkOverlay,null))));return o.canUseDOM?this.props.appendTo!==null?z.createPortal(r,this.props.appendTo||document.body):r:null}get top(){return this.windowStage!==s.windowStage.FULLSCREEN?Math.max(this.props.top||this.state.top,0):0}get left(){return this.windowStage!==s.windowStage.FULLSCREEN?Math.max(this.props.left||this.state.left,0):0}get width(){let i=this.props.width||this.state.width;if(this.windowStage===s.windowStage.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===s.windowStage.FULLSCREEN){if(this.props.appendTo)return i=this.props.appendTo.offsetHeight,i;const t=this.getWindow();i=t?t.innerHeight:0}else this.windowStage===s.windowStage.MINIMIZED&&(i=0);return i}get windowStage(){return this.props.stage||this.state.stage}getActionBar(i){return i.filter(t=>t&&t.type===v.WindowActionsBar)}getContent(i){return i.filter(t=>t&&t.type!==v.WindowActionsBar)}generateTitleId(){return"window-title-"+this._id}};g.displayName="Window",g.propTypes={width:h.number,height:h.number,left:h.number,top:h.number,initialWidth:h.number,initialHeight:h.number,initialLeft:h.number,initialTop:h.number,minWidth:h.number,minHeight:h.number,resizable:h.bool,draggable:h.bool,title:h.any,shouldUpdateOnDrag:h.bool,stage:h.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),className:h.string,id:h.string,style:h.object,overlayStyle:h.object,autoFocus:h.bool},g.defaultProps={minWidth:E,minHeight:C,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0,autoFocus:!0},g.contextType=o.ZIndexContext;let f=g;const B=o.createPropsContext(),F=o.withIdHOC(o.withPropsContext(B,f));F.displayName="KendoReactWindow";exports.Window=F;exports.WindowPropsContext=B;exports.WindowWithoutContext=f;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),x=require("react-dom"),h=require("prop-types"),N=require("./WindowTitlebar.js"),o=require("@progress/kendo-react-common"),U=require("./WindowResizeHandlers.js"),k=require("./MiddleLayerOptimization.js"),s=require("./StageEnum.js"),y=require("./package-metadata.js"),v=require("./WindowActionsBar.js"),u=require("./constants.js"),M=require("./utils.js");function A(w){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(w){for(const t in w)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(w,t);Object.defineProperty(i,t,e.get?e:{enumerable:!0,get:()=>w[t]})}}return i.default=w,Object.freeze(i)}const a=A(R),z=A(x),S=300,m=300,E=120,C=100,p=5,g=class g extends a.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.activeElement=null,this.onKeyDown=t=>{if(this.props.modal&&o.keepFocusInContainer(t,this.element),t.target!==t.currentTarget)return;const e=this.props.minWidth||E,n=this.props.minHeight||C;if((t.metaKey||t.ctrlKey)&&this.props.resizable){switch(t.keyCode){case o.Keys.up:t.preventDefault(),n<=this.height-p&&this.setState({height:this.height-p});break;case o.Keys.down:t.preventDefault(),this.setState({height:this.height+p});break;case o.Keys.left:e<=this.width-p&&this.setState({width:this.width-p});break;case o.Keys.right:this.setState({width:this.width+p});break;default:return}this.dispatchMoveEvent(this.props.onResize,t,!1,void 0);return}if(t.altKey){switch(t.keyCode){case o.Keys.up:this.windowStage===s.windowStage.MINIMIZED?(this.handleRestore(t),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.DEFAULT})):this.windowStage===s.windowStage.DEFAULT&&(this.handleFullscreen(t),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.FULLSCREEN}));break;case o.Keys.down:this.windowStage===s.windowStage.FULLSCREEN?(this.handleRestore(t),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.DEFAULT})):this.windowStage===s.windowStage.DEFAULT&&(this.handleMinimize(t),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.MINIMIZED}));break}return}if(!t.ctrlKey)switch(t.keyCode){case o.Keys.esc:this.props.onClose&&this.handleCloseWindow(t);return;case o.Keys.up:this.setState(r=>({top:r.top-p}));break;case o.Keys.down:this.setState(r=>({top:r.top+p}));break;case o.Keys.left:this.setState(r=>({left:r.left-p}));break;case o.Keys.right:this.setState(r=>({left:r.left+p}));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!==s.windowStage.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!==s.windowStage.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.getMaxZIndex(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=m;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=S;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=S;return this.props.width!==void 0?t=this.props.width:this.props.initialWidth!==void 0&&(t=this.props.initialWidth),t},this.getInitialHeight=()=>{let t=m;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:s.windowStage.MINIMIZED,height:0}),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.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(),n=e?e.innerWidth:0,d=e?e.innerHeight:0;this.setState({left:0,top:0,width:this.props.appendTo?this.props.appendTo.offsetWidth:n,height:this.props.appendTo?this.props.appendTo.offsetHeight:d,stage:s.windowStage.FULLSCREEN}),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.FULLSCREEN})},this.handleRestore=t=>{t.preventDefault(),this.windowStage===s.windowStage.FULLSCREEN?this.setState({stage:s.windowStage.DEFAULT,left:this.windowCoordinatesState.leftBeforeAction,top:this.windowCoordinatesState.topBeforeAction,width:this.windowCoordinatesState.widthBeforeAction,height:this.windowCoordinatesState.heightBeforeAction}):this.windowStage===s.windowStage.MINIMIZED&&this.setState({stage:s.windowStage.DEFAULT,height:this.windowCoordinatesState.heightBeforeAction}),o.dispatchEvent(this.props.onStageChange,t,this,{state:s.windowStage.DEFAULT})},this.handleCloseWindow=t=>{t.preventDefault(),o.dispatchEvent(this.props.onClose,t,this,{state:void 0})},this.handleDoubleClick=t=>{this.windowStage===s.windowStage.FULLSCREEN||this.windowStage===s.windowStage.MINIMIZED?this.handleRestore(t):this.handleFullscreen(t)},this.handleResize=(t,e)=>{const n=this.props.appendTo?t.pageX-this.offSetCoordinates.x:t.pageX,d=this.props.appendTo?t.pageY-this.offSetCoordinates.y:t.pageY,r=this.width,l=this.height,D=this.props.minWidth||E,I=this.props.minHeight||C,T=this.top-d,b=this.left-n,L=n-this.left,W=d-this.top,c=Object.assign({},this.state,{isDragging:!e.end});e.direction.indexOf("n")>=0&&I-(l+T)<0&&(this.top>0&&(c.height=l+T),c.top=d),e.direction.indexOf("s")>=0&&I-W<0&&(c.height=W),e.direction.indexOf("w")>=0&&D-(r+b)<0&&(this.left>0&&(c.width=r+b),c.left=n),e.direction.indexOf("e")>=0&&D-L<0&&(c.width=L),this.setState(c),this.dispatchMoveEvent(this.props.onResize,t,!0,e.end)},this.dispatchMoveEvent=(t,e,n,d)=>{t&&t.call(void 0,{nativeEvent:e.nativeEvent?e.nativeEvent:e.originalEvent,drag:n,end:d,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===s.windowStage.FULLSCREEN){const t=this.getWindow(),e=t?t.innerWidth:0,n=t?t.innerHeight:0;this.setState({width:this.props.appendTo?this.props.appendTo.offsetWidth:e,height:this.props.appendTo?this.props.appendTo.offsetHeight:n})}},this.getCurrentZIndex=()=>!this.state||this.context===void 0?this.context?this.context:u.DEFAULT_DIALOGS_ZINDEX:this.state.zIndex>(this.context?this.context+u.ZINDEX_DIALOGS_STEP:0)?this.state.zIndex:this.context+u.ZINDEX_DIALOGS_STEP,this.getDocument=()=>this.props.appendTo?this.props.appendTo.ownerDocument:document,this.getWindow=()=>{const t=this.getDocument();return t&&t.defaultView},o.validatePackage(y.packageMetadata),this.showLicenseWatermark=o.shouldShowValidationUI(y.packageMetadata),this.state={stage:this.props.stage||s.windowStage.DEFAULT,isDragging:!1,top:0,left:0,width:S,height:m,focused:!0,zIndex:u.DEFAULT_DIALOGS_ZINDEX},this.activeElement=document.activeElement}get _id(){return this.props.id+"-accessibility-id"}componentDidMount(){this.element&&this.props.autoFocus&&this.element.focus({preventScroll:!0});const i=this.getWindow();i&&i.addEventListener("resize",this.handleBrowserWindowResize),this.setState({stage:this.props.stage||s.windowStage.DEFAULT,isDragging:!1,top:this.getInitialTop(),left:this.getInitialLeft(),width:this.getInitialWidth(),height:this.getInitialHeight(),focused:!0,zIndex:M.getMaxZIndex(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){const e=this.props.appendTo.getBoundingClientRect(),n=t.body.getBoundingClientRect();this.offSetCoordinates.x=e.left-n.left,this.offSetCoordinates.y=e.top-n.top}this.mounted=!0}componentWillUnmount(){const i=this.getWindow();i&&i.removeEventListener("resize",this.handleBrowserWindowResize),this.mounted=!1,setTimeout(()=>{var t;!this.element&&this.activeElement&&document&&(document.contains(this.activeElement)?this.activeElement.focus({preventScroll:!0}):this.activeElement.id&&((t=document.getElementById(this.activeElement.id))==null||t.focus({preventScroll:!0})))})}componentDidUpdate(i){this.props.left&&i.left!==this.props.left&&this.setState({left:this.props.left}),this.props.top&&i.top!==this.props.top&&this.setState({top:this.props.top});const t=this.getDocument();if(this.props.appendTo&&t){const e=this.props.appendTo.getBoundingClientRect(),n=t.body.getBoundingClientRect();this.offSetCoordinates.x=e.left-n.left,this.offSetCoordinates.y=e.top-n.top}this.mounted=!0}render(){const i=a.Children.toArray(this.props.children),t=this.getContent(i),e=this.getActionBar(i),n=this.getCurrentZIndex(),d=o.classNames("k-window",this.props.className,{[`k-window-${this.props.themeColor}`]:this.props.themeColor,"k-window-minimized":this.state.stage==="MINIMIZED","k-focus":this.state.focused}),r=a.createElement(o.ZIndexContext.Provider,{value:n},a.createElement(a.Fragment,null,this.props.modal&&a.createElement("div",{className:"k-overlay",style:{zIndex:n,...this.props.overlayStyle}}),a.createElement("div",{id:this.props.id,[u.DATA_DIALOGS_ID]: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:d,style:{top:this.top,left:this.left,width:this.width,height:this.height||"",zIndex:n,...this.props.style}},a.createElement(k.MiddleLayerOptimization,{shouldUpdateOnDrag:this.props.shouldUpdateOnDrag||!1,isDragging:this.state.isDragging},a.createElement(o.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,autoScroll:!1,ref:l=>this.draggable=l},a.createElement(N.WindowTitleBar,{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!==s.windowStage.MINIMIZED?a.createElement(a.Fragment,null,a.createElement("div",{className:"k-window-content"},t),e):null,this.windowStage===s.windowStage.DEFAULT&&this.props.resizable?a.createElement(U.ResizeHandlers,{onResize:this.handleResize}):null),this.showLicenseWatermark&&a.createElement(o.WatermarkOverlay,null))));return o.canUseDOM?this.props.appendTo!==null?z.createPortal(r,this.props.appendTo||document.body):r:null}get top(){return this.windowStage!==s.windowStage.FULLSCREEN?Math.max(this.props.top||this.state.top,0):0}get left(){return this.windowStage!==s.windowStage.FULLSCREEN?Math.max(this.props.left||this.state.left,0):0}get width(){let i=this.props.width||this.state.width;if(this.windowStage===s.windowStage.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===s.windowStage.FULLSCREEN){if(this.props.appendTo)return i=this.props.appendTo.offsetHeight,i;const t=this.getWindow();i=t?t.innerHeight:0}else this.windowStage===s.windowStage.MINIMIZED&&(i=0);return i}get windowStage(){return this.props.stage||this.state.stage}getActionBar(i){return i.filter(t=>t&&t.type===v.WindowActionsBar)}getContent(i){return i.filter(t=>t&&t.type!==v.WindowActionsBar)}generateTitleId(){return"window-title-"+this._id}};g.displayName="Window",g.propTypes={width:h.number,height:h.number,left:h.number,top:h.number,initialWidth:h.number,initialHeight:h.number,initialLeft:h.number,initialTop:h.number,minWidth:h.number,minHeight:h.number,resizable:h.bool,draggable:h.bool,title:h.any,shouldUpdateOnDrag:h.bool,stage:h.oneOf(["DEFAULT","MINIMIZED","FULLSCREEN"]),className:h.string,id:h.string,style:h.object,overlayStyle:h.object,autoFocus:h.bool},g.defaultProps={minWidth:E,minHeight:C,resizable:!0,draggable:!0,modal:!1,doubleClickStageChange:!0,autoFocus:!0},g.contextType=o.ZIndexContext;let f=g;const B=o.createPropsContext(),F=o.withIdHOC(o.withPropsContext(B,f));F.displayName="KendoReactWindow";exports.Window=F;exports.WindowPropsContext=B;exports.WindowWithoutContext=f;
|
package/Window.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as h from "react";
|
|
10
9
|
import * as B from "react-dom";
|
|
11
10
|
import n from "prop-types";
|
package/WindowActionsBar.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),c=require("prop-types"),i=require("@progress/kendo-react-common");function u(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const l=u(a),r=e=>{const n={layout:"end",...e},{layout:t,children:o}=n,s=i.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 l.createElement("div",{className:s},o)};r.propTypes={children:c.any,layout:c.oneOf(["start","center","end","stretched"])};exports.WindowActionsBar=r;
|
package/WindowActionsBar.mjs
CHANGED
|
@@ -5,21 +5,20 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as c from "react";
|
|
10
9
|
import e from "prop-types";
|
|
11
10
|
import { classNames as a } from "@progress/kendo-react-common";
|
|
12
11
|
const i = (n) => {
|
|
13
|
-
const
|
|
12
|
+
const o = {
|
|
14
13
|
layout: "end",
|
|
15
14
|
...n
|
|
16
|
-
}, { layout: t, children:
|
|
15
|
+
}, { layout: t, children: s } = o, r = a("k-actions", "k-window-actions", "k-actions-horizontal", "k-hstack", {
|
|
17
16
|
"k-justify-content-start": t === "start",
|
|
18
17
|
"k-justify-content-center": t === "center",
|
|
19
18
|
"k-justify-content-end": t === "end",
|
|
20
19
|
"k-justify-content-stretch": t === "stretched"
|
|
21
20
|
});
|
|
22
|
-
return /* @__PURE__ */ c.createElement("div", { className: r },
|
|
21
|
+
return /* @__PURE__ */ c.createElement("div", { className: r }, s);
|
|
23
22
|
};
|
|
24
23
|
i.propTypes = {
|
|
25
24
|
children: e.any,
|
package/WindowResizeHandlers.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),c=require("@progress/kendo-react-common");function i(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const o=i(a),l=["n","e","s","w","se","sw","ne","nw"];class d extends o.Component{render(){return o.createElement("div",{className:"k-resize-handles-wrapper"}," ",l.map((e,n)=>o.createElement(c.Draggable,{key:n,onDrag:r=>{const{event:s}=r;s.originalEvent.preventDefault(),this.props.onResize(s,{end:!1,direction:e})},onRelease:r=>{const{event:s}=r;s.originalEvent.preventDefault(),this.props.onResize(s,{end:!0,direction:e})}},o.createElement("div",{className:"k-resize-handle k-resize-"+e,style:{display:"block",touchAction:"none",userSelect:"none"}}))))}}exports.ResizeHandlers=d;
|
package/WindowResizeHandlers.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as n from "react";
|
|
10
9
|
import { Draggable as a } from "@progress/kendo-react-common";
|
|
11
10
|
const o = ["n", "e", "s", "w", "se", "sw", "ne", "nw"];
|
package/WindowTitlebar.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react"),d=require("./StageEnum.js"),r=require("@progress/kendo-react-buttons"),E=require("@progress/kendo-react-intl"),s=require("@progress/kendo-svg-icons"),n=require("./messages/index.js");function R(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(o,i,l.get?l:{enumerable:!0,get:()=>e[i]})}}return o.default=e,Object.freeze(o)}const t=R(C),S=e=>{const{children:o,onCloseButtonClick:i,onMinimizeButtonClick:l,onFullScreenButtonClick:u,onRestoreButtonClick:m,onDoubleClick:w,stage:a,forwardedRef:g,id:B}=e,c=E.useLocalization(),f=e.minimizeButton?t.createElement(e.minimizeButton,{onClick:l,stage:a}):t.createElement(r.Button,{fillMode:"flat",icon:"window-minimize",svgIcon:s.windowMinimizeIcon,className:"k-window-titlebar-action",onClick:l,"aria-label":c.toLanguageString(n.dialogsWindowMinimizeButton,n.messages[n.dialogsWindowMinimizeButton])}),k=e.maximizeButton?t.createElement(e.maximizeButton,{onClick:u,stage:a}):t.createElement(r.Button,{fillMode:"flat",icon:"window-maximize",svgIcon:s.windowIcon,className:"k-window-titlebar-action",onClick:u,"aria-label":c.toLanguageString(n.dialogsWindowMaximizeButton,n.messages[n.dialogsWindowMaximizeButton])}),b=e.restoreButton?t.createElement(e.restoreButton,{onClick:m,stage:a}):t.createElement(r.Button,{fillMode:"flat",icon:"window-restore",svgIcon:s.windowRestoreIcon,className:"k-window-titlebar-action",onClick:m,"aria-label":c.toLanguageString(n.dialogsWindowRestoreButton,n.messages[n.dialogsWindowRestoreButton])}),z=e.closeButton?t.createElement(e.closeButton,{onClick:i,stage:a}):t.createElement(r.Button,{fillMode:"flat",icon:"x",svgIcon:s.xIcon,className:"k-window-titlebar-action",onClick:i,"aria-label":c.toLanguageString(n.dialogsWindowCloseButton,n.messages[n.dialogsWindowCloseButton])});return t.createElement("div",{className:"k-window-titlebar",style:{touchAction:"none"},ref:g,onDoubleClick:w},t.createElement("span",{className:"k-window-title",id:B},o||""),t.createElement("div",{className:"k-window-titlebar-actions"},a===d.windowStage.DEFAULT&&f,a===d.windowStage.DEFAULT&&k,a!==d.windowStage.DEFAULT&&b,z))},M=t.forwardRef((e,o)=>t.createElement(S,{...e,forwardedRef:o}));exports.WindowTitleBar=M;
|
package/WindowTitlebar.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
import * as e from "react";
|
|
10
9
|
import { windowStage as c } from "./StageEnum.mjs";
|
|
11
10
|
import { Button as a } from "@progress/kendo-react-buttons";
|
package/constants.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D="data-windowid",A=10002,I=2,S=".k-window:not(.k-dialog), .k-dialog-wrapper";exports.DATA_DIALOGS_ID=D;exports.DEFAULT_DIALOGS_ZINDEX=A;exports.DIALOGS_SELECTOR=S;exports.ZINDEX_DIALOGS_STEP=I;
|
package/constants.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
const o = "data-windowid", D = 10002, n = 2, t = ".k-window:not(.k-dialog), .k-dialog-wrapper";
|
|
10
9
|
export {
|
|
11
10
|
o as DATA_DIALOGS_ID,
|
package/index.js
CHANGED
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
8
|
+
"use client";
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./Dialog.js"),t=require("./DialogActionsBar.js"),o=require("./Window.js"),n=require("./WindowActionsBar.js");exports.Dialog=i.Dialog;exports.DialogPropsContext=i.DialogPropsContext;exports.DialogActionsBar=t.DialogActionsBar;exports.Window=o.Window;exports.WindowPropsContext=o.WindowPropsContext;exports.WindowWithoutContext=o.WindowWithoutContext;exports.WindowActionsBar=n.WindowActionsBar;
|
package/index.mjs
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import { Dialog as r, DialogPropsContext as i } from "./Dialog.mjs";
|
|
10
10
|
import { DialogActionsBar as e } from "./DialogActionsBar.mjs";
|
|
11
|
-
import { Window as p, WindowPropsContext as a, WindowWithoutContext as
|
|
12
|
-
import { WindowActionsBar as
|
|
11
|
+
import { Window as p, WindowPropsContext as a, WindowWithoutContext as W } from "./Window.mjs";
|
|
12
|
+
import { WindowActionsBar as f } from "./WindowActionsBar.mjs";
|
|
13
13
|
export {
|
|
14
14
|
r as Dialog,
|
|
15
15
|
e as DialogActionsBar,
|
|
16
16
|
i as DialogPropsContext,
|
|
17
17
|
p as Window,
|
|
18
|
-
|
|
18
|
+
f as WindowActionsBar,
|
|
19
19
|
a as WindowPropsContext,
|
|
20
|
-
|
|
20
|
+
W as WindowWithoutContext
|
|
21
21
|
};
|
package/messages/index.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o="dialogs.windowMaximizeButton",i="dialogs.windowMinimizeButton",t="dialogs.windowRestoreButton",n="dialogs.windowCloseButton",s={[o]:"maximize",[i]:"minimize",[t]:"restore",[n]:"close"};exports.dialogsWindowCloseButton=n;exports.dialogsWindowMaximizeButton=o;exports.dialogsWindowMinimizeButton=i;exports.dialogsWindowRestoreButton=t;exports.messages=s;
|
package/messages/index.mjs
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
const o = "dialogs.windowMaximizeButton", i = "dialogs.windowMinimizeButton", t = "dialogs.windowRestoreButton", n = "dialogs.windowCloseButton", s = {
|
|
10
9
|
[o]: "maximize",
|
|
11
10
|
[i]: "minimize",
|
package/package-metadata.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-dialogs",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1738077062,version:"9.4.0-develop.7",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -5,14 +5,13 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";
|
|
9
8
|
const e = {
|
|
10
9
|
name: "@progress/kendo-react-dialogs",
|
|
11
10
|
productName: "KendoReact",
|
|
12
11
|
productCode: "KENDOUIREACT",
|
|
13
12
|
productCodes: ["KENDOUIREACT"],
|
|
14
|
-
publishDate:
|
|
15
|
-
version: "9.4.0-develop.
|
|
13
|
+
publishDate: 1738077062,
|
|
14
|
+
version: "9.4.0-develop.7",
|
|
16
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
17
16
|
};
|
|
18
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dialogs",
|
|
3
|
-
"version": "9.4.0-develop.
|
|
3
|
+
"version": "9.4.0-develop.7",
|
|
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,8 +26,8 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@progress/kendo-licensing": "^1.3.4",
|
|
29
|
-
"@progress/kendo-react-buttons": "9.4.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "9.4.0-develop.
|
|
29
|
+
"@progress/kendo-react-buttons": "9.4.0-develop.7",
|
|
30
|
+
"@progress/kendo-react-common": "9.4.0-develop.7",
|
|
31
31
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
32
32
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
33
33
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"package": {
|
|
54
54
|
"productName": "KendoReact",
|
|
55
55
|
"productCode": "KENDOUIREACT",
|
|
56
|
-
"publishDate":
|
|
56
|
+
"publishDate": 1738077062,
|
|
57
57
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
58
58
|
}
|
|
59
59
|
},
|
package/utils.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./constants.js"),r=(s,t,o)=>{let e=s;if(t&&t.defaultView){const i=t.querySelectorAll(l.DIALOGS_SELECTOR);let a=!1;return i.forEach(d=>{const n=t.defaultView.getComputedStyle(d,null);if(d.getAttribute(l.DATA_DIALOGS_ID)!==o&&n.zIndex!==null){const I=parseInt(n.zIndex,10);I>=e&&(e=I,a=!0)}}),a?e+l.ZINDEX_DIALOGS_STEP:e}return e};exports.getMaxZIndex=r;
|
package/utils.mjs
CHANGED
|
@@ -5,23 +5,22 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const u = (n, t, i) => {
|
|
8
|
+
import { DIALOGS_SELECTOR as f, DATA_DIALOGS_ID as i, ZINDEX_DIALOGS_STEP as s } from "./constants.mjs";
|
|
9
|
+
const A = (n, t, o) => {
|
|
11
10
|
let e = n;
|
|
12
11
|
if (t && t.defaultView) {
|
|
13
|
-
const
|
|
12
|
+
const x = t.querySelectorAll(f);
|
|
14
13
|
let l = !1;
|
|
15
|
-
return
|
|
14
|
+
return x.forEach((d) => {
|
|
16
15
|
const a = t.defaultView.getComputedStyle(d, null);
|
|
17
|
-
if (d.getAttribute(
|
|
16
|
+
if (d.getAttribute(i) !== o && a.zIndex !== null) {
|
|
18
17
|
const I = parseInt(a.zIndex, 10);
|
|
19
18
|
I >= e && (e = I, l = !0);
|
|
20
19
|
}
|
|
21
|
-
}), l ? e +
|
|
20
|
+
}), l ? e + s : e;
|
|
22
21
|
}
|
|
23
22
|
return e;
|
|
24
23
|
};
|
|
25
24
|
export {
|
|
26
|
-
|
|
25
|
+
A as getMaxZIndex
|
|
27
26
|
};
|