dwyl / abase

:house: A (solid) Base for your Web Application.
9 stars 0 forks source link

Schema mapping to html form input types #14

Open samhstn opened 7 years ago

samhstn commented 7 years ago

Decide on what joi data types should map to which html input types.

e.g.

Joi.string().email() -> <input type="email" />
eliasmalik commented 7 years ago

Proposal:

Joi.array --> unsupported
Joi.boolean --> <input type="checkbox">
Joi.binary --> <input type="radio">
Joi.date --> <input type="date">
Joi.func --> unsupported
Joi.number --> <input type="number"> // type="number" intended for floationg point...suitable for ints?
Joi.object --> unsupported
Joi.string --> <input type="text">
Joi.string.min(>140) --> <textarea>
Joi.string.length(>140) --> <textarea>
Joi.string.isoDate --> <input type="date">
Joi.string.email --> <input type="email">
Joi.string.isoDate --> <input type="date">
Joi.any() --> <select><option>....</select>
nelsonic commented 7 years ago

@shouston3 / @eliascodes this is a really good list. (understanding the types of data we want to capture, validate and store)