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

Enhancement: Add generics and better slots to PTabs #1218

Merged
merged 3 commits into from
Apr 18, 2024
Merged

Conversation

pleek91
Copy link
Collaborator

@pleek91 pleek91 commented Apr 18, 2024

Description

Wanted to fix a few issues.

  1. Tabs could not be readonly
  2. Events did not reflect the tabs passed in

Updating these components to use generics and defineSlots fixes these

Note: There's a weird type issue in the install method for PTabs. I've run into this before and it seems to be related to using defineSlots producing some type other than what app.component wants. But everything seems to work as I'd expect when testing this.

@pleek91 pleek91 requested a review from a team as a code owner April 18, 2024 15:56
Copy link

netlify bot commented Apr 18, 2024

Deploy Preview for prefect-design ready!

Name Link
🔨 Latest commit 9980f06
🔍 Latest deploy log https://app.netlify.com/sites/prefect-design/deploys/662142c7ac4e750008d4ffa4
😎 Deploy Preview https://deploy-preview-1218--prefect-design.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines -5 to -7
// adding defineSlots doesn't match what app.component expects
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
// @ts-ignore
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interestingly enough, this component doesn't even use defineSlots...

Copy link

netlify bot commented Apr 18, 2024

Deploy Preview for prefect-design ready!

Name Link
🔨 Latest commit 3179fff
🔍 Latest deploy log https://app.netlify.com/sites/prefect-design/deploys/662143f455219c0008aba72d
😎 Deploy Preview https://deploy-preview-1218--prefect-design.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This components slots were inconsistent with the root PTabs component. Which likely would lead to implementation errors/bugs at some point. Bringing it inline (yay slot types!)

@pleek91 pleek91 enabled auto-merge April 18, 2024 16:02
@pleek91 pleek91 merged commit bb125b9 into main Apr 18, 2024
6 checks passed
@pleek91 pleek91 deleted the p-tabs-enhancements branch April 18, 2024 21: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