Skip to content

Add DateProperty and EmailProperty components#961

Open
Devesh0129 wants to merge 4 commits intodevelopfrom
305-components-depending-on-string-format
Open

Add DateProperty and EmailProperty components#961
Devesh0129 wants to merge 4 commits intodevelopfrom
305-components-depending-on-string-format

Conversation

@Devesh0129
Copy link
Copy Markdown
Collaborator

Paste this schema in Schema → Text View

{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"birthDate": {
"type": "string",
"format": "date"
},
"email": {
"type": "string",
"format": "email"
}
}
}

Then switch to Data → GUI View and verify:

  • name shows a plain text input
  • birthDate shows a date picker calendar
  • email shows an email input with placeholder `email@exam

@Devesh0129 Devesh0129 linked an issue Apr 30, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@Logende Logende left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DateProperty.vue is perfect! Regarding the EmailProperty.vue, it looks to me as if it is the same as the normal string property, except it additionally has a placeholder. If that is the case, to avoid duplication a better approach would be:

  1. No new EmailProperty.vue
  2. In resolveCorrespondingComponent.ts‎, if the type has string and format is email, then IF the schema does not have any examples (undefined or an array of length 0), set node.schema.examples to [ "[email protected]" ]
  3. the email-condition block should not return anything, just modify the schema. Then in the next check, the code would go into the normal StringProperty block and create a StringProperty, but with the newly added example (if no example was provided by the user). Examples are rendered as placeholders, in the same way as you put your custom placeholder.
    @Devesh0129

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.

Components depending on string format

2 participants