@leafer/display 1.0.2 → 1.0.4
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 +11 -10
- package/src/Branch.ts +18 -11
- package/src/Leaf.ts +81 -24
- package/types/index.d.ts +18 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/display",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "@leafer/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,16 +22,17 @@
|
|
|
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/
|
|
25
|
+
"@leafer/math": "1.0.4",
|
|
26
|
+
"@leafer/data": "1.0.4",
|
|
27
|
+
"@leafer/layout": "1.0.4",
|
|
28
|
+
"@leafer/display-module": "1.0.4",
|
|
29
|
+
"@leafer/event": "1.0.4",
|
|
30
|
+
"@leafer/decorator": "1.0.4",
|
|
31
|
+
"@leafer/helper": "1.0.4",
|
|
32
|
+
"@leafer/debug": "1.0.4",
|
|
33
|
+
"@leafer/platform": "1.0.4"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
|
-
"@leafer/interface": "1.0.
|
|
36
|
+
"@leafer/interface": "1.0.4"
|
|
36
37
|
}
|
|
37
38
|
}
|
package/src/Branch.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ILeaf } from '@leafer/interface'
|
|
2
2
|
import { ChildEvent } from '@leafer/event'
|
|
3
3
|
import { BoundsHelper } from '@leafer/math'
|
|
4
|
-
import { BranchHelper, LeafBoundsHelper
|
|
4
|
+
import { BranchHelper, LeafBoundsHelper } from '@leafer/helper'
|
|
5
5
|
import { useModule } from '@leafer/decorator'
|
|
6
6
|
import { BranchRender } from '@leafer/display-module'
|
|
7
7
|
|
|
@@ -74,7 +74,7 @@ export class Branch extends Leaf { // tip: rewrited Group
|
|
|
74
74
|
child.__layout.boxChanged || child.__layout.boxChange() // layouted(removed), need update
|
|
75
75
|
child.__layout.matrixChanged || child.__layout.matrixChange() // layouted(removed), need update
|
|
76
76
|
|
|
77
|
-
if (child.
|
|
77
|
+
if (child.__bubbleMap) child.__emitLifeEvent(ChildEvent.ADD)
|
|
78
78
|
|
|
79
79
|
if (this.leafer) {
|
|
80
80
|
child.__bindLeafer(this.leafer)
|
|
@@ -90,14 +90,10 @@ export class Branch extends Leaf { // tip: rewrited Group
|
|
|
90
90
|
|
|
91
91
|
public remove(child?: ILeaf, destroy?: boolean): void {
|
|
92
92
|
if (child) {
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this.__preRemove()
|
|
98
|
-
this.__realRemoveChild(child)
|
|
99
|
-
if (destroy) child.destroy()
|
|
100
|
-
}
|
|
93
|
+
|
|
94
|
+
if ((child as ILeaf).animationOut) child.__runAnimation('out', () => this.__remove(child, destroy))
|
|
95
|
+
else this.__remove(child, destroy)
|
|
96
|
+
|
|
101
97
|
} else if (child === undefined) {
|
|
102
98
|
super.remove(null, destroy)
|
|
103
99
|
}
|
|
@@ -120,6 +116,17 @@ export class Branch extends Leaf { // tip: rewrited Group
|
|
|
120
116
|
this.removeAll(true)
|
|
121
117
|
}
|
|
122
118
|
|
|
119
|
+
protected __remove(child?: ILeaf, destroy?: boolean): void {
|
|
120
|
+
const index = this.children.indexOf(child)
|
|
121
|
+
if (index > -1) {
|
|
122
|
+
this.children.splice(index, 1)
|
|
123
|
+
if (child.isBranch) this.__.__childBranchNumber = (this.__.__childBranchNumber || 1) - 1
|
|
124
|
+
this.__preRemove()
|
|
125
|
+
this.__realRemoveChild(child)
|
|
126
|
+
if (destroy) child.destroy()
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
123
130
|
protected __preRemove(): void {
|
|
124
131
|
if (this.__hasMask) this.__updateMask()
|
|
125
132
|
if (this.__hasEraser) this.__updateEraser()
|
|
@@ -128,6 +135,7 @@ export class Branch extends Leaf { // tip: rewrited Group
|
|
|
128
135
|
}
|
|
129
136
|
|
|
130
137
|
protected __realRemoveChild(child: ILeaf): void {
|
|
138
|
+
child.__emitLifeEvent(ChildEvent.REMOVE)
|
|
131
139
|
child.parent = null
|
|
132
140
|
if (this.leafer) {
|
|
133
141
|
child.__bindLeafer(null)
|
|
@@ -140,7 +148,6 @@ export class Branch extends Leaf { // tip: rewrited Group
|
|
|
140
148
|
|
|
141
149
|
protected __emitChildEvent(type: string, child: ILeaf): void {
|
|
142
150
|
const event = new ChildEvent(type, child, this)
|
|
143
|
-
if (child.hasEvent(type)) child.emitEvent(event)
|
|
144
151
|
if (this.hasEvent(type) && !this.isLeafer) this.emitEvent(event)
|
|
145
152
|
this.leafer.emitEvent(event)
|
|
146
153
|
}
|
package/src/Leaf.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
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'
|
|
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, IMotionPathData, IUnitData, IRotationPointData } 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'
|
|
5
5
|
import { LeafDataProxy, LeafMatrix, LeafBounds, LeafEventer, LeafRender } from '@leafer/display-module'
|
|
6
6
|
import { boundsType, useModule, defineDataProcessor } from '@leafer/decorator'
|
|
7
|
-
import { LeafHelper
|
|
7
|
+
import { LeafHelper } from '@leafer/helper'
|
|
8
8
|
import { ChildEvent } from '@leafer/event'
|
|
9
|
+
import { needPlugin } from '@leafer/debug'
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
const { LEAF, create } = IncrementId
|
|
12
13
|
const { toInnerPoint, toOuterPoint, multiplyParent } = MatrixHelper
|
|
13
14
|
const { toOuterOf } = BoundsHelper
|
|
14
|
-
const { copy } = PointHelper
|
|
15
|
+
const { copy, move } = PointHelper
|
|
15
16
|
const { moveLocal, zoomOfLocal, rotateOfLocal, skewOfLocal, moveWorld, zoomOfWorld, rotateOfWorld, skewOfWorld, transform, transformWorld, setTransform, getFlipTransform, getLocalOrigin, getRelativeWorld, drop } = LeafHelper
|
|
16
17
|
|
|
17
18
|
@useModule(LeafDataProxy)
|
|
@@ -39,6 +40,9 @@ export class Leaf implements ILeaf {
|
|
|
39
40
|
public get isBranch(): boolean { return false }
|
|
40
41
|
public get isBranchLeaf(): boolean { return false }
|
|
41
42
|
|
|
43
|
+
public syncEventer?: ILeaf // 同步触发一样事件的元素
|
|
44
|
+
public lockNormalStyle?: boolean
|
|
45
|
+
|
|
42
46
|
public __: ILeafData
|
|
43
47
|
public __layout: ILeafLayout
|
|
44
48
|
|
|
@@ -84,14 +88,11 @@ export class Leaf implements ILeaf {
|
|
|
84
88
|
public get pathInputed(): boolean { return this.__.__pathInputed as unknown as boolean }
|
|
85
89
|
|
|
86
90
|
// event
|
|
87
|
-
public set event(map: IEventMap) {
|
|
91
|
+
public set event(map: IEventMap) { this.on(map) }
|
|
88
92
|
|
|
89
93
|
public __captureMap?: IEventListenerMap
|
|
90
94
|
public __bubbleMap?: IEventListenerMap
|
|
91
95
|
|
|
92
|
-
public __parentWait?: IFunction[]
|
|
93
|
-
public __leaferWait?: IFunction[]
|
|
94
|
-
|
|
95
96
|
// branch
|
|
96
97
|
public children?: ILeaf[]
|
|
97
98
|
|
|
@@ -104,10 +105,12 @@ export class Leaf implements ILeaf {
|
|
|
104
105
|
constructor(data?: ILeafInputData) {
|
|
105
106
|
this.innerId = create(LEAF)
|
|
106
107
|
this.reset(data)
|
|
108
|
+
if (this.__bubbleMap) this.__emitLifeEvent(ChildEvent.CREATED)
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
|
|
110
112
|
public reset(data?: ILeafInputData): void {
|
|
113
|
+
if (this.leafer) this.leafer.forceRender(this.__world) // fix: add old bounds rendering
|
|
111
114
|
|
|
112
115
|
this.__world = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0, scaleX: 1, scaleY: 1 }
|
|
113
116
|
if (data !== null) this.__local = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0 }
|
|
@@ -132,12 +135,12 @@ export class Leaf implements ILeaf {
|
|
|
132
135
|
|
|
133
136
|
public waitParent(item: IFunction, bind?: IObject): void {
|
|
134
137
|
if (bind) item = item.bind(bind)
|
|
135
|
-
this.parent ? item() :
|
|
138
|
+
this.parent ? item() : this.on(ChildEvent.ADD, item, 'once')
|
|
136
139
|
}
|
|
137
140
|
|
|
138
141
|
public waitLeafer(item: IFunction, bind?: IObject): void {
|
|
139
142
|
if (bind) item = item.bind(bind)
|
|
140
|
-
this.leafer ? item() :
|
|
143
|
+
this.leafer ? item() : this.on(ChildEvent.MOUNTED, item, 'once')
|
|
141
144
|
}
|
|
142
145
|
|
|
143
146
|
public nextRender(item: IFunction, bind?: IObject, off?: 'off'): void {
|
|
@@ -149,9 +152,7 @@ export class Leaf implements ILeaf {
|
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
public __bindLeafer(leafer: ILeaferBase | null): void {
|
|
152
|
-
if (this.isLeafer)
|
|
153
|
-
if (leafer !== null) leafer = this as unknown as ILeaferBase
|
|
154
|
-
}
|
|
155
|
+
if (this.isLeafer && leafer !== null) leafer = this as unknown as ILeaferBase
|
|
155
156
|
|
|
156
157
|
if (this.leafer && !leafer) this.leafer.leafs--
|
|
157
158
|
|
|
@@ -160,7 +161,10 @@ export class Leaf implements ILeaf {
|
|
|
160
161
|
if (leafer) {
|
|
161
162
|
leafer.leafs++
|
|
162
163
|
this.__level = this.parent ? this.parent.__level + 1 : 1
|
|
163
|
-
if (this.
|
|
164
|
+
if ((this as ILeaf).animation) this.__runAnimation('in')
|
|
165
|
+
if (this.__bubbleMap) this.__emitLifeEvent(ChildEvent.MOUNTED)
|
|
166
|
+
} else {
|
|
167
|
+
this.__emitLifeEvent(ChildEvent.UNMOUNTED)
|
|
164
168
|
}
|
|
165
169
|
|
|
166
170
|
if (this.isBranch) {
|
|
@@ -173,7 +177,7 @@ export class Leaf implements ILeaf {
|
|
|
173
177
|
|
|
174
178
|
// data
|
|
175
179
|
|
|
176
|
-
public set(_data: IObject): void { }
|
|
180
|
+
public set(_data: IObject, _isTemp?: boolean): void { }
|
|
177
181
|
public get(_name?: string): ILeafInputData | IValue { return undefined }
|
|
178
182
|
|
|
179
183
|
public setAttr(name: string, value: any): void { (this as IObject)[name] = value }
|
|
@@ -222,12 +226,15 @@ export class Leaf implements ILeaf {
|
|
|
222
226
|
// ---
|
|
223
227
|
|
|
224
228
|
|
|
225
|
-
// state
|
|
229
|
+
// @leafer-in/state rewrite
|
|
226
230
|
|
|
227
231
|
public focus(_value?: boolean): void { }
|
|
228
232
|
|
|
233
|
+
public updateState(): void { }
|
|
234
|
+
|
|
229
235
|
// ---
|
|
230
236
|
|
|
237
|
+
|
|
231
238
|
public updateLayout(): void {
|
|
232
239
|
this.__layout.update()
|
|
233
240
|
}
|
|
@@ -387,12 +394,28 @@ export class Leaf implements ILeaf {
|
|
|
387
394
|
|
|
388
395
|
// simple
|
|
389
396
|
|
|
397
|
+
public getBoxPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
|
|
398
|
+
return this.getBoxPointByInner(this.getInnerPoint(world, relative, distance, change), null, null, true)
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
public getBoxPointByInner(inner: IPointData, _relative?: ILeaf, _distance?: boolean, change?: boolean): IPointData {
|
|
402
|
+
const point = change ? inner : { ...inner } as IPointData, { x, y } = this.boxBounds
|
|
403
|
+
move(point, -x, -y)
|
|
404
|
+
return point
|
|
405
|
+
}
|
|
406
|
+
|
|
390
407
|
public getInnerPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
|
|
391
408
|
const point = change ? world : {} as IPointData
|
|
392
409
|
this.worldToInner(world, point, distance, relative)
|
|
393
410
|
return point
|
|
394
411
|
}
|
|
395
412
|
|
|
413
|
+
public getInnerPointByBox(box: IPointData, _relative?: ILeaf, _distance?: boolean, change?: boolean): IPointData {
|
|
414
|
+
const point = change ? box : { ...box } as IPointData, { x, y } = this.boxBounds
|
|
415
|
+
move(point, x, y)
|
|
416
|
+
return point
|
|
417
|
+
}
|
|
418
|
+
|
|
396
419
|
public getInnerPointByLocal(local: IPointData, _relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
|
|
397
420
|
return this.getInnerPoint(local, this.parent, distance, change)
|
|
398
421
|
}
|
|
@@ -407,23 +430,27 @@ export class Leaf implements ILeaf {
|
|
|
407
430
|
return this.getWorldPoint(inner, this.parent, distance, change)
|
|
408
431
|
}
|
|
409
432
|
|
|
433
|
+
public getPagePoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
|
|
434
|
+
const layer = this.leafer ? this.leafer.zoomLayer : this
|
|
435
|
+
return layer.getInnerPoint(world, relative, distance, change)
|
|
436
|
+
}
|
|
437
|
+
|
|
410
438
|
public getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
|
|
411
439
|
const point = change ? inner : {} as IPointData
|
|
412
440
|
this.innerToWorld(inner, point, distance, relative)
|
|
413
441
|
return point
|
|
414
442
|
}
|
|
415
443
|
|
|
444
|
+
public getWorldPointByBox(box: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
|
|
445
|
+
return this.getWorldPoint(this.getInnerPointByBox(box, null, null, change), relative, distance, true)
|
|
446
|
+
}
|
|
447
|
+
|
|
416
448
|
public getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
|
|
417
449
|
const point = change ? local : {} as IPointData
|
|
418
450
|
this.localToWorld(local, point, distance, relative)
|
|
419
451
|
return point
|
|
420
452
|
}
|
|
421
453
|
|
|
422
|
-
public getPagePoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
|
|
423
|
-
const layer = this.leafer ? this.leafer.zoomLayer : this
|
|
424
|
-
return layer.getInnerPoint(world, relative, distance, change)
|
|
425
|
-
}
|
|
426
|
-
|
|
427
454
|
public getWorldPointByPage(page: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData {
|
|
428
455
|
const layer = this.leafer ? this.leafer.zoomLayer : this
|
|
429
456
|
return layer.getWorldPoint(page, relative, distance, change)
|
|
@@ -552,6 +579,31 @@ export class Leaf implements ILeaf {
|
|
|
552
579
|
|
|
553
580
|
public __updateRenderPath(): void { }
|
|
554
581
|
|
|
582
|
+
// ---
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
// @leafer-in/motion-path rewrite
|
|
586
|
+
|
|
587
|
+
public getMotionPathData(): IMotionPathData {
|
|
588
|
+
return needPlugin('path')
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
public getMotionPoint(_motionDistance: number | IUnitData): IRotationPointData {
|
|
592
|
+
return needPlugin('path')
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
public getMotionTotal(): number {
|
|
596
|
+
return 0
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
public __updateMotionPath(): void { }
|
|
600
|
+
|
|
601
|
+
// ---
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
// @leafer-in/animate rewrite
|
|
605
|
+
public __runAnimation(_type: 'in' | 'out', _complete?: IFunction): void { }
|
|
606
|
+
|
|
555
607
|
|
|
556
608
|
// Branch rewrite
|
|
557
609
|
|
|
@@ -572,7 +624,7 @@ export class Leaf implements ILeaf {
|
|
|
572
624
|
|
|
573
625
|
// LeafEventer rewrite
|
|
574
626
|
|
|
575
|
-
public on(_type: string | string[], _listener
|
|
627
|
+
public on(_type: string | string[] | IEventMap, _listener?: IEventListener, _options?: IEventOption): void { }
|
|
576
628
|
|
|
577
629
|
public off(_type?: string | string[], _listener?: IEventListener, _options?: IEventOption): void { }
|
|
578
630
|
|
|
@@ -600,17 +652,22 @@ export class Leaf implements ILeaf {
|
|
|
600
652
|
}
|
|
601
653
|
|
|
602
654
|
|
|
655
|
+
public __emitLifeEvent(type: string): void {
|
|
656
|
+
if (this.hasEvent(type)) this.emitEvent(new ChildEvent(type, this, this.parent))
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
|
|
603
660
|
public destroy(): void {
|
|
604
661
|
if (!this.destroyed) {
|
|
605
662
|
const { parent } = this
|
|
606
663
|
if (parent) this.remove()
|
|
607
664
|
if (this.children) (this as unknown as IBranch).removeAll(true)
|
|
608
|
-
|
|
665
|
+
this.__emitLifeEvent(ChildEvent.DESTROY)
|
|
609
666
|
|
|
610
667
|
this.__.destroy()
|
|
611
|
-
this.__layout.destroy()
|
|
668
|
+
this.__layout.destroy();
|
|
612
669
|
|
|
613
|
-
this
|
|
670
|
+
(this as ILeaf).destroyEventer()
|
|
614
671
|
this.destroyed = true
|
|
615
672
|
}
|
|
616
673
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaf, InnerId, ILeaferBase, ILeafData, ILeafLayout, IMatrixWithBoundsScaleData, IMatrixWithBoundsData, IMatrixData, IBoundsData, IMatrixWithScaleData, IHitCanvas, IEventMap, IEventListenerMap,
|
|
1
|
+
import { ILeaf, InnerId, ILeaferBase, ILeafData, ILeafLayout, IMatrixWithBoundsScaleData, IMatrixWithBoundsData, IMatrixData, IBoundsData, IMatrixWithScaleData, IHitCanvas, IEventMap, IEventListenerMap, ILeafInputData, IFunction, IObject, IValue, IJSONOptions, IFindMethod, ILeaferCanvas, IRenderOptions, ILocationType, IBoundsType, ILayoutBoundsData, IPointData, IAlign, IAxis, IRadiusPointData, IMotionPathData, IUnitData, IRotationPointData, IEventListener, IEventOption, IEventListenerId, IEvent, IAttrDecorator } from '@leafer/interface';
|
|
2
2
|
import { LeafData } from '@leafer/data';
|
|
3
3
|
import { LeafLayout } from '@leafer/layout';
|
|
4
4
|
|
|
@@ -15,6 +15,8 @@ declare class Leaf implements ILeaf {
|
|
|
15
15
|
get isLeafer(): boolean;
|
|
16
16
|
get isBranch(): boolean;
|
|
17
17
|
get isBranchLeaf(): boolean;
|
|
18
|
+
syncEventer?: ILeaf;
|
|
19
|
+
lockNormalStyle?: boolean;
|
|
18
20
|
__: ILeafData;
|
|
19
21
|
__layout: ILeafLayout;
|
|
20
22
|
__world: IMatrixWithBoundsScaleData;
|
|
@@ -46,8 +48,6 @@ declare class Leaf implements ILeaf {
|
|
|
46
48
|
set event(map: IEventMap);
|
|
47
49
|
__captureMap?: IEventListenerMap;
|
|
48
50
|
__bubbleMap?: IEventListenerMap;
|
|
49
|
-
__parentWait?: IFunction[];
|
|
50
|
-
__leaferWait?: IFunction[];
|
|
51
51
|
children?: ILeaf[];
|
|
52
52
|
noBounds?: boolean;
|
|
53
53
|
destroyed: boolean;
|
|
@@ -59,7 +59,7 @@ declare class Leaf implements ILeaf {
|
|
|
59
59
|
nextRender(item: IFunction, bind?: IObject, off?: 'off'): void;
|
|
60
60
|
removeNextRender(item: IFunction): void;
|
|
61
61
|
__bindLeafer(leafer: ILeaferBase | null): void;
|
|
62
|
-
set(_data: IObject): void;
|
|
62
|
+
set(_data: IObject, _isTemp?: boolean): void;
|
|
63
63
|
get(_name?: string): ILeafInputData | IValue;
|
|
64
64
|
setAttr(name: string, value: any): void;
|
|
65
65
|
getAttr(name: string): any;
|
|
@@ -78,6 +78,7 @@ declare class Leaf implements ILeaf {
|
|
|
78
78
|
findOne(_condition: number | string | IFindMethod, _options?: any): ILeaf | undefined;
|
|
79
79
|
findId(_id: number | string): ILeaf | undefined;
|
|
80
80
|
focus(_value?: boolean): void;
|
|
81
|
+
updateState(): void;
|
|
81
82
|
updateLayout(): void;
|
|
82
83
|
forceUpdate(attrName?: string): void;
|
|
83
84
|
forceRender(_bounds?: IBoundsData): void;
|
|
@@ -112,13 +113,17 @@ declare class Leaf implements ILeaf {
|
|
|
112
113
|
localToWorld(local: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void;
|
|
113
114
|
worldToInner(world: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void;
|
|
114
115
|
innerToWorld(inner: IPointData, to?: IPointData, distance?: boolean, relative?: ILeaf): void;
|
|
116
|
+
getBoxPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
117
|
+
getBoxPointByInner(inner: IPointData, _relative?: ILeaf, _distance?: boolean, change?: boolean): IPointData;
|
|
115
118
|
getInnerPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
119
|
+
getInnerPointByBox(box: IPointData, _relative?: ILeaf, _distance?: boolean, change?: boolean): IPointData;
|
|
116
120
|
getInnerPointByLocal(local: IPointData, _relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
117
121
|
getLocalPoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
118
122
|
getLocalPointByInner(inner: IPointData, _relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
123
|
+
getPagePoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
119
124
|
getWorldPoint(inner: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
125
|
+
getWorldPointByBox(box: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
120
126
|
getWorldPointByLocal(local: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
121
|
-
getPagePoint(world: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
122
127
|
getWorldPointByPage(page: IPointData, relative?: ILeaf, distance?: boolean, change?: boolean): IPointData;
|
|
123
128
|
setTransform(matrix: IMatrixData, resize?: boolean): void;
|
|
124
129
|
transform(matrix: IMatrixData, resize?: boolean): void;
|
|
@@ -155,11 +160,16 @@ declare class Leaf implements ILeaf {
|
|
|
155
160
|
__drawRenderPath(_canvas: ILeaferCanvas): void;
|
|
156
161
|
__updatePath(): void;
|
|
157
162
|
__updateRenderPath(): void;
|
|
163
|
+
getMotionPathData(): IMotionPathData;
|
|
164
|
+
getMotionPoint(_motionDistance: number | IUnitData): IRotationPointData;
|
|
165
|
+
getMotionTotal(): number;
|
|
166
|
+
__updateMotionPath(): void;
|
|
167
|
+
__runAnimation(_type: 'in' | 'out', _complete?: IFunction): void;
|
|
158
168
|
__updateSortChildren(): void;
|
|
159
169
|
add(_child: ILeaf, _index?: number): void;
|
|
160
170
|
remove(_child?: ILeaf, destroy?: boolean): void;
|
|
161
171
|
dropTo(parent: ILeaf, index?: number, resize?: boolean): void;
|
|
162
|
-
on(_type: string | string[], _listener
|
|
172
|
+
on(_type: string | string[] | IEventMap, _listener?: IEventListener, _options?: IEventOption): void;
|
|
163
173
|
off(_type?: string | string[], _listener?: IEventListener, _options?: IEventOption): void;
|
|
164
174
|
on_(_type: string | string[], _listener: IEventListener, _bind?: IObject, _options?: IEventOption): IEventListenerId;
|
|
165
175
|
off_(_id: IEventListenerId | IEventListenerId[]): void;
|
|
@@ -169,6 +179,7 @@ declare class Leaf implements ILeaf {
|
|
|
169
179
|
hasEvent(_type: string, _capture?: boolean): boolean;
|
|
170
180
|
static changeAttr(attrName: string, defaultValue: IValue, fn?: IAttrDecorator): void;
|
|
171
181
|
static addAttr(attrName: string, defaultValue: IValue, fn?: IAttrDecorator): void;
|
|
182
|
+
__emitLifeEvent(type: string): void;
|
|
172
183
|
destroy(): void;
|
|
173
184
|
}
|
|
174
185
|
|
|
@@ -184,6 +195,7 @@ declare class Branch extends Leaf {
|
|
|
184
195
|
remove(child?: ILeaf, destroy?: boolean): void;
|
|
185
196
|
removeAll(destroy?: boolean): void;
|
|
186
197
|
clear(): void;
|
|
198
|
+
protected __remove(child?: ILeaf, destroy?: boolean): void;
|
|
187
199
|
protected __preRemove(): void;
|
|
188
200
|
protected __realRemoveChild(child: ILeaf): void;
|
|
189
201
|
protected __emitChildEvent(type: string, child: ILeaf): void;
|