Compare commits
No commits in common. "main" and "v0.0.0" have entirely different histories.
3 changed files with 3 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lightweight-sdk/web-component",
|
"name": "@lightweight-sdk/web-component",
|
||||||
"version": "0.0.2",
|
"version": "0.0.0",
|
||||||
"description": "A lightweight library to build web components easily",
|
"description": "A lightweight library to build web components easily",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc -b",
|
"build": "tsc -b",
|
||||||
|
|
|
||||||
|
|
@ -58,13 +58,11 @@ export function CustomComponent<T extends ConstructorFunction<AbstractComponent>
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply any specified CSS classes to the component root element
|
// Apply any specified CSS classes to the component root element
|
||||||
if (p.cssClasses) {
|
|
||||||
this.classList.add(...p.cssClasses);
|
this.classList.add(...p.cssClasses);
|
||||||
}
|
|
||||||
|
|
||||||
// Process and link properties specified in __linkedProperties to their DOM elements
|
// Process and link properties specified in __linkedProperties to their DOM elements
|
||||||
for (const requested of this.__linkedProperties ?? []) {
|
for (const requested of this.__linkedProperties ?? []) {
|
||||||
const elt = findRefElement(requested.ref, this);
|
const elt = findRefElement(requested.ref);
|
||||||
if (elt == null) {
|
if (elt == null) {
|
||||||
throw new Error(`ref ${requested.ref} not found`);
|
throw new Error(`ref ${requested.ref} not found`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,5 @@ export function findRefElement(ref: string, parent?: HTMLElement): HTMLElement |
|
||||||
* @returns the template as a string
|
* @returns the template as a string
|
||||||
*/
|
*/
|
||||||
export function parseModuleToHtml(mod: any): string {
|
export function parseModuleToHtml(mod: any): string {
|
||||||
if (mod == null) return "";
|
|
||||||
return "default" in mod ? mod.default as string : "";
|
return "default" in mod ? mod.default as string : "";
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue