@fluffjs/fluff 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/runtime/FluffBase.js +6 -0
- package/runtime/FluffElementImpl.js +0 -3
- package/runtime/tests/TestDirectChildComponent.d.ts +6 -0
- package/runtime/tests/TestDirectChildComponent.js +10 -0
- package/runtime/tests/TestDirectParentComponent.d.ts +6 -0
- package/runtime/tests/TestDirectParentComponent.js +10 -0
package/package.json
CHANGED
package/runtime/FluffBase.js
CHANGED
|
@@ -89,6 +89,9 @@ export class FluffBase extends HTMLElement {
|
|
|
89
89
|
this.__baseSubscriptions.push(sub);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
+
else if (!(propName in scope.locals) && !(propName in scope.host)) {
|
|
93
|
+
console.warn(`Binding dependency "${propName}" not found on component ${scope.host.constructor.name}`);
|
|
94
|
+
}
|
|
92
95
|
}
|
|
93
96
|
}
|
|
94
97
|
__getReactivePropFromScope(propName, scope) {
|
|
@@ -155,6 +158,9 @@ export class FluffBase extends HTMLElement {
|
|
|
155
158
|
if (el instanceof FluffBase) {
|
|
156
159
|
update();
|
|
157
160
|
}
|
|
161
|
+
else {
|
|
162
|
+
console.warn(`Element <${tagName}> is not a FluffBase instance after whenDefined - binding for "${binding.n}" skipped`);
|
|
163
|
+
}
|
|
158
164
|
});
|
|
159
165
|
}
|
|
160
166
|
}
|
|
@@ -269,9 +269,6 @@ export class FluffElement extends FluffBase {
|
|
|
269
269
|
if (closestComponent && closestComponent !== el)
|
|
270
270
|
continue;
|
|
271
271
|
if (el instanceof HTMLElement) {
|
|
272
|
-
const tagName = el.tagName.toLowerCase();
|
|
273
|
-
if (customElements.get(tagName))
|
|
274
|
-
continue;
|
|
275
272
|
this.__processBindingsOnElement(el, scope);
|
|
276
273
|
}
|
|
277
274
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElement.js';
|
|
2
|
+
export class TestDirectChildComponent extends FluffElement {
|
|
3
|
+
value = '';
|
|
4
|
+
__render() {
|
|
5
|
+
this.__getShadowRoot().innerHTML = `<span class="value">${this.value}</span>`;
|
|
6
|
+
}
|
|
7
|
+
__setupBindings() {
|
|
8
|
+
super.__setupBindings();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FluffElement } from '../FluffElement.js';
|
|
2
|
+
export class TestDirectParentComponent extends FluffElement {
|
|
3
|
+
itemName = 'test-item';
|
|
4
|
+
__render() {
|
|
5
|
+
this.__getShadowRoot().innerHTML = '<test-direct-child data-lid="l0" x-fluff-component></test-direct-child>';
|
|
6
|
+
}
|
|
7
|
+
__setupBindings() {
|
|
8
|
+
super.__setupBindings();
|
|
9
|
+
}
|
|
10
|
+
}
|