|
|
|
@ -446,8 +446,8 @@ export default function dom(
|
|
|
|
|
this._root =this.attachShadow({ mode: '${options.shadowDom}' });
|
|
|
|
|
` || b`
|
|
|
|
|
this._copycontent();
|
|
|
|
|
const observer = new MutationObserver(() => this._slotcontent());
|
|
|
|
|
observer.observe(this, {childList: true, subtree: true});
|
|
|
|
|
this.slotObserver = new MutationObserver(() => this._slotcontent());
|
|
|
|
|
this.slotObserver.observe(this, {childList: true, subtree: true});
|
|
|
|
|
`}
|
|
|
|
|
${css.code && !lightDom && b`this._root.innerHTML = \`<style>${css.code.replace(/\\/g, '\\\\')}${options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}</style>\`;`}
|
|
|
|
|
${should_add_css && lightDom && b`if (!@_document.getElementById("${component.stylesheet.id}-style")) ${add_css}();`}
|
|
|
|
@ -544,6 +544,17 @@ export default function dom(
|
|
|
|
|
}
|
|
|
|
|
}` as FunctionExpression
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
declaration.body.body.push({
|
|
|
|
|
type: 'MethodDefinition',
|
|
|
|
|
kind: 'method',
|
|
|
|
|
static: false,
|
|
|
|
|
computed: false,
|
|
|
|
|
key: { type: 'Identifier', name: 'disconnectedCallback' },
|
|
|
|
|
value: x`function() {
|
|
|
|
|
this.slotObserver.disconnect();
|
|
|
|
|
}` as FunctionExpression
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declaration.body.body.push(...accessors);
|
|
|
|
|