@leafer/display 1.0.0 → 1.0.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 +10 -10
- package/src/Leaf.ts +11 -5
- package/types/index.d.ts +6 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/display",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "@leafer/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/math": "1.0.
|
|
26
|
-
"@leafer/data": "1.0.
|
|
27
|
-
"@leafer/layout": "1.0.
|
|
28
|
-
"@leafer/display-module": "1.0.
|
|
29
|
-
"@leafer/event": "1.0.
|
|
30
|
-
"@leafer/decorator": "1.0.
|
|
31
|
-
"@leafer/helper": "1.0.
|
|
32
|
-
"@leafer/platform": "1.0.
|
|
25
|
+
"@leafer/math": "1.0.1",
|
|
26
|
+
"@leafer/data": "1.0.1",
|
|
27
|
+
"@leafer/layout": "1.0.1",
|
|
28
|
+
"@leafer/display-module": "1.0.1",
|
|
29
|
+
"@leafer/event": "1.0.1",
|
|
30
|
+
"@leafer/decorator": "1.0.1",
|
|
31
|
+
"@leafer/helper": "1.0.1",
|
|
32
|
+
"@leafer/platform": "1.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@leafer/interface": "1.0.
|
|
35
|
+
"@leafer/interface": "1.0.1"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/src/Leaf.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaferBase, ILeaf, ILeafInputData, ILeafData, ILeaferCanvas, IRenderOptions, IBoundsType, ILocationType, IMatrixWithBoundsData, ILayoutBoundsData, IValue, ILeafLayout, InnerId, IHitCanvas, IRadiusPointData, IEventListenerMap, IEventListener,
|
|
1
|
+
import { ILeaferBase, ILeaf, ILeafInputData, ILeafData, ILeaferCanvas, IRenderOptions, IBoundsType, ILocationType, IMatrixWithBoundsData, ILayoutBoundsData, IValue, ILeafLayout, InnerId, IHitCanvas, IRadiusPointData, IEventListenerMap, IEventListener, IEventListenerId, IEvent, IObject, IFunction, IPointData, IBoundsData, IBranch, IFindMethod, IMatrixData, IAttrDecorator, IMatrixWithBoundsScaleData, IMatrixWithScaleData, IAlign, IJSONOptions, IEventMap, IEventOption, IAxis } from '@leafer/interface'
|
|
2
2
|
import { BoundsHelper, IncrementId, MatrixHelper, PointHelper } from '@leafer/math'
|
|
3
3
|
import { LeafData } from '@leafer/data'
|
|
4
4
|
import { LeafLayout } from '@leafer/layout'
|
|
@@ -12,7 +12,7 @@ const { LEAF, create } = IncrementId
|
|
|
12
12
|
const { toInnerPoint, toOuterPoint, multiplyParent } = MatrixHelper
|
|
13
13
|
const { toOuterOf } = BoundsHelper
|
|
14
14
|
const { copy } = PointHelper
|
|
15
|
-
const { moveLocal, zoomOfLocal, rotateOfLocal, skewOfLocal, moveWorld, zoomOfWorld, rotateOfWorld, skewOfWorld, transform, transformWorld, setTransform, getLocalOrigin, getRelativeWorld, drop } = LeafHelper
|
|
15
|
+
const { moveLocal, zoomOfLocal, rotateOfLocal, skewOfLocal, moveWorld, zoomOfWorld, rotateOfWorld, skewOfWorld, transform, transformWorld, setTransform, getFlipTransform, getLocalOrigin, getRelativeWorld, drop } = LeafHelper
|
|
16
16
|
|
|
17
17
|
@useModule(LeafDataProxy)
|
|
18
18
|
@useModule(LeafMatrix)
|
|
@@ -84,6 +84,8 @@ export class Leaf implements ILeaf {
|
|
|
84
84
|
public get pathInputed(): boolean { return this.__.__pathInputed as unknown as boolean }
|
|
85
85
|
|
|
86
86
|
// event
|
|
87
|
+
public set event(map: IEventMap) { let event; for (let key in map) event = map[key], event instanceof Array ? this.on(key, event[0], event[1]) : this.on(key, event) }
|
|
88
|
+
|
|
87
89
|
public __captureMap?: IEventListenerMap
|
|
88
90
|
public __bubbleMap?: IEventListenerMap
|
|
89
91
|
|
|
@@ -474,6 +476,10 @@ export class Leaf implements ILeaf {
|
|
|
474
476
|
skewOfWorld(this, worldOrigin, skewX, skewY, resize)
|
|
475
477
|
}
|
|
476
478
|
|
|
479
|
+
public flip(axis: IAxis): void {
|
|
480
|
+
transform(this, getFlipTransform(this, axis))
|
|
481
|
+
}
|
|
482
|
+
|
|
477
483
|
|
|
478
484
|
// @leafer-in/resize rewrite
|
|
479
485
|
|
|
@@ -560,11 +566,11 @@ export class Leaf implements ILeaf {
|
|
|
560
566
|
|
|
561
567
|
// LeafEventer rewrite
|
|
562
568
|
|
|
563
|
-
public on(_type: string | string[], _listener: IEventListener, _options?:
|
|
569
|
+
public on(_type: string | string[], _listener: IEventListener, _options?: IEventOption): void { }
|
|
564
570
|
|
|
565
|
-
public off(_type?: string | string[], _listener?: IEventListener, _options?:
|
|
571
|
+
public off(_type?: string | string[], _listener?: IEventListener, _options?: IEventOption): void { }
|
|
566
572
|
|
|
567
|
-
public on_(_type: string | string[], _listener: IEventListener, _bind?: IObject, _options?:
|
|
573
|
+
public on_(_type: string | string[], _listener: IEventListener, _bind?: IObject, _options?: IEventOption): IEventListenerId { return undefined }
|
|
568
574
|
|
|
569
575
|
public off_(_id: IEventListenerId | IEventListenerId[]): void { }
|
|
570
576
|
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaf, InnerId, ILeaferBase, ILeafData, ILeafLayout, IMatrixWithBoundsScaleData, IMatrixWithBoundsData, IMatrixData, IBoundsData, IMatrixWithScaleData, IHitCanvas, IEventListenerMap, IFunction, ILeafInputData, IObject, IValue, IJSONOptions, IFindMethod, ILeaferCanvas, IRenderOptions, ILocationType, IBoundsType, ILayoutBoundsData, IPointData, IAlign, IRadiusPointData, IEventListener,
|
|
1
|
+
import { ILeaf, InnerId, ILeaferBase, ILeafData, ILeafLayout, IMatrixWithBoundsScaleData, IMatrixWithBoundsData, IMatrixData, IBoundsData, IMatrixWithScaleData, IHitCanvas, IEventMap, IEventListenerMap, IFunction, ILeafInputData, IObject, IValue, IJSONOptions, IFindMethod, ILeaferCanvas, IRenderOptions, ILocationType, IBoundsType, ILayoutBoundsData, IPointData, IAlign, IAxis, IRadiusPointData, IEventListener, IEventOption, IEventListenerId, IEvent, IAttrDecorator } from '@leafer/interface';
|
|
2
2
|
import { LeafData } from '@leafer/data';
|
|
3
3
|
import { LeafLayout } from '@leafer/layout';
|
|
4
4
|
|
|
@@ -43,6 +43,7 @@ declare class Leaf implements ILeaf {
|
|
|
43
43
|
get __ignoreHitWorld(): boolean;
|
|
44
44
|
get __inLazyBounds(): boolean;
|
|
45
45
|
get pathInputed(): boolean;
|
|
46
|
+
set event(map: IEventMap);
|
|
46
47
|
__captureMap?: IEventListenerMap;
|
|
47
48
|
__bubbleMap?: IEventListenerMap;
|
|
48
49
|
__parentWait?: IFunction[];
|
|
@@ -130,6 +131,7 @@ declare class Leaf implements ILeaf {
|
|
|
130
131
|
scaleOfWorld(worldOrigin: IPointData, scaleX: number, scaleY?: number, resize?: boolean): void;
|
|
131
132
|
rotateOfWorld(worldOrigin: IPointData, rotation: number): void;
|
|
132
133
|
skewOfWorld(worldOrigin: IPointData, skewX: number, skewY?: number, resize?: boolean): void;
|
|
134
|
+
flip(axis: IAxis): void;
|
|
133
135
|
scaleResize(scaleX: number, scaleY?: number, _noResize?: boolean): void;
|
|
134
136
|
__scaleResize(_scaleX: number, _scaleY: number): void;
|
|
135
137
|
resizeWidth(_width: number): void;
|
|
@@ -156,9 +158,9 @@ declare class Leaf implements ILeaf {
|
|
|
156
158
|
add(_child: ILeaf, _index?: number): void;
|
|
157
159
|
remove(_child?: ILeaf, destroy?: boolean): void;
|
|
158
160
|
dropTo(parent: ILeaf, index?: number, resize?: boolean): void;
|
|
159
|
-
on(_type: string | string[], _listener: IEventListener, _options?:
|
|
160
|
-
off(_type?: string | string[], _listener?: IEventListener, _options?:
|
|
161
|
-
on_(_type: string | string[], _listener: IEventListener, _bind?: IObject, _options?:
|
|
161
|
+
on(_type: string | string[], _listener: IEventListener, _options?: IEventOption): void;
|
|
162
|
+
off(_type?: string | string[], _listener?: IEventListener, _options?: IEventOption): void;
|
|
163
|
+
on_(_type: string | string[], _listener: IEventListener, _bind?: IObject, _options?: IEventOption): IEventListenerId;
|
|
162
164
|
off_(_id: IEventListenerId | IEventListenerId[]): void;
|
|
163
165
|
once(_type: string | string[], _listener: IEventListener, _capture?: boolean): void;
|
|
164
166
|
emit(_type: string, _event?: IEvent | IObject, _capture?: boolean): void;
|