uiik 1.0.9 → 1.3.0-alpha
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/CHANGELOG.md +22 -0
- package/README.md +7 -0
- package/{types/detector.d.ts → detector.d.ts} +0 -19
- package/draggable.d.ts +8 -0
- package/droppable.d.ts +9 -0
- package/{types/index.d.ts → index.d.ts} +5 -0
- package/index.esm.js +1852 -1253
- package/index.js +1914 -1296
- package/package.json +5 -5
- package/resizable.d.ts +7 -0
- package/rotatable.d.ts +6 -0
- package/selectable.d.ts +8 -0
- package/sortable.d.ts +9 -0
- package/splittable.d.ts +6 -0
- package/transform.d.ts +19 -0
- package/types.d.ts +286 -0
- package/utils.d.ts +51 -0
- package/types/draggable.d.ts +0 -25
- package/types/droppable.d.ts +0 -30
- package/types/resizable.d.ts +0 -19
- package/types/rotatable.d.ts +0 -23
- package/types/selectable.d.ts +0 -32
- package/types/splittable.d.ts +0 -23
- package/types/types.d.ts +0 -320
- package/types/utils.d.ts +0 -22
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uiik",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.3.0-alpha",
|
|
4
4
|
"description": "A UI interactions kit includes draggable, splittable, rotatable, selectable, etc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.esm.js",
|
|
7
|
-
"types": "
|
|
7
|
+
"types": "index.d.ts",
|
|
8
8
|
"author": "holyhigh2",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"test": "rollup --config rollup.config.test.js --watch",
|
|
31
31
|
"doc": "npx typedoc"
|
|
32
32
|
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"myfx":"1.1.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@babel/core": "^7.12.3",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"rollup-pluginutils": "^2.8.2",
|
|
55
55
|
"tslib": "^2.4.0",
|
|
56
56
|
"typescript": "^4.8.2",
|
|
57
|
-
"typedoc": "^0.
|
|
57
|
+
"typedoc": "^0.24.8",
|
|
58
58
|
"typedoc-plugin-markdown": "^3.14.0"
|
|
59
59
|
}
|
|
60
60
|
}
|
package/resizable.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ResizableOptions, Uii } from "./types";
|
|
2
|
+
export declare class Resizable extends Uii {
|
|
3
|
+
constructor(els: string | HTMLElement, opts?: ResizableOptions);
|
|
4
|
+
bindHandle(handle: HTMLElement | SVGElement, dir: string, panel: HTMLElement, opts: ResizableOptions): void;
|
|
5
|
+
initHandle(panel: HTMLElement): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function newResizable(els: string | HTMLElement, opts?: ResizableOptions): Resizable;
|
package/rotatable.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RotatableOptions, Uii } from "./types";
|
|
2
|
+
import 'myfx';
|
|
3
|
+
export declare class Rotatable extends Uii {
|
|
4
|
+
constructor(els: string | Element, opts?: RotatableOptions);
|
|
5
|
+
}
|
|
6
|
+
export declare function newRotatable(els: string | HTMLElement, opts?: RotatableOptions): Rotatable;
|
package/selectable.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SelectableOptions, Uii } from "./types";
|
|
2
|
+
export declare class Selectable extends Uii {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(container: string | HTMLElement, opts?: SelectableOptions);
|
|
5
|
+
updateTargets(): void;
|
|
6
|
+
onOptionChanged(): void;
|
|
7
|
+
}
|
|
8
|
+
export declare function newSelectable(container: string | HTMLElement, opts?: SelectableOptions): Selectable;
|
package/sortable.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SortableOptions, Uii } from "./types";
|
|
2
|
+
export declare class Sortable extends Uii {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(container: string | HTMLElement | Array<HTMLElement>, opts?: SortableOptions);
|
|
5
|
+
active(draggingItem: HTMLElement, fromContainer: HTMLElement, toContainers: HTMLElement[], toOpts: SortableOptions): void;
|
|
6
|
+
deactive(draggingItem: HTMLElement, fromContainer: HTMLElement, toContainers: HTMLElement[], opts: SortableOptions): void;
|
|
7
|
+
onOptionChanged(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function newSortable(container: string | HTMLElement | Array<HTMLElement>, opts?: SortableOptions): Sortable;
|
package/splittable.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SplittableOptions, Uii } from './types';
|
|
2
|
+
export declare class Splittable extends Uii {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(container: string | HTMLElement, opts?: SplittableOptions);
|
|
5
|
+
}
|
|
6
|
+
export declare function newSplittable(container: string | HTMLElement, opts?: SplittableOptions): Splittable;
|
package/transform.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class UiiTransformer {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
angle: number;
|
|
5
|
+
el: HTMLElement | SVGGraphicsElement;
|
|
6
|
+
constructor(el: HTMLElement | SVGGraphicsElement);
|
|
7
|
+
normalize(el: HTMLElement | SVGGraphicsElement): this;
|
|
8
|
+
moveTo(x: number, y: number): void;
|
|
9
|
+
moveToX(x: number): void;
|
|
10
|
+
moveToY(y: number): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function wrapper(el: HTMLElement | SVGGraphicsElement): UiiTransformer;
|
|
13
|
+
export declare function getTranslate(el: HTMLElement | SVGGraphicsElement): {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function moveTo(el: HTMLElement | SVGGraphicsElement, x: number, y: number): void;
|
|
18
|
+
export declare function moveBy(el: HTMLElement | SVGGraphicsElement, x: number, y: number): void;
|
|
19
|
+
export declare function rotateTo(el: HTMLElement | SVGGraphicsElement, deg: number, cx?: number, cy?: number): void;
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
export declare abstract class Uii {
|
|
2
|
+
#private;
|
|
3
|
+
protected ele: Array<HTMLElement>;
|
|
4
|
+
opts: Record<string, any>;
|
|
5
|
+
protected enabled: boolean;
|
|
6
|
+
protected eleString: string;
|
|
7
|
+
constructor(ele: string | Element | NodeList | HTMLCollection | Array<string | Element>, opts?: Record<string, any>);
|
|
8
|
+
destroy(): void;
|
|
9
|
+
addPointerDown(el: Element, pointerDown: (args: Record<string, any>) => void, opts: {
|
|
10
|
+
threshold?: number;
|
|
11
|
+
lockPage?: boolean;
|
|
12
|
+
}): void;
|
|
13
|
+
registerEvent(el: Element, event: string, hook: Function, useCapture?: boolean): void;
|
|
14
|
+
disable(): void;
|
|
15
|
+
enable(): void;
|
|
16
|
+
getOptions(): Record<string, any>;
|
|
17
|
+
getOption(name: string): any;
|
|
18
|
+
setOptions(options?: Record<string, any>): void;
|
|
19
|
+
setOption(name: string, value: any): void;
|
|
20
|
+
protected onOptionChanged(opts?: Record<string, any>): void;
|
|
21
|
+
}
|
|
22
|
+
export type ResizableOptions = {
|
|
23
|
+
handle?: ((target: HTMLElement | SVGGraphicsElement) => NodeList | HTMLCollection | HTMLElement[] | HTMLElement | SVGGraphicsElement) | string | NodeList | HTMLCollection | HTMLElement[] | HTMLElement | SVGGraphicsElement;
|
|
24
|
+
minSize?: number | Array<number>;
|
|
25
|
+
maxSize?: number | Array<number>;
|
|
26
|
+
dir?: string[];
|
|
27
|
+
aspectRatio?: number;
|
|
28
|
+
ghost?: boolean | Function;
|
|
29
|
+
ghostClass?: string;
|
|
30
|
+
onPointerDown?: (event: MouseEvent) => boolean;
|
|
31
|
+
onStart?: (data: {
|
|
32
|
+
w: number;
|
|
33
|
+
h: number;
|
|
34
|
+
}, event: MouseEvent) => void;
|
|
35
|
+
onResize?: (data: {
|
|
36
|
+
w: number;
|
|
37
|
+
h: number;
|
|
38
|
+
ow: number;
|
|
39
|
+
oh: number;
|
|
40
|
+
}, event: MouseEvent) => void;
|
|
41
|
+
onEnd?: (data: {
|
|
42
|
+
w: number;
|
|
43
|
+
h: number;
|
|
44
|
+
}, event: MouseEvent) => void;
|
|
45
|
+
onClone?: (data: {
|
|
46
|
+
clone: HTMLElement;
|
|
47
|
+
}, event: MouseEvent) => void;
|
|
48
|
+
};
|
|
49
|
+
export type SplittableOptions = {
|
|
50
|
+
handleSize?: number;
|
|
51
|
+
minSize?: number | number[];
|
|
52
|
+
oneSideMode?: "start" | "end";
|
|
53
|
+
sticky?: boolean | boolean[];
|
|
54
|
+
inside?: boolean;
|
|
55
|
+
ghost?: boolean;
|
|
56
|
+
ghostClass?: string;
|
|
57
|
+
handle?: string;
|
|
58
|
+
onStart?: (data: {
|
|
59
|
+
size1: number;
|
|
60
|
+
size2: number;
|
|
61
|
+
}, event: MouseEvent) => void;
|
|
62
|
+
onSplit?: (data: {
|
|
63
|
+
size1: number;
|
|
64
|
+
size2: number;
|
|
65
|
+
}, event: MouseEvent) => void;
|
|
66
|
+
onEnd?: (data: {
|
|
67
|
+
size1: number;
|
|
68
|
+
size2: number;
|
|
69
|
+
}, event: MouseEvent) => void;
|
|
70
|
+
onSticky?: (data: {
|
|
71
|
+
size1: number;
|
|
72
|
+
size2: number;
|
|
73
|
+
position: "start" | "end" | "none";
|
|
74
|
+
}, event: MouseEvent) => void;
|
|
75
|
+
onClone?: (data: {
|
|
76
|
+
clone: HTMLElement;
|
|
77
|
+
}, event: MouseEvent) => void;
|
|
78
|
+
};
|
|
79
|
+
export type DraggableOptions = {
|
|
80
|
+
containment?: boolean | HTMLElement | string;
|
|
81
|
+
watch?: boolean | string;
|
|
82
|
+
threshold?: number;
|
|
83
|
+
handle?: string;
|
|
84
|
+
filter?: string;
|
|
85
|
+
droppable?: (() => NodeList | HTMLCollection | HTMLElement[]) | string | HTMLElement | HTMLElement[];
|
|
86
|
+
ghost?: ((el: HTMLElement) => HTMLElement) | boolean;
|
|
87
|
+
ghostClass?: string;
|
|
88
|
+
direction?: "v" | "h";
|
|
89
|
+
scroll?: boolean;
|
|
90
|
+
scrollSpeed?: number;
|
|
91
|
+
zIndex?: number;
|
|
92
|
+
group?: string;
|
|
93
|
+
classes?: string;
|
|
94
|
+
snap?: string;
|
|
95
|
+
snapOptions?: {
|
|
96
|
+
tolerance: number;
|
|
97
|
+
};
|
|
98
|
+
cursor?: {
|
|
99
|
+
default?: string;
|
|
100
|
+
active?: string;
|
|
101
|
+
over?: string;
|
|
102
|
+
};
|
|
103
|
+
grid?: number | number[];
|
|
104
|
+
type?: string;
|
|
105
|
+
onPointerDown?: (data: {
|
|
106
|
+
draggable: HTMLElement | SVGGraphicsElement;
|
|
107
|
+
}, event: MouseEvent) => boolean;
|
|
108
|
+
onStart?: (data: {
|
|
109
|
+
draggable: HTMLElement | SVGGraphicsElement;
|
|
110
|
+
x: number;
|
|
111
|
+
y: number;
|
|
112
|
+
}, event: MouseEvent) => void;
|
|
113
|
+
onDrag?: (data: {
|
|
114
|
+
draggable: HTMLElement | SVGGraphicsElement;
|
|
115
|
+
x: number;
|
|
116
|
+
y: number;
|
|
117
|
+
ox: number;
|
|
118
|
+
oy: number;
|
|
119
|
+
}, event: MouseEvent) => boolean | void;
|
|
120
|
+
onEnd?: (data: {
|
|
121
|
+
draggable: HTMLElement | SVGGraphicsElement;
|
|
122
|
+
x: number;
|
|
123
|
+
y: number;
|
|
124
|
+
}, event: MouseEvent) => boolean | void;
|
|
125
|
+
onClone?: (data: {
|
|
126
|
+
clone: HTMLElement | SVGGraphicsElement;
|
|
127
|
+
}, event: MouseEvent) => void;
|
|
128
|
+
onSnap?: (data: {
|
|
129
|
+
el: HTMLElement | SVGGraphicsElement;
|
|
130
|
+
targetH: HTMLElement | SVGGraphicsElement;
|
|
131
|
+
targetV: HTMLElement | SVGGraphicsElement;
|
|
132
|
+
dirH: string;
|
|
133
|
+
dirV: string;
|
|
134
|
+
}, event: MouseEvent) => void;
|
|
135
|
+
};
|
|
136
|
+
export type DroppableOptions = {
|
|
137
|
+
activeClass?: string;
|
|
138
|
+
hoverClass?: string;
|
|
139
|
+
accepts?: ((ele: Array<HTMLElement>, draggable: HTMLElement) => boolean) | string;
|
|
140
|
+
onActive?: (data: {
|
|
141
|
+
draggable: HTMLElement;
|
|
142
|
+
droppables: Array<HTMLElement>;
|
|
143
|
+
}) => void;
|
|
144
|
+
onEnter?: (data: {
|
|
145
|
+
draggable: HTMLElement;
|
|
146
|
+
droppable: HTMLElement;
|
|
147
|
+
}, event: MouseEvent) => void;
|
|
148
|
+
onOver?: (data: {
|
|
149
|
+
draggable: HTMLElement;
|
|
150
|
+
droppable: HTMLElement;
|
|
151
|
+
}, event: MouseEvent) => void;
|
|
152
|
+
onLeave?: (data: {
|
|
153
|
+
draggable: HTMLElement;
|
|
154
|
+
droppable: HTMLElement;
|
|
155
|
+
}, event: MouseEvent) => void;
|
|
156
|
+
onDrop?: (data: {
|
|
157
|
+
draggable: HTMLElement;
|
|
158
|
+
droppable: HTMLElement;
|
|
159
|
+
}, event: MouseEvent) => void;
|
|
160
|
+
onDeactive?: (data: {
|
|
161
|
+
draggable: HTMLElement;
|
|
162
|
+
droppables: Array<HTMLElement>;
|
|
163
|
+
}) => void;
|
|
164
|
+
};
|
|
165
|
+
export type RotatableOptions = {
|
|
166
|
+
cursor?: {
|
|
167
|
+
default?: string;
|
|
168
|
+
active?: string;
|
|
169
|
+
};
|
|
170
|
+
handle?: ((target: HTMLElement | SVGGraphicsElement) => NodeList | HTMLCollection | HTMLElement[] | HTMLElement | SVGGraphicsElement) | string | NodeList | HTMLCollection | HTMLElement[] | HTMLElement | SVGGraphicsElement;
|
|
171
|
+
onPointerDown?: (event: MouseEvent) => boolean;
|
|
172
|
+
onStart?: (data: {
|
|
173
|
+
deg: number;
|
|
174
|
+
cx: number;
|
|
175
|
+
cy: number;
|
|
176
|
+
}, event: MouseEvent) => {};
|
|
177
|
+
onRotate?: (data: {
|
|
178
|
+
deg: number;
|
|
179
|
+
cx: number;
|
|
180
|
+
cy: number;
|
|
181
|
+
}, event: MouseEvent) => {};
|
|
182
|
+
onEnd?: (data: {
|
|
183
|
+
deg: number;
|
|
184
|
+
}, event: MouseEvent) => {};
|
|
185
|
+
};
|
|
186
|
+
export type SelectableOptions = {
|
|
187
|
+
class?: string;
|
|
188
|
+
selectingClass?: string;
|
|
189
|
+
selectedClass?: string;
|
|
190
|
+
targets?: (() => NodeList | HTMLCollection | HTMLElement[]) | string;
|
|
191
|
+
mode?: "overlap" | "inclusion";
|
|
192
|
+
scroll?: boolean;
|
|
193
|
+
scrollSpeed?: number;
|
|
194
|
+
filter?: ((el: HTMLElement) => boolean) | string;
|
|
195
|
+
onPointerDown?: (event: MouseEvent) => boolean;
|
|
196
|
+
onStart?: (data: {
|
|
197
|
+
selection: Array<HTMLElement>;
|
|
198
|
+
selectable: HTMLElement;
|
|
199
|
+
}, event: MouseEvent) => void;
|
|
200
|
+
onSelect?: (data: {
|
|
201
|
+
selection: Array<HTMLElement>;
|
|
202
|
+
selectable: HTMLElement;
|
|
203
|
+
}, event: MouseEvent) => void;
|
|
204
|
+
onEnd?: (data: {
|
|
205
|
+
selection: Array<HTMLElement>;
|
|
206
|
+
selectable: HTMLElement;
|
|
207
|
+
}, event: MouseEvent) => void;
|
|
208
|
+
};
|
|
209
|
+
export type SortableOptions = {
|
|
210
|
+
scroll?: boolean;
|
|
211
|
+
scrollSpeed?: number;
|
|
212
|
+
filter?: string;
|
|
213
|
+
ghostContainer?: HTMLElement;
|
|
214
|
+
ghostClass?: string;
|
|
215
|
+
group?: string;
|
|
216
|
+
handle?: string;
|
|
217
|
+
activeClass?: string;
|
|
218
|
+
move?: {
|
|
219
|
+
to?: ((item: HTMLElement, from: HTMLElement) => boolean) | boolean | 'copy';
|
|
220
|
+
from?: ((item: HTMLElement, from: HTMLElement, to: HTMLElement) => boolean) | boolean;
|
|
221
|
+
};
|
|
222
|
+
spill?: 'remove' | 'revert';
|
|
223
|
+
sort?: boolean;
|
|
224
|
+
onActive?: (data: {
|
|
225
|
+
item: HTMLElement;
|
|
226
|
+
from: HTMLElement;
|
|
227
|
+
}) => void;
|
|
228
|
+
onDeactive?: (data: {
|
|
229
|
+
item: HTMLElement;
|
|
230
|
+
from: HTMLElement;
|
|
231
|
+
}) => void;
|
|
232
|
+
onStart?: (data: {
|
|
233
|
+
item: HTMLElement;
|
|
234
|
+
from: HTMLElement;
|
|
235
|
+
index: number;
|
|
236
|
+
}, event: MouseEvent) => void;
|
|
237
|
+
onEnd?: (data: {
|
|
238
|
+
item: HTMLElement;
|
|
239
|
+
from: HTMLElement;
|
|
240
|
+
to: HTMLElement;
|
|
241
|
+
}, event: MouseEvent) => void;
|
|
242
|
+
onChange?: (data: {
|
|
243
|
+
item: HTMLElement;
|
|
244
|
+
from: HTMLElement;
|
|
245
|
+
to: HTMLElement;
|
|
246
|
+
fromIndex: number;
|
|
247
|
+
toIndex: number;
|
|
248
|
+
}, event: MouseEvent) => void;
|
|
249
|
+
onUpdate?: (data: {
|
|
250
|
+
item: HTMLElement;
|
|
251
|
+
from: HTMLElement;
|
|
252
|
+
to: HTMLElement;
|
|
253
|
+
}, event: MouseEvent) => void;
|
|
254
|
+
onEnter?: (data: {
|
|
255
|
+
item: HTMLElement;
|
|
256
|
+
from: HTMLElement;
|
|
257
|
+
to: HTMLElement;
|
|
258
|
+
dir: string;
|
|
259
|
+
}, event: MouseEvent) => void;
|
|
260
|
+
onLeave?: (data: {
|
|
261
|
+
item: HTMLElement;
|
|
262
|
+
from: HTMLElement;
|
|
263
|
+
to: HTMLElement;
|
|
264
|
+
}, event: MouseEvent) => void;
|
|
265
|
+
onAdd?: (data: {
|
|
266
|
+
item: HTMLElement;
|
|
267
|
+
from: HTMLElement;
|
|
268
|
+
to: HTMLElement;
|
|
269
|
+
index: number;
|
|
270
|
+
}, event: MouseEvent) => void;
|
|
271
|
+
onRemove?: (data: {
|
|
272
|
+
item: HTMLElement;
|
|
273
|
+
from: HTMLElement;
|
|
274
|
+
to: HTMLElement;
|
|
275
|
+
}, event: MouseEvent) => void;
|
|
276
|
+
};
|
|
277
|
+
export type CollisionDetectorOptions = {
|
|
278
|
+
container?: Element;
|
|
279
|
+
};
|
|
280
|
+
export type CollisionData = {
|
|
281
|
+
x1: number;
|
|
282
|
+
y1: number;
|
|
283
|
+
x2: number;
|
|
284
|
+
y2: number;
|
|
285
|
+
el?: HTMLElement;
|
|
286
|
+
};
|
package/utils.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const ONE_ANG: number;
|
|
2
|
+
export declare const ONE_RAD: number;
|
|
3
|
+
export declare function getBox(child: Element, parent?: Element): {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
w: number;
|
|
7
|
+
h: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function getPointOffset(e: MouseEvent, pos: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}): number[];
|
|
13
|
+
export declare function isSVGEl(el: Element): el is SVGElement;
|
|
14
|
+
export declare const EDGE_THRESHOLD = 5;
|
|
15
|
+
export declare const DRAGGING_RULE = "body * { pointer-events: none; }";
|
|
16
|
+
export declare function lockPage(): void;
|
|
17
|
+
export declare function unlockPage(): void;
|
|
18
|
+
export declare function saveCursor(): void;
|
|
19
|
+
export declare function setCursor(cursor: string): void;
|
|
20
|
+
export declare function restoreCursor(): void;
|
|
21
|
+
export declare function getStyleXy(el: HTMLElement | SVGGraphicsElement): {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
};
|
|
25
|
+
export declare function getMatrixInfo(elCStyle: CSSStyleDeclaration | HTMLElement | SVGGraphicsElement): {
|
|
26
|
+
scale: number;
|
|
27
|
+
angle: number;
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
};
|
|
31
|
+
export declare function getPointInContainer(event: MouseEvent | PointerEvent, el: HTMLElement | SVGGraphicsElement, elRect?: DOMRect, elCStyle?: CSSStyleDeclaration, matrixInfo?: {
|
|
32
|
+
scale: number;
|
|
33
|
+
angle: number;
|
|
34
|
+
}): {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
};
|
|
38
|
+
export declare function getRectInContainer(el: HTMLElement | SVGGraphicsElement, container: HTMLElement | SVGGraphicsElement): {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
w: number;
|
|
42
|
+
h: number;
|
|
43
|
+
};
|
|
44
|
+
export declare function getCenterXy(el: HTMLElement | SVGGraphicsElement): {
|
|
45
|
+
sx: number;
|
|
46
|
+
sy: number;
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
ox: number;
|
|
50
|
+
oy: number;
|
|
51
|
+
};
|
package/types/draggable.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { DraggableOptions, Uii } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* 用于表示一个或多个可拖动元素的定义
|
|
4
|
-
* > 可用CSS接口
|
|
5
|
-
* - .uii-draggable
|
|
6
|
-
* - .uii-draggable-handle
|
|
7
|
-
* - .uii-draggable-active
|
|
8
|
-
* - .uii-draggable-ghost
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export declare class Draggable extends Uii {
|
|
12
|
-
#private;
|
|
13
|
-
constructor(els: string | HTMLElement | Array<string | HTMLElement>, opts?: DraggableOptions);
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
onOptionChanged(opts: Record<string, any>): void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* create a draggable pattern for one or more elements with opts
|
|
21
|
-
* @param els selector string / html element
|
|
22
|
-
* @param opts
|
|
23
|
-
* @returns Draggable instance
|
|
24
|
-
*/
|
|
25
|
-
export declare function newDraggable(els: string | HTMLElement | Array<string | HTMLElement>, opts?: DraggableOptions): Draggable;
|
package/types/droppable.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { DroppableOptions, Uii } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* 用于表示一个或多个可响应拖动元素的定义
|
|
4
|
-
* > 可用CSS接口
|
|
5
|
-
* - .uii-droppable
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export declare class Droppable extends Uii {
|
|
9
|
-
#private;
|
|
10
|
-
constructor(el: string | HTMLElement | Array<string | HTMLElement>, opts?: DroppableOptions);
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
bindEvent(el: HTMLElement, opts: Record<string, any>): void;
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
active(target: HTMLElement): void;
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
deactive(target: HTMLElement): void;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Enable els to response to draggable objects
|
|
26
|
-
* @param els selector string / html element
|
|
27
|
-
* @param opts
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
export declare function newDroppable(els: string | HTMLElement | Array<string | HTMLElement>, opts?: DroppableOptions): Droppable;
|
package/types/resizable.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ResizableOptions, Uii } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* 用于表示一个或多个可改变尺寸元素的定义
|
|
4
|
-
* > 可用CSS接口
|
|
5
|
-
* - .uii-resizable-handle
|
|
6
|
-
* - .uii-resizable-handle-[n/s/e/w/ne/nw/se/sw]
|
|
7
|
-
* - .uii-resizable-handle-active
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export declare class Resizable extends Uii {
|
|
11
|
-
constructor(els: string | HTMLElement, opts?: ResizableOptions);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Make els resizable
|
|
15
|
-
* @param els selector string / html element
|
|
16
|
-
* @param opts
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
export declare function newResizable(els: string | HTMLElement, opts?: ResizableOptions): Resizable;
|
package/types/rotatable.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* dom rotator
|
|
3
|
-
* @author holyhigh2
|
|
4
|
-
*/
|
|
5
|
-
import { RotatableOptions, Uii } from './types';
|
|
6
|
-
/**
|
|
7
|
-
* 用于表示一个或多个可旋转元素的定义
|
|
8
|
-
* > 可用CSS接口
|
|
9
|
-
* - .uii-rotatable
|
|
10
|
-
* - .uii-rotatable-handle
|
|
11
|
-
* - .uii-rotatable-active
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export declare class Rotatable extends Uii {
|
|
15
|
-
constructor(els: string | HTMLElement, opts?: RotatableOptions);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Make els rotatable
|
|
19
|
-
* @param els selector string / html element
|
|
20
|
-
* @param opts
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
export declare function newRotatable(els: string | HTMLElement, opts?: RotatableOptions): Rotatable;
|
package/types/selectable.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* selector
|
|
3
|
-
* @author holyhigh2
|
|
4
|
-
*/
|
|
5
|
-
import { SelectableOptions, Uii } from "./types";
|
|
6
|
-
/**
|
|
7
|
-
* 用于表示一个元素选择器的定义
|
|
8
|
-
* > 可用CSS接口
|
|
9
|
-
* - .uii-selector
|
|
10
|
-
* - .uii-selecting
|
|
11
|
-
* - .uii-selected
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export declare class Selectable extends Uii {
|
|
15
|
-
#private;
|
|
16
|
-
constructor(container: string | HTMLElement, opts?: SelectableOptions);
|
|
17
|
-
/**
|
|
18
|
-
* 更新targets
|
|
19
|
-
*/
|
|
20
|
-
updateTargets(): void;
|
|
21
|
-
/**
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
onOptionChanged(): void;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Add a selector into the container
|
|
28
|
-
* @param container css selector or html element
|
|
29
|
-
* @param opts
|
|
30
|
-
* @returns
|
|
31
|
-
*/
|
|
32
|
-
export declare function newSelectable(container: string | HTMLElement, opts?: SelectableOptions): Selectable;
|
package/types/splittable.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SplittableOptions, Uii } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* 用于表示一个或多个分割器的定义
|
|
4
|
-
* > 可用CSS接口
|
|
5
|
-
* - .uii-splittable
|
|
6
|
-
* - .uii-splittable-handle
|
|
7
|
-
* - .uii-splittable-handle-ghost
|
|
8
|
-
* - .uii-splittable-handle-active
|
|
9
|
-
* - .uii-splittable-v
|
|
10
|
-
* - .uii-splittable-h
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare class Splittable extends Uii {
|
|
14
|
-
#private;
|
|
15
|
-
constructor(container: string | HTMLElement, opts?: SplittableOptions);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Add one or more splittors into the container
|
|
19
|
-
* @param container css selector or html element
|
|
20
|
-
* @param opts SplittableOptions
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
export declare function newSplittable(container: string | HTMLElement, opts?: SplittableOptions): Splittable;
|