Open zewa666 opened 4 years ago
hey @zewa666, thanks!
aurelia-validation
- I'm currently using ajv for validation, however I'm not fond of it..primarily because its difficult to customize error messages, and the ajv-errors
package requires redefining the error messages in the json schema document where I would prefer to use the ui schema. I may need some help with using aurelia-validation
, my previous experience with it was rocky but I don't recall the reasons. See my first attempt to make a schema form based plugin using aurelia-validation
: https://github.com/jbockle/aurelia-json-schema-form category
not quite sure what you mean, can you elaborate?optional
this is determined by json schema required
fieldcustom
components are already supported! I don't have much documented yet, but I'll circle back with a demo sometime when things are more stableorder
prop - that's a really good idea, I'll have to think about the right approach for thishidden/visible
- definitely a planned itemhey there, yep you're right with optional, I just see with used that one for a totally different use case. With regards to category what I meant there is that imagine your form consists of 2 or more sections which group inputs together. E.g in a feedback form a section could be about the feedback itself another one about personal details and a third one about notifications, where each of the sections contains a few form elements. Having the group, would help to render the form differently, e.g add a header on top of every section.
EDIT: here's a screenshot of what I meant. Essentially all these sections on the left side are powered by one json schema and the right sections shows the individual elements of each group
Ahh I see-I currently support this with a named 'ui:viewSlot' ui schema option. It essentially wraps the json schema element in another component similar to how you would expect <slot>
's work, however due to aurelia <slot>
limitations, I'm fulfilling this using an InlineViewStrategy
to build out the template. I like the complexity shown in your screenshot, I'm going to try to mimic that into my dev-app for a better example until I'm ready to dive into documentation.
It's awesome to see others have the same idea and even go the way to create a plugin. Kudos for that @jbockle. With Ranorex Webtestit we're building an IDE which hosts the Monaco Editor. That has the ability to show intellisense based on a given json schema. One of those schemas we use e.g for our settings file, which can be manipulated both in the editor but also in a dynamically built settings dialog. We've flavoured the schema with additional property like a
category
which then is used for the navigation sidebar to group co-located settings orconditionals
so that e.g typescript specific settings aren't shown if your projects language is python.So I thought I'd list a few use case ideas which might be of interest for your project to keep in mind.
category
prop to determine grouping of fieldsoptional
property to determine whether a form field has to be filled outcustom
components through additional configurationorder
prop for how things should get listedhidden/visible
to determine at runtime whether a component should be rendered or not