|
|
@ -213,7 +213,7 @@ export default class EachBlockWrapper extends Wrapper {
|
|
|
|
// TODO neaten this up... will end up with an empty line in the block
|
|
|
|
// TODO neaten this up... will end up with an empty line in the block
|
|
|
|
block.builders.init.addBlock(deindent`
|
|
|
|
block.builders.init.addBlock(deindent`
|
|
|
|
if (!${this.vars.each_block_value}.${length}) {
|
|
|
|
if (!${this.vars.each_block_value}.${length}) {
|
|
|
|
${each_block_else} = ${this.else.block.name}(ctx);
|
|
|
|
${each_block_else} = ${this.else.block.name}(#component, ctx);
|
|
|
|
${each_block_else}.c();
|
|
|
|
${each_block_else}.c();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`);
|
|
|
|
`);
|
|
|
@ -231,7 +231,7 @@ export default class EachBlockWrapper extends Wrapper {
|
|
|
|
if (!${this.vars.each_block_value}.${length} && ${each_block_else}) {
|
|
|
|
if (!${this.vars.each_block_value}.${length} && ${each_block_else}) {
|
|
|
|
${each_block_else}.p(changed, ctx);
|
|
|
|
${each_block_else}.p(changed, ctx);
|
|
|
|
} else if (!${this.vars.each_block_value}.${length}) {
|
|
|
|
} else if (!${this.vars.each_block_value}.${length}) {
|
|
|
|
${each_block_else} = ${this.else.block.name}(ctx);
|
|
|
|
${each_block_else} = ${this.else.block.name}(#component, ctx);
|
|
|
|
${each_block_else}.c();
|
|
|
|
${each_block_else}.c();
|
|
|
|
${each_block_else}.${mountOrIntro}(${initialMountNode}, ${this.vars.anchor});
|
|
|
|
${each_block_else}.${mountOrIntro}(${initialMountNode}, ${this.vars.anchor});
|
|
|
|
} else if (${each_block_else}) {
|
|
|
|
} else if (${each_block_else}) {
|
|
|
@ -247,7 +247,7 @@ export default class EachBlockWrapper extends Wrapper {
|
|
|
|
${each_block_else} = null;
|
|
|
|
${each_block_else} = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (!${each_block_else}) {
|
|
|
|
} else if (!${each_block_else}) {
|
|
|
|
${each_block_else} = ${this.else.block.name}(ctx);
|
|
|
|
${each_block_else} = ${this.else.block.name}(#component, ctx);
|
|
|
|
${each_block_else}.c();
|
|
|
|
${each_block_else}.c();
|
|
|
|
${each_block_else}.${mountOrIntro}(${initialMountNode}, ${this.vars.anchor});
|
|
|
|
${each_block_else}.${mountOrIntro}(${initialMountNode}, ${this.vars.anchor});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -340,7 +340,7 @@ export default class EachBlockWrapper extends Wrapper {
|
|
|
|
|
|
|
|
|
|
|
|
${this.block.hasOutros && `@groupOutros();`}
|
|
|
|
${this.block.hasOutros && `@groupOutros();`}
|
|
|
|
${this.node.hasAnimation && `for (let #i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].r();`}
|
|
|
|
${this.node.hasAnimation && `for (let #i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].r();`}
|
|
|
|
${blocks} = @updateKeyedEach(${blocks}, changed, ${get_key}, ${dynamic ? '1' : '0'}, ctx, ${this.vars.each_block_value}, ${lookup}, ${updateMountNode}, ${destroy}, ${create_each_block}, "${mountOrIntro}", ${anchor}, ${this.vars.get_each_context});
|
|
|
|
${blocks} = @updateKeyedEach(${blocks}, #component, changed, ${get_key}, ${dynamic ? '1' : '0'}, ctx, ${this.vars.each_block_value}, ${lookup}, ${updateMountNode}, ${destroy}, ${create_each_block}, "${mountOrIntro}", ${anchor}, ${this.vars.get_each_context});
|
|
|
|
${this.node.hasAnimation && `for (let #i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].a();`}
|
|
|
|
${this.node.hasAnimation && `for (let #i = 0; #i < ${blocks}.length; #i += 1) ${blocks}[#i].a();`}
|
|
|
|
`);
|
|
|
|
`);
|
|
|
|
|
|
|
|
|
|
|
|