@leafer/display 1.0.0-alpha.1 → 1.0.0-alpha.10
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 +13 -11
- package/src/Branch.ts +2 -2
- package/src/Leaf.ts +31 -31
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/display",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.10",
|
|
4
4
|
"description": "@leafer/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "src/index.ts",
|
|
8
|
-
"files": [
|
|
8
|
+
"files": [
|
|
9
|
+
"src"
|
|
10
|
+
],
|
|
9
11
|
"repository": {
|
|
10
12
|
"type": "git",
|
|
11
13
|
"url": "https://github.com/leaferjs/leafer.git"
|
|
@@ -17,15 +19,15 @@
|
|
|
17
19
|
"leaferjs"
|
|
18
20
|
],
|
|
19
21
|
"dependencies": {
|
|
20
|
-
"@leafer/math": "1.0.0-alpha.
|
|
21
|
-
"@leafer/data": "1.0.0-alpha.
|
|
22
|
-
"@leafer/layout": "1.0.0-alpha.
|
|
23
|
-
"@leafer/module": "1.0.0-alpha.
|
|
24
|
-
"@leafer/event": "1.0.0-alpha.
|
|
25
|
-
"@leafer/decorator": "1.0.0-alpha.
|
|
26
|
-
"@leafer/helper": "1.0.0-alpha.
|
|
22
|
+
"@leafer/math": "1.0.0-alpha.10",
|
|
23
|
+
"@leafer/data": "1.0.0-alpha.10",
|
|
24
|
+
"@leafer/layout": "1.0.0-alpha.10",
|
|
25
|
+
"@leafer/display-module": "1.0.0-alpha.10",
|
|
26
|
+
"@leafer/event": "1.0.0-alpha.10",
|
|
27
|
+
"@leafer/decorator": "1.0.0-alpha.10",
|
|
28
|
+
"@leafer/helper": "1.0.0-alpha.10"
|
|
27
29
|
},
|
|
28
30
|
"devDependencies": {
|
|
29
|
-
|
|
31
|
+
"@leafer/interface": "1.0.0-alpha.10"
|
|
30
32
|
}
|
|
31
|
-
}
|
|
33
|
+
}
|
package/src/Branch.ts
CHANGED
|
@@ -121,10 +121,10 @@ export class Branch extends Leaf {
|
|
|
121
121
|
const event = new ChildEvent(ChildEvent.REMOVE, child, this)
|
|
122
122
|
if (this.hasEvent(ChildEvent.REMOVE)) this.emitEvent(event)
|
|
123
123
|
this.root.emitEvent(event)
|
|
124
|
-
child.root =
|
|
124
|
+
child.root = null
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
child.parent =
|
|
127
|
+
child.parent = null
|
|
128
128
|
this.__layout.boxBoundsChange()
|
|
129
129
|
}
|
|
130
130
|
} else {
|
package/src/Leaf.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeafer, ILeaf, ILeafInputData, ILeafData, ILeaferCanvas, IRenderOptions, IMatrixWithBoundsData, __Number, __Boolean, ILeafLayout, InnerId, IHitCanvas, IRadiusPointData, IEventListenerMap, IEventListener, IEventListenerOptions, IEventListenerId, IEvent, IObject, IFunction,
|
|
1
|
+
import { ILeafer, ILeaf, ILeafInputData, ILeafData, ILeaferCanvas, IRenderOptions, IMatrixWithBoundsData, __Number, __Boolean, ILeafLayout, InnerId, IHitCanvas, IRadiusPointData, IEventListenerMap, IEventListener, IEventListenerOptions, IEventListenerId, IEvent, IObject, IFunction, __String } from '@leafer/interface'
|
|
2
2
|
import { IncrementId } from '@leafer/math'
|
|
3
3
|
import { LeafData } from '@leafer/data'
|
|
4
4
|
import { LeafLayout } from '@leafer/layout'
|
|
@@ -84,7 +84,7 @@ export class Leaf implements ILeaf {
|
|
|
84
84
|
for (let i = 0; i < len; i++) {
|
|
85
85
|
this.__parentWait[i]()
|
|
86
86
|
}
|
|
87
|
-
this.__parentWait =
|
|
87
|
+
this.__parentWait = null
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
public __setAsLeafer(): void {
|
|
@@ -114,11 +114,11 @@ export class Leaf implements ILeaf {
|
|
|
114
114
|
|
|
115
115
|
// LeafDataProxy rewrite
|
|
116
116
|
|
|
117
|
-
public __set(
|
|
117
|
+
public __set(_attrName: string, _newValue: unknown): void { }
|
|
118
118
|
|
|
119
|
-
public __get(
|
|
119
|
+
public __get(_attrName: string): unknown { return undefined }
|
|
120
120
|
|
|
121
|
-
public __updateAttr(
|
|
121
|
+
public __updateAttr(_attrName: string): void { }
|
|
122
122
|
|
|
123
123
|
// ---
|
|
124
124
|
|
|
@@ -172,9 +172,9 @@ export class Leaf implements ILeaf {
|
|
|
172
172
|
|
|
173
173
|
// LeafHit rewrite
|
|
174
174
|
|
|
175
|
-
public __hitWorld(
|
|
175
|
+
public __hitWorld(_point: IRadiusPointData): boolean { return true }
|
|
176
176
|
|
|
177
|
-
public __hit(
|
|
177
|
+
public __hit(_local: IRadiusPointData): boolean { return true }
|
|
178
178
|
|
|
179
179
|
public __updateHitCanvas(): void { }
|
|
180
180
|
|
|
@@ -183,11 +183,11 @@ export class Leaf implements ILeaf {
|
|
|
183
183
|
|
|
184
184
|
// LeafRender rewrite
|
|
185
185
|
|
|
186
|
-
public __render(
|
|
186
|
+
public __render(_canvas: ILeaferCanvas, _options: IRenderOptions): void { }
|
|
187
187
|
|
|
188
|
-
public __drawFast(
|
|
188
|
+
public __drawFast(_canvas: ILeaferCanvas, _options: IRenderOptions): void { }
|
|
189
189
|
|
|
190
|
-
public __draw(
|
|
190
|
+
public __draw(_canvas: ILeaferCanvas, _options: IRenderOptions): void { }
|
|
191
191
|
|
|
192
192
|
public __updateChange(): void { }
|
|
193
193
|
|
|
@@ -196,9 +196,9 @@ export class Leaf implements ILeaf {
|
|
|
196
196
|
|
|
197
197
|
// path
|
|
198
198
|
|
|
199
|
-
public __drawPath(
|
|
199
|
+
public __drawPath(_canvas: ILeaferCanvas): void { }
|
|
200
200
|
|
|
201
|
-
public __drawRenderPath(
|
|
201
|
+
public __drawRenderPath(_canvas: ILeaferCanvas): void { }
|
|
202
202
|
|
|
203
203
|
public __updatePath(): void { }
|
|
204
204
|
|
|
@@ -209,30 +209,30 @@ export class Leaf implements ILeaf {
|
|
|
209
209
|
|
|
210
210
|
public __updateSortChildren(): void { }
|
|
211
211
|
|
|
212
|
-
public add(
|
|
212
|
+
public add(_child: ILeaf, _index?: number): void { }
|
|
213
213
|
|
|
214
|
-
public remove(
|
|
214
|
+
public remove(_child?: ILeaf): void { }
|
|
215
215
|
|
|
216
216
|
// ---
|
|
217
217
|
|
|
218
218
|
|
|
219
219
|
// LeafEventer rewrite
|
|
220
220
|
|
|
221
|
-
public on(
|
|
221
|
+
public on(_type: string | string[], _listener: IEventListener, _options?: IEventListenerOptions | boolean): void { }
|
|
222
222
|
|
|
223
|
-
public off(
|
|
223
|
+
public off(_type: string | string[], _listener: IEventListener, _options?: IEventListenerOptions | boolean): void { }
|
|
224
224
|
|
|
225
|
-
public on__(
|
|
225
|
+
public on__(_type: string | string[], _listener: IEventListener, _bind?: IObject, _options?: IEventListenerOptions | boolean): IEventListenerId { return undefined }
|
|
226
226
|
|
|
227
|
-
public off__(
|
|
227
|
+
public off__(_id: IEventListenerId | IEventListenerId[]): void { }
|
|
228
228
|
|
|
229
|
-
public once(
|
|
229
|
+
public once(_type: string | string[], _listener: IEventListener, _capture?: boolean): void { }
|
|
230
230
|
|
|
231
|
-
public emit(
|
|
231
|
+
public emit(_type: string, _event?: IEvent | IObject, _capture?: boolean): void { }
|
|
232
232
|
|
|
233
|
-
public emitEvent(
|
|
233
|
+
public emitEvent(_event?: IEvent, _capture?: boolean): void { }
|
|
234
234
|
|
|
235
|
-
public hasEvent(
|
|
235
|
+
public hasEvent(_type: string, _capture?: boolean): boolean { return false }
|
|
236
236
|
|
|
237
237
|
// ---
|
|
238
238
|
|
|
@@ -241,25 +241,25 @@ export class Leaf implements ILeaf {
|
|
|
241
241
|
|
|
242
242
|
if (this.__isBranch) {
|
|
243
243
|
this.children.forEach(child => { child.destroy() })
|
|
244
|
-
this.children =
|
|
244
|
+
this.children = null
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
if (this.__hitCanvas) {
|
|
248
248
|
this.__hitCanvas.destroy()
|
|
249
|
-
this.__hitCanvas =
|
|
249
|
+
this.__hitCanvas = null
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
this.leafer =
|
|
253
|
-
this.root =
|
|
254
|
-
this.parent =
|
|
252
|
+
this.leafer = null
|
|
253
|
+
this.root = null
|
|
254
|
+
this.parent = null
|
|
255
255
|
|
|
256
256
|
this.__.destroy()
|
|
257
257
|
this.__layout.destroy()
|
|
258
|
-
this.__ =
|
|
259
|
-
this.__layout =
|
|
258
|
+
this.__ = null
|
|
259
|
+
this.__layout = null
|
|
260
260
|
|
|
261
|
-
this.__captureMap =
|
|
262
|
-
this.__bubbleMap =
|
|
261
|
+
this.__captureMap = null
|
|
262
|
+
this.__bubbleMap = null
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
|