diff --git a/src/data/test/mockDSData.js b/src/data/test/mockDSData.js index 85b6928a..56fef848 100644 --- a/src/data/test/mockDSData.js +++ b/src/data/test/mockDSData.js @@ -13,4 +13,10 @@ let cities=[ { value: "oxford", label: "Oxford" }, ] -export {ethnicity,cities} \ No newline at end of file +let checkboxData=[ + {id:"laptop", value:"laptop", label:"Laptop"}, + {id:"mobile", value:"mobile", label:"Mobile"}, + {id:"tablet", value:"tablet", label:"Tablet"}, +] + +export {ethnicity, cities, checkboxData} diff --git a/src/routes/DesignSystemApp.svelte b/src/routes/DesignSystemApp.svelte index a2e8d181..a660c934 100644 --- a/src/routes/DesignSystemApp.svelte +++ b/src/routes/DesignSystemApp.svelte @@ -1,5 +1,5 @@ @@ -88,16 +90,83 @@ - Mobile - Laptop - Tablet -`} + code={` + {#each checkboxData as option} + console.log("User selections: ", selections.join(", "))} + /> + {/each} + `} > - - Mobile - Laptop - Tablet + + {#each checkboxData as option} + console.log("User selections: ", selections.join(", "))} + /> + {/each} + +
+

Checkboxes: {selections}

+
+ + + {#each checkboxData as option} + console.log("User selections: ", errorSelection.join(", "))} + /> + {/each} + `} + > + + {#each checkboxData as option} + console.log("User selections: ", errorSelection.join(", "))} + /> + {/each} diff --git a/src/ui/ons/ONSCheckboxes.svelte b/src/ui/ons/ONSCheckboxes.svelte index 3db146b2..6141e12f 100644 --- a/src/ui/ons/ONSCheckboxes.svelte +++ b/src/ui/ons/ONSCheckboxes.svelte @@ -1,6 +1,26 @@ -
-

Select all that apply

-
- + + + +
+
+ {#if legendIsQuestionTitle} + +

{title}

+
+ {/if} +
+

{checkboxesLabel}

+
+ +
+
+
-
+ diff --git a/src/ui/ons/partials/ONSCheckbox.svelte b/src/ui/ons/partials/ONSCheckbox.svelte index 3581ce20..afa58100 100644 --- a/src/ui/ons/partials/ONSCheckbox.svelte +++ b/src/ui/ons/partials/ONSCheckbox.svelte @@ -1,12 +1,34 @@ -

+ - - + { + onChangeBindGroup(e); + onChange(bindGroup); + }} + /> + -

+ +