vsn 0.1.79 → 0.1.82
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/demo/demo.html +32 -0
- package/demo/vsn.js +2 -2
- package/dist/Attribute.d.ts +1 -1
- package/dist/Attribute.js.map +1 -1
- package/dist/DOM.js +5 -1
- package/dist/DOM.js.map +1 -1
- package/dist/attributes/ComponentAttribute.js +9 -4
- package/dist/attributes/ComponentAttribute.js.map +1 -1
- package/dist/attributes/Name.js +1 -1
- package/dist/attributes/Name.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/vsn.min.js +2 -2
- package/package.json +1 -1
- package/src/Attribute.ts +1 -1
- package/src/DOM.ts +6 -1
- package/src/attributes/ComponentAttribute.ts +3 -4
- package/src/attributes/Name.ts +1 -1
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/Attribute.ts
CHANGED
package/src/DOM.ts
CHANGED
|
@@ -128,7 +128,12 @@ export class DOM extends EventDispatcher {
|
|
|
128
128
|
return this.querySelectorElement(element.parentElement, rest);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
|
|
131
|
+
let matches = element.querySelectorAll(q);
|
|
132
|
+
|
|
133
|
+
if (matches.length === 0 && (element as HTMLElement).shadowRoot) {
|
|
134
|
+
matches = (element as HTMLElement).shadowRoot.querySelectorAll(q);
|
|
135
|
+
}
|
|
136
|
+
return matches;
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
public querySelector(q: string): Element {
|
|
@@ -11,13 +11,12 @@ export class ComponentAttribute extends TemplateAttribute {
|
|
|
11
11
|
if (!Registry.instance.components.has(name)) {
|
|
12
12
|
await super.extract();
|
|
13
13
|
const clsName = this.getAttributeValue();
|
|
14
|
-
let cls
|
|
14
|
+
let cls;
|
|
15
15
|
if (clsName) {
|
|
16
16
|
cls = await Registry.instance.components.get(clsName);
|
|
17
|
-
if (!cls) {
|
|
18
|
-
throw new Error(`Component ${clsName} not found`);
|
|
19
|
-
}
|
|
20
17
|
}
|
|
18
|
+
if (!cls)
|
|
19
|
+
cls = class extends Component {};
|
|
21
20
|
Registry.instance.components.register(name, cls);
|
|
22
21
|
}
|
|
23
22
|
}
|
package/src/attributes/Name.ts
CHANGED
|
@@ -10,7 +10,7 @@ export class Name extends Attribute {
|
|
|
10
10
|
public async setup() {
|
|
11
11
|
const parentScope: Scope = this.tag.scope.parentScope;
|
|
12
12
|
if (parentScope) {
|
|
13
|
-
parentScope.set(this.
|
|
13
|
+
parentScope.set(this.getAttributeValue(), this.tag.scope);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.82';
|
|
2
2
|
|