@leafer/display 1.4.2 → 1.5.0

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.4.2",
3
+ "version": "1.5.0",
4
4
  "description": "@leafer/display",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,17 +22,17 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/math": "1.4.2",
26
- "@leafer/data": "1.4.2",
27
- "@leafer/layout": "1.4.2",
28
- "@leafer/display-module": "1.4.2",
29
- "@leafer/event": "1.4.2",
30
- "@leafer/decorator": "1.4.2",
31
- "@leafer/helper": "1.4.2",
32
- "@leafer/debug": "1.4.2",
33
- "@leafer/platform": "1.4.2"
25
+ "@leafer/math": "1.5.0",
26
+ "@leafer/data": "1.5.0",
27
+ "@leafer/layout": "1.5.0",
28
+ "@leafer/display-module": "1.5.0",
29
+ "@leafer/event": "1.5.0",
30
+ "@leafer/decorator": "1.5.0",
31
+ "@leafer/helper": "1.5.0",
32
+ "@leafer/debug": "1.5.0",
33
+ "@leafer/platform": "1.5.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@leafer/interface": "1.4.2"
36
+ "@leafer/interface": "1.5.0"
37
37
  }
38
38
  }
package/src/Leaf.ts CHANGED
@@ -1,4 +1,4 @@
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, ITransition } 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, ITransition, IValueFunction } 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'
@@ -649,13 +649,13 @@ export class Leaf implements ILeaf {
649
649
 
650
650
  // ---
651
651
 
652
- static changeAttr(attrName: string, defaultValue: IValue, fn?: IAttrDecorator): void {
652
+ static changeAttr(attrName: string, defaultValue: IValue | IValueFunction, fn?: IAttrDecorator): void {
653
653
  fn ? this.addAttr(attrName, defaultValue, fn) : defineDataProcessor(this.prototype, attrName, defaultValue)
654
654
  }
655
655
 
656
- static addAttr(attrName: string, defaultValue: IValue, fn?: IAttrDecorator): void {
656
+ static addAttr(attrName: string, defaultValue: IValue | IValueFunction, fn?: IAttrDecorator, helpValue?: IValue): void {
657
657
  if (!fn) fn = boundsType
658
- fn(defaultValue)(this.prototype, attrName)
658
+ fn(defaultValue, helpValue)(this.prototype, attrName)
659
659
  }
660
660
 
661
661
 
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, ILeafInputData, IFunction, IObject, IValue, IJSONOptions, IFindMethod, ILeaferCanvas, IRenderOptions, ILocationType, IBoundsType, ILayoutBoundsData, IPointData, ITransition, IAlign, IAxis, IRadiusPointData, IMotionPathData, IUnitData, IRotationPointData, IEventListener, IEventOption, IEventListenerId, IEvent, IAttrDecorator } from '@leafer/interface';
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, ITransition, IAlign, IAxis, IRadiusPointData, IMotionPathData, IUnitData, IRotationPointData, IEventListener, IEventOption, IEventListenerId, IEvent, IValueFunction, IAttrDecorator } from '@leafer/interface';
2
2
  import { LeafData } from '@leafer/data';
3
3
  import { LeafLayout } from '@leafer/layout';
4
4
 
@@ -180,8 +180,8 @@ declare class Leaf implements ILeaf {
180
180
  emit(_type: string, _event?: IEvent | IObject, _capture?: boolean): void;
181
181
  emitEvent(_event?: IEvent, _capture?: boolean): void;
182
182
  hasEvent(_type: string, _capture?: boolean): boolean;
183
- static changeAttr(attrName: string, defaultValue: IValue, fn?: IAttrDecorator): void;
184
- static addAttr(attrName: string, defaultValue: IValue, fn?: IAttrDecorator): void;
183
+ static changeAttr(attrName: string, defaultValue: IValue | IValueFunction, fn?: IAttrDecorator): void;
184
+ static addAttr(attrName: string, defaultValue: IValue | IValueFunction, fn?: IAttrDecorator, helpValue?: IValue): void;
185
185
  __emitLifeEvent(type: string): void;
186
186
  destroy(): void;
187
187
  }