|
@@ -2,18 +2,12 @@
|
|
|
<script>
|
|
<script>
|
|
|
import { ProgressLoop, Button } from '../../../../../packages/stdf/components';
|
|
import { ProgressLoop, Button } from '../../../../../packages/stdf/components';
|
|
|
|
|
|
|
|
- let percent = 20;
|
|
|
|
|
|
|
+ let percent = $state(20);
|
|
|
const changePercentFun = type => {
|
|
const changePercentFun = type => {
|
|
|
if (type === '+10') {
|
|
if (type === '+10') {
|
|
|
- percent += 10;
|
|
|
|
|
- if (percent > 100) {
|
|
|
|
|
- percent = 100;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ percent = percent >= 100 ? 100 : percent + 10;
|
|
|
} else {
|
|
} else {
|
|
|
- percent -= 10;
|
|
|
|
|
- if (percent < 0) {
|
|
|
|
|
- percent = 0;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ percent = percent <= 0 ? 0 : percent - 10;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
@@ -65,7 +59,7 @@
|
|
|
<div class="m-4 mt-8 font-bold text-lg">Custom text</div>
|
|
<div class="m-4 mt-8 font-bold text-lg">Custom text</div>
|
|
|
<div class="flex flex-grow gap-2 m-4">
|
|
<div class="flex flex-grow gap-2 m-4">
|
|
|
<div class="flex-1">
|
|
<div class="flex-1">
|
|
|
- <ProgressLoop useSlot>
|
|
|
|
|
|
|
+ <ProgressLoop>
|
|
|
<div class="text-xs text-center">
|
|
<div class="text-xs text-center">
|
|
|
<div>Completed</div>
|
|
<div>Completed</div>
|
|
|
<div class="text-lg text-primary dark:text-dark">6666</div>
|
|
<div class="text-lg text-primary dark:text-dark">6666</div>
|
|
@@ -74,7 +68,7 @@
|
|
|
</ProgressLoop>
|
|
</ProgressLoop>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="flex-1">
|
|
<div class="flex-1">
|
|
|
- <ProgressLoop useSlot>
|
|
|
|
|
|
|
+ <ProgressLoop>
|
|
|
<div class="text-xs text-center">
|
|
<div class="text-xs text-center">
|
|
|
<div>Residual flow</div>
|
|
<div>Residual flow</div>
|
|
|
<div class="text-lg text-primary dark:text-dark">66</div>
|
|
<div class="text-lg text-primary dark:text-dark">66</div>
|
|
@@ -83,7 +77,7 @@
|
|
|
</ProgressLoop>
|
|
</ProgressLoop>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="flex-1">
|
|
<div class="flex-1">
|
|
|
- <ProgressLoop useSlot>
|
|
|
|
|
|
|
+ <ProgressLoop>
|
|
|
<div class="text-xs">complete 2/3</div>
|
|
<div class="text-xs">complete 2/3</div>
|
|
|
</ProgressLoop>
|
|
</ProgressLoop>
|
|
|
</div>
|
|
</div>
|
|
@@ -120,16 +114,14 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="mx-4 pb-8">
|
|
<div class="mx-4 pb-8">
|
|
|
<Button heightIn="0" group size="full">
|
|
<Button heightIn="0" group size="full">
|
|
|
- <div class="flex">
|
|
|
|
|
- <!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
|
|
|
- <!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
|
|
|
- <div class="flex-1 border-r py-2 active:opacity-80" on:click={() => changePercentFun('-10')}>progress -10</div>
|
|
|
|
|
- <!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
|
|
|
- <!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
|
|
|
- <div class="flex-1 border-r py-2 active:opacity-80" on:click={() => changePercentFun('+10')}>progress +10</div>
|
|
|
|
|
- <!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
|
|
|
- <!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
|
|
|
- <div class="flex-1 py-2 active:opacity-80" on:click={() => (percent = 20)}>reset</div>
|
|
|
|
|
|
|
+ <div class="flex w-full">
|
|
|
|
|
+ <button class="flex-1 border-r border-white dark:border-black py-2 active:opacity-80" onclick={() => changePercentFun('-10')}>
|
|
|
|
|
+ -10
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button class="flex-1 border-r border-white dark:border-black py-2 active:opacity-80" onclick={() => changePercentFun('+10')}>
|
|
|
|
|
+ +10
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button class="flex-1 py-2 active:opacity-80" onclick={() => (percent = 20)}>Reset</button>
|
|
|
</div>
|
|
</div>
|
|
|
</Button>
|
|
</Button>
|
|
|
</div>
|
|
</div>
|