uiik 1.3.0-alpha → 1.3.0-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uiik",
3
- "version": "1.3.0-alpha",
3
+ "version": "1.3.0-beta.1",
4
4
  "description": "A UI interactions kit includes draggable, splittable, rotatable, selectable, etc.",
5
5
  "main": "index.js",
6
6
  "module": "index.esm.js",
@@ -28,6 +28,7 @@
28
28
  "scripts": {
29
29
  "build": "rollup --config",
30
30
  "test": "rollup --config rollup.config.test.js --watch",
31
+ "release": "rollup --config rollup.config.release.js",
31
32
  "doc": "npx typedoc"
32
33
  },
33
34
  "dependencies": {
package/resizable.d.ts CHANGED
@@ -1,7 +1,21 @@
1
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
+ */
2
10
  export declare class Resizable extends Uii {
3
11
  constructor(els: string | HTMLElement, opts?: ResizableOptions);
4
12
  bindHandle(handle: HTMLElement | SVGElement, dir: string, panel: HTMLElement, opts: ResizableOptions): void;
5
13
  initHandle(panel: HTMLElement): void;
6
14
  }
15
+ /**
16
+ * Make els resizable
17
+ * @param els selector string / html element
18
+ * @param opts
19
+ * @returns
20
+ */
7
21
  export declare function newResizable(els: string | HTMLElement, opts?: ResizableOptions): Resizable;
package/rotatable.d.ts CHANGED
@@ -1,6 +1,19 @@
1
1
  import { RotatableOptions, Uii } from "./types";
2
- import 'myfx';
2
+ /**
3
+ * 用于表示一个或多个可旋转元素的定义
4
+ * > 可用CSS接口
5
+ * - .uii-rotatable
6
+ * - .uii-rotatable-handle
7
+ * - .uii-rotatable-active
8
+ * @public
9
+ */
3
10
  export declare class Rotatable extends Uii {
4
11
  constructor(els: string | Element, opts?: RotatableOptions);
5
12
  }
13
+ /**
14
+ * Make els rotatable
15
+ * @param els selector string / html element
16
+ * @param opts
17
+ * @returns
18
+ */
6
19
  export declare function newRotatable(els: string | HTMLElement, opts?: RotatableOptions): Rotatable;
package/selectable.d.ts CHANGED
@@ -1,8 +1,28 @@
1
1
  import { SelectableOptions, Uii } from "./types";
2
+ /**
3
+ * 用于表示一个元素选择器的定义
4
+ * > 可用CSS接口
5
+ * - .uii-selector
6
+ * - .uii-selecting
7
+ * - .uii-selected
8
+ * @public
9
+ */
2
10
  export declare class Selectable extends Uii {
3
11
  #private;
4
12
  constructor(container: string | HTMLElement, opts?: SelectableOptions);
13
+ /**
14
+ * 更新targets
15
+ */
5
16
  updateTargets(): void;
17
+ /**
18
+ * @internal
19
+ */
6
20
  onOptionChanged(): void;
7
21
  }
22
+ /**
23
+ * Add a selector into the container
24
+ * @param container css selector or html element
25
+ * @param opts
26
+ * @returns
27
+ */
8
28
  export declare function newSelectable(container: string | HTMLElement, opts?: SelectableOptions): Selectable;
package/sortable.d.ts CHANGED
@@ -1,9 +1,33 @@
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
+ */
2
10
  export declare class Sortable extends Uii {
3
11
  #private;
4
12
  constructor(container: string | HTMLElement | Array<HTMLElement>, opts?: SortableOptions);
13
+ /**
14
+ * 调用active表示移出策略肯定是true | 'copy'
15
+ * @internal
16
+ */
5
17
  active(draggingItem: HTMLElement, fromContainer: HTMLElement, toContainers: HTMLElement[], toOpts: SortableOptions): void;
18
+ /**
19
+ * @internal
20
+ */
6
21
  deactive(draggingItem: HTMLElement, fromContainer: HTMLElement, toContainers: HTMLElement[], opts: SortableOptions): void;
22
+ /**
23
+ * @internal
24
+ */
7
25
  onOptionChanged(): void;
8
26
  }
27
+ /**
28
+ * make elements within the container sortable
29
+ * @param container css selector or html element(array)
30
+ * @param opts
31
+ * @returns
32
+ */
9
33
  export declare function newSortable(container: string | HTMLElement | Array<HTMLElement>, opts?: SortableOptions): Sortable;
package/splittable.d.ts CHANGED
@@ -1,6 +1,23 @@
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
+ */
2
13
  export declare class Splittable extends Uii {
3
14
  #private;
4
15
  constructor(container: string | HTMLElement, opts?: SplittableOptions);
5
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
+ */
6
23
  export declare function newSplittable(container: string | HTMLElement, opts?: SplittableOptions): Splittable;
package/transform.d.ts CHANGED
@@ -1,19 +1,46 @@
1
+ /**
2
+ * Transform APIs
3
+ * 用于屏蔽svg/html元素的transform差异,如rotate函数兼容问题
4
+ * @author holyhigh2
5
+ */
1
6
  export declare class UiiTransformer {
2
7
  x: number;
3
8
  y: number;
4
9
  angle: number;
5
10
  el: HTMLElement | SVGGraphicsElement;
6
11
  constructor(el: HTMLElement | SVGGraphicsElement);
7
- normalize(el: HTMLElement | SVGGraphicsElement): this;
12
+ normalize(el?: HTMLElement | SVGGraphicsElement): this;
8
13
  moveTo(x: number, y: number): void;
9
14
  moveToX(x: number): void;
10
15
  moveToY(y: number): void;
16
+ rotateTo(deg: number, cx?: number, cy?: number): void;
11
17
  }
18
+ /**
19
+ * 返回一个包装后的变形对象,可执行变形操作
20
+ * @param el
21
+ */
12
22
  export declare function wrapper(el: HTMLElement | SVGGraphicsElement): UiiTransformer;
23
+ /**
24
+ * 获取元素当前transform中的位移数据
25
+ * @param el HTMLElement|SVGGraphicsElement
26
+ * @returns {x,y}
27
+ */
13
28
  export declare function getTranslate(el: HTMLElement | SVGGraphicsElement): {
14
29
  x: number;
15
30
  y: number;
16
31
  };
32
+ /**
33
+ * 自动检测HTML元素或SVG元素并设置对应移动属性
34
+ * @param el HTMLElement|SVGGraphicsElement
35
+ * @param x value of px
36
+ * @param y value of px
37
+ */
17
38
  export declare function moveTo(el: HTMLElement | SVGGraphicsElement, x: number, y: number): void;
39
+ /**
40
+ * 自动检测HTML元素或SVG元素并设置对应移动属性
41
+ * @param el HTMLElement|SVGGraphicsElement
42
+ * @param x value of px
43
+ * @param y value of px
44
+ */
18
45
  export declare function moveBy(el: HTMLElement | SVGGraphicsElement, x: number, y: number): void;
19
46
  export declare function rotateTo(el: HTMLElement | SVGGraphicsElement, deg: number, cx?: number, cy?: number): void;