Skip to content

Commit 6460aeb

Browse files
committed
🛠️ Dialog Items
- Added WIP MultiSelect - Disabled invalid error in colorPicker
1 parent b030bce commit 6460aeb

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/components/dialogItems/colorPicker.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
let colorPicker = new ColorPicker(`${PACKAGE.name}:${label}-color_picker`, {
1212
onChange() {
13+
// @ts-ignore
1314
const color = colorPicker.get() as tinycolor.Instance
1415
value.set(color.toHexString())
1516
},
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<script lang="ts">
2+
import { Valuable } from '../../util/stores'
3+
import BaseDialogItem from './baseDialogItem.svelte'
4+
5+
export let label: string
6+
export let tooltip: string = ''
7+
export let options: Record<string, string>
8+
export let defaultSelection: string[]
9+
export let selection: Valuable<boolean[]>
10+
11+
function toggleOption(option: number) {
12+
selection.get()[option] = !selection.get()[option]
13+
selection.set(selection.get())
14+
}
15+
</script>
16+
17+
<BaseDialogItem {label} {tooltip}>
18+
<div class="dialog_bar form_bar checkbox_bar">
19+
<label class="name_space_left" for="export">{label}</label>
20+
<div class="spacer" />
21+
<div>
22+
{#each $selection as value, i}
23+
<input type="checkbox" class="focusable_input" id="export" bind:checked={value} />
24+
{/each}
25+
</div>
26+
</div>
27+
</BaseDialogItem>
28+
29+
<style>
30+
.checkbox_bar {
31+
flex-direction: row;
32+
align-items: center;
33+
}
34+
.spacer {
35+
flex-grow: 1;
36+
border-bottom: 2px dashed var(--color-button);
37+
height: 0px;
38+
margin: 8px;
39+
margin-left: 16px;
40+
}
41+
label {
42+
width: auto;
43+
}
44+
</style>

0 commit comments

Comments
 (0)