@riotjs/dom-bindings
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -563,4 +563,4 @@ import domdiff from 'domdiff'; | ||
function create$4(node, { component, slots, attributes }) { | ||
const tag = getTag(component, slots, attributes); | ||
function create$4(node, { name, getComponent, slots, attributes }) { | ||
const tag = getTag(getComponent(name), slots, attributes); | ||
@@ -797,3 +797,3 @@ return { | ||
* { | ||
* type: 'text', | ||
* type: expressionTypes.TEXT, | ||
* childNodeIndex: 0, | ||
@@ -811,3 +811,3 @@ * evaluate(scope) { | ||
* { | ||
* type: 'text', | ||
* type: expressionTypes.TEXT, | ||
* childNodeIndex: 0, | ||
@@ -830,3 +830,3 @@ * evaluate(scope) { | ||
* redundantAttribute: 'expr2', | ||
* type: 'if', | ||
* type: bindingTypes.IF, | ||
* evaluate(scope) { | ||
@@ -833,0 +833,0 @@ * return scope.isVisible; |
@@ -1185,4 +1185,4 @@ (function (global, factory) { | ||
function create$4(node, { component, slots, attributes }) { | ||
const tag = getTag(component, slots, attributes); | ||
function create$4(node, { name, getComponent, slots, attributes }) { | ||
const tag = getTag(getComponent(name), slots, attributes); | ||
@@ -1419,3 +1419,3 @@ return { | ||
* { | ||
* type: 'text', | ||
* type: expressionTypes.TEXT, | ||
* childNodeIndex: 0, | ||
@@ -1433,3 +1433,3 @@ * evaluate(scope) { | ||
* { | ||
* type: 'text', | ||
* type: expressionTypes.TEXT, | ||
* childNodeIndex: 0, | ||
@@ -1452,3 +1452,3 @@ * evaluate(scope) { | ||
* redundantAttribute: 'expr2', | ||
* type: 'if', | ||
* type: bindingTypes.IF, | ||
* evaluate(scope) { | ||
@@ -1455,0 +1455,0 @@ * return scope.isVisible; |
{ | ||
"name": "@riotjs/dom-bindings", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Riot.js DOM bindings", | ||
@@ -5,0 +5,0 @@ "main": "dist/umd.dom-bindings.js", |
@@ -360,6 +360,10 @@ # dom-bindings | ||
- `component` | ||
- `getComponent` | ||
- type: `Function` | ||
- required: `true` | ||
- description: the factory function responsible for the tag creation | ||
- `name` | ||
- type: `string` | ||
- optional: `true` | ||
- description: the component id that will be passed as first argument to the `getComponent` function | ||
- `slots` | ||
@@ -407,3 +411,4 @@ - type: `Array<Slot>` | ||
type: bindingTypes.TAG, | ||
component: HumanReadableTime, | ||
name: 'human-readable-time', | ||
getComponent: () => HumanReadableTime, | ||
selector: 'time', | ||
@@ -465,3 +470,7 @@ attributes: [{ | ||
type: bindingTypes.TAG, | ||
component: components['my-tag'] | ||
name: 'my-tag', | ||
getComponent(name) { | ||
// name here will be 'my-tag' | ||
return components[name] | ||
} | ||
}]) | ||
@@ -483,3 +492,7 @@ }]).mount(target, { items: [1, 2] }) | ||
type: bindingTypes.TAG, | ||
component: components['my-tag'] | ||
name: 'my-tag', | ||
getComponent(name) { | ||
// name here will be 'my-tag' | ||
return components[name] | ||
} | ||
}]) | ||
@@ -486,0 +499,0 @@ }]).mount(target, { isVisible: true }) |
@@ -55,4 +55,4 @@ import { ATTRIBUTE } from '../expressions/expression-types' | ||
export default function create(node, { component, slots, attributes }) { | ||
const tag = getTag(component, slots, attributes) | ||
export default function create(node, { name, getComponent, slots, attributes }) { | ||
const tag = getTag(getComponent(name), slots, attributes) | ||
@@ -59,0 +59,0 @@ return { |
@@ -18,3 +18,3 @@ /** | ||
* { | ||
* type: 'text', | ||
* type: expressionTypes.TEXT, | ||
* childNodeIndex: 0, | ||
@@ -32,3 +32,3 @@ * evaluate(scope) { | ||
* { | ||
* type: 'text', | ||
* type: expressionTypes.TEXT, | ||
* childNodeIndex: 0, | ||
@@ -51,3 +51,3 @@ * evaluate(scope) { | ||
* redundantAttribute: 'expr2', | ||
* type: 'if', | ||
* type: bindingTypes.IF, | ||
* evaluate(scope) { | ||
@@ -54,0 +54,0 @@ * return scope.isVisible; |
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
99115
502