web:rename function

This commit is contained in:
pengfei.zhou 2021-04-14 17:46:58 +08:00 committed by osborn
parent 009e8734b6
commit 1a5ed94568
8 changed files with 74 additions and 18 deletions

View File

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

View File

@ -4557,8 +4557,11 @@ var doric_web = (function (exports, axios, sandbox) {
for (let key in props) { for (let key in props) {
this.blendProps(this.view, key, props[key]); this.blendProps(this.view, key, props[key]);
} }
this.onBlended(); this.onBlending();
this.layout(); this.layout();
this.onBlended();
}
onBlending() {
} }
onBlended() { onBlended() {
} }
@ -4792,8 +4795,8 @@ var doric_web = (function (exports, axios, sandbox) {
blend(props) { blend(props) {
super.blend(props); super.blend(props);
} }
onBlended() { onBlending() {
super.onBlended(); super.onBlending();
this.configChildNode(); this.configChildNode();
} }
configChildNode() { configChildNode() {
@ -5237,8 +5240,8 @@ var doric_web = (function (exports, axios, sandbox) {
getSubNodeById(viewId) { getSubNodeById(viewId) {
return viewId === this.childViewId ? this.childNode : undefined; return viewId === this.childViewId ? this.childNode : undefined;
} }
onBlended() { onBlending() {
super.onBlended(); super.onBlending();
const model = this.getSubModel(this.childViewId); const model = this.getSubModel(this.childViewId);
if (model === undefined) { if (model === undefined) {
return; return;
@ -5503,8 +5506,8 @@ var doric_web = (function (exports, axios, sandbox) {
this.view.removeChild(this.view.lastElementChild); this.view.removeChild(this.view.lastElementChild);
} }
} }
onBlended() { onBlending() {
super.onBlended(); super.onBlending();
if (this.childNodes.length !== this.itemCount) { if (this.childNodes.length !== this.itemCount) {
const ret = this.pureCallJSResponse("renderBunchedItems", this.childNodes.length, this.itemCount); const ret = this.pureCallJSResponse("renderBunchedItems", this.childNodes.length, this.itemCount);
this.childNodes = this.childNodes.concat(ret.map(e => { this.childNodes = this.childNodes.concat(ret.map(e => {
@ -5633,6 +5636,35 @@ var doric_web = (function (exports, axios, sandbox) {
} }
} }
class DoricRefreshableNode extends DoricSuperNode {
blendSubNode(model) {
}
getSubNodeById(viewId) {
return undefined;
}
build() {
const ret = document.createElement('div');
ret.style.overflow = "scroll";
const header = document.createElement('div');
const content = document.createElement('div');
header.style.width = "100%";
header.style.height = "200px";
header.style.backgroundColor = "red";
content.style.width = "100%";
content.style.height = "100%";
content.style.backgroundColor = "blue";
ret.appendChild(header);
ret.appendChild(content);
ret.addEventListener("scroll", () => {
ret.scrollTop = 200;
});
return ret;
}
onBlended() {
this.view.scrollTop = 200;
}
}
const bundles = new Map; const bundles = new Map;
const plugins = new Map; const plugins = new Map;
const nodes = new Map; const nodes = new Map;
@ -5668,6 +5700,7 @@ var doric_web = (function (exports, axios, sandbox) {
registerViewNode('ListItem', DoricListItemNode); registerViewNode('ListItem', DoricListItemNode);
registerViewNode('List', DoricListNode); registerViewNode('List', DoricListNode);
registerViewNode('Draggable', DoricDraggableNode); registerViewNode('Draggable', DoricDraggableNode);
registerViewNode('Refreshable', DoricRefreshableNode);
function getScriptId(contextId) { function getScriptId(contextId) {
return `__doric_script_${contextId}`; return `__doric_script_${contextId}`;

File diff suppressed because one or more lines are too long

View File

@ -14,6 +14,7 @@ import { PopoverPlugin } from './plugins/PopoverPlugin'
import { DoricListItemNode } from "./shader/DoricListItemNode" import { DoricListItemNode } from "./shader/DoricListItemNode"
import { DoricListNode } from "./shader/DoricListNode" import { DoricListNode } from "./shader/DoricListNode"
import { DoricDraggableNode } from "./shader/DoricDraggableNode" import { DoricDraggableNode } from "./shader/DoricDraggableNode"
import { DoricRefreshableNode } from "./shader/DoricRefreshableNode"
const bundles: Map<string, string> = new Map const bundles: Map<string, string> = new Map
@ -63,3 +64,4 @@ registerViewNode('Scroller', DoricScrollerNode)
registerViewNode('ListItem', DoricListItemNode) registerViewNode('ListItem', DoricListItemNode)
registerViewNode('List', DoricListNode) registerViewNode('List', DoricListNode)
registerViewNode('Draggable', DoricDraggableNode) registerViewNode('Draggable', DoricDraggableNode)
registerViewNode('Refreshable', DoricRefreshableNode)

View File

@ -43,8 +43,8 @@ export class DoricListNode extends DoricSuperNode {
} }
} }
onBlended() { onBlending() {
super.onBlended() super.onBlending()
if (this.childNodes.length !== this.itemCount) { if (this.childNodes.length !== this.itemCount) {
const ret = this.pureCallJSResponse("renderBunchedItems", this.childNodes.length, this.itemCount) as DVModel[] const ret = this.pureCallJSResponse("renderBunchedItems", this.childNodes.length, this.itemCount) as DVModel[]
this.childNodes = this.childNodes.concat(ret.map(e => { this.childNodes = this.childNodes.concat(ret.map(e => {

View File

@ -11,8 +11,22 @@ export class DoricRefreshableNode extends DoricSuperNode {
build() { build() {
const ret = document.createElement('div') const ret = document.createElement('div')
ret.style.overflow = "scroll"
const header = document.createElement('div')
const content = document.createElement('div')
header.style.width = "100%"
header.style.height = "200px"
header.style.backgroundColor = "red"
content.style.width = "100%"
content.style.height = "100%"
content.style.backgroundColor = "blue"
ret.appendChild(header)
ret.appendChild(content)
ret.addEventListener("scroll", () => {
ret.scrollTop = 200
})
return ret return ret
} }
} }

View File

@ -24,8 +24,8 @@ export class DoricScrollerNode extends DoricSuperNode {
return viewId === this.childViewId ? this.childNode : undefined return viewId === this.childViewId ? this.childNode : undefined
} }
onBlended() { onBlending() {
super.onBlended() super.onBlending()
const model = this.getSubModel(this.childViewId) const model = this.getSubModel(this.childViewId)
if (model === undefined) { if (model === undefined) {
return return

View File

@ -141,12 +141,18 @@ export abstract class DoricViewNode {
for (let key in props) { for (let key in props) {
this.blendProps(this.view, key, props[key]) this.blendProps(this.view, key, props[key])
} }
this.onBlended() this.onBlending()
this.layout() this.layout()
} }
onBlending() {
}
onBlended() { onBlended() {
} }
configBorder() { configBorder() {
if (this.border) { if (this.border) {
this.view.style.borderStyle = "solid" this.view.style.borderStyle = "solid"
@ -397,8 +403,8 @@ export abstract class DoricGroupViewNode extends DoricSuperNode {
blend(props: { [index: string]: any }) { blend(props: { [index: string]: any }) {
super.blend(props) super.blend(props)
} }
onBlended() { onBlending() {
super.onBlended() super.onBlending()
this.configChildNode() this.configChildNode()
} }
configChildNode() { configChildNode() {