web:support hidden

This commit is contained in:
pengfei.zhou 2021-04-16 14:34:16 +08:00 committed by osborn
parent f3b4c2f077
commit 900bccb98a
4 changed files with 37 additions and 5 deletions

View File

@ -17,11 +17,23 @@ class NaivgatorDemo extends Panel {
height: 50, height: 50,
}), }),
...[ ...[
'NavbarDemo', "DraggableDemo", 'AnimatorDemo',
'NavbarDemo',
"DraggableDemo",
"RefreshableDemo", "RefreshableDemo",
'Counter', 'EffectsDemo', 'ImageDemo', 'LayoutDemo', 'Counter',
'ListDemo', 'ModalDemo', 'NavigatorDemo', 'EffectsDemo',
'NetworkDemo', 'ScrollerDemo', 'SliderDemo', 'Snake', 'StorageDemo', 'PopoverDemo'].map(e => 'ImageDemo',
'LayoutDemo',
'ListDemo',
'ModalDemo',
'NavigatorDemo',
'NetworkDemo',
'ScrollerDemo',
'SliderDemo',
'Snake',
'StorageDemo',
'PopoverDemo'].map(e =>
label(e).apply({ label(e).apply({
height: 50, height: 50,
backgroundColor: colors[0], backgroundColor: colors[0],

View File

@ -4505,6 +4505,7 @@ var doric_web = (function (exports, axios, sandbox) {
this.frameHeight = 0; this.frameHeight = 0;
this.offsetX = 0; this.offsetX = 0;
this.offsetY = 0; this.offsetY = 0;
this._originDisplay = "";
this.transform = {}; this.transform = {};
this.context = context; this.context = context;
} }
@ -4516,6 +4517,7 @@ var doric_web = (function (exports, axios, sandbox) {
} }
} }
this.view = this.build(); this.view = this.build();
this._originDisplay = this.view.style.display;
} }
get paddingLeft() { get paddingLeft() {
return this.padding.left || 0; return this.padding.left || 0;
@ -4696,6 +4698,14 @@ var doric_web = (function (exports, axios, sandbox) {
}; };
} }
break; break;
case 'hidden':
if (prop === true) {
this.view.style.display = "none";
}
else {
this.view.style.display = this._originDisplay;
}
break;
default: default:
console.error(`Cannot blend prop for ${propName}`); console.error(`Cannot blend prop for ${propName}`);
break; break;

File diff suppressed because one or more lines are too long

View File

@ -103,6 +103,8 @@ export abstract class DoricViewNode {
view!: HTMLElement view!: HTMLElement
_originDisplay: string = ""
transform: { transform: {
translateX?: number, translateX?: number,
translateY?: number, translateY?: number,
@ -127,6 +129,7 @@ export abstract class DoricViewNode {
} }
} }
this.view = this.build() this.view = this.build()
this._originDisplay = this.view.style.display
} }
abstract build(): HTMLElement abstract build(): HTMLElement
@ -322,6 +325,13 @@ export abstract class DoricViewNode {
} }
} }
break break
case 'hidden':
if (prop === true) {
this.view.style.display = "none"
} else {
this.view.style.display = this._originDisplay
}
break
default: default:
console.error(`Cannot blend prop for ${propName}`) console.error(`Cannot blend prop for ${propName}`)
break break