@progress/kendo-react-dialogs 14.5.0-develop.13 → 14.5.0-develop.14

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