|
|
@ -11,7 +11,7 @@ import { ClassDeclaration, FunctionExpression, Node, Statement, ObjectExpression
|
|
|
|
export default function dom(
|
|
|
|
export default function dom(
|
|
|
|
component: Component,
|
|
|
|
component: Component,
|
|
|
|
options: CompileOptions
|
|
|
|
options: CompileOptions
|
|
|
|
): { js: Node[]; css: CssResult } {
|
|
|
|
): { js: Node[]; css: CssResult; } {
|
|
|
|
const { name } = component;
|
|
|
|
const { name } = component;
|
|
|
|
|
|
|
|
|
|
|
|
const renderer = new Renderer(component, options);
|
|
|
|
const renderer = new Renderer(component, options);
|
|
|
@ -469,7 +469,7 @@ export default function dom(
|
|
|
|
$$setup(options) {
|
|
|
|
$$setup(options) {
|
|
|
|
${css.code && b`this.shadowRoot.innerHTML = \`<style>${css.code.replace(/\\/g, '\\\\')}${options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}</style>\`;`}
|
|
|
|
${css.code && b`this.shadowRoot.innerHTML = \`<style>${css.code.replace(/\\/g, '\\\\')}${options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}</style>\`;`}
|
|
|
|
|
|
|
|
|
|
|
|
@init(this, { props: options ? options.props : null, target: this.shadowRoot }, ${definition}, ${has_create_fragment ? 'create_fragment': 'null'}, ${not_equal}, ${prop_indexes}, ${dirty});
|
|
|
|
@init(this, { props: options ? options.props : null, target: this.shadowRoot }, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, ${dirty});
|
|
|
|
|
|
|
|
|
|
|
|
${dev_props_check}
|
|
|
|
${dev_props_check}
|
|
|
|
|
|
|
|
|
|
|
@ -521,7 +521,7 @@ export default function dom(
|
|
|
|
constructor(options) {
|
|
|
|
constructor(options) {
|
|
|
|
super(${options.dev && `options`});
|
|
|
|
super(${options.dev && `options`});
|
|
|
|
${should_add_css && b`if (!@_document.getElementById("${component.stylesheet.id}-style")) ${add_css}();`}
|
|
|
|
${should_add_css && b`if (!@_document.getElementById("${component.stylesheet.id}-style")) ${add_css}();`}
|
|
|
|
@init(this, options, ${definition}, ${has_create_fragment ? 'create_fragment': 'null'}, ${not_equal}, ${prop_indexes}, ${dirty});
|
|
|
|
@init(this, options, ${definition}, ${has_create_fragment ? 'create_fragment' : 'null'}, ${not_equal}, ${prop_indexes}, ${dirty});
|
|
|
|
${options.dev && b`@dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "${name.name}", options, id: create_fragment.name });`}
|
|
|
|
${options.dev && b`@dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "${name.name}", options, id: create_fragment.name });`}
|
|
|
|
|
|
|
|
|
|
|
|
${dev_props_check}
|
|
|
|
${dev_props_check}
|
|
|
|