From df8189cd66c4c56982aa522f1a22539e06263733 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 17 Mar 2026 10:32:59 -0400 Subject: [PATCH] cherry: import element_input_v2.svelte from wip-modal-fix-attempt --- src/lib/elements/element_input_v2.svelte | 801 +++++++++++++++++++++++ 1 file changed, 801 insertions(+) create mode 100644 src/lib/elements/element_input_v2.svelte diff --git a/src/lib/elements/element_input_v2.svelte b/src/lib/elements/element_input_v2.svelte new file mode 100644 index 00000000..803ad623 --- /dev/null +++ b/src/lib/elements/element_input_v2.svelte @@ -0,0 +1,801 @@ + + +
+ {#if type === 'email' || type === 'date' || type === 'number' || type === 'tel' || type === 'text' || type === 'time' || type === 'url'} + {#if content_layout == 'label_start' && label} + + {/if} + + + + {#if content_layout != 'label_start' && label} + + {/if} + + {description} + {:else if type === 'date_time'} + {#if content_layout == 'label_start' && label} + {label} + + {/if} + +
+ {#if label_begin} + + {/if} + + + + {#if !label_begin} + + {/if} +
+ +
+ {#if label_begin} + + {/if} + + + + {#if !label_begin} + + {/if} +
+ + {#if content_layout != 'label_start' && label} + {label} + + {/if} + + {description} + {:else if type === 'checkbox'} + {#if checkbox_none} + {#if !value} + {(checked = 'checked')} + {/if} + + {/if} + {#if checkbox_li.length} + {#if content_layout == 'label_start' && label} + {label} + {/if} + + {#each Object.entries(checkbox_li) as [li_key, li_value]} + {#if li_key.toString() === value.toString()} + + {:else} + + {/if} + {/each} + + {#if content_layout != 'label_start' && label} + {label} + {/if} + {:else} + {#if label_begin} + + {/if} + + + {/if} + + {description} + {:else if type === 'radio'} + {#if radio_none} + {#if !value} + {(checked = 'checked')} + {/if} + + {/if} + {#if radio_li} + {#if content_layout == 'label_start' && label} + {label}: + {/if} + + + {#each Object.entries(radio_li) as [li_key, li_value]} + {#if value === null} + + + {:else if li_key.toString() === value.toString() || (li_key == 'true' && value == true) || (li_key == 'false' && value == false)} + + {:else} + + {/if} + + + {/each} + + + {#if !label_begin} + {label}: + {/if} + {:else} + {#if label_begin} + + {/if} + + + + {#if !label_begin} + + {/if} + {/if} + + {description} + {:else if type === 'textarea'} + {#if label_begin} + + {/if} + + {#if value_new_line}
{/if} + + + + {#if !label_begin} + + {/if} + + {description} + {:else if type === 'hidden'} + + {:else if type === 'select'} + {#if label_begin} + + {/if} + + + + {#if !label_begin} + + {/if} + + {description} + {/if} + + {@render more_html?.()} +
+ +