Browse Source

Merge pull request #11647 from kaytwo/multiline-valves

feat: allow string valves to include newlines
Timothy Jaeryang Baek 1 month ago
parent
commit
2de03494a6
1 changed files with 12 additions and 1 deletions
  1. 12 1
      src/lib/components/common/Valves.svelte

+ 12 - 1
src/lib/components/common/Valves.svelte

@@ -80,7 +80,7 @@
 									/>
 									/>
 								</div>
 								</div>
 							</div>
 							</div>
-						{:else}
+						{:else if (valvesSpec.properties[property]?.type ?? null) !== 'string'}
 							<input
 							<input
 								class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-hidden border border-gray-100 dark:border-gray-850"
 								class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-hidden border border-gray-100 dark:border-gray-850"
 								type="text"
 								type="text"
@@ -92,6 +92,17 @@
 									dispatch('change');
 									dispatch('change');
 								}}
 								}}
 							/>
 							/>
+						{:else}
+							<textarea
+								class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-hidden border border-gray-100 dark:border-gray-850"
+								placeholder={valvesSpec.properties[property].title}
+								bind:value={valves[property]}
+								autocomplete="off"
+								required
+								on:change={() => {
+									dispatch('change');
+								}}
+							/>
 						{/if}
 						{/if}
 					</div>
 					</div>
 				</div>
 				</div>