consul/ui/packages/consul-ui/app/components/form-group/element/index.hbs

38 lines
1.1 KiB
Handlebars
Raw Normal View History

{{!
Copyright (c) HashiCorp, Inc.
[COMPLIANCE] License changes (#18443) * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Updating the license from MPL to Business Source License Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at <Blog URL>, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl. * add missing license headers * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-11 13:12:13 +00:00
SPDX-License-Identifier: BUSL-1.1
}}
{{#let (hash
Element=(component 'form-group/element' group=@group name=@name)
Text=(component 'form-group/element/text' didinsert=(action this.connect) name=this.name oninput=(action (mut this.touched) true))
Checkbox=(component 'form-group/element/checkbox' didinsert=(action this.connect) name=this.name onchange=(action (mut this.touched) true))
Radio=(component 'form-group/element/radio' didinsert=(action this.connect) name=this.name onchange=(action (mut this.touched) true))
Label=(component 'form-group/element/label')
Error=(component 'form-group/element/error')
state=state
)
as |el|}}
{{#if (includes this.type (array 'radiogroup' 'checkbox-group' 'checkboxgroup'))}}
<div
data-property={{this.prop}}
class="type-{{this.type}}{{if (state-matches state 'error') ' has-error'}}"
...attributes
>
{{yield el}}
</div>
{{else}}
<label
data-property={{this.prop}}
class="type-{{this.type}}{{if (state-matches state 'error') ' has-error'}}"
...attributes
>
{{yield el}}
</label>
{{/if}}
{{/let}}