@leafer-ui/display 1.3.2 → 1.3.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/display",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
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.3.2",
26
- "@leafer-ui/data": "1.3.2",
27
- "@leafer-ui/display-module": "1.3.2",
28
- "@leafer-ui/decorator": "1.3.2",
29
- "@leafer-ui/external": "1.3.2"
25
+ "@leafer/core": "1.3.3",
26
+ "@leafer-ui/data": "1.3.3",
27
+ "@leafer-ui/display-module": "1.3.3",
28
+ "@leafer-ui/decorator": "1.3.3",
29
+ "@leafer-ui/external": "1.3.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@leafer/interface": "1.3.2",
33
- "@leafer-ui/interface": "1.3.2"
32
+ "@leafer/interface": "1.3.3",
33
+ "@leafer-ui/interface": "1.3.3"
34
34
  }
35
35
  }
package/src/Box.ts CHANGED
@@ -60,6 +60,8 @@ export class Box extends Group implements IBox {
60
60
 
61
61
  if (data.__autoSide) {
62
62
 
63
+ if (data.__hasSurface) this.__extraUpdate() // Box自身存在样式,需要额外更新
64
+
63
65
  super.__updateBoxBounds()
64
66
 
65
67
  const { boxBounds } = this.__layout
package/src/Leafer.ts CHANGED
@@ -256,7 +256,7 @@ export class Leafer extends Group implements ILeafer {
256
256
  override __setAttr(attrName: string, newValue: IValue): boolean {
257
257
  if (this.canvas) {
258
258
  if (canvasSizeAttrs.includes(attrName)) {
259
- if (!newValue) debug.warn(attrName + ' is 0')
259
+ // if (!newValue) debug.warn(attrName + ' is 0')
260
260
  this.__changeCanvasSize(attrName, newValue as number)
261
261
  } else if (attrName === 'fill') {
262
262
  this.__changeFill(newValue as string)
package/src/Text.ts CHANGED
@@ -41,7 +41,7 @@ export class Text extends UI implements IText {
41
41
  @boundsType('')
42
42
  public text?: IString | INumber
43
43
 
44
- @boundsType('L')
44
+ @boundsType('caption')
45
45
  public fontFamily?: IString
46
46
 
47
47
  @boundsType(12)
package/src/UI.ts CHANGED
@@ -1,7 +1,7 @@
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 } from '@leafer/interface'
2
2
  import { Leaf, PathDrawer, surfaceType, dataType, positionType, 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 } from '@leafer/core'
3
3
 
4
- import { IUI, IShadowEffect, IBlurEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString, IUIInputData, IExportOptions, IExportResult, IFill, IStroke, IArrowType, IFindUIMethod, ILeafer, IEditorConfig, IEditorConfigFunction, IEditToolFunction, IKeyframe, IAnimation, IAnimate, IStates, IStateName, ITransition, IAnimateType, IEffect } from '@leafer-ui/interface'
4
+ import { IUI, IShadowEffect, IBlurEffect, IStrokeAlign, IStrokeJoin, IStrokeCap, IBlendMode, IDashPatternString, IShadowString, IGrayscaleEffect, IUIData, IGroup, IStrokeWidthString, ICornerRadiusString, IUIInputData, IExportOptions, IExportResult, IFill, IStroke, IArrowType, IFindUIMethod, ILeafer, IEditorConfig, IEditorConfigFunction, IEditToolFunction, IKeyframe, IAnimation, IAnimate, IStates, IStateName, ITransition, IAnimateType, IEffect, IStateStyle } from '@leafer-ui/interface'
5
5
  import { effectType, zoomLayerType } from '@leafer-ui/decorator'
6
6
 
7
7
  import { UIData } from '@leafer-ui/data'
@@ -326,17 +326,19 @@ export class UI extends Leaf implements IUI { // tip: rewrited Box
326
326
  public disabled?: IBoolean
327
327
 
328
328
 
329
- public normalStyle?: IUIInputData
329
+ public normalStyle?: IStateStyle
330
330
 
331
- public hoverStyle?: IUIInputData
331
+ public hoverStyle?: IStateStyle
332
332
 
333
- public pressStyle?: IUIInputData
333
+ public pressStyle?: IStateStyle
334
334
 
335
- public focusStyle?: IUIInputData
335
+ public focusStyle?: IStateStyle
336
336
 
337
- public selectedStyle?: IUIInputData
337
+ public selectedStyle?: IStateStyle
338
338
 
339
- public disabledStyle?: IUIInputData
339
+ public disabledStyle?: IStateStyle
340
+
341
+ public placeholderStyle?: IStateStyle
340
342
 
341
343
 
342
344
  public button?: IBoolean
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IString, INumber, IBoolean, IMaskType, IEraserType, IAlign, IUnitPointData, IPathCommandData, IPathCommandObject, IPathString, IWindingRule, IFlowType, IFourNumber, IGap, IPointGap, IFlowAlign, IFlowAxisAlign, IFlowWrap, IFlowBoxType, IAutoSize, IAutoBoxData, IConstraint, IRangeSize, IAxis, IBoundsData, IHitType, ICursorType, IUnitData, IObject, IPointData, IPathCreator, IValue, IFindCondition, ILeaferCanvas, IPathDrawer, IExportFileType, IJSONOptions, IPickOptions, IPickResult, IRenderer, IWatcher, ILayouter, ISelector, IInteraction, ICanvasManager, IHitCanvasManager, ILeaferConfig, IAutoBounds, IBounds, IEventListenerId, ITimer, IControl, ILeaferType, IScreenSizeData, IResizeEvent, IZoomType, IClientPointData, IRenderOptions, ILeaferImage, ICanvasContext2DSettings, ICanvasContext2D } from '@leafer/interface';
2
2
  import { Leaf, LeafList } from '@leafer/core';
3
- import { IUI, IUIData, IUIInputData, ILeafer, IGroup, IBlendMode, IFill, IStroke, IStrokeAlign, IStrokeWidthString, IStrokeCap, IStrokeJoin, IDashPatternString, IArrowType, ICornerRadiusString, IShadowEffect, IShadowString, IBlurEffect, IGrayscaleEffect, IEffect, IAnimation, ITransition, IStates, IStateName, IAnimate, IEditorConfig, IFindUIMethod, IKeyframe, IAnimateType, IExportOptions, IExportResult, IEditorConfigFunction, IEditToolFunction, IGroupData, IGroupInputData, IUIJSONData, IFindCondition as IFindCondition$1, ILeaferData, IApp, IEditorBase, IFunction, ILeaferInputData, IBox, IBoxData, IOverflow, IBoxInputData, IFrame, IFrameData, IFrameInputData, IRect, IRectData, IRectInputData, IEllipse, IEllipseData, IEllipseInputData, IPolygon, IPolygonData, IPolygonInputData, IStar, IStarData, IStarInputData, ILine, ILineData, ILineInputData, IImage, IImageData, IImageInputData, ICanvas, ICanvasData, ICanvasInputData, IText, ITextData, IHitType as IHitType$1, IFontWeight, ITextCase, ITextDecoration, IWritingMode, ITextAlign, IVerticalAlign, ITextWrap, ITextDrawData, ITextInputData, IPath, IPathData, IPathInputData, IPen, IPenData, IPathCommandData as IPathCommandData$1, IPenInputData } from '@leafer-ui/interface';
3
+ import { IUI, IUIData, IUIInputData, ILeafer, IGroup, IBlendMode, IFill, IStroke, IStrokeAlign, IStrokeWidthString, IStrokeCap, IStrokeJoin, IDashPatternString, IArrowType, ICornerRadiusString, IShadowEffect, IShadowString, IBlurEffect, IGrayscaleEffect, IEffect, IAnimation, ITransition, IStates, IStateName, IStateStyle, IAnimate, IEditorConfig, IFindUIMethod, IKeyframe, IAnimateType, IExportOptions, IExportResult, IEditorConfigFunction, IEditToolFunction, IGroupData, IGroupInputData, IUIJSONData, IFindCondition as IFindCondition$1, ILeaferData, IApp, IEditorBase, IFunction, ILeaferInputData, IBox, IBoxData, IOverflow, IBoxInputData, IFrame, IFrameData, IFrameInputData, IRect, IRectData, IRectInputData, IEllipse, IEllipseData, IEllipseInputData, IPolygon, IPolygonData, IPolygonInputData, IStar, IStarData, IStarInputData, ILine, ILineData, ILineInputData, IImage, IImageData, IImageInputData, ICanvas, ICanvasData, ICanvasInputData, IText, ITextData, IHitType as IHitType$1, IFontWeight, ITextCase, ITextDecoration, IWritingMode, ITextAlign, IVerticalAlign, ITextWrap, ITextDrawData, ITextInputData, IPath, IPathData, IPathInputData, IPen, IPenData, IPathCommandData as IPathCommandData$1, IPenInputData } from '@leafer-ui/interface';
4
4
 
5
5
  declare class UI extends Leaf implements IUI {
6
6
  __: IUIData;
@@ -98,12 +98,13 @@ declare class UI extends Leaf implements IUI {
98
98
  state?: IStateName;
99
99
  selected?: IBoolean;
100
100
  disabled?: IBoolean;
101
- normalStyle?: IUIInputData;
102
- hoverStyle?: IUIInputData;
103
- pressStyle?: IUIInputData;
104
- focusStyle?: IUIInputData;
105
- selectedStyle?: IUIInputData;
106
- disabledStyle?: IUIInputData;
101
+ normalStyle?: IStateStyle;
102
+ hoverStyle?: IStateStyle;
103
+ pressStyle?: IStateStyle;
104
+ focusStyle?: IStateStyle;
105
+ selectedStyle?: IStateStyle;
106
+ disabledStyle?: IStateStyle;
107
+ placeholderStyle?: IStateStyle;
107
108
  button?: IBoolean;
108
109
  data: IObject;
109
110
  set scale(value: INumber | IPointData);