2023-03-14 13:18:55 +00:00
|
|
|
{{!
|
|
|
|
Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
SPDX-License-Identifier: BUSL-1.1
|
2023-03-14 13:18:55 +00:00
|
|
|
}}
|
|
|
|
|
2021-11-24 14:53:12 +00:00
|
|
|
<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>
|