meilisearch-admin/app/components/input-text.hbs

28 lines
714 B
Handlebars
Raw Normal View History

2022-03-24 10:56:55 +00:00
<div class="mb-4">
2022-03-24 08:36:20 +00:00
{{#if @label}}
2022-08-20 15:11:49 +00:00
<label for={{this.id}} class="block font-medium mb-1 text-dark {{if @required "after:content-['*'] after:text-red-500"}}">
{{~@label~}}
2022-04-26 10:28:40 +00:00
</label>
2022-03-24 08:36:20 +00:00
{{/if}}
2022-06-05 05:46:12 +00:00
<div class="relative flex items-center border rounded-md">
2022-03-24 08:36:20 +00:00
{{#if @prefixIcon}}
2022-04-26 10:28:40 +00:00
<@prefixIcon class="h-8 w-8 pl-2" />
2022-03-24 08:36:20 +00:00
{{/if}}
<input
type="text"
name={{@name}}
id={{this.id}}
class="block w-full p-2 bg-transparent focus:outline-none"
placeholder={{@placeholder}}
value={{@value}}
2022-08-20 15:11:49 +00:00
required={{@required}}
2022-03-24 08:36:20 +00:00
{{on 'input' this.onChange}}
2022-04-26 10:28:40 +00:00
/>
2022-03-24 08:36:20 +00:00
</div>
2022-03-28 10:37:09 +00:00
{{#if @helper}}
2022-04-26 10:28:40 +00:00
<div class="mt-1 text-sm">
{{@helper}}
</div>
2022-03-28 10:37:09 +00:00
{{/if}}
2022-03-24 08:36:20 +00:00
</div>