|
|
@ -1,5 +1,5 @@
|
|
|
|
import { createClassComponent } from '../../../../legacy/legacy-client.js';
|
|
|
|
import { createClassComponent } from '../../../../legacy/legacy-client.js';
|
|
|
|
import { destroy_effect, render_effect } from '../../reactivity/effects.js';
|
|
|
|
import { destroy_effect, effect_root, render_effect } from '../../reactivity/effects.js';
|
|
|
|
import { append } from '../template.js';
|
|
|
|
import { append } from '../template.js';
|
|
|
|
import { define_property, get_descriptor, object_keys } from '../../../shared/utils.js';
|
|
|
|
import { define_property, get_descriptor, object_keys } from '../../../shared/utils.js';
|
|
|
|
|
|
|
|
|
|
|
@ -145,24 +145,26 @@ if (typeof HTMLElement === 'function') {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Reflect component props as attributes
|
|
|
|
// Reflect component props as attributes
|
|
|
|
this.$$me = render_effect(() => {
|
|
|
|
this.$$me = effect_root(() => {
|
|
|
|
this.$$r = true;
|
|
|
|
render_effect(() => {
|
|
|
|
for (const key of object_keys(this.$$c)) {
|
|
|
|
this.$$r = true;
|
|
|
|
if (!this.$$p_d[key]?.reflect) continue;
|
|
|
|
for (const key of object_keys(this.$$c)) {
|
|
|
|
this.$$d[key] = this.$$c[key];
|
|
|
|
if (!this.$$p_d[key]?.reflect) continue;
|
|
|
|
const attribute_value = get_custom_element_value(
|
|
|
|
this.$$d[key] = this.$$c[key];
|
|
|
|
key,
|
|
|
|
const attribute_value = get_custom_element_value(
|
|
|
|
this.$$d[key],
|
|
|
|
key,
|
|
|
|
this.$$p_d,
|
|
|
|
this.$$d[key],
|
|
|
|
'toAttribute'
|
|
|
|
this.$$p_d,
|
|
|
|
);
|
|
|
|
'toAttribute'
|
|
|
|
if (attribute_value == null) {
|
|
|
|
);
|
|
|
|
this.removeAttribute(this.$$p_d[key].attribute || key);
|
|
|
|
if (attribute_value == null) {
|
|
|
|
} else {
|
|
|
|
this.removeAttribute(this.$$p_d[key].attribute || key);
|
|
|
|
this.setAttribute(this.$$p_d[key].attribute || key, attribute_value);
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.setAttribute(this.$$p_d[key].attribute || key, attribute_value);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.$$r = false;
|
|
|
|
this.$$r = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
for (const type in this.$$l) {
|
|
|
|
for (const type in this.$$l) {
|
|
|
@ -196,7 +198,7 @@ if (typeof HTMLElement === 'function') {
|
|
|
|
Promise.resolve().then(() => {
|
|
|
|
Promise.resolve().then(() => {
|
|
|
|
if (!this.$$cn && this.$$c) {
|
|
|
|
if (!this.$$cn && this.$$c) {
|
|
|
|
this.$$c.$destroy();
|
|
|
|
this.$$c.$destroy();
|
|
|
|
destroy_effect(this.$$me);
|
|
|
|
this.$$me();
|
|
|
|
this.$$c = undefined;
|
|
|
|
this.$$c = undefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|