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

Added feature to have a quick date(s) that input the defined date or a … #4276

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Bond-Addict
Copy link
Contributor

Description

This allow a quick date property. When used, it allows for a on key letter input. By default this allows you to quickly select today simply by adding the property and then hitting the 't' key. You can pass it any date or date string and even change what key you want to trigger the change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any feature but make things better)

@Bond-Addict
Copy link
Contributor Author

Please dont approve until the branch can be built and storybook can run. Currently there is an issue where the code breaks just simply being in a different branch than dev.

@Bond-Addict Bond-Addict marked this pull request as draft May 22, 2024 20:18
@Bond-Addict Bond-Addict changed the title Added feature to have a quick date that inputs the defined date or a … Added feature to have a quick date(s) that input the defined date or a … May 22, 2024
@Bond-Addict Bond-Addict marked this pull request as ready for review May 22, 2024 23:17
@m0ksem
Copy link
Collaborator

m0ksem commented May 24, 2024

@Bond-Addict, how about we allow you to listen for keydown event and handle it manually?

<VaDateInput @keydown="makeQuickDatesHere" />

I don't think we need to include this feature into VaDateInput.

I know there is an issue in DateInput not listening for user events. But you can wrap in div right now. Here is the fix for the issue, will be available in 1.9.11. (#4285)

<div @keydown="...">
  <VaDateInput />
</div>

@m0ksem m0ksem self-requested a review May 24, 2024 00:13
@Bond-Addict
Copy link
Contributor Author

While I do agree this could be handled with just the keydown event on a wrapper, this will require a lot of extra setup and result in a large amount of code duplication. I would compare this to the displayFormatFn I added a bit back.

Although that logic could have been accomplished using the template cell logic, it would have caused a lot of code duplication. And a very large wrapper component that would very difficult to maintain. Since that feature had been added, I've used that on almost every single page of my application which has close to 60 data tables whose display in the table rows needed modifications to ensure they were readable in a format that was understandable.

Rather than having my parent get data from my api for the table to be populated and then also having to have the child custom wrapper table get the data or additional data I'm able to utilize the collection I've already selected to get any property I need and concatenate or transform my cells in any way I need.

Is there a concern about performance?

IMO, this would allow a much easier development process, and i think if it were available, it would be widely utilized. In my case, I plan on using Vuestic as my sole component library on any future projects, and I know my users will want this feature in the future as well.

@m0ksem
Copy link
Collaborator

m0ksem commented May 24, 2024

While I do agree this could be handled with just the keydown event on a wrapper, this will require a lot of extra setup and result in a large amount of code duplication. I would compare this to the displayFormatFn I added a bit back.

Although that logic could have been accomplished using the template cell logic, it would have caused a lot of code duplication. And a very large wrapper component that would very difficult to maintain. Since that feature had been added, I've used that on almost every single page of my application which has close to 60 data tables whose display in the table rows needed modifications to ensure they were readable in a format that was understandable.

Rather than having my parent get data from my api for the table to be populated and then also having to have the child custom wrapper table get the data or additional data I'm able to utilize the collection I've already selected to get any property I need and concatenate or transform my cells in any way I need.

Is there a concern about performance?

IMO, this would allow a much easier development process, and i think if it were available, it would be widely utilized. In my case, I plan on using Vuestic as my sole component library on any future projects, and I know my users will want this feature in the future as well.

While I do agree this could be handled with just the keydown event on a wrapper, this will require a lot of extra setup and result in a large amount of code duplication. I would compare this to the displayFormatFn I added a bit back.

Although that logic could have been accomplished using the template cell logic, it would have caused a lot of code duplication. And a very large wrapper component that would very difficult to maintain. Since that feature had been added, I've used that on almost every single page of my application which has close to 60 data tables whose display in the table rows needed modifications to ensure they were readable in a format that was understandable.

Rather than having my parent get data from my api for the table to be populated and then also having to have the child custom wrapper table get the data or additional data I'm able to utilize the collection I've already selected to get any property I need and concatenate or transform my cells in any way I need.

Is there a concern about performance?

IMO, this would allow a much easier development process, and i think if it were available, it would be widely utilized. In my case, I plan on using Vuestic as my sole component library on any future projects, and I know my users will want this feature in the future as well.

I understand your concern about maintainability, but I don't think we must implement features into components, that can be done with wrapper/composable on user side. Moving this road means implementing every behavior/styles required for specific project by specific users. This adds extra maintainability steps for Vuestic itself. displayFormatFn is extremely must have, because date formats are essential for any apps.

You must have a wrapper if you need to extend basic functionality. That's how UI Frameworks are designed. I must provide you a guide how to extend components easily, including props extending, global redeclaration and template extending. I used Vue.extend in vue2, but I'm not sure what the correct way in vue3 right now.

@Bond-Addict
Copy link
Contributor Author

I understand. I will just utilize your recent fix. Thank you for the consideration

@Bond-Addict
Copy link
Contributor Author

Can you also make the @keydown event work on the regular date picket as well?

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