0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2025-02-15 09:17:02 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/wizard-mapper-selector.hbs

77 Zeilen
1,8 KiB
Handlebars

2020-03-22 04:30:11 +11:00
<div class="type-selector">
2024-11-22 16:45:50 +01:00
{{#if this.hasTypes}}
2021-04-12 19:49:53 +05:30
<a role="button" {{action "toggleTypes"}} class="active">
2024-11-22 16:45:50 +01:00
{{this.activeTypeLabel}}
2020-04-06 11:54:16 +10:00
</a>
2021-04-12 19:49:53 +05:30
2024-11-22 16:45:50 +01:00
{{#if this.showTypes}}
2020-04-13 22:17:22 +10:00
<div class="selector-types">
2024-11-22 16:45:50 +01:00
{{#each this.selectorTypes as |item|}}
2020-04-13 22:17:22 +10:00
{{wizard-mapper-selector-type
2024-11-22 16:45:50 +01:00
activeType=this.activeType
2020-04-13 22:17:22 +10:00
item=item
2023-07-10 07:55:54 +01:00
toggle=(action "toggleType")
}}
2020-04-13 22:17:22 +10:00
{{/each}}
</div>
{{/if}}
2020-04-06 11:54:16 +10:00
{{else}}
2024-11-22 16:45:50 +01:00
<span>{{this.activeTypeLabel}}</span>
2020-04-06 11:54:16 +10:00
{{/if}}
2020-03-22 04:30:11 +11:00
</div>
<div class="input">
2024-11-22 16:45:50 +01:00
{{#if this.showText}}
2023-04-03 12:28:06 +10:00
<Input
@type="text"
@value={{this.value}}
2024-11-22 16:45:50 +01:00
placeholder={{i18n this.placeholderKey}}
2023-04-03 12:28:06 +10:00
{{on "change" (action "changeInputValue")}}
/>
2020-03-22 04:30:11 +11:00
{{/if}}
2024-11-22 16:45:50 +01:00
{{#if this.showComboBox}}
2020-03-22 04:30:11 +11: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 07:55:54 +01:00
}}
2020-03-22 04:30:11 +11:00
{{/if}}
2021-04-12 19:49:53 +05:30
2024-11-22 16:45:50 +01:00
{{#if this.showMultiSelect}}
2020-03-24 20:35:46 +11: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 07:55:54 +01:00
}}
2020-04-05 11:37:09 +10:00
{{/if}}
2021-04-12 19:49:53 +05:30
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 07:55:54 +01:00
onChange=(action "changeValue")
}}
2020-03-23 16:41:04 +11:00
{{/if}}
2021-04-12 19:49:53 +05:30
2024-11-22 16:45:50 +01:00
{{#if this.showTag}}
2020-03-23 16:41:04 +11: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 07:55:54 +01:00
}}
2020-03-23 16:41:04 +11:00
{{/if}}
2021-04-12 19:49:53 +05:30
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 07:55:54 +01:00
}}
2020-04-02 19:21:03 +11:00
{{/if}}
2023-07-10 07:55:54 +01:00
</div>