mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
chore: lift components folder
This commit is contained in:
parent
76df51674d
commit
2200b29b92
301 changed files with 57 additions and 76 deletions
|
@ -1,43 +0,0 @@
|
|||
<script>
|
||||
export let currentIndex = 0;
|
||||
export let vertical = false;
|
||||
|
||||
import { createEventDispatcher, setContext } from "svelte";
|
||||
import { writable, derived } from "svelte/store";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
const steps = writable([]);
|
||||
const stepsById = derived(steps, $ =>
|
||||
$.reduce((a, c) => ({ ...a, [c.id]: c }), {})
|
||||
);
|
||||
|
||||
setContext("ProgressIndicator", {
|
||||
steps,
|
||||
stepsById,
|
||||
add: step => {
|
||||
steps.update(_ => [
|
||||
..._,
|
||||
{
|
||||
...step,
|
||||
index: _.length,
|
||||
current: _.length === currentIndex,
|
||||
complete: _.length <= currentIndex
|
||||
}
|
||||
]);
|
||||
},
|
||||
change: index => {
|
||||
dispatch("change", index);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<ul
|
||||
class:bx--progress={true}
|
||||
class:bx--progress--vertical={vertical}
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave>
|
||||
<slot />
|
||||
</ul>
|
Loading…
Add table
Add a link
Reference in a new issue