@leafer/display 1.0.0-rc.26 → 1.0.0-rc.27

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/display",
3
- "version": "1.0.0-rc.26",
3
+ "version": "1.0.0-rc.27",
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.0-rc.26",
26
- "@leafer/data": "1.0.0-rc.26",
27
- "@leafer/layout": "1.0.0-rc.26",
28
- "@leafer/display-module": "1.0.0-rc.26",
29
- "@leafer/event": "1.0.0-rc.26",
30
- "@leafer/decorator": "1.0.0-rc.26",
31
- "@leafer/helper": "1.0.0-rc.26",
32
- "@leafer/platform": "1.0.0-rc.26"
25
+ "@leafer/math": "1.0.0-rc.27",
26
+ "@leafer/data": "1.0.0-rc.27",
27
+ "@leafer/layout": "1.0.0-rc.27",
28
+ "@leafer/display-module": "1.0.0-rc.27",
29
+ "@leafer/event": "1.0.0-rc.27",
30
+ "@leafer/decorator": "1.0.0-rc.27",
31
+ "@leafer/helper": "1.0.0-rc.27",
32
+ "@leafer/platform": "1.0.0-rc.27"
33
33
  },
34
34
  "devDependencies": {
35
- "@leafer/interface": "1.0.0-rc.26"
35
+ "@leafer/interface": "1.0.0-rc.27"
36
36
  }
37
37
  }
package/src/Leaf.ts CHANGED
@@ -173,6 +173,11 @@ export class Leaf implements ILeaf {
173
173
  public set(_data: IObject): void { }
174
174
  public get(_name?: string): ILeafInputData | IValue { return undefined }
175
175
 
176
+ public setAttr(name: string, value: any): void { (this as IObject)[name] = value }
177
+ public getAttr(name: string): any { return (this as IObject)[name] }
178
+
179
+ public getComputedAttr(name: string): any { return (this.__ as IObject)[name] }
180
+
176
181
  public toJSON(): IObject {
177
182
  return this.__.__getInputData()
178
183
  }
@@ -474,7 +479,7 @@ export class Leaf implements ILeaf {
474
479
  }
475
480
 
476
481
 
477
- // @leafer-ui/scale rewrite
482
+ // @leafer-in/resize rewrite
478
483
 
479
484
  public scaleResize(scaleX: number, scaleY = scaleX, _noResize?: boolean): void {
480
485
  (this as ILeaf).scaleX *= scaleX;
package/types/index.d.ts CHANGED
@@ -59,6 +59,9 @@ declare class Leaf implements ILeaf {
59
59
  __bindLeafer(leafer: ILeaferBase | null): void;
60
60
  set(_data: IObject): void;
61
61
  get(_name?: string): ILeafInputData | IValue;
62
+ setAttr(name: string, value: any): void;
63
+ getAttr(name: string): any;
64
+ getComputedAttr(name: string): any;
62
65
  toJSON(): IObject;
63
66
  toString(): string;
64
67
  toSVG(): string;