uiik 1.1.0 → 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 +14 -0
- package/README.md +1 -0
- package/detector.d.ts +0 -19
- package/draggable.d.ts +1 -18
- package/droppable.d.ts +0 -21
- package/index.d.ts +2 -0
- package/index.esm.js +2582 -2
- package/index.js +2625 -2
- package/package.json +4 -7
- package/resizable.d.ts +3 -15
- package/rotatable.d.ts +3 -16
- package/selectable.d.ts +0 -20
- package/sortable.d.ts +0 -24
- package/splittable.d.ts +0 -17
- package/transform.d.ts +19 -0
- package/types.d.ts +39 -307
- package/utils.d.ts +41 -12
- package/detector.js +0 -128
- package/draggable.js +0 -530
- package/droppable.js +0 -160
- package/resizable.js +0 -308
- package/rotatable.js +0 -137
- package/selectable.js +0 -281
- package/sortable.js +0 -441
- package/splittable.js +0 -340
- package/types.js +0 -116
- package/utils.js +0 -58
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uiik",
|
|
3
|
-
"version": "1.
|
|
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",
|
|
@@ -26,15 +26,12 @@
|
|
|
26
26
|
"detector"
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build": "
|
|
29
|
+
"build": "rollup --config",
|
|
30
30
|
"test": "rollup --config rollup.config.test.js --watch",
|
|
31
31
|
"doc": "npx typedoc"
|
|
32
32
|
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"myfx":">=1.0"
|
|
35
|
-
},
|
|
36
33
|
"dependencies": {
|
|
37
|
-
"myfx":"1.0
|
|
34
|
+
"myfx":"1.1.0"
|
|
38
35
|
},
|
|
39
36
|
"devDependencies": {
|
|
40
37
|
"@babel/core": "^7.12.3",
|
|
@@ -57,7 +54,7 @@
|
|
|
57
54
|
"rollup-pluginutils": "^2.8.2",
|
|
58
55
|
"tslib": "^2.4.0",
|
|
59
56
|
"typescript": "^4.8.2",
|
|
60
|
-
"typedoc": "^0.
|
|
57
|
+
"typedoc": "^0.24.8",
|
|
61
58
|
"typedoc-plugin-markdown": "^3.14.0"
|
|
62
59
|
}
|
|
63
60
|
}
|
package/resizable.d.ts
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import { ResizableOptions, Uii } from
|
|
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
|
-
*/
|
|
1
|
+
import { ResizableOptions, Uii } from "./types";
|
|
10
2
|
export declare class Resizable extends Uii {
|
|
11
3
|
constructor(els: string | HTMLElement, opts?: ResizableOptions);
|
|
4
|
+
bindHandle(handle: HTMLElement | SVGElement, dir: string, panel: HTMLElement, opts: ResizableOptions): void;
|
|
5
|
+
initHandle(panel: HTMLElement): void;
|
|
12
6
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Make els resizable
|
|
15
|
-
* @param els selector string / html element
|
|
16
|
-
* @param opts
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
7
|
export declare function newResizable(els: string | HTMLElement, opts?: ResizableOptions): Resizable;
|
package/rotatable.d.ts
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import { RotatableOptions, Uii } from
|
|
2
|
-
|
|
3
|
-
* 用于表示一个或多个可旋转元素的定义
|
|
4
|
-
* > 可用CSS接口
|
|
5
|
-
* - .uii-rotatable
|
|
6
|
-
* - .uii-rotatable-handle
|
|
7
|
-
* - .uii-rotatable-active
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
1
|
+
import { RotatableOptions, Uii } from "./types";
|
|
2
|
+
import 'myfx';
|
|
10
3
|
export declare class Rotatable extends Uii {
|
|
11
|
-
constructor(els: string |
|
|
4
|
+
constructor(els: string | Element, opts?: RotatableOptions);
|
|
12
5
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Make els rotatable
|
|
15
|
-
* @param els selector string / html element
|
|
16
|
-
* @param opts
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
6
|
export declare function newRotatable(els: string | HTMLElement, opts?: RotatableOptions): Rotatable;
|
package/selectable.d.ts
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
import { SelectableOptions, Uii } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* 用于表示一个元素选择器的定义
|
|
4
|
-
* > 可用CSS接口
|
|
5
|
-
* - .uii-selector
|
|
6
|
-
* - .uii-selecting
|
|
7
|
-
* - .uii-selected
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
2
|
export declare class Selectable extends Uii {
|
|
11
3
|
#private;
|
|
12
4
|
constructor(container: string | HTMLElement, opts?: SelectableOptions);
|
|
13
|
-
/**
|
|
14
|
-
* 更新targets
|
|
15
|
-
*/
|
|
16
5
|
updateTargets(): void;
|
|
17
|
-
/**
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
6
|
onOptionChanged(): void;
|
|
21
7
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Add a selector into the container
|
|
24
|
-
* @param container css selector or html element
|
|
25
|
-
* @param opts
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
8
|
export declare function newSelectable(container: string | HTMLElement, opts?: SelectableOptions): Selectable;
|
package/sortable.d.ts
CHANGED
|
@@ -1,33 +1,9 @@
|
|
|
1
1
|
import { SortableOptions, Uii } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* 用于表示一类排序容器的定义
|
|
4
|
-
* > 可用CSS接口
|
|
5
|
-
* - .uii-sortable-container
|
|
6
|
-
* - .uii-sortable-ghost
|
|
7
|
-
* - .uii-sortable-active
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
2
|
export declare class Sortable extends Uii {
|
|
11
3
|
#private;
|
|
12
4
|
constructor(container: string | HTMLElement | Array<HTMLElement>, opts?: SortableOptions);
|
|
13
|
-
/**
|
|
14
|
-
* 调用active表示移出策略肯定是true | 'copy'
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
5
|
active(draggingItem: HTMLElement, fromContainer: HTMLElement, toContainers: HTMLElement[], toOpts: SortableOptions): void;
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
6
|
deactive(draggingItem: HTMLElement, fromContainer: HTMLElement, toContainers: HTMLElement[], opts: SortableOptions): void;
|
|
22
|
-
/**
|
|
23
|
-
* @internal
|
|
24
|
-
*/
|
|
25
7
|
onOptionChanged(): void;
|
|
26
8
|
}
|
|
27
|
-
/**
|
|
28
|
-
* make elements within the container sortable
|
|
29
|
-
* @param container css selector or html element(array)
|
|
30
|
-
* @param opts
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
9
|
export declare function newSortable(container: string | HTMLElement | Array<HTMLElement>, opts?: SortableOptions): Sortable;
|
package/splittable.d.ts
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
1
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
2
|
export declare class Splittable extends Uii {
|
|
14
3
|
#private;
|
|
15
4
|
constructor(container: string | HTMLElement, opts?: SplittableOptions);
|
|
16
5
|
}
|
|
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
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;
|