2024-10-25 14:54:11 +00:00
|
|
|
<div class="{{@wrapper-classes}}">
|
2024-11-19 14:05:12 +00:00
|
|
|
{{#if @readonly}}
|
|
|
|
<ul>
|
|
|
|
{{#each this.args.list as |element|}}
|
|
|
|
<li>
|
|
|
|
<div class="string-array-element-wrapper">
|
|
|
|
<p class="{{@element-key-classes}}">{{element.key}}</p>
|
|
|
|
<p class="{{@element-value-classes}}">{{element.value}}</p>
|
2024-10-25 14:54:11 +00:00
|
|
|
</div>
|
2024-11-19 14:05:12 +00:00
|
|
|
</li>
|
|
|
|
{{/each}}
|
|
|
|
</ul>
|
|
|
|
{{else}}
|
|
|
|
<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}}
|
2024-10-25 14:54:11 +00:00
|
|
|
|
2024-11-19 14:05:12 +00:00
|
|
|
</ul>
|
|
|
|
<div
|
|
|
|
class="{{@add-element-classes}}"
|
|
|
|
type="button"
|
|
|
|
{{on "click" this.addElement}}
|
|
|
|
>
|
|
|
|
Add element
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2024-10-25 14:54:11 +00:00
|
|
|
</div>
|