@leafer-ui/display 1.0.10 → 1.1.0
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/Group.ts +4 -4
- package/src/Leafer.ts +3 -3
- package/src/Text.ts +1 -1
- package/src/UI.ts +10 -5
- package/types/index.d.ts +5 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/display",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
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
|
|
26
|
-
"@leafer-ui/data": "1.0
|
|
27
|
-
"@leafer-ui/display-module": "1.0
|
|
28
|
-
"@leafer-ui/decorator": "1.0
|
|
29
|
-
"@leafer-ui/external": "1.0
|
|
25
|
+
"@leafer/core": "1.1.0",
|
|
26
|
+
"@leafer-ui/data": "1.1.0",
|
|
27
|
+
"@leafer-ui/display-module": "1.1.0",
|
|
28
|
+
"@leafer-ui/decorator": "1.1.0",
|
|
29
|
+
"@leafer-ui/external": "1.1.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@leafer/interface": "1.0
|
|
33
|
-
"@leafer-ui/interface": "1.0
|
|
32
|
+
"@leafer/interface": "1.1.0",
|
|
33
|
+
"@leafer-ui/interface": "1.1.0"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/Group.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IJSONOptions, IPickOptions, IPickResult, IPointData } from '@leafer/interface'
|
|
2
2
|
import { Branch, useModule, dataProcessor, registerUI } from '@leafer/core'
|
|
3
3
|
|
|
4
|
-
import { IGroup, IGroupData, IGroupInputData, IUI, IUIInputData, IUIJSONData, IFindCondition, IFindUIMethod } from '@leafer-ui/interface'
|
|
4
|
+
import { IGroup, IGroupData, IGroupInputData, IUI, IUIInputData, IUIJSONData, ITransition, IFindCondition, IFindUIMethod } from '@leafer-ui/interface'
|
|
5
5
|
import { GroupData } from '@leafer-ui/data'
|
|
6
6
|
|
|
7
7
|
import { UI } from './UI'
|
|
@@ -36,19 +36,19 @@ export class Group extends UI implements IGroup { // tip: rewrited Box
|
|
|
36
36
|
|
|
37
37
|
// data
|
|
38
38
|
|
|
39
|
-
public set(data: IUIInputData,
|
|
39
|
+
public set(data: IUIInputData, transition?: ITransition | 'temp'): void {
|
|
40
40
|
if (data.children) {
|
|
41
41
|
const { children } = data
|
|
42
42
|
|
|
43
43
|
delete data.children
|
|
44
44
|
this.children ? this.clear() : this.__setBranch()
|
|
45
45
|
|
|
46
|
-
super.set(data,
|
|
46
|
+
super.set(data, transition)
|
|
47
47
|
|
|
48
48
|
children.forEach(child => this.add(child))
|
|
49
49
|
data.children = children
|
|
50
50
|
|
|
51
|
-
} else super.set(data,
|
|
51
|
+
} else super.set(data, transition)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
public toJSON(options?: IJSONOptions): IUIJSONData {
|
package/src/Leafer.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ILeaferCanvas, IRenderer, ILayouter, ISelector, IWatcher, IInteraction, ILeaferConfig, ICanvasManager, IHitCanvasManager, IAutoBounds, IScreenSizeData, IResizeEvent, IEventListenerId, ITimer, IValue, IObject, IControl, IPointData, ILeaferType, ICursorType, IBoundsData, INumber, IZoomType, IFourNumber, IBounds, IClientPointData } from '@leafer/interface'
|
|
2
2
|
import { AutoBounds, LayoutEvent, ResizeEvent, LeaferEvent, CanvasManager, ImageManager, DataHelper, Creator, Run, Debug, RenderEvent, registerUI, boundsType, canvasSizeAttrs, dataProcessor, WaitHelper, WatchEvent, Bounds, LeafList, needPlugin } from '@leafer/core'
|
|
3
3
|
|
|
4
|
-
import { ILeaferInputData, ILeaferData, IFunction, IUIInputData, ILeafer, IApp, IEditorBase } from '@leafer-ui/interface'
|
|
4
|
+
import { ILeaferInputData, ILeaferData, IFunction, IUIInputData, ITransition, ILeafer, IApp, IEditorBase } from '@leafer-ui/interface'
|
|
5
5
|
import { LeaferData } from '@leafer-ui/data'
|
|
6
6
|
|
|
7
7
|
import { Group } from './Group'
|
|
@@ -159,8 +159,8 @@ export class Leafer extends Group implements ILeafer {
|
|
|
159
159
|
|
|
160
160
|
public initType(_type: ILeaferType): void { } // rewrite in @leafer-ui/type
|
|
161
161
|
|
|
162
|
-
public set(data: IUIInputData): void {
|
|
163
|
-
this.waitInit(() => { super.set(data) })
|
|
162
|
+
public set(data: IUIInputData, transition?: ITransition | 'temp'): void {
|
|
163
|
+
this.waitInit(() => { super.set(data, transition) })
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
public start(): void {
|
package/src/Text.ts
CHANGED
package/src/UI.ts
CHANGED
|
@@ -306,6 +306,9 @@ export class UI extends Leaf implements IUI { // tip: rewrited Box
|
|
|
306
306
|
|
|
307
307
|
public motionPath?: boolean
|
|
308
308
|
|
|
309
|
+
public motionPrecision?: INumber
|
|
310
|
+
|
|
311
|
+
|
|
309
312
|
public motion?: INumber | IUnitData
|
|
310
313
|
|
|
311
314
|
public motionRotation?: INumber | IBoolean
|
|
@@ -377,11 +380,13 @@ export class UI extends Leaf implements IUI { // tip: rewrited Box
|
|
|
377
380
|
public reset(_data?: IUIInputData): void { }
|
|
378
381
|
|
|
379
382
|
|
|
380
|
-
public set(data: IUIInputData,
|
|
381
|
-
if (
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
383
|
+
public set(data: IUIInputData, transition?: ITransition | 'temp'): void {
|
|
384
|
+
if (transition) {
|
|
385
|
+
if (transition === 'temp') {
|
|
386
|
+
this.lockNormalStyle = true
|
|
387
|
+
Object.assign(this, data)
|
|
388
|
+
this.lockNormalStyle = false
|
|
389
|
+
} else this.animate(data, transition)
|
|
385
390
|
} else Object.assign(this, data)
|
|
386
391
|
}
|
|
387
392
|
|
package/types/index.d.ts
CHANGED
|
@@ -91,6 +91,7 @@ declare class UI extends Leaf implements IUI {
|
|
|
91
91
|
transition?: ITransition;
|
|
92
92
|
transitionOut?: ITransition;
|
|
93
93
|
motionPath?: boolean;
|
|
94
|
+
motionPrecision?: INumber;
|
|
94
95
|
motion?: INumber | IUnitData;
|
|
95
96
|
motionRotation?: INumber | IBoolean;
|
|
96
97
|
states?: IStates;
|
|
@@ -114,7 +115,7 @@ declare class UI extends Leaf implements IUI {
|
|
|
114
115
|
get editInner(): string;
|
|
115
116
|
constructor(data?: IUIInputData);
|
|
116
117
|
reset(_data?: IUIInputData): void;
|
|
117
|
-
set(data: IUIInputData,
|
|
118
|
+
set(data: IUIInputData, transition?: ITransition | 'temp'): void;
|
|
118
119
|
get(name?: string | string[] | IUIInputData): IUIInputData | IValue;
|
|
119
120
|
createProxyData(): IUIInputData;
|
|
120
121
|
find(_condition: number | string | IFindCondition | IFindUIMethod, _options?: any): IUI[];
|
|
@@ -151,7 +152,7 @@ declare class Group extends UI implements IGroup {
|
|
|
151
152
|
constructor(data?: IGroupInputData);
|
|
152
153
|
reset(data?: IGroupInputData): void;
|
|
153
154
|
__setBranch(): void;
|
|
154
|
-
set(data: IUIInputData,
|
|
155
|
+
set(data: IUIInputData, transition?: ITransition | 'temp'): void;
|
|
155
156
|
toJSON(options?: IJSONOptions): IUIJSONData;
|
|
156
157
|
pick(_hitPoint: IPointData, _options?: IPickOptions): IPickResult;
|
|
157
158
|
addAt(child: IUI | IUI[] | IUIInputData | IUIInputData[], index: number): void;
|
|
@@ -211,7 +212,7 @@ declare class Leafer extends Group implements ILeafer {
|
|
|
211
212
|
init(userConfig?: ILeaferConfig, parentApp?: IApp): void;
|
|
212
213
|
onInit(): void;
|
|
213
214
|
initType(_type: ILeaferType): void;
|
|
214
|
-
set(data: IUIInputData): void;
|
|
215
|
+
set(data: IUIInputData, transition?: ITransition | 'temp'): void;
|
|
215
216
|
start(): void;
|
|
216
217
|
stop(): void;
|
|
217
218
|
unlockLayout(): void;
|
|
@@ -383,7 +384,7 @@ declare class Text extends UI implements IText {
|
|
|
383
384
|
fill?: IFill;
|
|
384
385
|
strokeAlign?: IStrokeAlign;
|
|
385
386
|
hitFill?: IHitType$1;
|
|
386
|
-
text?: IString;
|
|
387
|
+
text?: IString | INumber;
|
|
387
388
|
fontFamily?: IString;
|
|
388
389
|
fontSize?: INumber;
|
|
389
390
|
fontWeight?: IFontWeight;
|