@leafer-ui/display 1.0.0-rc.25 → 1.0.0-rc.26

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.0.0-rc.25",
3
+ "version": "1.0.0-rc.26",
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.0.0-rc.25",
26
- "@leafer-ui/data": "1.0.0-rc.25",
27
- "@leafer-ui/display-module": "1.0.0-rc.25",
28
- "@leafer-ui/decorator": "1.0.0-rc.25",
29
- "@leafer-ui/external": "1.0.0-rc.25"
25
+ "@leafer/core": "1.0.0-rc.26",
26
+ "@leafer-ui/data": "1.0.0-rc.26",
27
+ "@leafer-ui/display-module": "1.0.0-rc.26",
28
+ "@leafer-ui/decorator": "1.0.0-rc.26",
29
+ "@leafer-ui/external": "1.0.0-rc.26"
30
30
  },
31
31
  "devDependencies": {
32
- "@leafer/interface": "1.0.0-rc.25",
33
- "@leafer-ui/interface": "1.0.0-rc.25"
32
+ "@leafer/interface": "1.0.0-rc.26",
33
+ "@leafer-ui/interface": "1.0.0-rc.26"
34
34
  }
35
35
  }
package/src/Box.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ILeaferCanvas, IRenderOptions, IBoundsData } from '@leafer/interface'
2
- import { rewrite, rewriteAble, registerUI, BoundsHelper, dataProcessor, affectRenderBoundsType } from '@leafer/core'
1
+ import { ILeaferCanvas, IRenderOptions, IBoundsData, IBoolean } from '@leafer/interface'
2
+ import { rewrite, rewriteAble, registerUI, BoundsHelper, dataProcessor, affectRenderBoundsType, dataType } from '@leafer/core'
3
3
 
4
4
  import { IBox, IBoxData, IBoxInputData, IOverflow } from '@leafer-ui/interface'
5
5
  import { BoxData } from '@leafer-ui/data'
@@ -23,6 +23,9 @@ export class Box extends Group implements IBox {
23
23
  @dataProcessor(BoxData)
24
24
  declare public __: IBoxData
25
25
 
26
+ @dataType(false)
27
+ public resizeChildren: IBoolean
28
+
26
29
  @affectRenderBoundsType('show')
27
30
  declare public overflow: IOverflow
28
31
 
@@ -56,8 +59,8 @@ export class Box extends Group implements IBox {
56
59
  super.__updateBoxBounds()
57
60
  if (!data.__autoSize) {
58
61
  const b = this.__layout.boxBounds
59
- if (!data.__autoWidth) b.x = 0, b.width = data.width
60
- if (!data.__autoHeight) b.y = 0, b.height = data.height
62
+ if (!data.__autoWidth) b.height += b.y, b.width = data.width, b.x = b.y = 0
63
+ if (!data.__autoHeight) b.width += b.x, b.height = data.height, b.y = b.x = 0
61
64
  }
62
65
  } else {
63
66
  this.__updateRectBoxBounds()
package/src/Text.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ILeaferCanvas, IPathDrawer, IPathCommandData, IBoolean, INumber, IString, IBoundsData, IUnitData } from '@leafer/interface'
2
- import { BoundsHelper, boundsType, surfaceType, dataProcessor, registerUI, affectStrokeBoundsType, hitType, MathHelper } from '@leafer/core'
2
+ import { BoundsHelper, boundsType, surfaceType, dataProcessor, registerUI, affectStrokeBoundsType, dataType, hitType, MathHelper } from '@leafer/core'
3
3
 
4
4
  import { IFill, IText, IFontWeight, ITextCase, ITextDecoration, ITextData, ITextInputData, ITextAlign, IVerticalAlign, ITextDrawData, IOverflow, IStrokeAlign, IHitType, ITextWrap } from '@leafer-ui/interface'
5
5
  import { TextData, UnitConvert } from '@leafer-ui/data'
@@ -26,6 +26,9 @@ export class Text extends UI implements IText {
26
26
  @boundsType(0)
27
27
  declare public height: INumber
28
28
 
29
+ @dataType(false)
30
+ public resizeFontSize: IBoolean
31
+
29
32
  @surfaceType('#000000')
30
33
  declare public fill: IFill
31
34
 
package/src/UI.ts CHANGED
@@ -63,7 +63,7 @@ export class UI extends Leaf implements IUI { // tip: rewrited Box
63
63
  @stateType(false)
64
64
  public disabled: IBoolean
65
65
 
66
- @dataType(false)
66
+ @surfaceType(false)
67
67
  public locked: IBoolean
68
68
 
69
69
 
@@ -182,6 +182,9 @@ export class UI extends Leaf implements IUI { // tip: rewrited Box
182
182
  @boundsType() // rewrite in flow
183
183
  public autoHeight: IAutoSize
184
184
 
185
+ @boundsType()
186
+ public lockRatio: IBoolean
187
+
185
188
  @boundsType()
186
189
  public autoBox: IAutoBoxData | IConstraint
187
190
 
@@ -382,9 +385,9 @@ export class UI extends Leaf implements IUI { // tip: rewrited Box
382
385
 
383
386
  public findTag(tag: string | string[]): IUI[] { return this.find({ tag }) }
384
387
 
385
- public findOne(_condition: number | string | IFindCondition | IFindUIMethod, _options?: any): IUI { return undefined }
388
+ public findOne(_condition: number | string | IFindCondition | IFindUIMethod, _options?: any): IUI | undefined { return undefined }
386
389
 
387
- public findId(id: number | string): IUI { return this.findOne({ id }) }
390
+ public findId(id: number | string): IUI | undefined { return this.findOne({ id }) }
388
391
 
389
392
 
390
393
  // path
package/types/index.d.ts CHANGED
@@ -53,6 +53,7 @@ declare class UI extends Leaf implements IUI {
53
53
  inFlow: IBoolean;
54
54
  autoWidth: IAutoSize;
55
55
  autoHeight: IAutoSize;
56
+ lockRatio: IBoolean;
56
57
  autoBox: IAutoBoxData | IConstraint;
57
58
  widthRange: IRangeSize;
58
59
  heightRange: IRangeSize;
@@ -105,8 +106,8 @@ declare class UI extends Leaf implements IUI {
105
106
  createProxyData(): IUIInputData;
106
107
  find(_condition: number | string | IFindCondition | IFindUIMethod, _options?: any): IUI[];
107
108
  findTag(tag: string | string[]): IUI[];
108
- findOne(_condition: number | string | IFindCondition | IFindUIMethod, _options?: any): IUI;
109
- findId(id: number | string): IUI;
109
+ findOne(_condition: number | string | IFindCondition | IFindUIMethod, _options?: any): IUI | undefined;
110
+ findId(id: number | string): IUI | undefined;
110
111
  getPath(curve?: boolean, pathForRender?: boolean): IPathCommandData;
111
112
  getPathString(curve?: boolean, pathForRender?: boolean): IPathString;
112
113
  load(): void;
@@ -240,6 +241,7 @@ declare class Box extends Group implements IBox {
240
241
  get __tag(): string;
241
242
  get isBranchLeaf(): boolean;
242
243
  __: IBoxData;
244
+ resizeChildren: IBoolean;
243
245
  overflow: IOverflow;
244
246
  isOverflow: boolean;
245
247
  constructor(data?: IBoxInputData);
@@ -355,6 +357,7 @@ declare class Text extends UI implements IText {
355
357
  __: ITextData;
356
358
  width: INumber;
357
359
  height: INumber;
360
+ resizeFontSize: IBoolean;
358
361
  fill: IFill;
359
362
  strokeAlign: IStrokeAlign;
360
363
  hitFill: IHitType$1;