umbraco / Umbraco.UIBuilder.Demo

MIT License
0 stars 2 forks source link

Set comment email as Email Address datatype #5

Open bjarnef opened 1 year ago

bjarnef commented 1 year ago

I think it would be great to add an "Email Address" datatype instance:

image

and set this as datatype instead: https://github.com/umbraco/Umbraco.UIBuilder.Demo/blob/main/src/Umbraco.UIBuilder.Demo/UmbracoBuilderExtensions.cs#L47

.AddField(c => c.Email).SetDataType("Email Address").SetValidationRegex("[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+")

or the guid overload method in https://github.com/umbraco/Umbraco.UIBuilder.Issues/issues/67

Eventually it could add constants like this in core: https://github.com/umbraco/Umbraco-CMS/blob/8e609af90168a7c5e088b30193266733269457ec/src/Umbraco.Core/Constants-DataTypes.cs