@ribajs/core
Advanced tools
Comparing version 0.16.13 to 0.17.0
@@ -154,4 +154,4 @@ import { Observer, IObserverSyncCallback } from './observer'; | ||
*/ | ||
getValue(el: HTMLSelectElement | HTMLInputElement): any; | ||
getValue(el: HTMLSelectElement | HTMLInputElement): string | boolean | void | string[]; | ||
private getStarArguments; | ||
} |
@@ -187,3 +187,14 @@ "use strict"; | ||
if (routineFn instanceof Function) { | ||
routineFn.call(this, this.el, value); | ||
// If value is a promise | ||
if (value && typeof (value.then) === 'function' && typeof (value.catch) === 'function') { | ||
value.then((realValue) => { | ||
routineFn.call(this, this.el, realValue); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
} | ||
else { | ||
routineFn.call(this, this.el, value); | ||
} | ||
} | ||
@@ -190,0 +201,0 @@ } |
@@ -141,3 +141,3 @@ "use strict"; | ||
if (!this.el._bound) { | ||
const innerHTML = this.component.template.call(this); | ||
const innerHTML = this.component.template.call(this, this.el); | ||
// if innerHTML is null this component uses the innerHTML which he already has! | ||
@@ -144,0 +144,0 @@ if (innerHTML !== null) { |
@@ -139,4 +139,4 @@ "use strict"; | ||
// IMPORTANT this must be a function and not a Arrow Functions | ||
return function (context, ev, binding, el) { | ||
this.call(self, ev, binding.view.models, el, context); | ||
return function (context, event, binding, el) { | ||
this.call(self, context, event, binding.view.models, el); | ||
}; | ||
@@ -143,0 +143,0 @@ } |
@@ -9,3 +9,3 @@ import { IBinders } from './binder.service'; | ||
/** If the template function returns null no template is injected */ | ||
template: (() => string | null) | (() => HTMLElement); | ||
template: ((el: HTMLElement) => string | null); | ||
initialize: (el: HTMLElement, data: ValueType) => Scope; | ||
@@ -12,0 +12,0 @@ /** array of attribiute names to force parse attributes as static (primitive) values */ |
@@ -39,3 +39,3 @@ import { IViewOptions } from './riba'; | ||
*/ | ||
constructor(els: HTMLCollection | HTMLElement | Node, models: any, options: IViewOptions); | ||
constructor(els: HTMLCollection | HTMLElement | Node | NodeListOf<ChildNode>, models: any, options: IViewOptions); | ||
buildBinding(node: HTMLElement | Text, type: string | null, declaration: string, binder: Binder<any>, identifier: string | null): void; | ||
@@ -42,0 +42,0 @@ /** |
@@ -174,4 +174,6 @@ "use strict"; | ||
View.debug(`Define Webcomponent ${nodeName} with customElements.define`); | ||
if (customElements.get(nodeName)) { | ||
View.debug(`Web component already defined`); | ||
// if node.constructor is not HTMLElement and not HTMLUnknownElement, it was registed | ||
// @see https://stackoverflow.com/questions/27334365/how-to-get-list-of-registered-custom-elements | ||
if (customElements.get(nodeName) || (node.constructor !== HTMLElement && node.constructor !== HTMLUnknownElement)) { | ||
View.debug(`Web component already defined`, node.constructor); | ||
} | ||
@@ -178,0 +180,0 @@ else { |
{ | ||
"name": "@ribajs/core", | ||
"description": "Core module of Riba.js", | ||
"version": "0.16.13", | ||
"version": "0.17.0", | ||
"author": "Pascal Garber <pascal@jumplink.eu>", | ||
@@ -37,10 +37,10 @@ "private": false, | ||
"devDependencies": { | ||
"@babel/cli": "^7.1.2", | ||
"@babel/core": "^7.1.2", | ||
"@babel/plugin-proposal-class-properties": "^7.1.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", | ||
"@babel/plugin-transform-runtime": "^7.1.0", | ||
"@babel/preset-env": "^7.1.0", | ||
"@babel/cli": "^7.2.3", | ||
"@babel/core": "^7.2.2", | ||
"@babel/plugin-proposal-class-properties": "^7.2.3", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.2.0", | ||
"@babel/plugin-transform-runtime": "^7.2.0", | ||
"@babel/preset-env": "^7.2.3", | ||
"@babel/preset-typescript": "^7.1.0", | ||
"@types/jquery": "^3.3.22", | ||
"@types/jquery": "^3.3.28", | ||
"babel-loader": "^8.0.4", | ||
@@ -53,9 +53,10 @@ "babel-plugin-array-includes": "^2.0.3", | ||
"sinon": "^6.3.5", | ||
"tslint": "^5.11.0", | ||
"typescript": "^3.1.5", | ||
"webpack": "^4.23.0", | ||
"tslint": "^5.12.0", | ||
"typescript": "^3.2.2", | ||
"uglifyjs-webpack-plugin": "^2.0.1", | ||
"webpack": "^4.28.0", | ||
"webpack-cli": "^3.1.2" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime-corejs2": "^7.1.2", | ||
"@babel/runtime-corejs2": "^7.2.0", | ||
"@types/core-js": "^2.5.0", | ||
@@ -62,0 +63,0 @@ "@types/debug": "^0.0.30", |
@@ -12,5 +12,4 @@ // https://github.com/Microsoft/TypeScript-Babel-Starter | ||
compress: true, | ||
mangle: { | ||
safari10: true, // https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/92 | ||
}, | ||
safari10: true, // https://github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/92 | ||
mangle: {}, | ||
output: { | ||
@@ -17,0 +16,0 @@ beautify: false, |
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
2781088
34537
20
98
0
1
0
11