1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576 | 1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
41×
41×
41×
41×
41×
41×
41×
92×
20×
72×
41×
41×
41×
41×
41×
41×
41×
39×
2×
1×
1×
20×
20×
20×
20×
5×
5×
5×
5×
20×
5×
5×
5×
5×
20×
4×
4×
4×
4×
20×
6×
6×
6×
6×
20×
1×
82×
82×
49×
1×
48×
82×
1×
41×
41×
41×
41×
41×
41×
41×
41×
41×
41×
20×
20×
20×
20×
1×
11×
1×
17×
17×
17×
17×
17×
17×
17×
17×
17×
1×
17×
1×
1×
1×
17×
17×
17×
17×
17×
1×
17×
1×
17×
17×
17×
17×
17×
17×
17×
17×
17×
17×
17×
17×
17×
17×
1×
38×
38×
38×
38×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
1×
17×
9×
8×
8×
17×
17×
17×
136×
17×
17×
17×
17×
17×
2×
2×
2×
2×
3×
3×
1×
1×
4×
4×
4×
2×
2×
2×
2×
2×
2×
1×
1×
1×
1×
1×
33×
1×
8×
8×
8×
8×
8×
8×
8×
2×
8×
2×
6×
6×
8×
8×
8×
8×
2×
8×
8×
8×
8×
5×
5×
5×
5×
3×
3×
3×
3×
2×
3×
3×
3×
1×
5×
5×
5×
5×
5×
5×
1×
5×
5×
1×
4×
1×
5×
5×
2×
2×
2×
1×
2×
2×
2×
2×
1×
6×
6×
6×
6×
3×
6×
6×
6×
6×
6×
6×
6×
3×
3×
3×
6×
3×
3×
3×
6×
6×
6×
6×
6×
5×
5×
2×
5×
5×
5×
1×
5×
5×
5×
2×
3×
6×
1×
7×
7×
7×
7×
1×
7×
7×
7×
7×
1×
6×
6×
7×
7×
7×
1×
7×
1×
1×
1×
7×
6×
6×
1×
4×
1×
1×
1×
1×
1×
1×
1×
1×
7×
7×
10×
7×
7×
7×
4×
1×
1×
261×
261×
261×
261×
1×
| define(["require", "exports", "@syncfusion/ej2-base"], function (require, exports, ej2_base_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var elementClass = ['north-west', 'north', 'north-east', 'west', 'east', 'south-west', 'south', 'south-east'];
var RESIZE_HANDLER = 'e-resize-handle';
var FOCUSED_HANDLER = 'e-focused-handle';
var DIALOG_RESIZABLE = 'e-dlg-resizable';
var RESTRICT_LEFT = ['e-restrict-left'];
var RESIZE_WITHIN_VIEWPORT = 'e-resize-viewport';
var dialogBorderResize = ['north', 'west', 'east', 'south'];
var targetElement;
var selectedHandler;
var originalWidth = 0;
var originalHeight = 0;
var originalX = 0;
var originalY = 0;
var originalMouseX = 0;
var originalMouseY = 0;
var minHeight;
var maxHeight;
var minWidth;
var maxWidth;
var containerElement;
var resizeStart = null;
var resize = null;
var resizeEnd = null;
var resizeWestWidth;
var setLeft = true;
var previousWidth = 0;
var setWidth = true;
// eslint-disable-next-line
var proxy;
/**
*
* @param {ResizeArgs} args - specifies the resize args
* @returns {void}
*/
function createResize(args) {
resizeStart = args.resizeBegin;
resize = args.resizing;
resizeEnd = args.resizeComplete;
targetElement = getDOMElement(args.element);
containerElement = getDOMElement(args.boundary);
var directions = args.direction.split(' ');
for (var i = 0; i < directions.length; i++) {
if (dialogBorderResize.indexOf(directions[i]) >= 0 && directions[i]) {
setBorderResizeElm(directions[i]);
}
else if (directions[i].trim() !== '') {
var resizeHandler = ej2_base_1.createElement('div', { className: 'e-icons ' + RESIZE_HANDLER + ' ' + 'e-' + directions[i] });
targetElement.appendChild(resizeHandler);
}
}
minHeight = args.minHeight;
minWidth = args.minWidth;
maxWidth = args.maxWidth;
maxHeight = args.maxHeight;
if (args.proxy && args.proxy.element && args.proxy.element.classList.contains('e-dialog')) {
wireEvents(args.proxy);
}
else {
wireEvents();
}
}
exports.createResize = createResize;
/**
*
* @param {string} direction - specifies the string
* @returns {void}
*/
function setBorderResizeElm(direction) {
calculateValues();
var borderBottom = ej2_base_1.createElement('span', {
attrs: {
'unselectable': 'on', 'contenteditable': 'false'
}
});
borderBottom.setAttribute('class', 'e-dialog-border-resize e-' + direction);
if (direction === 'south') {
borderBottom.style.height = '2px';
borderBottom.style.width = '100%';
borderBottom.style.bottom = '0px';
borderBottom.style.left = '0px';
}
if (direction === 'north') {
borderBottom.style.height = '2px';
borderBottom.style.width = '100%';
borderBottom.style.top = '0px';
borderBottom.style.left = '0px';
}
if (direction === 'east') {
borderBottom.style.height = '100%';
borderBottom.style.width = '2px';
borderBottom.style.right = '0px';
borderBottom.style.top = '0px';
}
if (direction === 'west') {
borderBottom.style.height = '100%';
borderBottom.style.width = '2px';
borderBottom.style.left = '0px';
borderBottom.style.top = '0px';
}
targetElement.appendChild(borderBottom);
}
/**
*
* @param {string} element - specifies the element
* @returns {HTMLElement} - returns the element
*/
function getDOMElement(element) {
var domElement;
if (!ej2_base_1.isNullOrUndefined(element)) {
if (typeof (element) === 'string') {
domElement = document.querySelector(element);
}
else {
domElement = element;
}
}
return domElement;
}
/**
* Wires up the event handlers for the resizable elements.
*
* @param {any} [args] - Optional arguments that provide context for the event handlers.
* @returns {void}
*/
function wireEvents(args) {
var context = args || this;
var resizers = targetElement.querySelectorAll('.' + RESIZE_HANDLER);
for (var i = 0; i < resizers.length; i++) {
selectedHandler = resizers[i];
ej2_base_1.EventHandler.add(selectedHandler, 'mousedown', onMouseDown, context);
var eventName = (ej2_base_1.Browser.info.name === 'msie') ? 'pointerdown' : 'touchstart';
ej2_base_1.EventHandler.add(selectedHandler, eventName, onTouchStart, context);
}
var borderResizers = targetElement.querySelectorAll('.e-dialog-border-resize');
Eif (!ej2_base_1.isNullOrUndefined(borderResizers)) {
for (var i = 0; i < borderResizers.length; i++) {
selectedHandler = borderResizers[i];
ej2_base_1.EventHandler.add(selectedHandler, 'mousedown', onMouseDown, context);
var eventName = (ej2_base_1.Browser.info.name === 'msie') ? 'pointerdown' : 'touchstart';
ej2_base_1.EventHandler.add(selectedHandler, eventName, onTouchStart, context);
}
}
}
/* istanbul ignore next */
/**
*
* @param {string} e - specifies the string
* @returns {string} - returns the string
*/
function getEventType(e) {
return (e.indexOf('mouse') > -1) ? 'mouse' : 'touch';
}
/* istanbul ignore next */
/**
*
* @param {MouseEvent} e - specifies the mouse event
* @returns {void}
*/
function onMouseDown(e) {
e.preventDefault();
targetElement = e.target.parentElement;
calculateValues();
originalMouseX = e.pageX;
originalMouseY = e.pageY;
e.target.classList.add(FOCUSED_HANDLER);
Eif (!ej2_base_1.isNullOrUndefined(resizeStart)) {
var proxy_1 = null || this;
Iif (resizeStart(e, proxy_1) === true) {
return;
}
}
Iif (this.targetEle && targetElement && targetElement.querySelector('.' + DIALOG_RESIZABLE)) {
containerElement = this.target === ('body' || 'document.body' || document.body) ? null : this.targetEle;
maxWidth = this.targetEle.clientWidth;
maxHeight = this.targetEle.clientHeight;
}
var target = (ej2_base_1.isNullOrUndefined(containerElement)) ? document : containerElement;
ej2_base_1.EventHandler.add(target, 'mousemove', onMouseMove, this);
ej2_base_1.EventHandler.add(document, 'mouseup', onMouseUp, this);
for (var i = 0; i < RESTRICT_LEFT.length; i++) {
Iif (targetElement.classList.contains(RESTRICT_LEFT[i])) {
setLeft = false;
}
else {
setLeft = true;
}
}
}
/* istanbul ignore next */
/**
*
* @param {MouseEvent} e - specifies the event
* @returns {void}
*/
function onMouseUp(e) {
var touchMoveEvent = (ej2_base_1.Browser.info.name === 'msie') ? 'pointermove' : 'touchmove';
var touchEndEvent = (ej2_base_1.Browser.info.name === 'msie') ? 'pointerup' : 'touchend';
var target = (ej2_base_1.isNullOrUndefined(containerElement)) ? document : containerElement;
var eventName = (ej2_base_1.Browser.info.name === 'msie') ? 'pointerdown' : 'touchstart';
ej2_base_1.EventHandler.remove(target, 'mousemove', onMouseMove);
ej2_base_1.EventHandler.remove(target, touchMoveEvent, onMouseMove);
ej2_base_1.EventHandler.remove(target, eventName, onMouseMove);
Eif (!ej2_base_1.isNullOrUndefined(document.body.querySelector('.' + FOCUSED_HANDLER))) {
document.body.querySelector('.' + FOCUSED_HANDLER).classList.remove(FOCUSED_HANDLER);
}
Eif (!ej2_base_1.isNullOrUndefined(resizeEnd)) {
var proxy_2 = null || this;
resizeEnd(e, proxy_2);
}
ej2_base_1.EventHandler.remove(document, 'mouseup', onMouseUp);
ej2_base_1.EventHandler.remove(document, touchEndEvent, onMouseUp);
}
/* istanbul ignore next */
/**
* @returns {void}
*/
function calculateValues() {
originalWidth = parseFloat(getComputedStyle(targetElement, null).getPropertyValue('width').replace('px', ''));
originalHeight = parseFloat(getComputedStyle(targetElement, null).getPropertyValue('height').replace('px', ''));
originalX = targetElement.getBoundingClientRect().left;
originalY = targetElement.getBoundingClientRect().top;
}
/* istanbul ignore next */
/**
*
* @param {MouseEvent} e - specifies the event
* @returns {void}
*/
function onTouchStart(e) {
targetElement = e.target.parentElement;
calculateValues();
var dialogResizeElement = targetElement.classList.contains('e-dialog');
Eif ((e.target.classList.contains(RESIZE_HANDLER) || e.target.classList.contains('e-dialog-border-resize')) && dialogResizeElement) {
e.target.classList.add(FOCUSED_HANDLER);
}
var coordinates = e.touches ? e.changedTouches[0] : e;
originalMouseX = coordinates.pageX;
originalMouseY = coordinates.pageY;
Eif (!ej2_base_1.isNullOrUndefined(resizeStart)) {
var proxy_3 = null || this;
Iif (resizeStart(e, proxy_3) === true) {
return;
}
}
var touchMoveEvent = (ej2_base_1.Browser.info.name === 'msie') ? 'pointermove' : 'touchmove';
var touchEndEvent = (ej2_base_1.Browser.info.name === 'msie') ? 'pointerup' : 'touchend';
var target = (ej2_base_1.isNullOrUndefined(containerElement)) ? document : containerElement;
ej2_base_1.EventHandler.add(target, touchMoveEvent, onMouseMove, this);
ej2_base_1.EventHandler.add(document, touchEndEvent, onMouseUp, this);
}
/* istanbul ignore next */
/**
*
* @param {MouseEvent} e - specifies the event
* @returns {void}
*/
function onMouseMove(e) {
if (e.target.classList.contains(RESIZE_HANDLER) && e.target.classList.contains(FOCUSED_HANDLER)) {
selectedHandler = e.target;
}
else Eif (!ej2_base_1.isNullOrUndefined(document.body.querySelector('.' + FOCUSED_HANDLER))) {
selectedHandler = document.body.querySelector('.' + FOCUSED_HANDLER);
}
Eif (!ej2_base_1.isNullOrUndefined(selectedHandler)) {
var resizeTowards = '';
for (var i = 0; i < elementClass.length; i++) {
if (selectedHandler.classList.contains('e-' + elementClass[i])) {
resizeTowards = elementClass[i];
}
}
Eif (!ej2_base_1.isNullOrUndefined(resize)) {
var proxy_4 = null || this;
resize(e, proxy_4);
}
switch (resizeTowards) {
case 'south':
resizeSouth(e);
break;
case 'north':
resizeNorth(e);
break;
case 'west':
resizeWest(e);
break;
case 'east':
resizeEast(e);
break;
case 'south-east':
resizeSouth(e);
resizeEast(e);
break;
case 'south-west':
resizeSouth(e);
resizeWest(e);
break;
case 'north-east':
resizeNorth(e);
resizeEast(e);
break;
case 'north-west':
resizeNorth(e);
resizeWest(e);
break;
default: break;
}
}
}
/* istanbul ignore next */
/**
*
* @param {HTMLElement} element - specifies the eleemnt
* @returns {ClientRect} - returns the client
*/
function getClientRectValues(element) {
return element.getBoundingClientRect();
}
/**
* @param {MouseEvent | TouchEvent} e - specifies the event
* @returns {void}
*/
function resizeSouth(e) {
var documentHeight = document.documentElement.clientHeight;
var calculateValue = false;
var coordinates = e.touches ? e.changedTouches[0] : e;
var currentpageY = coordinates.pageY;
var targetRectValues = getClientRectValues(targetElement);
var containerRectValues;
if (!ej2_base_1.isNullOrUndefined(containerElement)) {
containerRectValues = getClientRectValues(containerElement);
}
if (!ej2_base_1.isNullOrUndefined(containerElement)) {
calculateValue = true;
}
else Eif (ej2_base_1.isNullOrUndefined(containerElement) && ((documentHeight - currentpageY) >= 0 || (targetRectValues.top < 0))) {
calculateValue = true;
}
var calculatedHeight = originalHeight + (currentpageY - originalMouseY);
calculatedHeight = (calculatedHeight > minHeight) ? calculatedHeight : minHeight;
var containerTop = 0;
if (!ej2_base_1.isNullOrUndefined(containerElement)) {
containerTop = containerRectValues.top;
}
var borderValue = ej2_base_1.isNullOrUndefined(containerElement) ? 0 : containerElement.offsetHeight - containerElement.clientHeight;
var topWithoutborder = (targetRectValues.top - containerTop) - (borderValue / 2);
topWithoutborder = (topWithoutborder < 0) ? 0 : topWithoutborder;
if (targetRectValues.top > 0 && (topWithoutborder + calculatedHeight) > maxHeight) {
calculateValue = false;
Iif (targetElement.classList.contains(RESIZE_WITHIN_VIEWPORT)) {
return;
}
targetElement.style.height = (maxHeight - parseInt(topWithoutborder.toString(), 10)) + 'px';
return;
}
var targetTop = 0;
Eif (calculateValue) {
Iif (targetRectValues.top < 0 && (documentHeight + (targetRectValues.height + targetRectValues.top) > 0)) {
targetTop = targetRectValues.top;
if ((calculatedHeight + targetTop) <= 30) {
calculatedHeight = (targetRectValues.height - (targetRectValues.height + targetRectValues.top)) + 30;
}
}
if (((calculatedHeight + targetRectValues.top) >= maxHeight)) {
targetElement.style.height = targetRectValues.height +
(documentHeight - (targetRectValues.height + targetRectValues.top)) + 'px';
}
var calculatedTop = (ej2_base_1.isNullOrUndefined(containerElement)) ? targetTop : topWithoutborder;
Eif (calculatedHeight >= minHeight && ((calculatedHeight + calculatedTop) <= maxHeight)) {
targetElement.style.height = calculatedHeight + 'px';
}
}
}
/**
* Resizes the element towards the north direction.
*
* @param {MouseEvent | TouchEvent} e - The event object.
* @returns {void}
*/
function resizeNorth(e) {
var calculateValue = false;
var boundaryRectValues;
var pageY = (getEventType(e.type) === 'mouse') ? e.pageY : e.touches[0].pageY;
var targetRectValues = getClientRectValues(targetElement);
var borderValue = ej2_base_1.isNullOrUndefined(containerElement) ? 0 : containerElement.offsetHeight - containerElement.clientHeight;
if (!ej2_base_1.isNullOrUndefined(containerElement)) {
boundaryRectValues = getClientRectValues(containerElement);
}
Iif (!ej2_base_1.isNullOrUndefined(containerElement) && (targetRectValues.top - boundaryRectValues.top) > 0) {
calculateValue = true;
}
else if (ej2_base_1.isNullOrUndefined(containerElement) && pageY > 0) {
calculateValue = true;
}
else if (!ej2_base_1.isNullOrUndefined(containerElement) &&
(Math.floor((targetRectValues.top - boundaryRectValues.top) + targetRectValues.height +
(boundaryRectValues.bottom - targetRectValues.bottom)) - borderValue) <= maxHeight) {
calculateValue = true;
}
var currentHeight = originalHeight - (pageY - originalMouseY);
if (calculateValue) {
Eif (currentHeight >= minHeight && currentHeight <= maxHeight) {
var containerTop = 0;
if (!ej2_base_1.isNullOrUndefined(containerElement)) {
containerTop = boundaryRectValues.top;
}
var top_1 = (originalY - containerTop) + (pageY - originalMouseY);
top_1 = top_1 > 0 ? top_1 : 1;
targetElement.style.height = currentHeight + 'px';
targetElement.style.top = top_1 + 'px';
}
}
}
/**
* Resizes the element towards the west direction.
*
* @param {MouseEvent | TouchEvent} e - The event object.
* @returns {void}
*/
function resizeWest(e) {
var documentWidth = document.documentElement.clientWidth;
var calculateValue = false;
var rectValues;
if (!ej2_base_1.isNullOrUndefined(containerElement)) {
rectValues = getClientRectValues(containerElement);
}
var pageX = (getEventType(e.type) === 'mouse') ? e.pageX : e.touches[0].pageX;
var targetRectValues = getClientRectValues(targetElement);
var borderValue = ej2_base_1.isNullOrUndefined(containerElement) ? 0 : containerElement.offsetWidth - containerElement.clientWidth;
/* eslint-disable */
var left = ej2_base_1.isNullOrUndefined(containerElement) ? 0 : rectValues.left;
var containerWidth = ej2_base_1.isNullOrUndefined(containerElement) ? 0 : rectValues.width;
/* eslint-enable */
Eif (ej2_base_1.isNullOrUndefined(resizeWestWidth)) {
if (!ej2_base_1.isNullOrUndefined(containerElement)) {
resizeWestWidth = (((targetRectValues.left - left) - borderValue / 2)) + targetRectValues.width;
resizeWestWidth = resizeWestWidth + (containerWidth - borderValue - resizeWestWidth);
}
else {
resizeWestWidth = documentWidth;
}
}
if (!ej2_base_1.isNullOrUndefined(containerElement) &&
(Math.floor((targetRectValues.left - rectValues.left) + targetRectValues.width +
(rectValues.right - targetRectValues.right)) - borderValue) <= maxWidth) {
calculateValue = true;
}
else Eif (ej2_base_1.isNullOrUndefined(containerElement) && pageX >= 0) {
calculateValue = true;
}
var calculatedWidth = originalWidth - (pageX - originalMouseX);
Eif (setLeft) {
calculatedWidth = (calculatedWidth > resizeWestWidth) ? resizeWestWidth : calculatedWidth;
}
Eif (calculateValue) {
if (calculatedWidth >= minWidth && calculatedWidth <= maxWidth) {
var containerLeft = 0;
if (!ej2_base_1.isNullOrUndefined(containerElement)) {
containerLeft = rectValues.left;
}
var left_1 = (originalX - containerLeft) + (pageX - originalMouseX);
left_1 = (left_1 > 0) ? left_1 : 1;
if (calculatedWidth !== previousWidth && setWidth) {
targetElement.style.width = calculatedWidth + 'px';
}
Eif (setLeft) {
targetElement.style.left = left_1 + 'px';
if (left_1 === 1) {
setWidth = false;
}
else {
setWidth = true;
}
}
}
}
previousWidth = calculatedWidth;
}
/**
* Resizes the element towards the east direction.
*
* @param {MouseEvent | TouchEvent} e - The event object.
* @returns {void}
*/
function resizeEast(e) {
var documentWidth = document.documentElement.clientWidth;
var calculateValue = false;
var containerRectValues;
if (!ej2_base_1.isNullOrUndefined(containerElement)) {
containerRectValues = getClientRectValues(containerElement);
}
var coordinates = e.touches ? e.changedTouches[0] : e;
var pageX = coordinates.pageX;
var targetRectValues = getClientRectValues(targetElement);
if (!ej2_base_1.isNullOrUndefined(containerElement) && (((targetRectValues.left - containerRectValues.left) + targetRectValues.width) <= maxWidth
|| (targetRectValues.right - containerRectValues.left) >= targetRectValues.width)) {
calculateValue = true;
}
else Eif (ej2_base_1.isNullOrUndefined(containerElement) && (documentWidth - pageX) > 0) {
calculateValue = true;
}
var calculatedWidth = originalWidth + (pageX - originalMouseX);
var containerLeft = 0;
if (!ej2_base_1.isNullOrUndefined(containerElement)) {
containerLeft = containerRectValues.left;
}
if (((targetRectValues.left - containerLeft) + calculatedWidth) > maxWidth) {
calculateValue = false;
Iif (targetElement.classList.contains(RESIZE_WITHIN_VIEWPORT)) {
return;
}
targetElement.style.width = maxWidth - (targetRectValues.left - containerLeft) + 'px';
}
if (calculateValue) {
Eif (calculatedWidth >= minWidth && calculatedWidth <= maxWidth) {
targetElement.style.width = calculatedWidth + 'px';
}
}
}
/* istanbul ignore next */
/**
*
* @param {number} minimumHeight - specifies the number
* @returns {void}
*/
function setMinHeight(minimumHeight) {
minHeight = minimumHeight;
}
exports.setMinHeight = setMinHeight;
/**
*
* @param {number} value - specifies the number value
* @returns {void}
*/
function setMaxWidth(value) {
maxWidth = value;
}
exports.setMaxWidth = setMaxWidth;
/**
*
* @param {number} value - specifies the number value
* @returns {void}
*/
function setMaxHeight(value) {
maxHeight = value;
}
exports.setMaxHeight = setMaxHeight;
/**
* @returns {void}
*/
function removeResize() {
var handlers = targetElement.querySelectorAll('.' + RESIZE_HANDLER);
for (var i = 0; i < handlers.length; i++) {
ej2_base_1.detach(handlers[i]);
}
var borderResizers = targetElement.querySelectorAll('.e-dialog-border-resize');
Eif (!ej2_base_1.isNullOrUndefined(borderResizers)) {
for (var i = 0; i < borderResizers.length; i++) {
ej2_base_1.detach(borderResizers[i]);
}
}
}
exports.removeResize = removeResize;
/**
* @returns {void}
*/
function resizeDestroy() {
targetElement = null;
selectedHandler = null;
containerElement = null;
resizeWestWidth = null;
}
exports.resizeDestroy = resizeDestroy;
});
|