zcw-shared 1.18.0 → 1.19.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.
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { HTMLElement, Document, MouseEvent, TouchEvent } from '../../references/dom.d';
|
|
3
|
+
import type { Window } from '../../references/browser.d';
|
|
4
|
+
export interface Size {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ResizableEnvironment {
|
|
9
|
+
document: Document;
|
|
10
|
+
window: Window;
|
|
11
|
+
}
|
|
12
|
+
export interface UseResizableOptions {
|
|
13
|
+
initialSize?: Size;
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
onResizeStart?: (size: Size, event: MouseEvent | TouchEvent) => void;
|
|
16
|
+
onResize?: (size: Size, event: MouseEvent | TouchEvent) => void;
|
|
17
|
+
onResizeEnd?: (size: Size, event: MouseEvent | TouchEvent) => void;
|
|
18
|
+
constraints?: {
|
|
19
|
+
minWidth?: number;
|
|
20
|
+
maxWidth?: number;
|
|
21
|
+
minHeight?: number;
|
|
22
|
+
maxHeight?: number;
|
|
23
|
+
};
|
|
24
|
+
directions?: {
|
|
25
|
+
top?: boolean;
|
|
26
|
+
right?: boolean;
|
|
27
|
+
bottom?: boolean;
|
|
28
|
+
left?: boolean;
|
|
29
|
+
topLeft?: boolean;
|
|
30
|
+
topRight?: boolean;
|
|
31
|
+
bottomLeft?: boolean;
|
|
32
|
+
bottomRight?: boolean;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export declare function useResizable(targetRef: Ref<HTMLElement | null>, options: UseResizableOptions | undefined, env: ResizableEnvironment): {
|
|
36
|
+
size: Ref<Size, Size>;
|
|
37
|
+
style: Ref<{
|
|
38
|
+
width: string;
|
|
39
|
+
height: string;
|
|
40
|
+
}, {
|
|
41
|
+
width: string;
|
|
42
|
+
height: string;
|
|
43
|
+
}>;
|
|
44
|
+
isResizing: Ref<boolean, boolean>;
|
|
45
|
+
onResizeHandleMouseDown: (e: MouseEvent | TouchEvent, direction?: string) => void;
|
|
46
|
+
reset: () => void;
|
|
47
|
+
cleanupEventListeners: () => void;
|
|
48
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { ref, onMounted, onUnmounted } from 'vue';
|
|
2
|
+
export function useResizable(targetRef, options = {}, env) {
|
|
3
|
+
const { initialSize = { width: 0, height: 0 }, enabled = true, onResizeStart, onResize, onResizeEnd, constraints = {}, directions = { bottomRight: true } } = options;
|
|
4
|
+
const size = ref({ ...initialSize });
|
|
5
|
+
const isResizing = ref(false);
|
|
6
|
+
let startX = 0;
|
|
7
|
+
let startY = 0;
|
|
8
|
+
let startWidth = 0;
|
|
9
|
+
let startHeight = 0;
|
|
10
|
+
let currentDirection = '';
|
|
11
|
+
let sizeInitialized = false;
|
|
12
|
+
const style = ref({
|
|
13
|
+
width: `${initialSize.width}px`,
|
|
14
|
+
height: `${initialSize.height}px`
|
|
15
|
+
});
|
|
16
|
+
const initializeSize = () => {
|
|
17
|
+
if (!targetRef.value || sizeInitialized)
|
|
18
|
+
return;
|
|
19
|
+
const { width, height } = targetRef.value.getBoundingClientRect();
|
|
20
|
+
if (initialSize.width === 0 && initialSize.height === 0) {
|
|
21
|
+
size.value = { width, height };
|
|
22
|
+
style.value = {
|
|
23
|
+
width: `${width}px`,
|
|
24
|
+
height: `${height}px`
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
size.value = { ...initialSize };
|
|
29
|
+
style.value = {
|
|
30
|
+
width: `${initialSize.width}px`,
|
|
31
|
+
height: `${initialSize.height}px`
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
sizeInitialized = true;
|
|
35
|
+
};
|
|
36
|
+
const onResizeHandleMouseDown = (e, direction = 'bottomRight') => {
|
|
37
|
+
if (!enabled || !targetRef.value)
|
|
38
|
+
return;
|
|
39
|
+
e.stopPropagation();
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
isResizing.value = true;
|
|
42
|
+
currentDirection = direction;
|
|
43
|
+
if ('clientX' in e) {
|
|
44
|
+
startX = e.clientX;
|
|
45
|
+
startY = e.clientY;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
startX = e.touches[0].clientX;
|
|
49
|
+
startY = e.touches[0].clientY;
|
|
50
|
+
}
|
|
51
|
+
startWidth = targetRef.value.clientWidth;
|
|
52
|
+
startHeight = targetRef.value.clientHeight;
|
|
53
|
+
onResizeStart?.({ width: startWidth, height: startHeight }, e);
|
|
54
|
+
if ('clientX' in e) {
|
|
55
|
+
env.document.addEventListener('mousemove', onResizeMouseMove, { passive: true });
|
|
56
|
+
env.document.addEventListener('mouseup', onResizeMouseUp);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
env.document.addEventListener('touchmove', onResizeTouchMove, { passive: true });
|
|
60
|
+
env.document.addEventListener('touchend', onResizeTouchEnd);
|
|
61
|
+
env.document.addEventListener('touchcancel', onResizeTouchEnd);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const onResizeMouseMove = (e) => {
|
|
65
|
+
if (!isResizing.value || !targetRef.value)
|
|
66
|
+
return;
|
|
67
|
+
env.window.requestAnimationFrame(() => {
|
|
68
|
+
if (!targetRef.value)
|
|
69
|
+
return;
|
|
70
|
+
const deltaX = e.clientX - startX;
|
|
71
|
+
const deltaY = e.clientY - startY;
|
|
72
|
+
updateSize(deltaX, deltaY, e);
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
const onResizeTouchMove = (e) => {
|
|
76
|
+
if (!isResizing.value || !targetRef.value)
|
|
77
|
+
return;
|
|
78
|
+
env.window.requestAnimationFrame(() => {
|
|
79
|
+
if (!targetRef.value)
|
|
80
|
+
return;
|
|
81
|
+
const deltaX = e.touches[0].clientX - startX;
|
|
82
|
+
const deltaY = e.touches[0].clientY - startY;
|
|
83
|
+
updateSize(deltaX, deltaY, e);
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const updateSize = (deltaX, deltaY, e) => {
|
|
87
|
+
let newWidth = startWidth;
|
|
88
|
+
let newHeight = startHeight;
|
|
89
|
+
if (currentDirection.includes('right')) {
|
|
90
|
+
newWidth = startWidth + deltaX;
|
|
91
|
+
}
|
|
92
|
+
else if (currentDirection.includes('left')) {
|
|
93
|
+
newWidth = startWidth - deltaX;
|
|
94
|
+
}
|
|
95
|
+
if (currentDirection.includes('bottom')) {
|
|
96
|
+
newHeight = startHeight + deltaY;
|
|
97
|
+
}
|
|
98
|
+
else if (currentDirection.includes('top')) {
|
|
99
|
+
newHeight = startHeight - deltaY;
|
|
100
|
+
}
|
|
101
|
+
if (constraints.minWidth !== undefined) {
|
|
102
|
+
newWidth = Math.max(constraints.minWidth, newWidth);
|
|
103
|
+
}
|
|
104
|
+
if (constraints.maxWidth !== undefined) {
|
|
105
|
+
newWidth = Math.min(constraints.maxWidth, newWidth);
|
|
106
|
+
}
|
|
107
|
+
if (constraints.minHeight !== undefined) {
|
|
108
|
+
newHeight = Math.max(constraints.minHeight, newHeight);
|
|
109
|
+
}
|
|
110
|
+
if (constraints.maxHeight !== undefined) {
|
|
111
|
+
newHeight = Math.min(constraints.maxHeight, newHeight);
|
|
112
|
+
}
|
|
113
|
+
size.value = { width: newWidth, height: newHeight };
|
|
114
|
+
style.value = {
|
|
115
|
+
width: `${newWidth}px`,
|
|
116
|
+
height: `${newHeight}px`
|
|
117
|
+
};
|
|
118
|
+
onResize?.(size.value, e);
|
|
119
|
+
};
|
|
120
|
+
const onResizeMouseUp = (e) => {
|
|
121
|
+
if (!isResizing.value)
|
|
122
|
+
return;
|
|
123
|
+
isResizing.value = false;
|
|
124
|
+
onResizeEnd?.(size.value, e);
|
|
125
|
+
env.document.removeEventListener('mousemove', onResizeMouseMove);
|
|
126
|
+
env.document.removeEventListener('mouseup', onResizeMouseUp);
|
|
127
|
+
};
|
|
128
|
+
const onResizeTouchEnd = (e) => {
|
|
129
|
+
if (!isResizing.value)
|
|
130
|
+
return;
|
|
131
|
+
isResizing.value = false;
|
|
132
|
+
onResizeEnd?.(size.value, e);
|
|
133
|
+
env.document.removeEventListener('touchmove', onResizeTouchMove);
|
|
134
|
+
env.document.removeEventListener('touchend', onResizeTouchEnd);
|
|
135
|
+
env.document.removeEventListener('touchcancel', onResizeTouchEnd);
|
|
136
|
+
};
|
|
137
|
+
const reset = () => {
|
|
138
|
+
size.value = { ...initialSize };
|
|
139
|
+
style.value = {
|
|
140
|
+
width: `${initialSize.width}px`,
|
|
141
|
+
height: `${initialSize.height}px`
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
const cleanupEventListeners = () => {
|
|
145
|
+
env.document.removeEventListener('mousemove', onResizeMouseMove);
|
|
146
|
+
env.document.removeEventListener('mouseup', onResizeMouseUp);
|
|
147
|
+
env.document.removeEventListener('touchmove', onResizeTouchMove);
|
|
148
|
+
env.document.removeEventListener('touchend', onResizeTouchEnd);
|
|
149
|
+
env.document.removeEventListener('touchcancel', onResizeTouchEnd);
|
|
150
|
+
};
|
|
151
|
+
onMounted(() => {
|
|
152
|
+
initializeSize();
|
|
153
|
+
});
|
|
154
|
+
onUnmounted(() => {
|
|
155
|
+
cleanupEventListeners();
|
|
156
|
+
});
|
|
157
|
+
onUnmounted(() => {
|
|
158
|
+
cleanupEventListeners();
|
|
159
|
+
});
|
|
160
|
+
return {
|
|
161
|
+
size,
|
|
162
|
+
style,
|
|
163
|
+
isResizing,
|
|
164
|
+
onResizeHandleMouseDown,
|
|
165
|
+
reset,
|
|
166
|
+
cleanupEventListeners
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=useResizable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizable.js","sourceRoot":"","sources":["../../src/hooks/useResizable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EA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|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcw-shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"references",
|
|
6
6
|
"dist",
|
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
"./hooks/useDraggable": "./dist/hooks/useDraggable.js",
|
|
115
115
|
"./hooks/useLocalStorage": "./dist/hooks/useLocalStorage.js",
|
|
116
116
|
"./hooks/usePluginSystem": "./dist/hooks/usePluginSystem.js",
|
|
117
|
+
"./hooks/useResizable": "./dist/hooks/useResizable.js",
|
|
117
118
|
"./hooks/useSessionStorage": "./dist/hooks/useSessionStorage.js",
|
|
118
119
|
"./hooks/useStorage": "./dist/hooks/useStorage.js",
|
|
119
120
|
"./hooks/useStorageWithIndexedDB": "./dist/hooks/useStorageWithIndexedDB.js",
|
package/references/dom.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface HTMLElement extends Element {
|
|
|
19
19
|
}
|
|
20
20
|
addEventListener(event: string, handler: (e: any) => void, options?: any): void
|
|
21
21
|
removeEventListener(event: string, handler: (e: any) => void, options?: any): void
|
|
22
|
+
clientWidth: number
|
|
23
|
+
clientHeight: number
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export interface HTMLImageElement extends HTMLElement {
|