ziko 0.49.0 → 0.49.1
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ziko",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.1",
|
|
4
4
|
"description": "A versatile JavaScript library offering a rich set of Hyperscript Based UI components, advanced mathematical utilities, interactivity ,animations, client side routing and more ...",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"front-end",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export function define_wc(name, UIElement, props = {}, { mode = 'open'} = {}) {
|
|
2
2
|
if (globalThis.customElements?.get(name)) {
|
|
3
3
|
console.warn(`Custom element "${name}" is already defined`);
|
|
4
|
-
return;
|
|
4
|
+
return;
|
|
5
5
|
}
|
|
6
6
|
if(name.search('-') === -1){
|
|
7
7
|
console.warn(`"${name}" is not a valid custom element name`);
|
|
@@ -25,19 +25,21 @@ export function define_wc(name, UIElement, props = {}, { mode = 'open'} = {}) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
connectedCallback() {
|
|
28
|
-
this.
|
|
28
|
+
this.render();
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
render() {
|
|
32
32
|
this.shadowRoot.innerHTML = '';
|
|
33
|
-
|
|
33
|
+
const item = UIElement(this.props);
|
|
34
|
+
if(item instanceof Array) item.forEach(n => n.mount(this.shadowRoot))
|
|
35
|
+
else item.mount(this.shadowRoot)
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
attributeChangedCallback(name, _, newValue) {
|
|
37
39
|
Object.assign(this.props, {
|
|
38
40
|
[name]: this.mask[name].type(newValue)
|
|
39
41
|
});
|
|
40
|
-
this.
|
|
42
|
+
this.render();
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
);
|