@leafer-ui/data 1.0.2 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/data",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "@leafer-ui/data",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "1.0.2",
26
- "@leafer-ui/external": "1.0.2"
25
+ "@leafer/core": "1.0.3",
26
+ "@leafer-ui/external": "1.0.3"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.0.2",
30
- "@leafer-ui/interface": "1.0.2"
29
+ "@leafer/interface": "1.0.3",
30
+ "@leafer-ui/interface": "1.0.3"
31
31
  }
32
32
  }
package/src/ImageData.ts CHANGED
@@ -16,7 +16,7 @@ export class ImageData extends RectData implements IImageData {
16
16
 
17
17
  public __setImageFill(value: string): void {
18
18
  if (this.__leaf.image) this.__leaf.image = null;
19
- (this as IImageInputData).fill = value ? { type: 'image', mode: 'strench', url: value } : undefined
19
+ (this as IImageInputData).fill = value ? { type: 'image', mode: 'stretch', url: value } : undefined
20
20
  }
21
21
 
22
22
  public __getData(): IObject {
package/src/UIData.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { INumber, IValue, IBoolean, IPathCommandData, IPathString } from '@leafer/interface'
1
+ import { INumber, IValue, IBoolean, IPathCommandData, IPathString, IPointData } from '@leafer/interface'
2
2
  import { PathConvert, LeafData, Debug } from '@leafer/core'
3
3
 
4
4
  import { IShadowEffect, IUI, IUIData, IUnitData, ILeafPaint } from '@leafer-ui/interface'
@@ -12,6 +12,8 @@ export class UIData extends LeafData implements IUIData {
12
12
 
13
13
  declare public __leaf: IUI
14
14
 
15
+ public get scale(): INumber | IPointData { const { scaleX, scaleY } = this as IUIData; return scaleX !== scaleY ? { x: scaleX, y: scaleY } : scaleX }
16
+
15
17
  public __blendLayer?: boolean // 非元素属性必须以两个下划线开头
16
18
 
17
19
  public __isFills?: boolean
@@ -52,9 +54,12 @@ export class UIData extends LeafData implements IUIData {
52
54
  public get __autoSide() { return !this._width || !this._height }
53
55
  public get __autoSize() { return !this._width && !this._height }
54
56
 
57
+
55
58
  protected setVisible(value: IBoolean) {
56
- if (this.__leaf.leafer) this.__leaf.leafer.watcher.hasVisible = true
57
59
  this._visible = value
60
+
61
+ const { leafer } = this.__leaf
62
+ if (leafer) leafer.watcher.hasVisible = true
58
63
  }
59
64
 
60
65
  protected setWidth(value: INumber) {
package/types/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { IBoolean, INumber, IValue, IPathCommandData, IPathString } from '@leafer/interface';
1
+ import { INumber, IPointData, IBoolean, IValue, IPathCommandData, IPathString } from '@leafer/interface';
2
2
  import { LeafData } from '@leafer/core';
3
3
  import { IUIData, IUI, IUnitData, IGroupData, IBoxData, ILeaferData, IObject, IFrameData, ILineData, IRectData, IEllipseData, IPolygonData, IStarData, IPathData, IPenData, ITextData, IFontWeight, IImageData, IImage, ICanvasData } from '@leafer-ui/interface';
4
4
 
5
5
  declare class UIData extends LeafData implements IUIData {
6
6
  __leaf: IUI;
7
+ get scale(): INumber | IPointData;
7
8
  __blendLayer?: boolean;
8
9
  __isFills?: boolean;
9
10
  __isStrokes?: boolean;