@leafer-ui/display 1.9.6 → 1.9.8
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/Box.ts +4 -4
- package/src/Text.ts +5 -5
- package/src/UI.ts +9 -5
- package/types/index.d.ts +7 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/display",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.8",
|
|
4
4
|
"description": "@leafer-ui/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.9.
|
|
26
|
-
"@leafer-ui/data": "1.9.
|
|
27
|
-
"@leafer-ui/display-module": "1.9.
|
|
28
|
-
"@leafer-ui/decorator": "1.9.
|
|
29
|
-
"@leafer-ui/external": "1.9.
|
|
25
|
+
"@leafer/core": "1.9.8",
|
|
26
|
+
"@leafer-ui/data": "1.9.8",
|
|
27
|
+
"@leafer-ui/display-module": "1.9.8",
|
|
28
|
+
"@leafer-ui/decorator": "1.9.8",
|
|
29
|
+
"@leafer-ui/external": "1.9.8"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@leafer/interface": "1.9.
|
|
33
|
-
"@leafer-ui/interface": "1.9.
|
|
32
|
+
"@leafer/interface": "1.9.8",
|
|
33
|
+
"@leafer-ui/interface": "1.9.8"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/Box.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaferCanvas, IRenderOptions, IBoolean, INumber, IScrollPointData } from '@leafer/interface'
|
|
1
|
+
import { ILeaferCanvas, IRenderOptions, IBoolean, INumber, IScrollPointData, IFourNumber } from '@leafer/interface'
|
|
2
2
|
import { rewrite, rewriteAble, registerUI, BoundsHelper, dataProcessor, affectRenderBoundsType, dataType, boundsType, DataHelper, getBoundsData } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
import { IBox, IBoxData, IBoxInputData, IOverflow, IScrollConfig, IScroller } from '@leafer-ui/interface'
|
|
@@ -52,12 +52,12 @@ export class Box<TInputData = IBoxInputData> extends Group<TInputData> implement
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
@rewrite(rect.__updateStrokeSpread)
|
|
55
|
-
public __updateStrokeSpread():
|
|
55
|
+
public __updateStrokeSpread(): IFourNumber { return 0 }
|
|
56
56
|
|
|
57
57
|
@rewrite(rect.__updateRenderSpread)
|
|
58
|
-
public __updateRectRenderSpread():
|
|
58
|
+
public __updateRectRenderSpread(): IFourNumber { return 0 }
|
|
59
59
|
|
|
60
|
-
public __updateRenderSpread():
|
|
60
|
+
public __updateRenderSpread(): IFourNumber { return this.__updateRectRenderSpread() || -1 }
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
@rewrite(rect.__updateBoxBounds)
|
package/src/Text.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ILeaferCanvas, IBoolean, INumber, IString, IBoundsData, IUnitData, IRenderOptions } from '@leafer/interface'
|
|
1
|
+
import { ILeaferCanvas, IBoolean, INumber, IString, IBoundsData, IUnitData, IRenderOptions, IFourNumber } from '@leafer/interface'
|
|
2
2
|
import { BoundsHelper, boundsType, surfaceType, dataProcessor, registerUI, affectStrokeBoundsType, dataType, hitType, MathHelper, DataHelper } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
import { IFill, IText, IFontWeight, ITextCase, ITextDecoration, ITextData, ITextInputData, ITextAlign, IVerticalAlign, ITextDrawData, ITextOverflow, IStrokeAlign, IHitType, ITextWrap, IWritingMode, IBackgroundBoxStyle } from '@leafer-ui/interface'
|
|
@@ -154,10 +154,10 @@ export class Text<TConstructorData = ITextInputData> extends UI<TConstructorData
|
|
|
154
154
|
else data.__textBoxBounds = b
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
override __updateRenderSpread():
|
|
158
|
-
let
|
|
159
|
-
if (!
|
|
160
|
-
return
|
|
157
|
+
override __updateRenderSpread(): IFourNumber {
|
|
158
|
+
let spread = super.__updateRenderSpread()
|
|
159
|
+
if (!spread) spread = this.isOverflow ? 1 : 0
|
|
160
|
+
return spread
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
override __updateRenderBounds(): void {
|
package/src/UI.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ILeaferCanvas, IPathDrawer, IPathCommandData, IHitType, INumber, IBoolean, IString, IPathString, IExportFileType, IPointData, ICursorType, IMaskType, IEraserType, IValue, IWindingRule, IPathCreator, IFourNumber, IBoundsData, IFlowType, IGap, IFlowWrap, IAxis, IConstraint, IAutoBoxData, IFlowBoxType, IPointGap, IFlowAlign, IFlowAxisAlign, IFindCondition, IAutoSize, IRangeSize, IAlign, IUnitPointData, IObject, IScaleData, IUnitData, IPathCommandObject, ITransition, IFilter, ILeaferImage, IScaleFixed, IDragBoundsType } from '@leafer/interface'
|
|
2
|
-
import { Leaf, PathDrawer, surfaceType, dataType, positionType, scrollType, boundsType, pathType, scaleType, rotationType, opacityType, visibleType, sortType, maskType, dataProcessor, registerUI, useModule, rewrite, rewriteAble, UICreator, PathCorner, hitType, strokeType, PathConvert, eraserType, cursorType, autoLayoutType, pen, naturalBoundsType, pathInputType, MathHelper, Plugin, DataHelper, affectRenderBoundsType, isString, isNumber } from '@leafer/core'
|
|
2
|
+
import { Leaf, PathDrawer, surfaceType, dimType, dataType, positionType, scrollType, boundsType, pathType, scaleType, rotationType, opacityType, visibleType, sortType, maskType, dataProcessor, registerUI, useModule, rewrite, rewriteAble, UICreator, PathCorner, hitType, strokeType, PathConvert, eraserType, cursorType, autoLayoutType, pen, naturalBoundsType, pathInputType, MathHelper, Plugin, DataHelper, affectRenderBoundsType, isString, isNumber } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
import { IUI, IShadowEffect, IBlurEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString, IUIInputData, IExportOptions, IExportResult, IFill, IStroke, IArrowStyle, IFindUIMethod, ILeafer, IEditorConfig, IEditorConfigFunction, IEditToolFunction, IKeyframe, IAnimation, IAnimate, IStates, IStateName, IAnimateType, IStateStyle, IColorString, IAnimateList } from '@leafer-ui/interface'
|
|
5
5
|
import { effectType, zoomLayerType } from '@leafer-ui/decorator'
|
|
@@ -61,12 +61,16 @@ export class UI<TInputData = IUIInputData> extends Leaf<TInputData> implements I
|
|
|
61
61
|
public locked?: IBoolean
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
@
|
|
64
|
+
// @leafer-in/bright will rewrite
|
|
65
|
+
|
|
66
|
+
@dimType(false)
|
|
65
67
|
public dim?: IBoolean | INumber // 是否弱化内容,可设置具体透明度
|
|
66
68
|
|
|
67
|
-
@
|
|
69
|
+
@dimType(false)
|
|
68
70
|
public dimskip?: IBoolean // 跳过弱化,突出显示内容,不受dim影响
|
|
69
71
|
|
|
72
|
+
public bright?: IBoolean // 突出显示内容,并置顶渲染,不受dim影响
|
|
73
|
+
|
|
70
74
|
|
|
71
75
|
@sortType(0)
|
|
72
76
|
public zIndex?: INumber
|
|
@@ -144,7 +148,7 @@ export class UI<TInputData = IUIInputData> extends Leaf<TInputData> implements I
|
|
|
144
148
|
|
|
145
149
|
|
|
146
150
|
@affectRenderBoundsType(0)
|
|
147
|
-
public renderSpread?:
|
|
151
|
+
public renderSpread?: IFourNumber // 强行扩大渲染边界
|
|
148
152
|
|
|
149
153
|
|
|
150
154
|
// path
|
|
@@ -405,7 +409,7 @@ export class UI<TInputData = IUIInputData> extends Leaf<TInputData> implements I
|
|
|
405
409
|
public reset(_data?: IUIInputData): void { }
|
|
406
410
|
|
|
407
411
|
|
|
408
|
-
// @leafer-in/animate will rewrite
|
|
412
|
+
// @leafer-in/animate and @leafer-in/state will rewrite
|
|
409
413
|
|
|
410
414
|
public set(data: IUIInputData, _transition?: ITransition | 'temp'): void {
|
|
411
415
|
if (data) Object.assign(this, data)
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IString, INumber, IBoolean, IMaskType, IEraserType, IAlign, IUnitPointData, IPathCommandData, IPathCommandObject, IPathString, IWindingRule, IFlowType,
|
|
1
|
+
import { IString, INumber, IBoolean, IMaskType, IEraserType, IAlign, IUnitPointData, IFourNumber, IPathCommandData, IPathCommandObject, IPathString, IWindingRule, IFlowType, IGap, IPointGap, IFlowAlign, IFlowAxisAlign, IFlowWrap, IFlowBoxType, IAutoSize, IAutoBoxData, IConstraint, IRangeSize, IAxis, IBoundsData, IDragBoundsType, IHitType, ICursorType, IScaleFixed, IFilter, ITransition, IUnitData, IObject, IPointData, IPathCreator, IValue, IFindCondition, ILeaferCanvas, IPathDrawer, ILeaferImage, IExportFileType, IJSONOptions, IPickOptions, IPickResult, ILeaferMode, IRenderer, IWatcher, ILayouter, ISelector, IInteraction, ICanvasManager, IHitCanvasManager, ILeaferConfig, IAutoBounds, IBounds, IEventListenerId, ITimer, IControl, ILeaferType, IScreenSizeData, IResizeEvent, ICanvasSizeAttr, IZoomType, IZoomOptions, IClientPointData, IRenderOptions, ICanvasContext2DSettings, ICanvasContext2D } from '@leafer/interface';
|
|
2
2
|
import { Leaf, LeafList } from '@leafer/core';
|
|
3
3
|
import { IUIInputData, IUI, IUIData, ILeafer, IGroup, IBlendMode, IFill, IStroke, IStrokeAlign, IStrokeWidthString, IStrokeCap, IStrokeJoin, IDashPatternString, IArrowStyle, ICornerRadiusString, IShadowEffect, IShadowString, IBlurEffect, IGrayscaleEffect, IAnimation, IStates, IStateName, IStateStyle, IColorString, IEditorConfig, IAnimate, IAnimateList, IFindUIMethod, IKeyframe, IAnimateType, IExportOptions, IExportResult, IEditorConfigFunction, IEditToolFunction, IGroupInputData, IGroupData, IUIJSONData, IFindCondition as IFindCondition$1, ILeaferData, IApp, IEditorBase, IFunction, ILeaferInputData, IBoxInputData, IBox, IBoxData, IOverflow, IScrollConfig, IScroller, IFrameInputData, IFrame, IFrameData, IRectInputData, IRect, IRectData, IEllipseInputData, IEllipse, IEllipseData, IPolygonInputData, IPolygon, IPolygonData, IStarInputData, IStar, IStarData, ILineInputData, ILine, ILineData, IImageInputData, IImage, IImageData, ICanvasInputData, ICanvas, ICanvasData, ITextInputData, IText, ITextData, IBackgroundBoxStyle, IHitType as IHitType$1, IFontWeight, ITextCase, ITextDecoration, IWritingMode, ITextAlign, IVerticalAlign, ITextWrap, ITextOverflow, ITextDrawData, IPathInputData, IPath, IPathData, IPenInputData, IPen, IPenData, IPathCommandData as IPathCommandData$1, IPointData as IPointData$1 } from '@leafer-ui/interface';
|
|
4
4
|
|
|
@@ -21,6 +21,7 @@ declare class UI<TInputData = IUIInputData> extends Leaf<TInputData> implements
|
|
|
21
21
|
locked?: IBoolean;
|
|
22
22
|
dim?: IBoolean | INumber;
|
|
23
23
|
dimskip?: IBoolean;
|
|
24
|
+
bright?: IBoolean;
|
|
24
25
|
zIndex?: INumber;
|
|
25
26
|
mask?: IBoolean | IMaskType;
|
|
26
27
|
eraser?: IBoolean | IEraserType;
|
|
@@ -41,7 +42,7 @@ declare class UI<TInputData = IUIInputData> extends Leaf<TInputData> implements
|
|
|
41
42
|
around?: IAlign | IUnitPointData;
|
|
42
43
|
lazy?: IBoolean;
|
|
43
44
|
pixelRatio?: INumber;
|
|
44
|
-
renderSpread?:
|
|
45
|
+
renderSpread?: IFourNumber;
|
|
45
46
|
path?: IPathCommandData | IPathCommandObject[] | IPathString;
|
|
46
47
|
windingRule?: IWindingRule;
|
|
47
48
|
closed?: boolean;
|
|
@@ -289,9 +290,9 @@ declare class Box<TInputData = IBoxInputData> extends Group<TInputData> implemen
|
|
|
289
290
|
scroller?: IScroller;
|
|
290
291
|
hasScroller?: boolean;
|
|
291
292
|
constructor(data?: TInputData);
|
|
292
|
-
__updateStrokeSpread():
|
|
293
|
-
__updateRectRenderSpread():
|
|
294
|
-
__updateRenderSpread():
|
|
293
|
+
__updateStrokeSpread(): IFourNumber;
|
|
294
|
+
__updateRectRenderSpread(): IFourNumber;
|
|
295
|
+
__updateRenderSpread(): IFourNumber;
|
|
295
296
|
__updateRectBoxBounds(): void;
|
|
296
297
|
__updateBoxBounds(_secondLayout?: boolean): void;
|
|
297
298
|
__updateStrokeBounds(): void;
|
|
@@ -422,7 +423,7 @@ declare class Text<TConstructorData = ITextInputData> extends UI<TConstructorDat
|
|
|
422
423
|
get textDrawData(): ITextDrawData;
|
|
423
424
|
__updateTextDrawData(): void;
|
|
424
425
|
__updateBoxBounds(): void;
|
|
425
|
-
__updateRenderSpread():
|
|
426
|
+
__updateRenderSpread(): IFourNumber;
|
|
426
427
|
__updateRenderBounds(): void;
|
|
427
428
|
__updateChange(): void;
|
|
428
429
|
__drawRenderPath(canvas: ILeaferCanvas): void;
|