js: padding currently only support group or text,input

This commit is contained in:
pengfei.zhou
2022-08-25 10:42:56 +08:00
committed by osborn
parent 02259823da
commit 3937a3f4d3
16 changed files with 129 additions and 48 deletions

View File

@@ -52,12 +52,6 @@ export declare abstract class View implements Modeling {
hidden?: boolean;
viewId: string;
tag?: string;
padding?: {
left?: number;
right?: number;
top?: number;
bottom?: number;
};
layoutConfig?: LayoutConfig;
onClick?: Function;
superview?: Superview;
@@ -159,6 +153,12 @@ export declare abstract class Superview extends View {
export declare type ViewArray = View[];
export declare type ViewFragment = View | ViewArray | undefined | null;
export declare abstract class Group extends Superview implements JSX.ElementChildrenAttribute {
padding?: {
left?: number;
right?: number;
top?: number;
bottom?: number;
};
readonly children: View[];
allSubviews(): View[];
addChild(view: View): void;

View File

@@ -297,10 +297,6 @@ __decorate([
Property,
__metadata("design:type", Boolean)
], View.prototype, "hidden", void 0);
__decorate([
Property,
__metadata("design:type", Object)
], View.prototype, "padding", void 0);
__decorate([
Property,
__metadata("design:type", Object)
@@ -466,3 +462,7 @@ export class Group extends Superview {
this.addInnerElement(e);
}
}
__decorate([
Property,
__metadata("design:type", Object)
], Group.prototype, "padding", void 0);

View File

@@ -45,6 +45,12 @@ export declare class Input extends View {
length: number;
replacement: string;
}) => boolean;
padding?: {
left?: number;
right?: number;
top?: number;
bottom?: number;
};
getText(context: BridgeContext): Promise<string>;
setSelection(context: BridgeContext, start: number, end?: number): Promise<any>;
getSelection(context: BridgeContext): Promise<{

View File

@@ -135,6 +135,10 @@ __decorate([
Property,
__metadata("design:type", Function)
], Input.prototype, "beforeTextChange", void 0);
__decorate([
Property,
__metadata("design:type", Object)
], Input.prototype, "padding", void 0);
export var InputType;
(function (InputType) {
InputType[InputType["Default"] = 0] = "Default";

View File

@@ -23,6 +23,12 @@ export declare class Text extends View implements JSX.ElementChildrenAttribute {
underline?: boolean;
htmlText?: string;
truncateAt?: TruncateAt;
padding?: {
left?: number;
right?: number;
top?: number;
bottom?: number;
};
set innerElement(e: string);
}
export declare function text(config: Partial<Text>): Text;

View File

@@ -93,6 +93,10 @@ __decorate([
Property,
__metadata("design:type", Number)
], Text.prototype, "truncateAt", void 0);
__decorate([
Property,
__metadata("design:type", Object)
], Text.prototype, "padding", void 0);
export function text(config) {
const ret = new Text;
ret.layoutConfig = layoutConfig().fit();