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
docs(BButtonGroup): update component references #1580
base: main
Are you sure you want to change the base?
docs(BButtonGroup): update component references #1580
Conversation
description: `When set to 'true', disables the component's functionality and places it in a disabled state`, | ||
}, | ||
{ | ||
prop: 'event', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, instead of declaring the extended props, say those in BLink, instead what we should do is find a way to extend the props list.
This would make it so you don't need to change like 10 other files if BLink changes (or another thing that extends another, like BProgress)
What I would like to see is in the rendered table section for the component reference, a new "group" is made, the group has the header of its extended props, then in its section it declares all of its data.
What I would like to see is something like this:
(I'd like to see the "main props" without a formal "group", all the main ones are just at the top, implicitly stating that they are the "main" props)
Its a bit of a challenge, technically speaking. You'd have to: create a new property on the component reference data, import the sub-data, then copy the omit() function to remove keys like omit(BButtonProps, ['variant'])
, put the correct prop data on the component reference, then go into the Vue file and have the logic build out. I'm also doubting that BTable is in a position to fulfill this out of the box.
However, when its done, it will be a lot more straightforward than re-declaring each prop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(#1584)
…component-reference
@@ -10,16 +10,19 @@ export interface ComponentReference { | |||
type: string | |||
description?: string | |||
default?: unknown | |||
children?: Omit<ComponentReference['props'][number], 'children'>[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better way would be to extend the entire props list at once. Rather than declaring a prop a child of something else. Then just using the entire list
Of course, you will need to omit the real values, you can probably reuse the util -- its called omit
. I think its in object.ts
Something like
props: [],
parentProps: {
BLink: omit(BLinkProps, ['event', '/* some other omitted props*/]),
SomeOtherFakeComponent: ... // and so on
}
You can then use Object.entries and whatnot. The parentProps is probably something like Record<string, PropsReference>
where you'd need to extract the stuff from "props" into its own type
…component-reference
This PR is stale because it has been open for 45 days with no activity. It will not be auto-closed |
Describe the PR
Change on BButtonGroup & BButtonToolbar
Small replication
A small replication or video walkthrough can help demonstrate the changes made. This is optional, but can help observe the intended changes. A mentioned issue that contains a replication also works.
PR checklist
What kind of change does this PR introduce? (check at least one)
fix(...)
feat(...)
fix(...)
docs(...)
The PR fulfills these requirements:
CHANGELOG
is generated from these messages, and determines the next version type. Pull requests that do not follow conventional commits or do not have an override will be denied