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

Add instructions and/or example of adding a custom input #202

Open
mlilback opened this issue Aug 30, 2023 · 2 comments
Open

Add instructions and/or example of adding a custom input #202

mlilback opened this issue Aug 30, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mlilback
Copy link

Is your feature request related to a problem? Please describe.
The readme says that "adding new inputs is straightforward". I have no idea how to go about doing this.

Describe the solution you'd like
Please add instructions and/or an example on how to add a new input. Preferably using Web Components so minimal experience with React is necessary. Even a React example would be helpful, though.

@mlilback mlilback added the enhancement New feature or request label Aug 30, 2023
@pvrobays
Copy link
Collaborator

pvrobays commented Sep 6, 2023

Hi @mlilback
Thanks for your question.

Adding new inputs should be quite straightforward but you indeed need to know where to look. Let me try and help you along.

All input components can be found under /src/app/compoments/main/components/group/components/fields. There you'll find all the different input types we currently support in their own directory.

Adding a new one is as simple as:

  1. Add a new directory
  2. Add index.jsx, create your component
  3. add your new component to the fieldMap list in /src/app/components/main/components/group

Once that's done, you should be able to add your new input type in the configuration type, with its own custom options.

Webcomponents can be used (webcomponents in React ), but the React part needed to create a field is very limited so I would advice you to use React if you're going to create a new component from scratch.

To easily test your code, you can use the example application within the repo. To build and run it, use the npm build-example command.

Good luck! I'm curious: what's the component you'd like to add?
If you have any more questions, please let me know.

@mlilback
Copy link
Author

mlilback commented Sep 6, 2023

The app I'm working on lets users save a combination of search filters for convenience.

I'd like a list that shows a detailed description on the side when an item is selected. The list allows deleting but not adding. Reordering would also be useful.

I'm using Quasar which uses Vue, and that's the only modern framework I'm familiar with. But another project I'm doing the server-side for switched to React, so I should be able to figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants