@leafer/decorator 1.9.1 → 1.9.2

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/decorator",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "@leafer/decorator",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/platform": "1.9.1",
26
- "@leafer/data": "1.9.1",
27
- "@leafer/debug": "1.9.1"
25
+ "@leafer/platform": "1.9.2",
26
+ "@leafer/data": "1.9.2",
27
+ "@leafer/debug": "1.9.2"
28
28
  },
29
29
  "devDependencies": {
30
- "@leafer/interface": "1.9.1"
30
+ "@leafer/interface": "1.9.2"
31
31
  }
32
32
  }
package/src/data.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ILeafData, ILeaf, IObject, IValue, ILeafAttrDescriptor, ILeafAttrDescriptorFn, IValueFunction } from '@leafer/interface'
1
+ import { ILeafData, ILeaf, IObject, IValue, ILeafAttrDescriptor, ILeafAttrDescriptorFn, IValueFunction, IMatrixWithBoundsScaleData } from '@leafer/interface'
2
2
  import { DataHelper, isEmptyData, isObject, isUndefined } from '@leafer/data'
3
3
  import { Debug } from '@leafer/debug'
4
4
 
@@ -38,6 +38,17 @@ export function positionType(defaultValue?: IValue, checkFiniteNumber?: boolean)
38
38
  }))
39
39
  }
40
40
 
41
+ export function scrollType(defaultValue?: IValue, checkFiniteNumber?: boolean) {
42
+ return decorateLeafAttr(defaultValue, (key: string) => attr({
43
+ set(value: IValue) {
44
+ if (this.__setAttr(key, value, checkFiniteNumber)) {
45
+ this.__layout.matrixChanged || this.__layout.matrixChange()
46
+ this.__scrollWorld || (this.__scrollWorld = {} as IMatrixWithBoundsScaleData)
47
+ }
48
+ }
49
+ }))
50
+ }
51
+
41
52
  export function autoLayoutType(defaultValue?: IValue) {
42
53
  return decorateLeafAttr(defaultValue, (key: string) => attr({
43
54
  set(value: IValue) {
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { defineLeafAttr, decorateLeafAttr, attr, dataType, positionType, autoLayoutType, boundsType, doBoundsType, naturalBoundsType, affectStrokeBoundsType, doStrokeType, strokeType, affectRenderBoundsType, scaleType, rotationType, surfaceType, opacityType, visibleType, sortType, maskType, eraserType, hitType, pathType, pathInputType, cursorType, dataProcessor, layoutProcessor, defineDataProcessor } from './data'
1
+ export { defineLeafAttr, decorateLeafAttr, attr, dataType, positionType, scrollType, autoLayoutType, boundsType, doBoundsType, naturalBoundsType, affectStrokeBoundsType, doStrokeType, strokeType, affectRenderBoundsType, scaleType, rotationType, surfaceType, opacityType, visibleType, sortType, maskType, eraserType, hitType, pathType, pathInputType, cursorType, dataProcessor, layoutProcessor, defineDataProcessor } from './data'
2
2
  export { useModule, rewrite, rewriteAble } from './rewrite'
3
3
  export { defineKey, getDescriptor, createDescriptor } from './object'
4
4
  export { registerUI, registerUIEvent } from './class'
package/types/index.d.ts CHANGED
@@ -5,6 +5,7 @@ declare function attr(partDescriptor?: ILeafAttrDescriptor): ILeafAttrDescriptor
5
5
  declare function defineLeafAttr(target: ILeaf, key: string, defaultValue?: IValue, partDescriptor?: ILeafAttrDescriptor): void;
6
6
  declare function dataType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
7
7
  declare function positionType(defaultValue?: IValue, checkFiniteNumber?: boolean): (target: ILeaf, key: string) => void;
8
+ declare function scrollType(defaultValue?: IValue, checkFiniteNumber?: boolean): (target: ILeaf, key: string) => void;
8
9
  declare function autoLayoutType(defaultValue?: IValue): (target: ILeaf, key: string) => void;
9
10
  declare function scaleType(defaultValue?: IValue, checkFiniteNumber?: boolean): (target: ILeaf, key: string) => void;
10
11
  declare function rotationType(defaultValue?: IValue, checkFiniteNumber?: boolean): (target: ILeaf, key: string) => void;
@@ -43,4 +44,4 @@ declare function createDescriptor(key: string, defaultValue?: IValue): {
43
44
  declare function registerUI(): (target: IObject) => void;
44
45
  declare function registerUIEvent(): (target: IObject) => void;
45
46
 
46
- export { affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, eraserType, getDescriptor, hitType, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, sortType, strokeType, surfaceType, useModule, visibleType };
47
+ export { affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, eraserType, getDescriptor, hitType, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, useModule, visibleType };