gridstack 12.3.3 → 12.4.0

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.
Files changed (142) hide show
  1. package/dist/angular/esm2020/lib/base-widget.mjs +2 -2
  2. package/dist/angular/esm2020/lib/gridstack-item.component.mjs +2 -2
  3. package/dist/angular/esm2020/lib/gridstack.component.mjs +4 -2
  4. package/dist/angular/esm2020/lib/gridstack.module.mjs +2 -2
  5. package/dist/angular/esm2020/lib/types.mjs +2 -2
  6. package/dist/angular/fesm2015/gridstack-angular.mjs +6 -4
  7. package/dist/angular/fesm2015/gridstack-angular.mjs.map +1 -1
  8. package/dist/angular/fesm2020/gridstack-angular.mjs +7 -5
  9. package/dist/angular/fesm2020/gridstack-angular.mjs.map +1 -1
  10. package/dist/angular/lib/gridstack-item.component.d.ts +1 -1
  11. package/dist/angular/lib/gridstack.component.d.ts +4 -4
  12. package/dist/angular/lib/types.d.ts +1 -1
  13. package/dist/angular/package.json +1 -1
  14. package/dist/angular/projects/lib/src/index.d.ts +5 -0
  15. package/dist/angular/projects/lib/src/index.js +9 -0
  16. package/dist/angular/projects/lib/src/index.js.map +1 -0
  17. package/dist/angular/projects/lib/src/lib/base-widget.d.ts +56 -0
  18. package/dist/angular/projects/lib/src/lib/base-widget.js +94 -0
  19. package/dist/angular/projects/lib/src/lib/base-widget.js.map +1 -0
  20. package/dist/angular/projects/lib/src/lib/gridstack-item.component.d.ts +76 -0
  21. package/dist/angular/projects/lib/src/lib/gridstack-item.component.js +112 -0
  22. package/dist/angular/projects/lib/src/lib/gridstack-item.component.js.map +1 -0
  23. package/dist/angular/projects/lib/src/lib/gridstack.component.d.ts +233 -0
  24. package/dist/angular/projects/lib/src/lib/gridstack.component.js +457 -0
  25. package/dist/angular/projects/lib/src/lib/gridstack.component.js.map +1 -0
  26. package/dist/angular/projects/lib/src/lib/gridstack.module.d.ts +29 -0
  27. package/dist/angular/projects/lib/src/lib/gridstack.module.js +52 -0
  28. package/dist/angular/projects/lib/src/lib/gridstack.module.js.map +1 -0
  29. package/dist/angular/projects/lib/src/lib/types.d.ts +51 -0
  30. package/dist/angular/projects/lib/src/lib/types.js +6 -0
  31. package/dist/angular/projects/lib/src/lib/types.js.map +1 -0
  32. package/dist/angular/src/base-widget.ts +13 -13
  33. package/dist/angular/src/gridstack-item.component.ts +5 -5
  34. package/dist/angular/src/gridstack.component.ts +34 -32
  35. package/dist/angular/src/gridstack.module.ts +4 -4
  36. package/dist/angular/src/types.ts +3 -2
  37. package/dist/gridstack-all.js +1 -1
  38. package/dist/gridstack-all.js.LICENSE.txt +1 -1
  39. package/dist/gridstack-all.js.map +1 -1
  40. package/dist/gridstack.css +1 -1
  41. package/dist/src/dd-base-impl.d.ts +1 -1
  42. package/dist/src/dd-base-impl.js +1 -1
  43. package/dist/src/dd-base-impl.js.map +1 -1
  44. package/dist/src/dd-draggable.d.ts +1 -1
  45. package/dist/src/dd-draggable.js +1 -1
  46. package/dist/src/dd-draggable.js.map +1 -1
  47. package/dist/src/dd-droppable.d.ts +1 -1
  48. package/dist/src/dd-droppable.js +7 -1
  49. package/dist/src/dd-droppable.js.map +1 -1
  50. package/dist/src/dd-element.d.ts +1 -1
  51. package/dist/src/dd-element.js +1 -1
  52. package/dist/src/dd-element.js.map +1 -1
  53. package/dist/src/dd-gridstack.d.ts +1 -1
  54. package/dist/src/dd-gridstack.js +1 -1
  55. package/dist/src/dd-gridstack.js.map +1 -1
  56. package/dist/src/dd-manager.d.ts +1 -1
  57. package/dist/src/dd-manager.js +1 -1
  58. package/dist/src/dd-manager.js.map +1 -1
  59. package/dist/src/dd-resizable-handle.d.ts +5 -4
  60. package/dist/src/dd-resizable-handle.js +23 -8
  61. package/dist/src/dd-resizable-handle.js.map +1 -1
  62. package/dist/src/dd-resizable.d.ts +3 -5
  63. package/dist/src/dd-resizable.js +5 -10
  64. package/dist/src/dd-resizable.js.map +1 -1
  65. package/dist/src/dd-touch.d.ts +1 -1
  66. package/dist/src/dd-touch.js +1 -1
  67. package/dist/src/dd-touch.js.map +1 -1
  68. package/dist/src/gridstack-engine.d.ts +1 -1
  69. package/dist/src/gridstack-engine.js +7 -1
  70. package/dist/src/gridstack-engine.js.map +1 -1
  71. package/dist/src/gridstack.d.ts +1 -2
  72. package/dist/src/gridstack.js +9 -18
  73. package/dist/src/gridstack.js.map +1 -1
  74. package/dist/src/gridstack.scss +1 -1
  75. package/dist/src/types.d.ts +11 -6
  76. package/dist/src/types.js +1 -1
  77. package/dist/src/types.js.map +1 -1
  78. package/dist/src/utils.d.ts +1 -270
  79. package/dist/src/utils.js +37 -31
  80. package/dist/src/utils.js.map +1 -1
  81. package/doc/API.md +166 -165
  82. package/package.json +5 -5
  83. package/dist/dd-base-impl.d.ts +0 -69
  84. package/dist/dd-base-impl.js +0 -70
  85. package/dist/dd-base-impl.js.map +0 -1
  86. package/dist/dd-draggable.d.ts +0 -20
  87. package/dist/dd-draggable.js +0 -364
  88. package/dist/dd-draggable.js.map +0 -1
  89. package/dist/dd-droppable.d.ts +0 -26
  90. package/dist/dd-droppable.js +0 -149
  91. package/dist/dd-droppable.js.map +0 -1
  92. package/dist/dd-element.d.ts +0 -27
  93. package/dist/dd-element.js +0 -91
  94. package/dist/dd-element.js.map +0 -1
  95. package/dist/dd-gridstack.d.ts +0 -82
  96. package/dist/dd-gridstack.js +0 -165
  97. package/dist/dd-gridstack.js.map +0 -1
  98. package/dist/dd-manager.d.ts +0 -43
  99. package/dist/dd-manager.js +0 -14
  100. package/dist/dd-manager.js.map +0 -1
  101. package/dist/dd-resizable-handle.d.ts +0 -18
  102. package/dist/dd-resizable-handle.js +0 -113
  103. package/dist/dd-resizable-handle.js.map +0 -1
  104. package/dist/dd-resizable.d.ts +0 -30
  105. package/dist/dd-resizable.js +0 -304
  106. package/dist/dd-resizable.js.map +0 -1
  107. package/dist/dd-touch.d.ts +0 -33
  108. package/dist/dd-touch.js +0 -145
  109. package/dist/dd-touch.js.map +0 -1
  110. package/dist/gridstack-engine.d.ts +0 -321
  111. package/dist/gridstack-engine.js +0 -1272
  112. package/dist/gridstack-engine.js.map +0 -1
  113. package/dist/gridstack.d.ts +0 -802
  114. package/dist/gridstack.js +0 -2872
  115. package/dist/gridstack.js.map +0 -1
  116. package/dist/spec/gridstack-engine-spec.d.ts +0 -1
  117. package/dist/spec/gridstack-engine-spec.js +0 -358
  118. package/dist/spec/gridstack-engine-spec.js.map +0 -1
  119. package/dist/spec/gridstack-spec.d.ts +0 -1
  120. package/dist/spec/gridstack-spec.js +0 -1780
  121. package/dist/spec/gridstack-spec.js.map +0 -1
  122. package/dist/spec/integration/gridstack-integration.spec.d.ts +0 -1
  123. package/dist/spec/integration/gridstack-integration.spec.js +0 -171
  124. package/dist/spec/integration/gridstack-integration.spec.js.map +0 -1
  125. package/dist/spec/regression-spec.d.ts +0 -1
  126. package/dist/spec/regression-spec.js +0 -100
  127. package/dist/spec/regression-spec.js.map +0 -1
  128. package/dist/spec/utils-spec.d.ts +0 -1
  129. package/dist/spec/utils-spec.js +0 -243
  130. package/dist/spec/utils-spec.js.map +0 -1
  131. package/dist/types.d.ts +0 -427
  132. package/dist/types.js +0 -38
  133. package/dist/types.js.map +0 -1
  134. package/dist/utils.d.ts +0 -283
  135. package/dist/utils.js +0 -787
  136. package/dist/utils.js.map +0 -1
  137. package/dist/vitest.config.d.ts +0 -2
  138. package/dist/vitest.config.js +0 -74
  139. package/dist/vitest.config.js.map +0 -1
  140. package/dist/vitest.setup.d.ts +0 -1
  141. package/dist/vitest.setup.js +0 -90
  142. package/dist/vitest.setup.js.map +0 -1
@@ -1,43 +0,0 @@
1
- /**
2
- * dd-manager.ts 12.3.2
3
- * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
4
- */
5
- import { DDDraggable } from './dd-draggable';
6
- import { DDDroppable } from './dd-droppable';
7
- import { DDResizable } from './dd-resizable';
8
- /**
9
- * Global state manager for all Drag & Drop instances.
10
- *
11
- * This class maintains shared state across all drag & drop operations,
12
- * ensuring proper coordination between multiple grids and drag/drop elements.
13
- * All properties are static to provide global access throughout the DD system.
14
- */
15
- export declare class DDManager {
16
- /**
17
- * Controls drag operation pausing behavior.
18
- * If set to true or a number (milliseconds), dragging placement and collision
19
- * detection will only happen after the user pauses movement.
20
- * This improves performance during rapid mouse movements.
21
- */
22
- static pauseDrag: boolean | number;
23
- /**
24
- * Flag indicating if a mouse down event was already handled.
25
- * Prevents multiple handlers from processing the same mouse event.
26
- */
27
- static mouseHandled: boolean;
28
- /**
29
- * Reference to the element currently being dragged.
30
- * Used to track the active drag operation across the system.
31
- */
32
- static dragElement: DDDraggable;
33
- /**
34
- * Reference to the drop target element currently under the cursor.
35
- * Used to handle drop operations and hover effects.
36
- */
37
- static dropElement: DDDroppable;
38
- /**
39
- * Reference to the element currently being resized.
40
- * Helps ignore nested grid resize handles during resize operations.
41
- */
42
- static overResizeElement: DDResizable;
43
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * dd-manager.ts 12.3.2
3
- * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
4
- */
5
- /**
6
- * Global state manager for all Drag & Drop instances.
7
- *
8
- * This class maintains shared state across all drag & drop operations,
9
- * ensuring proper coordination between multiple grids and drag/drop elements.
10
- * All properties are static to provide global access throughout the DD system.
11
- */
12
- export class DDManager {
13
- }
14
- //# sourceMappingURL=dd-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dd-manager.js","sourceRoot":"","sources":["../src/dd-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;;;;;GAMG;AACH,MAAM,OAAO,SAAS;CAiCrB","sourcesContent":["/**\n * dd-manager.ts 12.3.2\n * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license\n */\n\nimport { DDDraggable } from './dd-draggable';\nimport { DDDroppable } from './dd-droppable';\nimport { DDResizable } from './dd-resizable';\n\n/**\n * Global state manager for all Drag & Drop instances.\n * \n * This class maintains shared state across all drag & drop operations,\n * ensuring proper coordination between multiple grids and drag/drop elements.\n * All properties are static to provide global access throughout the DD system.\n */\nexport class DDManager {\n /**\n * Controls drag operation pausing behavior.\n * If set to true or a number (milliseconds), dragging placement and collision\n * detection will only happen after the user pauses movement.\n * This improves performance during rapid mouse movements.\n */\n public static pauseDrag: boolean | number;\n\n /**\n * Flag indicating if a mouse down event was already handled.\n * Prevents multiple handlers from processing the same mouse event.\n */\n public static mouseHandled: boolean;\n\n /**\n * Reference to the element currently being dragged.\n * Used to track the active drag operation across the system.\n */\n public static dragElement: DDDraggable;\n\n /**\n * Reference to the drop target element currently under the cursor.\n * Used to handle drop operations and hover effects.\n */\n public static dropElement: DDDroppable;\n\n /**\n * Reference to the element currently being resized.\n * Helps ignore nested grid resize handles during resize operations.\n */\n public static overResizeElement: DDResizable;\n\n}\n"]}
@@ -1,18 +0,0 @@
1
- /**
2
- * dd-resizable-handle.ts 12.3.2
3
- * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
4
- */
5
- import { GridItemHTMLElement } from './gridstack';
6
- export interface DDResizableHandleOpt {
7
- start?: (event: any) => void;
8
- move?: (event: any) => void;
9
- stop?: (event: any) => void;
10
- }
11
- export declare class DDResizableHandle {
12
- protected host: GridItemHTMLElement;
13
- protected dir: string;
14
- protected option: DDResizableHandleOpt;
15
- constructor(host: GridItemHTMLElement, dir: string, option: DDResizableHandleOpt);
16
- /** call this when resize handle needs to be removed and cleaned up */
17
- destroy(): DDResizableHandle;
18
- }
@@ -1,113 +0,0 @@
1
- /**
2
- * dd-resizable-handle.ts 12.3.2
3
- * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
4
- */
5
- import { isTouch, pointerdown, touchend, touchmove, touchstart } from './dd-touch';
6
- class DDResizableHandle {
7
- constructor(host, dir, option) {
8
- this.host = host;
9
- this.dir = dir;
10
- this.option = option;
11
- /** @internal true after we've moved enough pixels to start a resize */
12
- this.moving = false;
13
- // create var event binding so we can easily remove and still look like TS methods (unlike anonymous functions)
14
- this._mouseDown = this._mouseDown.bind(this);
15
- this._mouseMove = this._mouseMove.bind(this);
16
- this._mouseUp = this._mouseUp.bind(this);
17
- this._keyEvent = this._keyEvent.bind(this);
18
- this._init();
19
- }
20
- /** @internal */
21
- _init() {
22
- const el = this.el = document.createElement('div');
23
- el.classList.add('ui-resizable-handle');
24
- el.classList.add(`${DDResizableHandle.prefix}${this.dir}`);
25
- el.style.zIndex = '100';
26
- el.style.userSelect = 'none';
27
- this.host.appendChild(this.el);
28
- this.el.addEventListener('mousedown', this._mouseDown);
29
- if (isTouch) {
30
- this.el.addEventListener('touchstart', touchstart);
31
- this.el.addEventListener('pointerdown', pointerdown);
32
- // this.el.style.touchAction = 'none'; // not needed unlike pointerdown doc comment
33
- }
34
- return this;
35
- }
36
- /** call this when resize handle needs to be removed and cleaned up */
37
- destroy() {
38
- if (this.moving)
39
- this._mouseUp(this.mouseDownEvent);
40
- this.el.removeEventListener('mousedown', this._mouseDown);
41
- if (isTouch) {
42
- this.el.removeEventListener('touchstart', touchstart);
43
- this.el.removeEventListener('pointerdown', pointerdown);
44
- }
45
- this.host.removeChild(this.el);
46
- delete this.el;
47
- delete this.host;
48
- return this;
49
- }
50
- /** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
51
- _mouseDown(e) {
52
- this.mouseDownEvent = e;
53
- document.addEventListener('mousemove', this._mouseMove, { capture: true, passive: true }); // capture, not bubble
54
- document.addEventListener('mouseup', this._mouseUp, true);
55
- if (isTouch) {
56
- this.el.addEventListener('touchmove', touchmove);
57
- this.el.addEventListener('touchend', touchend);
58
- }
59
- e.stopPropagation();
60
- e.preventDefault();
61
- }
62
- /** @internal */
63
- _mouseMove(e) {
64
- const s = this.mouseDownEvent;
65
- if (this.moving) {
66
- this._triggerEvent('move', e);
67
- }
68
- else if (Math.abs(e.x - s.x) + Math.abs(e.y - s.y) > 2) {
69
- // don't start unless we've moved at least 3 pixels
70
- this.moving = true;
71
- this._triggerEvent('start', this.mouseDownEvent);
72
- this._triggerEvent('move', e);
73
- // now track keyboard events to cancel
74
- document.addEventListener('keydown', this._keyEvent);
75
- }
76
- e.stopPropagation();
77
- // e.preventDefault(); passive = true
78
- }
79
- /** @internal */
80
- _mouseUp(e) {
81
- if (this.moving) {
82
- this._triggerEvent('stop', e);
83
- document.removeEventListener('keydown', this._keyEvent);
84
- }
85
- document.removeEventListener('mousemove', this._mouseMove, true);
86
- document.removeEventListener('mouseup', this._mouseUp, true);
87
- if (isTouch) {
88
- this.el.removeEventListener('touchmove', touchmove);
89
- this.el.removeEventListener('touchend', touchend);
90
- }
91
- delete this.moving;
92
- delete this.mouseDownEvent;
93
- e.stopPropagation();
94
- e.preventDefault();
95
- }
96
- /** @internal call when keys are being pressed - use Esc to cancel */
97
- _keyEvent(e) {
98
- if (e.key === 'Escape') {
99
- this.host.gridstackNode?.grid?.engine.restoreInitial();
100
- this._mouseUp(this.mouseDownEvent);
101
- }
102
- }
103
- /** @internal */
104
- _triggerEvent(name, event) {
105
- if (this.option[name])
106
- this.option[name](event);
107
- return this;
108
- }
109
- }
110
- /** @internal */
111
- DDResizableHandle.prefix = 'ui-resizable-';
112
- export { DDResizableHandle };
113
- //# sourceMappingURL=dd-resizable-handle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dd-resizable-handle.js","sourceRoot":"","sources":["../src/dd-resizable-handle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AASnF,MAAa,iBAAiB;IAU5B,YAAsB,IAAyB,EAAY,GAAW,EAAY,MAA4B;QAAxF,SAAI,GAAJ,IAAI,CAAqB;QAAY,QAAG,GAAH,GAAG,CAAQ;QAAY,WAAM,GAAN,MAAM,CAAsB;QAP9G,uEAAuE;QAC7D,WAAM,GAAG,KAAK,CAAC;QAOvB,+GAA+G;QAC/G,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAA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AAC;IAED,qEAAqE;IAC3D,SAAS,CAAC,CAAgB;QAClC,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,cAAc,EAAE,CAAC;YACvD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SACpC;IACH,CAAC;IAID,gBAAgB;IACN,aAAa,CAAC,IAAY,EAAE,KAAiB;QACrD,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;;AA1GD,gBAAgB;AACC,wBAAM,GAAG,eAAe,AAAlB,CAAmB;SAR/B,iBAAiB","sourcesContent":["/**\n * dd-resizable-handle.ts 12.3.2\n * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license\n */\n\nimport { isTouch, pointerdown, touchend, touchmove, touchstart } from './dd-touch';\nimport { GridItemHTMLElement } from './gridstack';\n\nexport interface DDResizableHandleOpt {\n start?: (event) => void;\n move?: (event) => void;\n stop?: (event) => void;\n}\n\nexport class DDResizableHandle {\n /** @internal */\n protected el: HTMLElement;\n /** @internal true after we've moved enough pixels to start a resize */\n protected moving = false;\n /** @internal */\n protected mouseDownEvent: MouseEvent;\n /** @internal */\n protected static prefix = 'ui-resizable-';\n\n constructor(protected host: GridItemHTMLElement, protected dir: string, protected option: DDResizableHandleOpt) {\n // create var event binding so we can easily remove and still look like TS methods (unlike anonymous functions)\n this._mouseDown = this._mouseDown.bind(this);\n this._mouseMove = this._mouseMove.bind(this);\n this._mouseUp = this._mouseUp.bind(this);\n this._keyEvent = this._keyEvent.bind(this);\n\n this._init();\n }\n\n /** @internal */\n protected _init(): DDResizableHandle {\n const el = this.el = document.createElement('div');\n el.classList.add('ui-resizable-handle');\n el.classList.add(`${DDResizableHandle.prefix}${this.dir}`);\n el.style.zIndex = '100';\n el.style.userSelect = 'none';\n this.host.appendChild(this.el);\n this.el.addEventListener('mousedown', this._mouseDown);\n if (isTouch) {\n this.el.addEventListener('touchstart', touchstart);\n this.el.addEventListener('pointerdown', pointerdown);\n // this.el.style.touchAction = 'none'; // not needed unlike pointerdown doc comment\n }\n return this;\n }\n\n /** call this when resize handle needs to be removed and cleaned up */\n public destroy(): DDResizableHandle {\n if (this.moving) this._mouseUp(this.mouseDownEvent);\n this.el.removeEventListener('mousedown', this._mouseDown);\n if (isTouch) {\n this.el.removeEventListener('touchstart', touchstart);\n this.el.removeEventListener('pointerdown', pointerdown);\n }\n this.host.removeChild(this.el);\n delete this.el;\n delete this.host;\n return this;\n }\n\n /** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */\n protected _mouseDown(e: MouseEvent): void {\n this.mouseDownEvent = e;\n document.addEventListener('mousemove', this._mouseMove, { capture: true, passive: true}); // capture, not bubble\n document.addEventListener('mouseup', this._mouseUp, true);\n if (isTouch) {\n this.el.addEventListener('touchmove', touchmove);\n this.el.addEventListener('touchend', touchend);\n }\n e.stopPropagation();\n e.preventDefault();\n }\n\n /** @internal */\n protected _mouseMove(e: MouseEvent): void {\n const s = this.mouseDownEvent;\n if (this.moving) {\n this._triggerEvent('move', e);\n } else if (Math.abs(e.x - s.x) + Math.abs(e.y - s.y) > 2) {\n // don't start unless we've moved at least 3 pixels\n this.moving = true;\n this._triggerEvent('start', this.mouseDownEvent);\n this._triggerEvent('move', e);\n // now track keyboard events to cancel\n document.addEventListener('keydown', this._keyEvent);\n }\n e.stopPropagation();\n // e.preventDefault(); passive = true\n }\n\n /** @internal */\n protected _mouseUp(e: MouseEvent): void {\n if (this.moving) {\n this._triggerEvent('stop', e);\n document.removeEventListener('keydown', this._keyEvent);\n }\n document.removeEventListener('mousemove', this._mouseMove, true);\n document.removeEventListener('mouseup', this._mouseUp, true);\n if (isTouch) {\n this.el.removeEventListener('touchmove', touchmove);\n this.el.removeEventListener('touchend', touchend);\n }\n delete this.moving;\n delete this.mouseDownEvent;\n e.stopPropagation();\n e.preventDefault();\n }\n\n /** @internal call when keys are being pressed - use Esc to cancel */\n protected _keyEvent(e: KeyboardEvent): void {\n if (e.key === 'Escape') {\n this.host.gridstackNode?.grid?.engine.restoreInitial();\n this._mouseUp(this.mouseDownEvent);\n }\n }\n\n\n\n /** @internal */\n protected _triggerEvent(name: string, event: MouseEvent): DDResizableHandle {\n if (this.option[name]) this.option[name](event);\n return this;\n }\n}\n"]}
@@ -1,30 +0,0 @@
1
- /**
2
- * dd-resizable.ts 12.3.2
3
- * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
4
- */
5
- import { DDBaseImplement, HTMLElementExtendOpt } from './dd-base-impl';
6
- import { DDUIData, GridItemHTMLElement } from './types';
7
- export interface DDResizableOpt {
8
- autoHide?: boolean;
9
- handles?: string;
10
- maxHeight?: number;
11
- maxHeightMoveUp?: number;
12
- maxWidth?: number;
13
- maxWidthMoveLeft?: number;
14
- minHeight?: number;
15
- minWidth?: number;
16
- start?: (event: Event, ui: DDUIData) => void;
17
- stop?: (event: Event) => void;
18
- resize?: (event: Event, ui: DDUIData) => void;
19
- }
20
- export declare class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt<DDResizableOpt> {
21
- el: GridItemHTMLElement;
22
- option: DDResizableOpt;
23
- constructor(el: GridItemHTMLElement, option?: DDResizableOpt);
24
- on(event: 'resizestart' | 'resize' | 'resizestop', callback: (event: DragEvent) => void): void;
25
- off(event: 'resizestart' | 'resize' | 'resizestop'): void;
26
- enable(): void;
27
- disable(): void;
28
- destroy(): void;
29
- updateOption(opts: DDResizableOpt): DDResizable;
30
- }
@@ -1,304 +0,0 @@
1
- /**
2
- * dd-resizable.ts 12.3.2
3
- * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
4
- */
5
- import { DDResizableHandle } from './dd-resizable-handle';
6
- import { DDBaseImplement } from './dd-base-impl';
7
- import { Utils } from './utils';
8
- import { DDManager } from './dd-manager';
9
- class DDResizable extends DDBaseImplement {
10
- // have to be public else complains for HTMLElementExtendOpt ?
11
- constructor(el, option = {}) {
12
- super();
13
- this.el = el;
14
- this.option = option;
15
- /** @internal */
16
- this.rectScale = { x: 1, y: 1 };
17
- /** @internal */
18
- this._ui = () => {
19
- const containmentEl = this.el.parentElement;
20
- const containmentRect = containmentEl.getBoundingClientRect();
21
- const newRect = {
22
- width: this.originalRect.width,
23
- height: this.originalRect.height + this.scrolled,
24
- left: this.originalRect.left,
25
- top: this.originalRect.top - this.scrolled
26
- };
27
- const rect = this.temporalRect || newRect;
28
- return {
29
- position: {
30
- left: (rect.left - containmentRect.left) * this.rectScale.x,
31
- top: (rect.top - containmentRect.top) * this.rectScale.y
32
- },
33
- size: {
34
- width: rect.width * this.rectScale.x,
35
- height: rect.height * this.rectScale.y
36
- }
37
- /* Gridstack ONLY needs position set above... keep around in case.
38
- element: [this.el], // The object representing the element to be resized
39
- helper: [], // TODO: not support yet - The object representing the helper that's being resized
40
- originalElement: [this.el],// we don't wrap here, so simplify as this.el //The object representing the original element before it is wrapped
41
- originalPosition: { // The position represented as { left, top } before the resizable is resized
42
- left: this.originalRect.left - containmentRect.left,
43
- top: this.originalRect.top - containmentRect.top
44
- },
45
- originalSize: { // The size represented as { width, height } before the resizable is resized
46
- width: this.originalRect.width,
47
- height: this.originalRect.height
48
- }
49
- */
50
- };
51
- };
52
- // create var event binding so we can easily remove and still look like TS methods (unlike anonymous functions)
53
- this._mouseOver = this._mouseOver.bind(this);
54
- this._mouseOut = this._mouseOut.bind(this);
55
- this.enable();
56
- this._setupAutoHide(this.option.autoHide);
57
- this._setupHandlers();
58
- }
59
- on(event, callback) {
60
- super.on(event, callback);
61
- }
62
- off(event) {
63
- super.off(event);
64
- }
65
- enable() {
66
- super.enable();
67
- this.el.classList.remove('ui-resizable-disabled');
68
- this._setupAutoHide(this.option.autoHide);
69
- }
70
- disable() {
71
- super.disable();
72
- this.el.classList.add('ui-resizable-disabled');
73
- this._setupAutoHide(false);
74
- }
75
- destroy() {
76
- this._removeHandlers();
77
- this._setupAutoHide(false);
78
- delete this.el;
79
- super.destroy();
80
- }
81
- updateOption(opts) {
82
- const updateHandles = (opts.handles && opts.handles !== this.option.handles);
83
- const updateAutoHide = (opts.autoHide && opts.autoHide !== this.option.autoHide);
84
- Object.keys(opts).forEach(key => this.option[key] = opts[key]);
85
- if (updateHandles) {
86
- this._removeHandlers();
87
- this._setupHandlers();
88
- }
89
- if (updateAutoHide) {
90
- this._setupAutoHide(this.option.autoHide);
91
- }
92
- return this;
93
- }
94
- /** @internal turns auto hide on/off */
95
- _setupAutoHide(auto) {
96
- if (auto) {
97
- this.el.classList.add('ui-resizable-autohide');
98
- // use mouseover and not mouseenter to get better performance and track for nested cases
99
- this.el.addEventListener('mouseover', this._mouseOver);
100
- this.el.addEventListener('mouseout', this._mouseOut);
101
- }
102
- else {
103
- this.el.classList.remove('ui-resizable-autohide');
104
- this.el.removeEventListener('mouseover', this._mouseOver);
105
- this.el.removeEventListener('mouseout', this._mouseOut);
106
- if (DDManager.overResizeElement === this) {
107
- delete DDManager.overResizeElement;
108
- }
109
- }
110
- return this;
111
- }
112
- /** @internal */
113
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
114
- _mouseOver(e) {
115
- // console.log(`${count++} pre-enter ${(this.el as GridItemHTMLElement).gridstackNode._id}`)
116
- // already over a child, ignore. Ideally we just call e.stopPropagation() but see https://github.com/gridstack/gridstack.js/issues/2018
117
- if (DDManager.overResizeElement || DDManager.dragElement)
118
- return;
119
- DDManager.overResizeElement = this;
120
- // console.log(`${count++} enter ${(this.el as GridItemHTMLElement).gridstackNode._id}`)
121
- this.el.classList.remove('ui-resizable-autohide');
122
- }
123
- /** @internal */
124
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
125
- _mouseOut(e) {
126
- // console.log(`${count++} pre-leave ${(this.el as GridItemHTMLElement).gridstackNode._id}`)
127
- if (DDManager.overResizeElement !== this)
128
- return;
129
- delete DDManager.overResizeElement;
130
- // console.log(`${count++} leave ${(this.el as GridItemHTMLElement).gridstackNode._id}`)
131
- this.el.classList.add('ui-resizable-autohide');
132
- }
133
- /** @internal */
134
- _setupHandlers() {
135
- this.handlers = this.option.handles.split(',')
136
- .map(dir => dir.trim())
137
- .map(dir => new DDResizableHandle(this.el, dir, {
138
- start: (event) => {
139
- this._resizeStart(event);
140
- },
141
- stop: (event) => {
142
- this._resizeStop(event);
143
- },
144
- move: (event) => {
145
- this._resizing(event, dir);
146
- }
147
- }));
148
- return this;
149
- }
150
- /** @internal */
151
- _resizeStart(event) {
152
- this.sizeToContent = Utils.shouldSizeToContent(this.el.gridstackNode, true); // strick true only and not number
153
- this.originalRect = this.el.getBoundingClientRect();
154
- this.scrollEl = Utils.getScrollElement(this.el);
155
- this.scrollY = this.scrollEl.scrollTop;
156
- this.scrolled = 0;
157
- this.startEvent = event;
158
- this._setupHelper();
159
- this._applyChange();
160
- const ev = Utils.initEvent(event, { type: 'resizestart', target: this.el });
161
- if (this.option.start) {
162
- this.option.start(ev, this._ui());
163
- }
164
- this.el.classList.add('ui-resizable-resizing');
165
- this.triggerEvent('resizestart', ev);
166
- return this;
167
- }
168
- /** @internal */
169
- _resizing(event, dir) {
170
- this.scrolled = this.scrollEl.scrollTop - this.scrollY;
171
- this.temporalRect = this._getChange(event, dir);
172
- this._applyChange();
173
- const ev = Utils.initEvent(event, { type: 'resize', target: this.el });
174
- if (this.option.resize) {
175
- this.option.resize(ev, this._ui());
176
- }
177
- this.triggerEvent('resize', ev);
178
- return this;
179
- }
180
- /** @internal */
181
- _resizeStop(event) {
182
- const ev = Utils.initEvent(event, { type: 'resizestop', target: this.el });
183
- // Remove style attr now, so the stop handler can rebuild style attrs
184
- this._cleanHelper();
185
- if (this.option.stop) {
186
- this.option.stop(ev); // Note: ui() not used by gridstack so don't pass
187
- }
188
- this.el.classList.remove('ui-resizable-resizing');
189
- this.triggerEvent('resizestop', ev);
190
- delete this.startEvent;
191
- delete this.originalRect;
192
- delete this.temporalRect;
193
- delete this.scrollY;
194
- delete this.scrolled;
195
- return this;
196
- }
197
- /** @internal */
198
- _setupHelper() {
199
- this.elOriginStyleVal = DDResizable._originStyleProp.map(prop => this.el.style[prop]);
200
- this.parentOriginStylePosition = this.el.parentElement.style.position;
201
- const parent = this.el.parentElement;
202
- const dragTransform = Utils.getValuesFromTransformedElement(parent);
203
- this.rectScale = {
204
- x: dragTransform.xScale,
205
- y: dragTransform.yScale
206
- };
207
- if (getComputedStyle(this.el.parentElement).position.match(/static/)) {
208
- this.el.parentElement.style.position = 'relative';
209
- }
210
- this.el.style.position = 'absolute';
211
- this.el.style.opacity = '0.8';
212
- return this;
213
- }
214
- /** @internal */
215
- _cleanHelper() {
216
- DDResizable._originStyleProp.forEach((prop, i) => {
217
- this.el.style[prop] = this.elOriginStyleVal[i] || null;
218
- });
219
- this.el.parentElement.style.position = this.parentOriginStylePosition || null;
220
- return this;
221
- }
222
- /** @internal */
223
- _getChange(event, dir) {
224
- const oEvent = this.startEvent;
225
- const newRect = {
226
- width: this.originalRect.width,
227
- height: this.originalRect.height + this.scrolled,
228
- left: this.originalRect.left,
229
- top: this.originalRect.top - this.scrolled
230
- };
231
- const offsetX = event.clientX - oEvent.clientX;
232
- const offsetY = this.sizeToContent ? 0 : event.clientY - oEvent.clientY; // prevent vert resize
233
- let moveLeft;
234
- let moveUp;
235
- if (dir.indexOf('e') > -1) {
236
- newRect.width += offsetX;
237
- }
238
- else if (dir.indexOf('w') > -1) {
239
- newRect.width -= offsetX;
240
- newRect.left += offsetX;
241
- moveLeft = true;
242
- }
243
- if (dir.indexOf('s') > -1) {
244
- newRect.height += offsetY;
245
- }
246
- else if (dir.indexOf('n') > -1) {
247
- newRect.height -= offsetY;
248
- newRect.top += offsetY;
249
- moveUp = true;
250
- }
251
- const constrain = this._constrainSize(newRect.width, newRect.height, moveLeft, moveUp);
252
- if (Math.round(newRect.width) !== Math.round(constrain.width)) { // round to ignore slight round-off errors
253
- if (dir.indexOf('w') > -1) {
254
- newRect.left += newRect.width - constrain.width;
255
- }
256
- newRect.width = constrain.width;
257
- }
258
- if (Math.round(newRect.height) !== Math.round(constrain.height)) {
259
- if (dir.indexOf('n') > -1) {
260
- newRect.top += newRect.height - constrain.height;
261
- }
262
- newRect.height = constrain.height;
263
- }
264
- return newRect;
265
- }
266
- /** @internal constrain the size to the set min/max values */
267
- _constrainSize(oWidth, oHeight, moveLeft, moveUp) {
268
- const o = this.option;
269
- const maxWidth = (moveLeft ? o.maxWidthMoveLeft : o.maxWidth) || Number.MAX_SAFE_INTEGER;
270
- const minWidth = o.minWidth / this.rectScale.x || oWidth;
271
- const maxHeight = (moveUp ? o.maxHeightMoveUp : o.maxHeight) || Number.MAX_SAFE_INTEGER;
272
- const minHeight = o.minHeight / this.rectScale.y || oHeight;
273
- const width = Math.min(maxWidth, Math.max(minWidth, oWidth));
274
- const height = Math.min(maxHeight, Math.max(minHeight, oHeight));
275
- return { width, height };
276
- }
277
- /** @internal */
278
- _applyChange() {
279
- let containmentRect = { left: 0, top: 0, width: 0, height: 0 };
280
- if (this.el.style.position === 'absolute') {
281
- const containmentEl = this.el.parentElement;
282
- const { left, top } = containmentEl.getBoundingClientRect();
283
- containmentRect = { left, top, width: 0, height: 0 };
284
- }
285
- if (!this.temporalRect)
286
- return this;
287
- Object.keys(this.temporalRect).forEach(key => {
288
- const value = this.temporalRect[key];
289
- const scaleReciprocal = key === 'width' || key === 'left' ? this.rectScale.x : key === 'height' || key === 'top' ? this.rectScale.y : 1;
290
- this.el.style[key] = (value - containmentRect[key]) * scaleReciprocal + 'px';
291
- });
292
- return this;
293
- }
294
- /** @internal */
295
- _removeHandlers() {
296
- this.handlers.forEach(handle => handle.destroy());
297
- delete this.handlers;
298
- return this;
299
- }
300
- }
301
- /** @internal */
302
- DDResizable._originStyleProp = ['width', 'height', 'position', 'left', 'top', 'opacity', 'zIndex'];
303
- export { DDResizable };
304
- //# sourceMappingURL=dd-resizable.js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Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license\n */\n\nimport { DDResizableHandle } from './dd-resizable-handle';\nimport { DDBaseImplement, HTMLElementExtendOpt } from './dd-base-impl';\nimport { Utils } from './utils';\nimport { DDUIData, GridItemHTMLElement, Rect, Size } from './types';\nimport { DDManager } from './dd-manager';\n\n// import { GridItemHTMLElement } from './types'; let count = 0; // TEST\n\n// TODO: merge with DDDragOpt\nexport interface DDResizableOpt {\n autoHide?: boolean;\n handles?: string;\n maxHeight?: number;\n maxHeightMoveUp?: number;\n maxWidth?: number;\n maxWidthMoveLeft?: number;\n minHeight?: number;\n minWidth?: number;\n start?: (event: Event, ui: DDUIData) => void;\n stop?: (event: Event) => void;\n resize?: (event: Event, ui: DDUIData) => void;\n}\n\ninterface RectScaleReciprocal {\n x: number;\n y: number;\n}\n\nexport class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt<DDResizableOpt> {\n /** @internal */\n protected handlers: DDResizableHandle[];\n /** @internal */\n protected originalRect: Rect;\n /** @internal */\n protected rectScale: RectScaleReciprocal = { x: 1, y: 1 };\n /** @internal */\n protected temporalRect: Rect;\n /** @internal */\n protected scrollY: number;\n /** @internal */\n protected scrolled: number;\n /** @internal */\n protected scrollEl: HTMLElement;\n /** @internal */\n protected startEvent: MouseEvent;\n /** @internal value saved in the same order as _originStyleProp[] */\n protected elOriginStyleVal: string[];\n /** @internal */\n protected parentOriginStylePosition: string;\n /** @internal */\n protected static _originStyleProp = ['width', 'height', 'position', 'left', 'top', 'opacity', 'zIndex'];\n /** @internal */\n protected sizeToContent: boolean;\n\n // have to be public else complains for HTMLElementExtendOpt ?\n constructor(public el: GridItemHTMLElement, public option: DDResizableOpt = {}) {\n super();\n // create var event binding so we can easily remove and still look like TS methods (unlike anonymous functions)\n this._mouseOver = this._mouseOver.bind(this);\n this._mouseOut = this._mouseOut.bind(this);\n this.enable();\n this._setupAutoHide(this.option.autoHide);\n this._setupHandlers();\n }\n\n public on(event: 'resizestart' | 'resize' | 'resizestop', callback: (event: DragEvent) => void): void {\n super.on(event, callback);\n }\n\n public off(event: 'resizestart' | 'resize' | 'resizestop'): void {\n super.off(event);\n }\n\n public enable(): void {\n super.enable();\n this.el.classList.remove('ui-resizable-disabled');\n this._setupAutoHide(this.option.autoHide);\n }\n\n public disable(): void {\n super.disable();\n this.el.classList.add('ui-resizable-disabled');\n this._setupAutoHide(false);\n }\n\n public destroy(): void {\n this._removeHandlers();\n this._setupAutoHide(false);\n delete this.el;\n super.destroy();\n }\n\n public updateOption(opts: DDResizableOpt): DDResizable {\n const updateHandles = (opts.handles && opts.handles !== this.option.handles);\n const updateAutoHide = (opts.autoHide && opts.autoHide !== this.option.autoHide);\n Object.keys(opts).forEach(key => this.option[key] = opts[key]);\n if (updateHandles) {\n this._removeHandlers();\n this._setupHandlers();\n }\n if (updateAutoHide) {\n this._setupAutoHide(this.option.autoHide);\n }\n return this;\n }\n\n /** @internal turns auto hide on/off */\n protected _setupAutoHide(auto: boolean): DDResizable {\n if (auto) {\n this.el.classList.add('ui-resizable-autohide');\n // use mouseover and not mouseenter to get better performance and track for nested cases\n this.el.addEventListener('mouseover', this._mouseOver);\n this.el.addEventListener('mouseout', this._mouseOut);\n } else {\n this.el.classList.remove('ui-resizable-autohide');\n this.el.removeEventListener('mouseover', this._mouseOver);\n this.el.removeEventListener('mouseout', this._mouseOut);\n if (DDManager.overResizeElement === this) {\n delete DDManager.overResizeElement;\n }\n }\n return this;\n }\n\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected _mouseOver(e: Event): void {\n // console.log(`${count++} pre-enter ${(this.el as GridItemHTMLElement).gridstackNode._id}`)\n // already over a child, ignore. Ideally we just call e.stopPropagation() but see https://github.com/gridstack/gridstack.js/issues/2018\n if (DDManager.overResizeElement || DDManager.dragElement) return;\n DDManager.overResizeElement = this;\n // console.log(`${count++} enter ${(this.el as GridItemHTMLElement).gridstackNode._id}`)\n this.el.classList.remove('ui-resizable-autohide');\n }\n\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected _mouseOut(e: Event): void {\n // console.log(`${count++} pre-leave ${(this.el as GridItemHTMLElement).gridstackNode._id}`)\n if (DDManager.overResizeElement !== this) return;\n delete DDManager.overResizeElement;\n // console.log(`${count++} leave ${(this.el as GridItemHTMLElement).gridstackNode._id}`)\n this.el.classList.add('ui-resizable-autohide');\n }\n\n /** @internal */\n protected _setupHandlers(): DDResizable {\n this.handlers = this.option.handles.split(',')\n .map(dir => dir.trim())\n .map(dir => new DDResizableHandle(this.el, dir, {\n start: (event: MouseEvent) => {\n this._resizeStart(event);\n },\n stop: (event: MouseEvent) => {\n this._resizeStop(event);\n },\n move: (event: MouseEvent) => {\n this._resizing(event, dir);\n }\n }));\n return this;\n }\n\n /** @internal */\n protected _resizeStart(event: MouseEvent): DDResizable {\n this.sizeToContent = Utils.shouldSizeToContent(this.el.gridstackNode, true); // strick true only and not number\n this.originalRect = this.el.getBoundingClientRect();\n this.scrollEl = Utils.getScrollElement(this.el);\n this.scrollY = this.scrollEl.scrollTop;\n this.scrolled = 0;\n this.startEvent = event;\n this._setupHelper();\n this._applyChange();\n const ev = Utils.initEvent<MouseEvent>(event, { type: 'resizestart', target: this.el });\n if (this.option.start) {\n this.option.start(ev, this._ui());\n }\n this.el.classList.add('ui-resizable-resizing');\n this.triggerEvent('resizestart', ev);\n return this;\n }\n\n /** @internal */\n protected _resizing(event: MouseEvent, dir: string): DDResizable {\n this.scrolled = this.scrollEl.scrollTop - this.scrollY;\n this.temporalRect = this._getChange(event, dir);\n this._applyChange();\n const ev = Utils.initEvent<MouseEvent>(event, { type: 'resize', target: this.el });\n if (this.option.resize) {\n this.option.resize(ev, this._ui());\n }\n this.triggerEvent('resize', ev);\n return this;\n }\n\n /** @internal */\n protected _resizeStop(event: MouseEvent): DDResizable {\n const ev = Utils.initEvent<MouseEvent>(event, { type: 'resizestop', target: this.el });\n // Remove style attr now, so the stop handler can rebuild style attrs\n this._cleanHelper();\n if (this.option.stop) {\n this.option.stop(ev); // Note: ui() not used by gridstack so don't pass\n }\n this.el.classList.remove('ui-resizable-resizing');\n this.triggerEvent('resizestop', ev);\n delete this.startEvent;\n delete this.originalRect;\n delete this.temporalRect;\n delete this.scrollY;\n delete this.scrolled;\n return this;\n }\n\n /** @internal */\n protected _setupHelper(): DDResizable {\n this.elOriginStyleVal = DDResizable._originStyleProp.map(prop => this.el.style[prop]);\n this.parentOriginStylePosition = this.el.parentElement.style.position;\n\n const parent = this.el.parentElement;\n const dragTransform = Utils.getValuesFromTransformedElement(parent);\n this.rectScale = {\n x: dragTransform.xScale,\n y: dragTransform.yScale\n };\n\n if (getComputedStyle(this.el.parentElement).position.match(/static/)) {\n this.el.parentElement.style.position = 'relative';\n }\n this.el.style.position = 'absolute';\n this.el.style.opacity = '0.8';\n return this;\n }\n\n /** @internal */\n protected _cleanHelper(): DDResizable {\n DDResizable._originStyleProp.forEach((prop, i) => {\n this.el.style[prop] = this.elOriginStyleVal[i] || null;\n });\n this.el.parentElement.style.position = this.parentOriginStylePosition || null;\n return this;\n }\n\n /** @internal */\n protected _getChange(event: MouseEvent, dir: string): Rect {\n const oEvent = this.startEvent;\n const newRect = { // Note: originalRect is a complex object, not a simple Rect, so copy out.\n width: this.originalRect.width,\n height: this.originalRect.height + this.scrolled,\n left: this.originalRect.left,\n top: this.originalRect.top - this.scrolled\n };\n\n const offsetX = event.clientX - oEvent.clientX;\n const offsetY = this.sizeToContent ? 0 : event.clientY - oEvent.clientY; // prevent vert resize\n let moveLeft: boolean;\n let moveUp: boolean;\n\n if (dir.indexOf('e') > -1) {\n newRect.width += offsetX;\n } else if (dir.indexOf('w') > -1) {\n newRect.width -= offsetX;\n newRect.left += offsetX;\n moveLeft = true;\n }\n if (dir.indexOf('s') > -1) {\n newRect.height += offsetY;\n } else if (dir.indexOf('n') > -1) {\n newRect.height -= offsetY;\n newRect.top += offsetY\n moveUp = true;\n }\n const constrain = this._constrainSize(newRect.width, newRect.height, moveLeft, moveUp);\n if (Math.round(newRect.width) !== Math.round(constrain.width)) { // round to ignore slight round-off errors\n if (dir.indexOf('w') > -1) {\n newRect.left += newRect.width - constrain.width;\n }\n newRect.width = constrain.width;\n }\n if (Math.round(newRect.height) !== Math.round(constrain.height)) {\n if (dir.indexOf('n') > -1) {\n newRect.top += newRect.height - constrain.height;\n }\n newRect.height = constrain.height;\n }\n return newRect;\n }\n\n /** @internal constrain the size to the set min/max values */\n protected _constrainSize(oWidth: number, oHeight: number, moveLeft: boolean, moveUp: boolean): Size {\n const o = this.option;\n const maxWidth = (moveLeft ? o.maxWidthMoveLeft : o.maxWidth) || Number.MAX_SAFE_INTEGER;\n const minWidth = o.minWidth / this.rectScale.x || oWidth;\n const maxHeight = (moveUp ? o.maxHeightMoveUp : o.maxHeight) || Number.MAX_SAFE_INTEGER;\n const minHeight = o.minHeight / this.rectScale.y || oHeight;\n const width = Math.min(maxWidth, Math.max(minWidth, oWidth));\n const height = Math.min(maxHeight, Math.max(minHeight, oHeight));\n return { width, height };\n }\n\n /** @internal */\n protected _applyChange(): DDResizable {\n let containmentRect = { left: 0, top: 0, width: 0, height: 0 };\n if (this.el.style.position === 'absolute') {\n const containmentEl = this.el.parentElement;\n const { left, top } = containmentEl.getBoundingClientRect();\n containmentRect = { left, top, width: 0, height: 0 };\n }\n if (!this.temporalRect) return this;\n Object.keys(this.temporalRect).forEach(key => {\n const value = this.temporalRect[key];\n const scaleReciprocal = key === 'width' || key === 'left' ? this.rectScale.x : key === 'height' || key === 'top' ? this.rectScale.y : 1;\n this.el.style[key] = (value - containmentRect[key]) * scaleReciprocal + 'px';\n });\n return this;\n }\n\n /** @internal */\n protected _removeHandlers(): DDResizable {\n this.handlers.forEach(handle => handle.destroy());\n delete this.handlers;\n return this;\n }\n\n /** @internal */\n protected _ui = (): DDUIData => {\n const containmentEl = this.el.parentElement;\n const containmentRect = containmentEl.getBoundingClientRect();\n const newRect = { // Note: originalRect is a complex object, not a simple Rect, so copy out.\n width: this.originalRect.width,\n height: this.originalRect.height + this.scrolled,\n left: this.originalRect.left,\n top: this.originalRect.top - this.scrolled\n };\n const rect = this.temporalRect || newRect;\n return {\n position: {\n left: (rect.left - containmentRect.left) * this.rectScale.x,\n top: (rect.top - containmentRect.top) * this.rectScale.y\n },\n size: {\n width: rect.width * this.rectScale.x,\n height: rect.height * this.rectScale.y\n }\n /* Gridstack ONLY needs position set above... keep around in case.\n element: [this.el], // The object representing the element to be resized\n helper: [], // TODO: not support yet - The object representing the helper that's being resized\n originalElement: [this.el],// we don't wrap here, so simplify as this.el //The object representing the original element before it is wrapped\n originalPosition: { // The position represented as { left, top } before the resizable is resized\n left: this.originalRect.left - containmentRect.left,\n top: this.originalRect.top - containmentRect.top\n },\n originalSize: { // The size represented as { width, height } before the resizable is resized\n width: this.originalRect.width,\n height: this.originalRect.height\n }\n */\n };\n }\n}\n"]}
@@ -1,33 +0,0 @@
1
- /**
2
- * touch.ts 12.3.2
3
- * Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
4
- */
5
- /**
6
- * Detect touch support - Windows Surface devices and other touch devices
7
- * should we use this instead ? (what we had for always showing resize handles)
8
- * /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
9
- */
10
- export declare const isTouch: boolean;
11
- /**
12
- * Handle the touchstart events
13
- * @param {Object} e The widget element's touchstart event
14
- */
15
- export declare function touchstart(e: TouchEvent): void;
16
- /**
17
- * Handle the touchmove events
18
- * @param {Object} e The document's touchmove event
19
- */
20
- export declare function touchmove(e: TouchEvent): void;
21
- /**
22
- * Handle the touchend events
23
- * @param {Object} e The document's touchend event
24
- */
25
- export declare function touchend(e: TouchEvent): void;
26
- /**
27
- * Note we don't get touchenter/touchleave (which are deprecated)
28
- * see https://stackoverflow.com/questions/27908339/js-touch-equivalent-for-mouseenter
29
- * so instead of PointerEvent to still get enter/leave and send the matching mouse event.
30
- */
31
- export declare function pointerdown(e: PointerEvent): void;
32
- export declare function pointerenter(e: PointerEvent): void;
33
- export declare function pointerleave(e: PointerEvent): void;