@progress/kendo-react-dialogs 14.5.0-develop.9 → 15.0.0-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Window.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
  };