uiik 1.3.0-beta.1 → 1.3.0-beta.3

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 CHANGED
@@ -7,7 +7,12 @@
7
7
  ### 新增
8
8
  - handle 属性变更,支持更多类型
9
9
  - onPointerDown 事件,可用于阻止后续逻辑
10
- - draggable watch参数,可用于dom变动自动检测
10
+ - Draggable watch参数,可用于dom变动自动检测
11
+ - Draggable self参数,仅自身元素响应时触发
12
+ - Droppable watch参数,可用于dom变动自动检测
13
+ - Uiik mouseButton参数,可指定鼠标响应按钮
14
+ ### 修复
15
+ - Droppable 元素同时为Draggable时会自己触发Droppable事件
11
16
 
12
17
  ## [1.2.0] - 2023/9/3
13
18
  ### Add
package/detector.d.ts CHANGED
@@ -6,29 +6,10 @@ export declare class CollisionDetector {
6
6
  elData: CollisionData;
7
7
  opts: Record<string, any>;
8
8
  constructor(el: string | HTMLElement, targets: (() => Array<HTMLElement>) | string | HTMLElement | Array<HTMLElement> | NodeList | HTMLCollection, opts?: CollisionDetectorOptions);
9
- /**
10
- * update targets data if them changed
11
- */
12
9
  update(): void;
13
- /**
14
- * detect targets and return overlaps
15
- * @returns
16
- */
17
10
  getOverlaps(): Array<HTMLElement>;
18
11
  getOverlaps(x1: number, y1: number, x2: number, y2: number): Array<HTMLElement>;
19
- /**
20
- * detect targets and return inclusions
21
- * @returns
22
- */
23
12
  getInclusions(): Array<HTMLElement>;
24
13
  getInclusions(x1: number, y1: number, x2: number, y2: number): Array<HTMLElement>;
25
14
  }
26
- /**
27
- * create a detector for the el and return
28
- * @param el element to be detected
29
- * @param targets
30
- * @param opts CollisionDetectorOptions
31
- * @param opts.container a root element of targets
32
- * @returns
33
- */
34
15
  export declare function newCollisionDetector(el: string | HTMLElement, targets: (() => Array<HTMLElement>) | string | HTMLElement | Array<HTMLElement> | NodeList | HTMLCollection, opts?: CollisionDetectorOptions): CollisionDetector;
package/draggable.d.ts CHANGED
@@ -1,28 +1,8 @@
1
1
  import { DraggableOptions, Uii } from "./types";
2
- /**
3
- * 用于表示一个或多个可拖动元素的定义
4
- * 每个拖动元素可以有独立handle,也可以公用一个handle
5
- * 可拖动元素拖动时自动剔除left/top/x/y/cx/cy属性,而使用transform:translate替代
6
- * > 可用CSS接口
7
- * - .uii-draggable
8
- * - .uii-draggable-handle
9
- * - .uii-draggable-active
10
- * - .uii-draggable-ghost
11
- * @public
12
- */
13
2
  export declare class Draggable extends Uii {
14
3
  #private;
15
4
  constructor(els: string | HTMLElement | Array<string | HTMLElement>, opts?: DraggableOptions);
16
5
  bindEvent(bindTarget: Element, opts: DraggableOptions, handleMap: WeakMap<Element, Element>): void;
17
- /**
18
- * @internal
19
- */
20
6
  onOptionChanged(opts: Record<string, any>): void;
21
7
  }
22
- /**
23
- * create a draggable pattern for one or more elements with opts
24
- * @param els selector string / html element
25
- * @param opts
26
- * @returns Draggable instance
27
- */
28
8
  export declare function newDraggable(els: string | HTMLElement | Array<string | HTMLElement>, opts?: DraggableOptions): Draggable;
package/droppable.d.ts CHANGED
@@ -1,30 +1,9 @@
1
1
  import { DroppableOptions, Uii } from "./types";
2
- /**
3
- * 用于表示一个或多个可响应拖动元素的定义
4
- * > 可用CSS接口
5
- * - .uii-droppable
6
- * @public
7
- */
8
2
  export declare class Droppable extends Uii {
9
3
  #private;
10
4
  constructor(el: string | HTMLElement | Array<string | HTMLElement>, opts?: DroppableOptions);
11
- /**
12
- * @internal
13
- */
14
5
  bindEvent(droppable: HTMLElement, opts: DroppableOptions): void;
15
- /**
16
- * @internal
17
- */
18
6
  active(target: HTMLElement): void;
19
- /**
20
- * @internal
21
- */
22
7
  deactive(target: HTMLElement): void;
23
8
  }
24
- /**
25
- * Enable els to response to draggable objects
26
- * @param els selector string / html element
27
- * @param opts
28
- * @returns
29
- */
30
9
  export declare function newDroppable(els: string | HTMLElement | Array<string | HTMLElement>, opts?: DroppableOptions): Droppable;