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

feat(tabs): exposes new values in brn-tabs-trigger #104

Merged
merged 6 commits into from
Jan 10, 2024

Conversation

thatsamsonkid
Copy link
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Which package are you modifying?

  • accordion
  • alert
  • alert-dialog
  • aspect-ratio
  • avatar
  • badge
  • button
  • calendar
  • card
  • checkbox
  • collapsible
  • combobox
  • command
  • context-menu
  • data-table
  • date-picker
  • dialog
  • dropdown-menu
  • hover-card
  • input
  • label
  • menubar
  • navigation-menu
  • popover
  • progress
  • radio-group
  • scroll-area
  • select
  • separator
  • sheet
  • skeleton
  • slider
  • switch
  • table
  • tabs
  • textarea
  • toast
  • toggle
  • tooltip
  • typography

What is the current behavior?

Brn Trigger currently does not expose the underlying elementRef as well as some other key values that could be useful in customizing the tabs component.

See this as an example of code used to create below tabs example

https://github.com/thatsamsonkid/portfolio-analog/blob/main/src/app/content/experience.component.ts#L199

Closes #

What is the new behavior?

PR update Brn trigger directive to expose underlying elementRef as well getters for key and if the tab is currently active.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Screen.Recording.2024-01-03.at.12.40.18.PM.mov

@thatsamsonkid thatsamsonkid changed the title feat: exposes new values in brn-tabs-trigger feat(tabs): exposes new values in brn-tabs-trigger Jan 6, 2024
Copy link
Collaborator

@goetzrobin goetzrobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple comments. Curious to hear your thoughts

@@ -48,4 +48,12 @@ export class BrnTabsTriggerDirective {
if (!this._key) return;
this._root.setValue(this._key);
}

get isSelected(): boolean {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe instead change it to a signal called _selected and expose a public readonly selected that is _selected.asReadonly()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@goetzrobin - I was just seeing computed signals are readonly by default. So could we not just do the following changes. See this PR thatsamsonkid@8b46768
Let me know what you think

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Much cleaner! Tabs was one of the earlier components so I am glad we are revisiting this and cleaning things up!

Copy link
Collaborator Author

@thatsamsonkid thatsamsonkid Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, I went ahead merged those changes in

@goetzrobin
Copy link
Collaborator

Also, @thatsamsonkid can you add the exposedAs for this issue: #105? Thanks already!

1 similar comment
@goetzrobin
Copy link
Collaborator

Also, @thatsamsonkid can you add the exposedAs for this issue: #105? Thanks already!

@thatsamsonkid
Copy link
Collaborator Author

All sounds like good ideas to me, I'll make the changes later today

Copy link
Collaborator

@goetzrobin goetzrobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@goetzrobin goetzrobin merged commit 19d2ce4 into spartan-ng:main Jan 10, 2024
6 checks passed
@thatsamsonkid thatsamsonkid deleted the feature/tabs-improvement branch January 29, 2024 04:21
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.

2 participants