@leafer-ui/interface 1.0.0-rc.16 → 1.0.0-rc.18
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 +2 -2
- package/src/IUI.ts +24 -5
- package/src/index.ts +1 -0
- package/src/module/IState.ts +11 -0
- package/types/index.d.ts +31 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.18",
|
|
4
4
|
"description": "@leafer-ui/interface",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/interface": "1.0.0-rc.
|
|
25
|
+
"@leafer/interface": "1.0.0-rc.18"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/IUI.ts
CHANGED
|
@@ -278,11 +278,19 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
|
|
|
278
278
|
readonly app: ILeafer
|
|
279
279
|
leafer?: ILeafer
|
|
280
280
|
parent?: IGroup
|
|
281
|
+
zoomLayer?: IGroup
|
|
281
282
|
readonly isFrame?: boolean
|
|
282
283
|
|
|
283
284
|
proxyData: IUIInputData
|
|
284
285
|
__proxyData?: IUIInputData
|
|
285
286
|
|
|
287
|
+
normalStyle: IUIInputData
|
|
288
|
+
hoverStyle: IUIInputData
|
|
289
|
+
pressStyle: IUIInputData
|
|
290
|
+
focusStyle: IUIInputData
|
|
291
|
+
selectedStyle: IUIInputData
|
|
292
|
+
disabledStyle: IUIInputData
|
|
293
|
+
|
|
286
294
|
children?: IUI[]
|
|
287
295
|
|
|
288
296
|
reset(data?: IUIInputData): void
|
|
@@ -290,7 +298,7 @@ export interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrDa
|
|
|
290
298
|
set(data: IUIInputData): void
|
|
291
299
|
toJSON(): IUIInputData
|
|
292
300
|
|
|
293
|
-
get(name?: string): IUIInputData | IValue
|
|
301
|
+
get(name?: string | string[] | IUIInputData): IUIInputData | IValue
|
|
294
302
|
createProxyData(): IUIInputData
|
|
295
303
|
|
|
296
304
|
find(condition: number | string | IFindUIMethod, options?: any): IUI[]
|
|
@@ -314,7 +322,13 @@ export interface IFindUIMethod {
|
|
|
314
322
|
export interface IUIData extends IUIComputedData, ILeafData {
|
|
315
323
|
|
|
316
324
|
padding?: number | number[]
|
|
317
|
-
|
|
325
|
+
|
|
326
|
+
normalStyle?: IUIInputData
|
|
327
|
+
hoverStyle?: IUIInputData
|
|
328
|
+
pressStyle?: IUIInputData
|
|
329
|
+
focusStyle?: IUIInputData
|
|
330
|
+
selectedStyle?: IUIInputData
|
|
331
|
+
disabledStyle?: IUIInputData
|
|
318
332
|
|
|
319
333
|
// 非数据属性, 自动计算的缓存数据
|
|
320
334
|
__isFills?: boolean
|
|
@@ -349,13 +363,18 @@ export interface IUIData extends IUIComputedData, ILeafData {
|
|
|
349
363
|
}
|
|
350
364
|
export interface IUIComputedData extends IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
|
|
351
365
|
padding?: number | number[]
|
|
352
|
-
|
|
353
|
-
locked?: boolean
|
|
354
366
|
}
|
|
355
367
|
|
|
356
368
|
export interface IUIBaseInputData extends IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData {
|
|
357
369
|
padding?: number | number[]
|
|
358
|
-
|
|
370
|
+
|
|
371
|
+
normalStyle?: IUIInputData
|
|
372
|
+
hoverStyle?: IUIInputData
|
|
373
|
+
pressStyle?: IUIInputData
|
|
374
|
+
focusStyle?: IUIInputData
|
|
375
|
+
selectedStyle?: IUIInputData
|
|
376
|
+
disabledStyle?: IUIInputData
|
|
377
|
+
|
|
359
378
|
children?: IUIInputData[]
|
|
360
379
|
}
|
|
361
380
|
|
package/src/index.ts
CHANGED
|
@@ -35,6 +35,7 @@ export { IPathArrowModule } from './module/IPathArrow'
|
|
|
35
35
|
export { ITextConvertModule } from './module/ITextConvert'
|
|
36
36
|
export { IColorConvertModule } from './module/IColorConvert'
|
|
37
37
|
export { IExportModule } from './module/IExport'
|
|
38
|
+
export { IStateModule } from './module/IState'
|
|
38
39
|
|
|
39
40
|
export { IPaintModule, IPaintImageModule, IPaintGradientModule } from './module/IPaint'
|
|
40
41
|
export { IEffectModule } from './module/IEffect'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ILeaf, IStateStyleType } from '@leafer/interface'
|
|
2
|
+
|
|
3
|
+
export interface IStateModule {
|
|
4
|
+
isHover(leaf: ILeaf): boolean
|
|
5
|
+
isPress(leaf: ILeaf): boolean
|
|
6
|
+
isFocus(leaf: ILeaf): boolean
|
|
7
|
+
isDrag(leaf: ILeaf): boolean
|
|
8
|
+
|
|
9
|
+
setStyle(leaf: ILeaf, stateType: IStateStyleType, value: boolean): void
|
|
10
|
+
updateEventStyle(leaf: ILeaf, eventType: string): void
|
|
11
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPointData, IExportFileType, ISizeData, IPathCommandData, IWindingRule, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, INumber, IBoolean, IString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPickOptions, IPickResult, ILeaf, IValue, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, IObject, ILeaferAttrData, IControl, ILeaferConfig, ILeaferType, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap } from '@leafer/interface';
|
|
1
|
+
import { IPointData, IExportFileType, ISizeData, IPathCommandData, IWindingRule, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, INumber, IBoolean, IString, IPathCreator, IBoundsData, ILeaferImageConfig, ILeaferCanvas, IRenderOptions, IPickOptions, IPickResult, ILeaf, IValue, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, IObject, ILeaferAttrData, IControl, ILeaferConfig, ILeaferType, ILeafRender, ILeafBounds, ILeafHit, IStateStyleType, ICachedLeaf, IBooleanMap } from '@leafer/interface';
|
|
2
2
|
export * from '@leafer/interface';
|
|
3
3
|
import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, IObject as IObject$1, ILeaf as ILeaf$1, IEditSize, IDragEvent, IRotateEvent, IGroupInputData as IGroupInputData$1, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IImageCursor, IAround } from '@leafer-ui/interface';
|
|
4
4
|
|
|
@@ -527,14 +527,21 @@ interface IUI extends IFillAttrData, IStrokeAttrData, ICornerRadiusAttrData, IEf
|
|
|
527
527
|
readonly app: ILeafer;
|
|
528
528
|
leafer?: ILeafer;
|
|
529
529
|
parent?: IGroup;
|
|
530
|
+
zoomLayer?: IGroup;
|
|
530
531
|
readonly isFrame?: boolean;
|
|
531
532
|
proxyData: IUIInputData;
|
|
532
533
|
__proxyData?: IUIInputData;
|
|
534
|
+
normalStyle: IUIInputData;
|
|
535
|
+
hoverStyle: IUIInputData;
|
|
536
|
+
pressStyle: IUIInputData;
|
|
537
|
+
focusStyle: IUIInputData;
|
|
538
|
+
selectedStyle: IUIInputData;
|
|
539
|
+
disabledStyle: IUIInputData;
|
|
533
540
|
children?: IUI[];
|
|
534
541
|
reset(data?: IUIInputData): void;
|
|
535
542
|
set(data: IUIInputData): void;
|
|
536
543
|
toJSON(): IUIInputData;
|
|
537
|
-
get(name?: string): IUIInputData | IValue;
|
|
544
|
+
get(name?: string | string[] | IUIInputData): IUIInputData | IValue;
|
|
538
545
|
createProxyData(): IUIInputData;
|
|
539
546
|
find(condition: number | string | IFindUIMethod, options?: any): IUI[];
|
|
540
547
|
findOne(condition: number | string | IFindUIMethod, options?: any): IUI;
|
|
@@ -551,7 +558,12 @@ interface IFindUIMethod {
|
|
|
551
558
|
}
|
|
552
559
|
interface IUIData extends IUIComputedData, ILeafData {
|
|
553
560
|
padding?: number | number[];
|
|
554
|
-
|
|
561
|
+
normalStyle?: IUIInputData;
|
|
562
|
+
hoverStyle?: IUIInputData;
|
|
563
|
+
pressStyle?: IUIInputData;
|
|
564
|
+
focusStyle?: IUIInputData;
|
|
565
|
+
selectedStyle?: IUIInputData;
|
|
566
|
+
disabledStyle?: IUIInputData;
|
|
555
567
|
__isFills?: boolean;
|
|
556
568
|
__isStrokes?: boolean;
|
|
557
569
|
readonly __strokeWidth: number;
|
|
@@ -574,11 +586,15 @@ interface IUIData extends IUIComputedData, ILeafData {
|
|
|
574
586
|
}
|
|
575
587
|
interface IUIComputedData extends IFillComputedData, IBorderComputedData, IStrokeComputedData, ITextStyleComputedData, ICornerRadiusComputedData, IEffectComputedData, ILeafComputedData {
|
|
576
588
|
padding?: number | number[];
|
|
577
|
-
locked?: boolean;
|
|
578
589
|
}
|
|
579
590
|
interface IUIBaseInputData extends IFillInputData, IStrokeInputData, ITextStyleInputData, ICornerRadiusInputData, IEffectInputData, ILeafInputData {
|
|
580
591
|
padding?: number | number[];
|
|
581
|
-
|
|
592
|
+
normalStyle?: IUIInputData;
|
|
593
|
+
hoverStyle?: IUIInputData;
|
|
594
|
+
pressStyle?: IUIInputData;
|
|
595
|
+
focusStyle?: IUIInputData;
|
|
596
|
+
selectedStyle?: IUIInputData;
|
|
597
|
+
disabledStyle?: IUIInputData;
|
|
582
598
|
children?: IUIInputData[];
|
|
583
599
|
}
|
|
584
600
|
type IUITag = 'App' | 'Leafer' | 'Rect' | 'Ellipse' | 'Polygon' | 'Star' | 'Line' | 'Path' | 'Pen' | 'Text' | 'Image' | 'Canvas' | 'Group' | 'Frame' | 'Box';
|
|
@@ -718,6 +734,15 @@ interface IExportModule {
|
|
|
718
734
|
export(leaf: ILeaf, filename: IExportFileType | string, options?: IExportOptions | number | boolean): Promise<IExportResult>;
|
|
719
735
|
}
|
|
720
736
|
|
|
737
|
+
interface IStateModule {
|
|
738
|
+
isHover(leaf: ILeaf): boolean;
|
|
739
|
+
isPress(leaf: ILeaf): boolean;
|
|
740
|
+
isFocus(leaf: ILeaf): boolean;
|
|
741
|
+
isDrag(leaf: ILeaf): boolean;
|
|
742
|
+
setStyle(leaf: ILeaf, stateType: IStateStyleType, value: boolean): void;
|
|
743
|
+
updateEventStyle(leaf: ILeaf, eventType: string): void;
|
|
744
|
+
}
|
|
745
|
+
|
|
721
746
|
interface ICachedShape extends ICachedLeaf {
|
|
722
747
|
worldCanvas?: ILeaferCanvas;
|
|
723
748
|
shapeBounds: IBoundsData;
|
|
@@ -759,4 +784,4 @@ interface IEffectModule {
|
|
|
759
784
|
backgroundBlur(ui: IUI, current: ILeaferCanvas, shape: ICachedShape): void;
|
|
760
785
|
}
|
|
761
786
|
|
|
762
|
-
export type { IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, ICornerRadiusString, IDashPatternString, IEditorBase, IEditorConfig, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFindUIMethod, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStroke, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };
|
|
787
|
+
export type { IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, ICornerRadiusString, IDashPatternString, IEditorBase, IEditorConfig, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFindUIMethod, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStateModule, IStroke, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };
|