0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-28 03:40:29 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/wizard-mapper-selector.hbs

77 Zeilen
1,8 KiB
Handlebars

2020-03-21 18:30:11 +01:00
<div class="type-selector">
2024-11-22 16:45:50 +01:00
{{#if this.hasTypes}}
2021-04-12 16:19:53 +02:00
<a role="button" {{action "toggleTypes"}} class="active">
2024-11-22 16:45:50 +01:00
{{this.activeTypeLabel}}
2020-04-06 03:54:16 +02:00
</a>
2021-04-12 16:19:53 +02:00
2024-11-22 16:45:50 +01:00
{{#if this.showTypes}}
2020-04-13 14:17:22 +02:00
<div class="selector-types">
2024-11-22 16:45:50 +01:00
{{#each this.selectorTypes as |item|}}
2020-04-13 14:17:22 +02:00
{{wizard-mapper-selector-type
2024-11-22 16:45:50 +01:00
activeType=this.activeType
2020-04-13 14:17:22 +02:00
item=item
2023-07-10 08:55:54 +02:00
toggle=(action "toggleType")
}}
2020-04-13 14:17:22 +02:00
{{/each}}
</div>
{{/if}}
2020-04-06 03:54:16 +02:00
{{else}}
2024-11-22 16:45:50 +01:00
<span>{{this.activeTypeLabel}}</span>
2020-04-06 03:54:16 +02:00
{{/if}}
2020-03-21 18:30:11 +01:00
</div>
<div class="input">
2024-11-22 16:45:50 +01:00
{{#if this.showText}}
2023-04-03 04:28:06 +02:00
<Input
@type="text"
@value={{this.value}}
2024-11-22 16:45:50 +01:00
placeholder={{i18n this.placeholderKey}}
2023-04-03 04:28:06 +02:00
{{on "change" (action "changeInputValue")}}
/>
2020-03-21 18:30:11 +01:00
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.showComboBox}}
2020-03-21 18:30:11 +01:00
{{combo-box
2024-11-22 16:45:50 +01:00
value=this.value
content=this.comboBoxContent
onChange=(action "changeValue")
2024-11-22 16:45:50 +01:00
options=(hash none=this.placeholderKey allowAny=this.comboBoxAllowAny)
2023-07-10 08:55:54 +02:00
}}
2020-03-21 18:30:11 +01:00
{{/if}}
2021-04-12 16:19:53 +02:00
2024-11-22 16:45:50 +01:00
{{#if this.showMultiSelect}}
2020-03-24 10:35:46 +01:00
{{multi-select
2024-11-22 16:45:50 +01:00
content=this.multiSelectContent
value=this.value
onChange=(action "changeValue")
2024-11-22 16:45:50 +01:00
options=this.multiSelectOptions
2023-07-10 08:55:54 +02:00
}}
2020-04-05 03:37:09 +02:00
{{/if}}
2021-04-12 16:19:53 +02:00
2024-11-22 16:45:50 +01:00
{{#if this.showList}}
{{wizard-value-list
2024-11-22 16:45:50 +01:00
values=this.value
addKey=this.placeholderKey
2023-07-10 08:55:54 +02:00
onChange=(action "changeValue")
}}
2020-03-23 06:41:04 +01:00
{{/if}}
2021-04-12 16:19:53 +02:00
2024-11-22 16:45:50 +01:00
{{#if this.showTag}}
2020-03-23 06:41:04 +01:00
{{tag-chooser
2024-11-22 16:45:50 +01:00
tags=this.value
onChange=(action "changeValue")
everyTag=true
2024-11-22 16:45:50 +01:00
options=(hash none=this.placeholderKey filterable=true)
2023-07-10 08:55:54 +02:00
}}
2020-03-23 06:41:04 +01:00
{{/if}}
2021-04-12 16:19:53 +02:00
2024-11-22 16:45:50 +01:00
{{#if this.showUser}}
{{wizard-user-chooser
2024-11-22 16:45:50 +01:00
placeholderKey=this.placeholderKey
value=this.value
autocomplete="discourse"
onChange=(action "changeUserValue")
2024-11-22 16:45:50 +01:00
options=this.userOptions
2023-07-10 08:55:54 +02:00
}}
2020-04-02 10:21:03 +02:00
{{/if}}
2023-07-10 08:55:54 +02:00
</div>