Skip to content
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

Give accordion feature parity with nunjucks macros #203

Merged
merged 7 commits into from
Jul 4, 2021

Conversation

peteryates
Copy link
Member

  • add heading_level param, defaults to 2
  • rename section title to heading_text
  • add heading_html slot to section
  • rename section summary to summary_text
  • add summary_html slot to section

I have not added a text argument to section as raw text can always be passed into the block to form the content.

Refs #202

This change adds a heading_html slot to the accordion section that takes
a block of HTML. If both heading_text and heading_html are supplied the
HTML will take precedence. If neither are supplied an error will be
raised.

To ease the process of testing the accordion has been split out into a
separate file; I repeatedly ran into problems getting the tests to work
when the accordion and section components shared a single file[0].

A lambda slot was used because ideally we want to specify the heading
level for each section once in the accordion; it wouldn't be ideal to
have to do it once-per-section. Lambda slots are the only style that
support sharing values between the parent and child.

[0] ViewComponent/view_component#1000
@peteryates peteryates merged commit 3816a6b into version-2.0.0 Jul 4, 2021
@peteryates peteryates deleted the version-2.0.0-pp-accordion branch July 4, 2021 19:50
@peteryates peteryates added this to the Version 2.0.0 milestone Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant