@leafer-ui/display 1.0.0-beta.4 → 1.0.0-beta.6
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 +8 -8
- package/src/UI.ts +11 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/display",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.6",
|
|
4
4
|
"description": "@leafer-ui/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"leaferjs"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@leafer/core": "1.0.0-beta.
|
|
23
|
-
"@leafer-ui/data": "1.0.0-beta.
|
|
24
|
-
"@leafer-ui/text": "1.0.0-beta.
|
|
25
|
-
"@leafer-ui/display-module": "1.0.0-beta.
|
|
26
|
-
"@leafer-ui/decorator": "1.0.0-beta.
|
|
22
|
+
"@leafer/core": "1.0.0-beta.6",
|
|
23
|
+
"@leafer-ui/data": "1.0.0-beta.6",
|
|
24
|
+
"@leafer-ui/text": "1.0.0-beta.6",
|
|
25
|
+
"@leafer-ui/display-module": "1.0.0-beta.6",
|
|
26
|
+
"@leafer-ui/decorator": "1.0.0-beta.6"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.0.0-beta.
|
|
30
|
-
"@leafer-ui/interface": "1.0.0-beta.
|
|
29
|
+
"@leafer/interface": "1.0.0-beta.6",
|
|
30
|
+
"@leafer-ui/interface": "1.0.0-beta.6"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/UI.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ILeaferCanvas, IPathDrawer, IPathCommandData, IHitType, __Number, __Boolean, __String, IPathString } from '@leafer/interface'
|
|
2
|
-
import { Leaf, PathDrawer, surfaceType, dataType, positionType, boundsType, pathType, scaleType, rotationType, opacityType, sortType, maskType, dataProcessor, useModule, rewrite, rewriteAble, UICreator, PathCorner, hitType, strokeType, PathConvert } from '@leafer/core'
|
|
1
|
+
import { ILeaferCanvas, IPathDrawer, IPathCommandData, IHitType, __Number, __Boolean, __String, IPathString, IExportFileType } from '@leafer/interface'
|
|
2
|
+
import { Leaf, PathDrawer, surfaceType, dataType, positionType, boundsType, pathType, scaleType, rotationType, opacityType, sortType, maskType, dataProcessor, useModule, rewrite, rewriteAble, UICreator, PathCorner, hitType, strokeType, PathConvert, eraserType } from '@leafer/core'
|
|
3
3
|
|
|
4
|
-
import { IUI, IShadowEffect, IBlurEffect, IPaint, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IPaintString, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString, IUITagInputData, IUIInputData } from '@leafer-ui/interface'
|
|
4
|
+
import { IUI, IShadowEffect, IBlurEffect, IPaint, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IPaintString, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString, IUITagInputData, IUIInputData, IExportOptions, IExportResult } from '@leafer-ui/interface'
|
|
5
5
|
import { effectType } from '@leafer-ui/decorator'
|
|
6
6
|
|
|
7
7
|
import { UIData } from '@leafer-ui/data'
|
|
8
8
|
import { UIBounds, UIHit, UIRender } from '@leafer-ui/display-module'
|
|
9
9
|
|
|
10
|
-
import { Paint } from '@leafer-ui/external'
|
|
10
|
+
import { Export, Paint } from '@leafer-ui/external'
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
@useModule(UIBounds)
|
|
@@ -47,6 +47,9 @@ export class UI extends Leaf implements IUI {
|
|
|
47
47
|
@maskType(false)
|
|
48
48
|
public isMask: __Boolean
|
|
49
49
|
|
|
50
|
+
@eraserType(false)
|
|
51
|
+
public isEraser?: __Boolean
|
|
52
|
+
|
|
50
53
|
@sortType(0)
|
|
51
54
|
public zIndex: __Number
|
|
52
55
|
|
|
@@ -68,7 +71,6 @@ export class UI extends Leaf implements IUI {
|
|
|
68
71
|
@boundsType(100)
|
|
69
72
|
public height: __Number
|
|
70
73
|
|
|
71
|
-
|
|
72
74
|
// scale
|
|
73
75
|
@scaleType(1)
|
|
74
76
|
public scaleX: __Number
|
|
@@ -76,7 +78,6 @@ export class UI extends Leaf implements IUI {
|
|
|
76
78
|
@scaleType(1)
|
|
77
79
|
public scaleY: __Number
|
|
78
80
|
|
|
79
|
-
|
|
80
81
|
// rotate
|
|
81
82
|
@rotationType(0)
|
|
82
83
|
public rotation: __Number
|
|
@@ -222,6 +223,10 @@ export class UI extends Leaf implements IUI {
|
|
|
222
223
|
@rewrite(PathDrawer.drawPathByData)
|
|
223
224
|
public __drawPathByData(_drawer: IPathDrawer, _data: IPathCommandData): void { }
|
|
224
225
|
|
|
226
|
+
public export(filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult> {
|
|
227
|
+
return Export.export(this, filename, options)
|
|
228
|
+
}
|
|
229
|
+
|
|
225
230
|
static one(data: IUITagInputData, x?: number, y?: number, width?: number, height?: number): IUI {
|
|
226
231
|
return UICreator.get(data.tag || this.prototype.__tag, data, x, y, width, height) as IUI
|
|
227
232
|
}
|