mirror of https://github.com/status-im/consul.git
31 lines
673 B
Handlebars
31 lines
673 B
Handlebars
{{!
|
|
Copyright (c) HashiCorp, Inc.
|
|
SPDX-License-Identifier: BUSL-1.1
|
|
}}
|
|
|
|
<label
|
|
class={{concat 'form-input' (if (get @chart.state.context.errors @name) ' has-error')}}
|
|
...attributes
|
|
>
|
|
<span>
|
|
{{yield to='label'}}
|
|
</span>
|
|
{{yield to='input'}}
|
|
{{#let
|
|
(or @validations.help @help)
|
|
as |help|}}
|
|
{{#if help}}
|
|
{{!- add an optional slot here called <:help>?-}}
|
|
<em>
|
|
{{help}}
|
|
</em>
|
|
{{/if}}
|
|
{{/let}}
|
|
<State @state={{@chart.state}} @matches="error">
|
|
{{!- add an optional slot here called <:alert/error/success>?-}}
|
|
<strong
|
|
role="alert"
|
|
>{{get (get @chart.state.context.errors @name) 'message'}}</strong>
|
|
</State>
|
|
</label>
|