@leafer-ui/data 2.0.1 → 2.0.2
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 +5 -5
- package/src/ImageData.ts +4 -1
- package/types/index.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/data",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "@leafer-ui/data",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "2.0.
|
|
26
|
-
"@leafer-ui/external": "2.0.
|
|
25
|
+
"@leafer/core": "2.0.2",
|
|
26
|
+
"@leafer-ui/external": "2.0.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "2.0.
|
|
30
|
-
"@leafer-ui/interface": "2.0.
|
|
29
|
+
"@leafer/interface": "2.0.2",
|
|
30
|
+
"@leafer-ui/interface": "2.0.2"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/ImageData.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IMultimediaType } from '@leafer/interface'
|
|
1
2
|
import { IImageData, IImageInputData, IImage, IObject, IJSONOptions } from '@leafer-ui/interface'
|
|
2
3
|
|
|
3
4
|
import { RectData } from './RectData'
|
|
@@ -7,6 +8,8 @@ export class ImageData extends RectData implements IImageData {
|
|
|
7
8
|
|
|
8
9
|
declare public __leaf: IImage
|
|
9
10
|
|
|
11
|
+
public get __urlType(): IMultimediaType { return 'image' }
|
|
12
|
+
|
|
10
13
|
protected _url: string
|
|
11
14
|
|
|
12
15
|
protected setUrl(value: string) {
|
|
@@ -15,7 +18,7 @@ export class ImageData extends RectData implements IImageData {
|
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
public __setImageFill(value: string): void {
|
|
18
|
-
(this as IImageInputData).fill = value ? { type:
|
|
21
|
+
(this as IImageInputData).fill = value ? { type: this.__urlType, mode: 'stretch', url: value } : undefined
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
public __getData(): IObject {
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INumber, IPointData, IBoolean, IValue, IPathCommandData, IPathCommandNode, IPathCommandObject, IPathString, IJSONOptions as IJSONOptions$1 } from '@leafer/interface';
|
|
1
|
+
import { INumber, IPointData, IBoolean, IValue, IPathCommandData, IPathCommandNode, IPathCommandObject, IPathString, IJSONOptions as IJSONOptions$1, IMultimediaType } from '@leafer/interface';
|
|
2
2
|
import { LeafData } from '@leafer/core';
|
|
3
3
|
import { IUIData, IUI, IStrokeComputedStyle, IGroupData, IBoxData, ILeaferData, IObject, IJSONOptions, IFrameData, ILineData, IRectData, IEllipseData, IPolygonData, IStarData, IPathData, IPenData, ITextData, IBackgroundBoxStyle, IFontWeight, IImageData, IImage, ICanvasData } from '@leafer-ui/interface';
|
|
4
4
|
|
|
@@ -98,6 +98,7 @@ declare class TextData extends UIData implements ITextData {
|
|
|
98
98
|
|
|
99
99
|
declare class ImageData extends RectData implements IImageData {
|
|
100
100
|
__leaf: IImage;
|
|
101
|
+
get __urlType(): IMultimediaType;
|
|
101
102
|
protected _url: string;
|
|
102
103
|
protected setUrl(value: string): void;
|
|
103
104
|
__setImageFill(value: string): void;
|