mirror of https://github.com/sveltejs/svelte
commit
7661c2818c
@ -0,0 +1,3 @@
|
||||
export default function(name: string): string {
|
||||
return name.replace(/^-((webkit)|(moz)|(o)|(ms))-/, '');
|
||||
}
|
@ -1 +1 @@
|
||||
{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["<Widget/>\n\n<script>\n\timport Widget from './Widget.html';\n\n\texport default {\n\t\tcomponents: {\n\t\t\tWidget\n\t\t}\n\t};\n</script>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["<Widget/>\n\n<script>\n\timport Widget from './Widget.html';\n\n\texport default {\n\t\tcomponents: {\n\t\t\tWidget\n\t\t}\n\t};\n</script>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@ -0,0 +1 @@
|
||||
@keyframes svelte-xyz-why{0%{color:red}100%{color:blue}}@-webkit-keyframes svelte-xyz-why{0%{color:red}100%{color:blue}}@-moz-keyframes svelte-xyz-why{0%{color:red}100%{color:blue}}@-o-keyframes svelte-xyz-why{0%{color:red}100%{color:blue}}.animated.svelte-xyz{-webkit-animation:svelte-xyz-why 2s;animation:svelte-xyz-why 2s}.also-animated.svelte-xyz{-webkit-animation:not-defined-here 2s;animation:not-defined-here 2s}
|
@ -0,0 +1,34 @@
|
||||
<div class='animated'>animated</div>
|
||||
<div class='also-animated'>also animated</div>
|
||||
|
||||
<style>
|
||||
@keyframes why {
|
||||
0% { color: red; }
|
||||
100% { color: blue; }
|
||||
}
|
||||
|
||||
@-webkit-keyframes why {
|
||||
0% { color: red; }
|
||||
100% { color: blue; }
|
||||
}
|
||||
|
||||
@-moz-keyframes why {
|
||||
0% { color: red; }
|
||||
100% { color: blue; }
|
||||
}
|
||||
|
||||
@-o-keyframes why {
|
||||
0% { color: red; }
|
||||
100% { color: blue; }
|
||||
}
|
||||
|
||||
.animated {
|
||||
-webkit-animation: why 2s;
|
||||
animation: why 2s;
|
||||
}
|
||||
|
||||
.also-animated {
|
||||
-webkit-animation: not-defined-here 2s;
|
||||
animation: not-defined-here 2s;
|
||||
}
|
||||
</style>
|
@ -1 +1 @@
|
||||
[svelte-ref-button].active.svelte-xyz{color:red}
|
||||
.svelte-ref-button.active.svelte-xyz{color:red}
|
@ -1 +1 @@
|
||||
<button svelte-ref-button="" class="active svelte-xyz">deactivate</button>
|
||||
<button class="active svelte-xyz svelte-ref-button">deactivate</button>
|
@ -1 +1 @@
|
||||
[svelte-ref-a].svelte-xyz{color:red}[svelte-ref-b].svelte-xyz{color:green}
|
||||
.svelte-ref-a.svelte-xyz{color:red}.svelte-ref-b.svelte-xyz{color:green}
|
@ -1,3 +1,3 @@
|
||||
<div class="svelte-xyz" svelte-ref-a=''></div>
|
||||
<div class="svelte-xyz" svelte-ref-b=''></div>
|
||||
<div class="svelte-xyz svelte-ref-a"></div>
|
||||
<div class="svelte-xyz svelte-ref-b"></div>
|
||||
<div></div>
|
@ -0,0 +1,11 @@
|
||||
<p>green {foo}</p>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
foo: 'green'
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,11 @@
|
||||
<p>red {foo}</p>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
foo: 'red'
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,36 @@
|
||||
export default {
|
||||
data: {
|
||||
x: true
|
||||
},
|
||||
|
||||
html: `
|
||||
<p>parent green</p>
|
||||
<p>green green</p>
|
||||
`,
|
||||
|
||||
test(assert, component, target) {
|
||||
// TODO replace this with component.set({ foo: undefined }) post-#1488
|
||||
// component.set({ foo: undefined });
|
||||
// delete component._state.foo;
|
||||
|
||||
component.set({
|
||||
x: false,
|
||||
foo: undefined
|
||||
});
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<p>parent red</p>
|
||||
<p>red red</p>
|
||||
`);
|
||||
|
||||
component.set({
|
||||
x: true,
|
||||
foo: undefined
|
||||
});
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<p>parent green</p>
|
||||
<p>green green</p>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,16 @@
|
||||
<p>parent {foo}</p>
|
||||
<svelte:component this="{x ? Green : Red}" bind:foo />
|
||||
|
||||
<script>
|
||||
import Green from './Green.html';
|
||||
import Red from './Red.html';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
Green,
|
||||
Red
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1 @@
|
||||
<p>{thing}</p>
|
@ -0,0 +1,20 @@
|
||||
export default {
|
||||
data: {
|
||||
visible: true,
|
||||
empty: []
|
||||
},
|
||||
|
||||
html: `
|
||||
<div>
|
||||
<p>text</p>
|
||||
</div>
|
||||
`,
|
||||
|
||||
nestedTransitions: true,
|
||||
|
||||
test(assert, component, target) {
|
||||
component.set({ visible: false });
|
||||
|
||||
assert.htmlEqual(target.innerHTML, ``);
|
||||
}
|
||||
};
|
@ -0,0 +1,17 @@
|
||||
{#if visible}
|
||||
<div>
|
||||
{#each empty as thing}
|
||||
<Thing {thing}/>
|
||||
{/each}
|
||||
|
||||
<p>text</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
Thing: './Thing.html'
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,3 @@
|
||||
<div>
|
||||
<p>this is a paragraph</p>
|
||||
</div>
|
@ -0,0 +1,24 @@
|
||||
import path from 'path';
|
||||
|
||||
export default {
|
||||
dev: true,
|
||||
|
||||
test(assert, component, target) {
|
||||
const h1 = target.querySelector('h1');
|
||||
const p = target.querySelector('p');
|
||||
|
||||
assert.deepEqual(h1.__svelte_meta.loc, {
|
||||
file: path.relative(process.cwd(), path.resolve(__dirname, 'main.html')),
|
||||
line: 0,
|
||||
column: 0,
|
||||
char: 0
|
||||
});
|
||||
|
||||
assert.deepEqual(p.__svelte_meta.loc, {
|
||||
file: path.relative(process.cwd(), path.resolve(__dirname, 'Foo.html')),
|
||||
line: 1,
|
||||
column: 1,
|
||||
char: 7
|
||||
});
|
||||
}
|
||||
};
|
@ -0,0 +1,10 @@
|
||||
<h1>this is a header</h1>
|
||||
<Foo/>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
Foo: './Foo.html'
|
||||
}
|
||||
};
|
||||
</script>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue