js: add stretchInset in image
This commit is contained in:
		| @@ -1786,6 +1786,10 @@ var Image = /** @class */ (function (_super) { | ||||
|         Property, | ||||
|         __metadata$4("design:type", Function) | ||||
|     ], Image.prototype, "loadCallback", void 0); | ||||
|     __decorate$4([ | ||||
|         Property, | ||||
|         __metadata$4("design:type", Object) | ||||
|     ], Image.prototype, "stretchInset", void 0); | ||||
|     return Image; | ||||
| }(View)); | ||||
| function image(config) { | ||||
|   | ||||
| @@ -1336,6 +1336,10 @@ __decorate$4([ | ||||
|     Property, | ||||
|     __metadata$4("design:type", Function) | ||||
| ], Image.prototype, "loadCallback", void 0); | ||||
| __decorate$4([ | ||||
|     Property, | ||||
|     __metadata$4("design:type", Object) | ||||
| ], Image.prototype, "stretchInset", void 0); | ||||
| function image(config) { | ||||
|     const ret = new Image; | ||||
|     ret.layoutConfig = layoutConfig().fit(); | ||||
|   | ||||
| @@ -2795,6 +2795,10 @@ __decorate$4([ | ||||
|     Property, | ||||
|     __metadata$4("design:type", Function) | ||||
| ], Image.prototype, "loadCallback", void 0); | ||||
| __decorate$4([ | ||||
|     Property, | ||||
|     __metadata$4("design:type", Object) | ||||
| ], Image.prototype, "stretchInset", void 0); | ||||
| function image(config) { | ||||
|     const ret = new Image; | ||||
|     ret.layoutConfig = layoutConfig().fit(); | ||||
|   | ||||
							
								
								
									
										12
									
								
								doric-js/index.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								doric-js/index.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -486,6 +486,18 @@ declare module 'doric/lib/src/widget/image' { | ||||
|                     width: number; | ||||
|                     height: number; | ||||
|             } | undefined) => void; | ||||
|             /** | ||||
|                 * Stretch a image according to pointed rect | ||||
|                 * Rect contains left, top, right & bottom | ||||
|                 * For Android, it is based on nine patch | ||||
|                 * For iOS, it is based on cap insets & stretch mode | ||||
|                 */ | ||||
|             stretchInset?: { | ||||
|                     left: number; | ||||
|                     top: number; | ||||
|                     right: number; | ||||
|                     bottom: number; | ||||
|             }; | ||||
|     } | ||||
|     export function image(config: Partial<Image>): Image; | ||||
| } | ||||
|   | ||||
							
								
								
									
										12
									
								
								doric-js/lib/src/widget/image.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								doric-js/lib/src/widget/image.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -48,5 +48,17 @@ export declare class Image extends View { | ||||
|         width: number; | ||||
|         height: number; | ||||
|     } | undefined) => void; | ||||
|     /** | ||||
|      * Stretch a image according to pointed rect | ||||
|      * Rect contains left, top, right & bottom | ||||
|      * For Android, it is based on nine patch | ||||
|      * For iOS, it is based on cap insets & stretch mode | ||||
|      */ | ||||
|     stretchInset?: { | ||||
|         left: number; | ||||
|         top: number; | ||||
|         right: number; | ||||
|         bottom: number; | ||||
|     }; | ||||
| } | ||||
| export declare function image(config: Partial<Image>): Image; | ||||
|   | ||||
| @@ -82,6 +82,10 @@ __decorate([ | ||||
|     Property, | ||||
|     __metadata("design:type", Function) | ||||
| ], Image.prototype, "loadCallback", void 0); | ||||
| __decorate([ | ||||
|     Property, | ||||
|     __metadata("design:type", Object) | ||||
| ], Image.prototype, "stretchInset", void 0); | ||||
| export function image(config) { | ||||
|     const ret = new Image; | ||||
|     ret.layoutConfig = layoutConfig().fit(); | ||||
|   | ||||
| @@ -80,6 +80,14 @@ export class Image extends View { | ||||
|  | ||||
|     @Property | ||||
|     loadCallback?: (image: { width: number; height: number } | undefined) => void | ||||
|  | ||||
|     @Property | ||||
|     stretchInset?: { | ||||
|         left: number, | ||||
|         top: number, | ||||
|         right: number, | ||||
|         bottom: number | ||||
|     } | ||||
| } | ||||
|  | ||||
| export function image(config: Partial<Image>) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user