linstrom/frontend-reactive/app/components/util/map-edit.hbs
mStar f0638af99f More utility components
One for a "map" of sorts and one for selecting one element of a list
2024-10-25 16:54:11 +02:00

27 lines
No EOL
637 B
Handlebars

<div class="{{@wrapper-classes}}">
<ul>
{{#each this.args.list as |element index|}}
<li>
<div class="string-array-element-wrapper">
<Input @type="text" @value={{element.key}} />
<Input @type="text" @value={{element.value}} />
<div
class="{{@remove-element-classes}}"
type="button"
{{on "click" (fn this.removeElement index)}}
>
X
</div>
</div>
</li>
{{/each}}
</ul>
<div
class="{{@add-element-classes}}"
type="button"
{{on "click" this.addElement}}
>
Add element
</div>
</div>