Skip to content

Commit

Permalink
fix: validate each individual attribute #119
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 committed Dec 17, 2024
1 parent 231fa46 commit 4c90c02
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 30 deletions.
8 changes: 6 additions & 2 deletions components/checkbox/demo/api.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,14 @@ class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down
8 changes: 6 additions & 2 deletions components/checkbox/demo/index.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,14 @@ class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down
16 changes: 12 additions & 4 deletions components/combobox/demo/api.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,14 @@ let AuroFormValidation$1 = class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down Expand Up @@ -5149,10 +5153,14 @@ class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down
16 changes: 12 additions & 4 deletions components/combobox/demo/index.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,14 @@ let AuroFormValidation$1 = class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down Expand Up @@ -5053,10 +5057,14 @@ class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down
16 changes: 12 additions & 4 deletions components/datepicker/demo/api.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,14 @@ let AuroFormValidation$1 = class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down Expand Up @@ -15328,10 +15332,14 @@ class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down
16 changes: 12 additions & 4 deletions components/datepicker/demo/index.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,14 @@ let AuroFormValidation$1 = class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down Expand Up @@ -15076,10 +15080,14 @@ class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down
8 changes: 6 additions & 2 deletions components/input/demo/api.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -1893,10 +1893,14 @@ class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down
8 changes: 6 additions & 2 deletions components/input/demo/index.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -1839,10 +1839,14 @@ class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down
8 changes: 6 additions & 2 deletions components/radio/demo/api.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,14 @@ class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down
8 changes: 6 additions & 2 deletions components/radio/demo/index.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,14 @@ class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down
8 changes: 6 additions & 2 deletions packages/form-validation/src/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ export default class AuroFormValidation {
elem.validity = 'badInput';
elem.setCustomValidity = elem.setCustomValidityBadInput || '';
}
} else if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
}

if (elem.value && elem.value.length > 0 && elem.value.length < elem.minLength) {
elem.validity = 'tooShort';
elem.setCustomValidity = elem.setCustomValidityTooShort || '';
} else if (elem.value && elem.value.length > elem.maxLength) {
}

if (elem.value && elem.value.length > elem.maxLength) {
elem.validity = 'tooLong';
elem.setCustomValidity = elem.setCustomValidityTooLong || '';
}
Expand Down

0 comments on commit 4c90c02

Please sign in to comment.