feat:modular add provider
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
import { Panel } from "../ui/panel"
|
||||
import { Group } from "../ui/view"
|
||||
import { ClassType } from "../util/types"
|
||||
import { Provider } from "./provider"
|
||||
|
||||
export abstract class Module extends Panel {
|
||||
superPanel?: ModularPanel
|
||||
|
||||
__provider?: Provider
|
||||
|
||||
get provider(): Provider | undefined {
|
||||
return this.__provider || (this.superPanel?.provider)
|
||||
}
|
||||
|
||||
set provider(provider: Provider | undefined) {
|
||||
this.__provider = provider
|
||||
}
|
||||
|
||||
dispatchMessage(message: any) {
|
||||
this.superPanel?.dispatchMessage(message)
|
||||
}
|
||||
|
@@ -185,10 +185,14 @@ export abstract class View implements Modeling {
|
||||
|
||||
nativeViewModel: NativeViewModel = {
|
||||
id: this.viewId,
|
||||
type: this.constructor.name,
|
||||
type: this.viewType(),
|
||||
props: this.__dirty_props__,
|
||||
}
|
||||
|
||||
viewType() {
|
||||
return this.constructor.name
|
||||
}
|
||||
|
||||
onPropertyChanged(propKey: string, oldV: Model, newV: Model): void {
|
||||
if (newV instanceof Function) {
|
||||
newV = this.callback2Id(newV)
|
||||
|
@@ -191,10 +191,14 @@ export abstract class View implements Modeling {
|
||||
|
||||
nativeViewModel: NativeViewModel = {
|
||||
id: this.viewId,
|
||||
type: this.constructor.name,
|
||||
type: this.viewType(),
|
||||
props: this.__dirty_props__,
|
||||
}
|
||||
|
||||
viewType() {
|
||||
return this.constructor.name
|
||||
}
|
||||
|
||||
onPropertyChanged(propKey: string, oldV: Model, newV: Model): void {
|
||||
if (newV instanceof Function) {
|
||||
newV = this.callback2Id(newV)
|
||||
|
Reference in New Issue
Block a user