Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: test slots not at top level #4689

Merged
merged 8 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<x-outer>
<x-inner>
a
<!---->
<div>
<div slot="foo">
I am the foo slot
</div>
</div>
<div>
<div slot="foo">
I am also the foo slot
</div>
</div>
<!---->
b
<!---->
fallback for foo
<!---->
c
</x-inner>
</x-outer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const tagName = 'x-outer';
export { default } from 'x/outer';
export * from 'x/outer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template lwc:render-mode="light">
a
<slot>fallback for default</slot>
b
<slot name=foo>fallback for foo</slot>
c
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
static renderMode = 'light'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template lwc:render-mode="light">
<x-inner>
<div>
<div slot="foo">I am the foo slot</div>
</div>
<div>
<div slot="foo">I am also the foo slot</div>
</div>
</x-inner>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
static renderMode = 'light'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<x-outer>
<template shadowrootmode="open">
<x-inner>
<template shadowrootmode="open">
a
<slot>
fallback for default
</slot>
b
<slot name="foo">
fallback for foo
</slot>
c
</template>
<div>
<div slot="foo">
I am the foo slot
</div>
</div>
<div>
<div slot="foo">
I am also the foo slot
</div>
</div>
</x-inner>
</template>
</x-outer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const tagName = 'x-outer';
export { default } from 'x/outer';
export * from 'x/outer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
a
<slot>fallback for default</slot>
b
<slot name=foo>fallback for foo</slot>
c
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template>
<x-inner>
<div>
<div slot="foo">I am the foo slot</div>
</div>
<div>
<div slot="foo">I am also the foo slot</div>
</div>
</x-inner>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<x-outer>
<x-inner>
a
<!---->
<x-external>
<div slot="foo">
I am the foo slot
</div>
</x-external>
<x-external>
<div slot="foo">
I am also the foo slot
</div>
</x-external>
<!---->
b
<!---->
fallback for foo
<!---->
c
</x-inner>
</x-outer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const tagName = 'x-outer';
export { default } from 'x/outer';
export * from 'x/outer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template lwc:render-mode="light">
a
<slot>fallback for default</slot>
b
<slot name=foo>fallback for foo</slot>
c
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
static renderMode = 'light'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template lwc:render-mode="light">
<x-inner>
<x-external lwc:external>
<div slot="foo">I am the foo slot</div>
</x-external>
<x-external lwc:external>
<div slot="foo">I am also the foo slot</div>
</x-external>
</x-inner>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
static renderMode = 'light'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<x-outer>
<template shadowrootmode="open">
<x-inner>
<template shadowrootmode="open">
a
<slot>
fallback for default
</slot>
b
<slot name="foo">
fallback for foo
</slot>
c
</template>
<x-external>
<div slot="foo">
I am the foo slot
</div>
</x-external>
<x-external>
<div slot="foo">
I am also the foo slot
</div>
</x-external>
</x-inner>
</template>
</x-outer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const tagName = 'x-outer';
export { default } from 'x/outer';
export * from 'x/outer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
a
<slot>fallback for default</slot>
b
<slot name=foo>fallback for foo</slot>
c
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template>
<x-inner>
<x-external lwc:external>
<div slot="foo">I am the foo slot</div>
</x-external>
<x-external lwc:external>
<div slot="foo">I am also the foo slot</div>
</x-external>
</x-inner>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<x-outer>
<x-inner>
a
<!---->
fallback for default
<!---->
b
<!---->
<div>
I am the foo slot
</div>
<div>
I am also the foo slot
</div>
<!---->
c
</x-inner>
</x-outer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const tagName = 'x-outer';
export { default } from 'x/outer';
export * from 'x/outer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template lwc:render-mode="light">
a
<slot>fallback for default</slot>
b
<slot name=foo>fallback for foo</slot>
c
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
static renderMode = 'light'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template lwc:render-mode="light">
<x-inner>
<template if:true={isTrue}>
<div slot="foo">I am the foo slot</div>
</template>
<template if:true={isTrue}>
<div slot="foo">I am also the foo slot</div>
</template>
</x-inner>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
static renderMode = 'light'
isTrue = true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<x-outer>
<template shadowrootmode="open">
<x-inner>
<template shadowrootmode="open">
a
<slot>
fallback for default
</slot>
b
<slot name="foo">
fallback for foo
</slot>
c
</template>
<div slot="foo">
I am the foo slot
</div>
<div slot="foo">
I am also the foo slot
</div>
</x-inner>
</template>
</x-outer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const tagName = 'x-outer';
export { default } from 'x/outer';
export * from 'x/outer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
a
<slot>fallback for default</slot>
b
<slot name=foo>fallback for foo</slot>
c
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template>
<x-inner>
<template if:true={isTrue}>
<div slot="foo">I am the foo slot</div>
</template>
<template if:true={isTrue}>
<div slot="foo">I am also the foo slot</div>
</template>
</x-inner>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
isTrue = true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<x-outer>
<x-inner>
a
<!---->
fallback for default
<!---->
b
<!---->
<div>
I am the foo slot
</div>
<div>
I am also the foo slot
</div>
<!---->
c
</x-inner>
</x-outer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const tagName = 'x-outer';
export { default } from 'x/outer';
export * from 'x/outer';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template lwc:render-mode="light">
a
<slot>fallback for default</slot>
b
<slot name=foo>fallback for foo</slot>
c
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { LightningElement} from 'lwc';

export default class extends LightningElement {
static renderMode = 'light'
}
Loading
Loading