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

@@ -127,14 +127,6 @@ export abstract class View implements Modeling {
viewId = uniqueId('ViewId')
@Property
padding?: {
left?: number,
right?: number,
top?: number,
bottom?: number,
}
@Property
layoutConfig?: LayoutConfig
@@ -483,6 +475,14 @@ export type ViewFragment = View | ViewArray | undefined | null
export abstract class Group extends Superview {
@Property
padding?: {
left?: number,
right?: number,
top?: number,
bottom?: number,
}
readonly children: View[] = []
allSubviews() {

View File

@@ -111,13 +111,6 @@ export abstract class View implements Modeling {
tag?: string
@Property
padding?: {
left?: number,
right?: number,
top?: number,
bottom?: number,
}
@Property
layoutConfig?: LayoutConfig
@@ -508,6 +501,14 @@ export type ViewFragment = View | ViewArray | undefined | null
export abstract class Group extends Superview implements JSX.ElementChildrenAttribute {
@Property
padding?: {
left?: number,
right?: number,
top?: number,
bottom?: number,
}
readonly children: View[] = new Proxy([], {
set: (target, index, value) => {
const ret = Reflect.set(target, index, value)

View File

@@ -104,6 +104,14 @@ export class Input extends View {
replacement: string,
}) => boolean
@Property
padding?: {
left?: number,
right?: number,
top?: number,
bottom?: number,
}
getText(context: BridgeContext) {
return this.nativeChannel(context, 'getText')() as Promise<string>
}

View File

@@ -69,6 +69,14 @@ export class Text extends View implements JSX.ElementChildrenAttribute {
@Property
truncateAt?: TruncateAt
@Property
padding?: {
left?: number,
right?: number,
top?: number,
bottom?: number,
}
set innerElement(e: string) {
this.text = e
}