Skip to content

Commit 7ab4f4f

Browse files
Chore: Added selections to Multiselect props, removed form SB options. Removed height and selected on select
1 parent ed30e8a commit 7ab4f4f

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/multiselect/MultiSelect.stories.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const meta = {
88
title: 'MultiSelect',
99
component: MultiSelect,
1010
decorators: [() => FullView],
11+
argTypes: {
12+
selections: {table: {disable: true}}
13+
},
1114
tags: ['autodocs'],
1215
} satisfies Meta<MultiSelect>;
1316

src/multiselect/MultiSelect.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,21 @@
99
let toggleMenu = () => {
1010
menu.setOpen(!menu.isOpen());
1111
};
12-
let selections = $state([]);
1312
1413
type MultiSelectProps = {
1514
variant: "Checkboxes" | "Text";
1615
label: string;
1716
noSelectionsLabel: string;
1817
options: string[];
18+
selections?: string[];
1919
};
2020
2121
let {
2222
variant = "Text",
2323
label = "Please select some options",
2424
noSelectionsLabel = "MultiSelect",
2525
options = ["Apple", "Banana", "Cherry"],
26+
selections = [],
2627
}: MultiSelectProps = $props();
2728
2829
const toggleSelection = (option: string) => {

src/select/Select.svelte

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,15 @@
55
type MDAISelectProps = {
66
label: string;
77
options: string[];
8-
selected: string;
9-
// height for sb component to show full dropdown
10-
height?: number;
11-
disabled?: boolean;
128
};
139
1410
let {
1511
label = "Select",
1612
options = ["Apple", "Banana", "Cherry"],
17-
selected = "",
1813
}: MDAISelectProps = $props();
19-
20-
let value = $derived(selected);
2114
</script>
2215

23-
<SMUISelect class="shaped-outlined" variant="outlined" {value} {label}>
16+
<SMUISelect class="shaped-outlined" variant="outlined" {label}>
2417
{#each options as option}
2518
<Option value={option}>{option}</Option>
2619
{/each}

0 commit comments

Comments
 (0)