-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New in Ember v4.4: Used the {{unique-id}} helper to generate IDs
- Loading branch information
Showing
4 changed files
with
92 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,70 @@ | ||
<form | ||
aria-describedby={{if | ||
@instructions | ||
(concat this.formId "-instructions") | ||
}} | ||
aria-labelledby={{if @title (concat this.formId "-title")}} | ||
data-test-form={{or @title ""}} | ||
local-class="form" | ||
{{autofocus}} | ||
{{on "submit" this.submitForm}} | ||
> | ||
<Ui::Form::Information | ||
@formId={{this.formId}} | ||
@instructions={{@instructions}} | ||
@title={{@title}} | ||
/> | ||
|
||
<ContainerQuery | ||
@features={{hash wide=(width min=480)}} | ||
as |CQ| | ||
> | ||
{{yield | ||
(hash | ||
Checkbox=(component | ||
"ui/form/checkbox" | ||
changeset=this.changeset | ||
isInline=true | ||
isWide=CQ.features.wide | ||
onUpdate=this.updateChangeset | ||
) | ||
Input=(component | ||
"ui/form/input" | ||
changeset=this.changeset | ||
isWide=CQ.features.wide | ||
onUpdate=this.updateChangeset | ||
) | ||
Number=(component | ||
"ui/form/number" | ||
changeset=this.changeset | ||
isWide=CQ.features.wide | ||
onUpdate=this.updateChangeset | ||
) | ||
Select=(component | ||
"ui/form/select" | ||
changeset=this.changeset | ||
isWide=CQ.features.wide | ||
onUpdate=this.updateChangeset | ||
) | ||
Textarea=(component | ||
"ui/form/textarea" | ||
changeset=this.changeset | ||
isWide=CQ.features.wide | ||
onUpdate=this.updateChangeset | ||
) | ||
) | ||
{{#let (unique-id) as |formId|}} | ||
<form | ||
aria-describedby={{if | ||
@instructions | ||
(concat formId "-instructions") | ||
}} | ||
</ContainerQuery> | ||
aria-labelledby={{if @title (concat formId "-title")}} | ||
data-test-form={{or @title ""}} | ||
local-class="form" | ||
{{autofocus}} | ||
{{on "submit" this.submitForm}} | ||
> | ||
<Ui::Form::Information | ||
@formId={{formId}} | ||
@instructions={{@instructions}} | ||
@title={{@title}} | ||
/> | ||
|
||
<div local-class="actions"> | ||
<button | ||
data-test-button="Submit" | ||
local-class="submit-button" | ||
type="submit" | ||
<ContainerQuery | ||
@features={{hash wide=(width min=480)}} | ||
as |CQ| | ||
> | ||
{{t "components.ui.form.submit"}} | ||
</button> | ||
</div> | ||
</form> | ||
{{yield | ||
(hash | ||
Checkbox=(component | ||
"ui/form/checkbox" | ||
changeset=this.changeset | ||
isInline=true | ||
isWide=CQ.features.wide | ||
onUpdate=this.updateChangeset | ||
) | ||
Input=(component | ||
"ui/form/input" | ||
changeset=this.changeset | ||
isWide=CQ.features.wide | ||
onUpdate=this.updateChangeset | ||
) | ||
Number=(component | ||
"ui/form/number" | ||
changeset=this.changeset | ||
isWide=CQ.features.wide | ||
onUpdate=this.updateChangeset | ||
) | ||
Select=(component | ||
"ui/form/select" | ||
changeset=this.changeset | ||
isWide=CQ.features.wide | ||
onUpdate=this.updateChangeset | ||
) | ||
Textarea=(component | ||
"ui/form/textarea" | ||
changeset=this.changeset | ||
isWide=CQ.features.wide | ||
onUpdate=this.updateChangeset | ||
) | ||
) | ||
}} | ||
</ContainerQuery> | ||
|
||
<div local-class="actions"> | ||
<button | ||
data-test-button="Submit" | ||
local-class="submit-button" | ||
type="submit" | ||
> | ||
{{t "components.ui.form.submit"}} | ||
</button> | ||
</div> | ||
</form> | ||
{{/let}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
<div | ||
local-class="container | ||
{{if @isInline 'is-inline'}} | ||
{{if @isWide 'is-wide'}} | ||
{{unless @errorMessage 'no-feedback'}} | ||
" | ||
> | ||
<div local-class="label"> | ||
{{yield (hash inputId=this.inputId) to="label"}} | ||
</div> | ||
|
||
<div local-class="field"> | ||
{{yield (hash inputId=this.inputId) to="field"}} | ||
</div> | ||
{{#let (unique-id) as |inputId|}} | ||
<div | ||
local-class="container | ||
{{if @isInline 'is-inline'}} | ||
{{if @isWide 'is-wide'}} | ||
{{unless @errorMessage 'no-feedback'}} | ||
" | ||
> | ||
<div local-class="label"> | ||
{{yield (hash inputId=inputId) to="label"}} | ||
</div> | ||
|
||
{{#if @errorMessage}} | ||
<div | ||
data-test-feedback | ||
local-class="feedback is-error" | ||
role="alert" | ||
> | ||
{{@errorMessage}} | ||
<div local-class="field"> | ||
{{yield (hash inputId=inputId) to="field"}} | ||
</div> | ||
{{/if}} | ||
</div> | ||
|
||
{{#if @errorMessage}} | ||
<div | ||
data-test-feedback | ||
local-class="feedback is-error" | ||
role="alert" | ||
> | ||
{{@errorMessage}} | ||
</div> | ||
{{/if}} | ||
</div> | ||
{{/let}} |
This file was deleted.
Oops, something went wrong.