-
-
Notifications
You must be signed in to change notification settings - Fork 32
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: Select
component
#18
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for vue-termui ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
I wonder if this should be really different: like the input component, it does look a lot like the prompts version but it could be so much more. I wonder if by having relative + absolute positioned boxes we could recreate the select menu that exists on the browser and cycle through them with tab (using the useFocusable()
)
we could also have both versions but I don't think we should have the submit
event for example, that should be handled at a higher level
I think I need to write one of these to better explain what I mean by something really interactive. I will try to give the select a try and open a new PR if you want?
type: [String, Number], | ||
required: true, | ||
}, | ||
indicator: { |
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.
Do you think this is more interesting that having two different props?
}, | ||
}) | ||
|
||
export const TuiOption = defineComponent({ |
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.
I think they can each of them have their own file 😄
<Option :value="item.value" v-for="(item, index) in options" :key="index"> | ||
<template v-slot="{ isActive }"> | ||
<Box flexDirection="column"> | ||
<Text :dimmed="isActive" :underline="isActive">{{ item.label }}</Text> | ||
</Box> | ||
</template> | ||
</Option> |
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.
Ideally, this should look like this:
<Option :value="item.value" v-for="(item, index) in options" :key="index"> | |
<template v-slot="{ isActive }"> | |
<Box flexDirection="column"> | |
<Text :dimmed="isActive" :underline="isActive">{{ item.label }}</Text> | |
</Box> | |
</template> | |
</Option> | |
<Option :value="item.value" v-for="(item, index) in options" :key="index"> | |
{{ item.label }} | |
</Option> |
and even allow not passing the value
prop. We can achieve this by using inject/provide. The v-slot
api is nice to allow the user further customization though
Sure,It's nice to see the PR. |
select-component.mov