-
Notifications
You must be signed in to change notification settings - Fork 1
Resolve re-yielded block-param curried sub-components (fix wcag/h71 FP) #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f0adb3c
resolve re-yielded block-param curried sub-components
johanrd 8d1d5a8
re-yield: pass binder's own @args; restrict binder to PascalCase
johanrd fc051ba
re-yield: broaden binder lookup; fall back to resolveByName for non-b…
johanrd 81d3abb
re-yield: resolve binder @arg={{this.prop}} via class getter
johanrd 1d1ccdc
re-yield: scope binder lookup to the in-scope re-yield reference
johanrd 4696407
re-yield: don't self-match parent on same-file binder lookup; reuse p…
johanrd 05c0d76
re-yield: align binder-tag predicate with wrapper recursion
johanrd d48e415
re-yield: bind to the matched entry's in-scope binder; follow re-yiel…
johanrd a00c260
re-yield: pin binder @arg tail forms; share wrapper predicate with bu…
johanrd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { hash } from '@ember/helper'; | ||
| import type { TOC } from '@ember/component/template-only'; | ||
|
|
||
| // `NavList` is an in-scope const component, NOT a block param introduced | ||
| // via `<… as |NavList|>`. A hash entry `NavList.Item` is therefore plain | ||
| // property access, not a block-param re-yield: `resolveBlockParamReyield` | ||
| // must find no binder and the caller must fall back to resolving the head | ||
| // (`NavList`) by name — landing on `<nav>` rather than TRANSPARENT. | ||
| interface NavSig { | ||
| Element: HTMLElement; | ||
| Blocks: { default: [{ Item: unknown }] }; | ||
| } | ||
| const NavList: TOC<NavSig> = <template> | ||
| <nav ...attributes>{{yield (hash Item="x")}}</nav> | ||
| </template>; |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import Component from '@glimmer/component'; | ||
| import { hash } from '@ember/helper'; | ||
| import type { TOC } from '@ember/component/template-only'; | ||
|
|
||
| interface LegendSig { Element: HTMLLegendElement; Blocks: { default: [] } } | ||
| const Legend: TOC<LegendSig> = <template><legend ...attributes>{{yield}}</legend></template>; | ||
|
|
||
| interface InnerSig { Element: HTMLFieldSetElement; Blocks: { default: [{ Legend: typeof Legend }] } } | ||
| class InnerFieldset extends Component<InnerSig> { | ||
| Legend = Legend; | ||
| <template><fieldset ...attributes>{{yield (hash Legend=this.Legend)}}</fieldset></template> | ||
| } | ||
|
|
||
| // Re-yields F.Legend (the nested fieldset's yielded sub-component) — | ||
| // mirrors HdsFormCheckboxGroup re-yielding HdsFormFieldset's F.Legend. | ||
| interface OuterSig { Element: HTMLFieldSetElement; Blocks: { default: [{ Legend: typeof Legend }] } } | ||
| class OuterGroup extends Component<OuterSig> { | ||
| <template> | ||
| <InnerFieldset as |F|> | ||
| {{yield (hash Legend=F.Legend)}} | ||
| </InnerFieldset> | ||
| </template> | ||
| } | ||
|
|
||
| <template> | ||
| <OuterGroup as |G|> | ||
| <G.Legend>Group legend</G.Legend> | ||
| <input type="checkbox" /> | ||
| </OuterGroup> | ||
| </template> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.