Skip to content

Commit

Permalink
Fixed issue with only having only allowing one tab open at a time for…
Browse files Browse the repository at this point in the history
… editor or preview tabs || Also converted all details and summary in editor components to svelte:fragments
  • Loading branch information
AlexthePear committed May 1, 2024
1 parent 4f9b185 commit bc6b054
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
</fieldset>
<!-- TODO: Make the avaibilityQuestion Input here be the default value for the sample -->
<AvailabilityQuestionInput bind:data />
<details>
<summary>Sample</summary>

<svelte:fragment slot="preview">
<AvailabilityQuestionInput {data} />
</details>
</svelte:fragment>
</BaseEditor>
9 changes: 7 additions & 2 deletions src/lib/components/questions/base/base_editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@

<!-- Copied From TextQuestionInput -->
<div class="tabs">
<input type="radio" name="tabs" id="tab-01-{data.name}:{data.type}" checked={true} />
<input
type="radio"
name="tabs-{data.name}:{data.type}"
id="tab-01-{data.name}:{data.type}"
checked={true}
/>
<label for="tab-01-{data.name}:{data.type}">Tab 1</label>
<div class="tab-content">
<fieldset>
Expand All @@ -35,7 +40,7 @@
<slot />
</div>

<input type="radio" name="tabs" id="tab-02-{data.name}:{data.type}" />
<input type="radio" name="tabs-{data.name}:{data.type}" id="tab-02-{data.name}:{data.type}" />
<label for="tab-02-{data.name}:{data.type}">Tab 2</label>
<div class="tab-content">
<slot name="preview" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
<legend>Default Color</legend>
<input type="color" name="color-" bind:value={data.value} />
</fieldset>
<details>
<summary>Sample</summary>
<svelte:fragment slot="preview">
<div class="question">
<ColorQuestionInput bind:data />
</div>
</details>
</svelte:fragment>
</BaseEditor>
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
<legend>Default Date</legend>
<input type="date" bind:value={data.value} />
</fieldset>
<details>
<summary>Sample</summary>
<svelte:fragment slot="preview">
<div class="question">
<DateQuestionInput bind:data />
</div>
</details>
</svelte:fragment>
</BaseEditor>
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
<legend>Default Date/Time</legend>
<input type="datetime-local" bind:value={data.value} />
</fieldset>
<details>
<summary>Sample</summary>
<svelte:fragment slot="preview">
<div class="question">
<DatetimeQuestionInput {data} />
</div>
</details>
</svelte:fragment>
</BaseEditor>
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
<legend>placeholder</legend>
<input type="text" bind:value={data.placeholder} />
</fieldset>
<details>
<summary>Sample</summary>
<NumberQuestionInput bind:data />
</details>
<svelte:fragment slot="preview">
<div class="question">
<NumberQuestionInput bind:data />
</div>
</svelte:fragment>
</BaseEditor>
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
deleteItem: DeleteItem
}}
/>
<details>
<summary>Sample</summary>
<SelectQuestionInput {data} />
</details>
<svelte:fragment slot="preview">
<div class="question">
<SelectQuestionInput {data} />
</div>
</svelte:fragment>
</BaseEditor>
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@
<fieldset>
<legend>Choices (COMMING SOON)</legend>
</fieldset>
<details>
<summary>Sample</summary>
<svelte:fragment slot="preview">
<div class="question">
<TextQuestionInput bind:data />
</div>
</details>
</svelte:fragment>
</BaseEditor>
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
<legend>Placeholder</legend>
<input type="text" bind:value={data.placeholder} />
</fieldset>
<details>
<summary>Sample</summary>
<svelte:fragment slot="preview">
<div class="question">
<TextareaQuestionInput bind:data />
</div>
</details>
</svelte:fragment>
</BaseEditor>
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
<legend>Default Time</legend>
<input type="time" bind:value={data.value} min={data.min} max={data.max} />
</fieldset>
<details>
<summary>Sample</summary>
<svelte:fragment slot="preview">
<div class="question">
<TimeQuestionInput bind:data />
</div>
</details>
</svelte:fragment>
</BaseEditor>
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<legend>Defualt Timezone ID</legend>
<input type="text" bind:value={data.value} />
</fieldset>
<details>
<summary> Time </summary>
<svelte:fragment slot="preview">
<TimezoneQuestionInput bind:data />
</details>
</svelte:fragment>
</BaseEditor>

0 comments on commit bc6b054

Please sign in to comment.