jsx: viewFragment support null or undefined
This commit is contained in:
parent
654b63f3c6
commit
7684eaa896
@ -716,7 +716,7 @@ var Group = /** @class */ (function (_super) {
|
|||||||
else if (e instanceof View) {
|
else if (e instanceof View) {
|
||||||
this.addChild(e);
|
this.addChild(e);
|
||||||
}
|
}
|
||||||
else {
|
else if (!!e) {
|
||||||
loge("Not allowed to add " + typeof e);
|
loge("Not allowed to add " + typeof e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -576,7 +576,7 @@ class Group extends Superview {
|
|||||||
else if (e instanceof View) {
|
else if (e instanceof View) {
|
||||||
this.addChild(e);
|
this.addChild(e);
|
||||||
}
|
}
|
||||||
else {
|
else if (!!e) {
|
||||||
loge(`Not allowed to add ${typeof e}`);
|
loge(`Not allowed to add ${typeof e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2106,7 +2106,7 @@ class Group extends Superview {
|
|||||||
else if (e instanceof View) {
|
else if (e instanceof View) {
|
||||||
this.addChild(e);
|
this.addChild(e);
|
||||||
}
|
}
|
||||||
else {
|
else if (!!e) {
|
||||||
loge(`Not allowed to add ${typeof e}`);
|
loge(`Not allowed to add ${typeof e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
doric-js/index.d.ts
vendored
2
doric-js/index.d.ts
vendored
@ -338,7 +338,7 @@ declare module 'doric/lib/src/ui/view' {
|
|||||||
toModel(): NativeViewModel;
|
toModel(): NativeViewModel;
|
||||||
}
|
}
|
||||||
export type ViewArray = View[];
|
export type ViewArray = View[];
|
||||||
export type ViewFragment = View | ViewArray;
|
export type ViewFragment = View | ViewArray | undefined | null;
|
||||||
export abstract class Group extends Superview implements JSX.ElementChildrenAttribute {
|
export abstract class Group extends Superview implements JSX.ElementChildrenAttribute {
|
||||||
readonly children: View[];
|
readonly children: View[];
|
||||||
allSubviews(): View[];
|
allSubviews(): View[];
|
||||||
|
2
doric-js/lib/src/ui/view.d.ts
vendored
2
doric-js/lib/src/ui/view.d.ts
vendored
@ -157,7 +157,7 @@ export declare abstract class Superview extends View {
|
|||||||
toModel(): NativeViewModel;
|
toModel(): NativeViewModel;
|
||||||
}
|
}
|
||||||
export declare type ViewArray = View[];
|
export declare type ViewArray = View[];
|
||||||
export declare type ViewFragment = View | ViewArray;
|
export declare type ViewFragment = View | ViewArray | undefined | null;
|
||||||
export declare abstract class Group extends Superview implements JSX.ElementChildrenAttribute {
|
export declare abstract class Group extends Superview implements JSX.ElementChildrenAttribute {
|
||||||
readonly children: View[];
|
readonly children: View[];
|
||||||
allSubviews(): View[];
|
allSubviews(): View[];
|
||||||
|
@ -458,7 +458,7 @@ export class Group extends Superview {
|
|||||||
else if (e instanceof View) {
|
else if (e instanceof View) {
|
||||||
this.addChild(e);
|
this.addChild(e);
|
||||||
}
|
}
|
||||||
else {
|
else if (!!e) {
|
||||||
loge(`Not allowed to add ${typeof e}`);
|
loge(`Not allowed to add ${typeof e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -479,7 +479,7 @@ export abstract class Superview extends View {
|
|||||||
}
|
}
|
||||||
export type ViewArray = View[]
|
export type ViewArray = View[]
|
||||||
|
|
||||||
export type ViewFragment = View | ViewArray
|
export type ViewFragment = View | ViewArray | undefined | null
|
||||||
|
|
||||||
export abstract class Group extends Superview {
|
export abstract class Group extends Superview {
|
||||||
|
|
||||||
@ -499,7 +499,7 @@ export abstract class Group extends Superview {
|
|||||||
e.forEach(e => this.addInnerElement(e))
|
e.forEach(e => this.addInnerElement(e))
|
||||||
} else if (e instanceof View) {
|
} else if (e instanceof View) {
|
||||||
this.addChild(e)
|
this.addChild(e)
|
||||||
} else {
|
} else if (!!e) {
|
||||||
loge(`Not allowed to add ${typeof e}`)
|
loge(`Not allowed to add ${typeof e}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -504,7 +504,7 @@ export abstract class Superview extends View {
|
|||||||
|
|
||||||
export type ViewArray = View[]
|
export type ViewArray = View[]
|
||||||
|
|
||||||
export type ViewFragment = View | ViewArray
|
export type ViewFragment = View | ViewArray | undefined | null
|
||||||
|
|
||||||
export abstract class Group extends Superview implements JSX.ElementChildrenAttribute {
|
export abstract class Group extends Superview implements JSX.ElementChildrenAttribute {
|
||||||
|
|
||||||
@ -540,7 +540,7 @@ export abstract class Group extends Superview implements JSX.ElementChildrenAttr
|
|||||||
e.forEach(e => this.addInnerElement(e))
|
e.forEach(e => this.addInnerElement(e))
|
||||||
} else if (e instanceof View) {
|
} else if (e instanceof View) {
|
||||||
this.addChild(e)
|
this.addChild(e)
|
||||||
} else {
|
} else if (!!e) {
|
||||||
loge(`Not allowed to add ${typeof e}`)
|
loge(`Not allowed to add ${typeof e}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
doric-web/dist/index.js
vendored
2
doric-web/dist/index.js
vendored
@ -2180,7 +2180,7 @@ class Group extends Superview {
|
|||||||
else if (e instanceof View) {
|
else if (e instanceof View) {
|
||||||
this.addChild(e);
|
this.addChild(e);
|
||||||
}
|
}
|
||||||
else {
|
else if (!!e) {
|
||||||
loge(`Not allowed to add ${typeof e}`);
|
loge(`Not allowed to add ${typeof e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user