I FUCKING DID IT
Added a helper component for managing a list of strings. This component could, in theory, also be turned into a generic one for any type of data
This commit is contained in:
parent
c7af216ce3
commit
e802027236
23 changed files with 1042 additions and 121 deletions
30
frontend-reactive/app/components/util/string-array.hbs
Normal file
30
frontend-reactive/app/components/util/string-array.hbs
Normal file
|
@ -0,0 +1,30 @@
|
|||
<div class="{{@wrapper-classes}}">
|
||||
<ul>
|
||||
{{#each this.args.list as |element index|}}
|
||||
<li>
|
||||
<div class="string-array-element-wrapper">
|
||||
<Input
|
||||
@type="text"
|
||||
@value={{element.value}}
|
||||
/>
|
||||
<div
|
||||
class="{{@remove-element-classes}}"
|
||||
type="button"
|
||||
id="{{this.args.prefix}}-{{index}}"
|
||||
{{on "click" this.removeElement}}
|
||||
>
|
||||
X
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
|
||||
</ul>
|
||||
<div
|
||||
class="{{@add-element-classes}}"
|
||||
type="button"
|
||||
{{on "click" this.addElement}}
|
||||
>
|
||||
Add element
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue