@ribajs/core
Advanced tools
Comparing version 0.16.7 to 0.16.8
{ | ||
"name": "@ribajs/core", | ||
"description": "Core module of Riba.js", | ||
"version": "0.16.7", | ||
"version": "0.16.8", | ||
"author": "Pascal Garber <pascal@jumplink.eu>", | ||
@@ -6,0 +6,0 @@ "private": false, |
@@ -9,5 +9,8 @@ import Debug from 'debug'; | ||
public readonly bound: boolean; | ||
protected debug: Debug.IDebugger; | ||
protected view?: View; | ||
protected bound: boolean; | ||
protected _bound: boolean; | ||
protected templateLoaded: boolean; | ||
@@ -26,2 +29,4 @@ | ||
public disconnectedFallbackCallback(): void; | ||
protected template(): Promise<string | null> | string | null; | ||
@@ -28,0 +33,0 @@ |
@@ -33,10 +33,6 @@ /** | ||
protected get bound() { | ||
public get bound() { | ||
return !!this._bound || !!this.view; | ||
} | ||
protected set bound(bound: boolean) { | ||
this._bound = !! bound; | ||
} | ||
/** | ||
@@ -64,2 +60,10 @@ * If true the component will automatically bind the component to riba if all required attributes are setted | ||
public disconnectedFallbackCallback() { | ||
this.disconnectedCallback(); | ||
// const parent = this.el.parentNode; | ||
// if (parent) { | ||
// parent.removeChild(this.el); | ||
// } | ||
} | ||
protected abstract template(): Promise<string | null> | string | null; | ||
@@ -215,3 +219,3 @@ | ||
this.el.removeEventListener('binder-changed', this.BinderChangedEventHandler); | ||
this.bound = false; | ||
this._bound = false; | ||
} | ||
@@ -341,3 +345,3 @@ | ||
this.view = new View(Array.prototype.slice.call(this.el.childNodes), this.scope, viewOptions); | ||
this.bound = true; | ||
this._bound = true; | ||
this.scope = this.view.models; | ||
@@ -354,7 +358,7 @@ this.view.bind(); | ||
protected async beforeBind(): Promise<any> { | ||
this.debug('beforeBind'); | ||
this.debug('beforeBind', this.bound); | ||
} | ||
protected async afterBind(): Promise<any> { | ||
this.debug('afterBind'); | ||
this.debug('afterBind', this.bound); | ||
} | ||
@@ -361,0 +365,0 @@ |
@@ -57,3 +57,4 @@ import { IViewOptions, Riba } from './riba'; | ||
public options: IViewOptions; | ||
public bindings: IBindable[] = []; | ||
public bindings: Array<IBindable> = []; | ||
public webComponents: Array<RibaComponentClass> = []; | ||
// public componentView: View | null = null; | ||
@@ -207,2 +208,4 @@ | ||
const component = new COMPONENT(node); | ||
// TODO call disconnectedCallback for unbind | ||
this.webComponents.push(component); | ||
} else { | ||
@@ -219,2 +222,4 @@ View.debug(`Define Webcomponent ${nodeName} with customElements.define`); | ||
const component = new COMPONENT(node); | ||
// TODO call disconnectedCallback for unbind | ||
this.webComponents.push(component); | ||
} | ||
@@ -249,2 +254,5 @@ } | ||
}); | ||
this.webComponents.forEach((webcomponent) => { | ||
webcomponent.disconnectedFallbackCallback(); | ||
}); | ||
} | ||
@@ -251,0 +259,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2728383
33595
98
0
1
0
11