feat(input-text): add validated success state and text editing context menu to text inputs

This commit is contained in:
2026-04-12 16:58:39 +00:00
parent a0b17132ad
commit 653ef109be
5 changed files with 133 additions and 17 deletions

View File

@@ -229,7 +229,8 @@ export const demoFunc = () => html`
.label=${'Email with Validation'}
.value=${'invalid@'}
.validationFunction=${(value: string) => {
if (value.includes('@') && value.includes('.')) {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (emailRegex.test(value)) {
return { valid: true, message: 'Email address is valid' };
}
return { valid: false, message: 'Please enter a valid email address' };