@truenas/ui-components 0.1.29 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4148,8 +4148,13 @@ class TnFormFieldComponent {
|
|
|
4148
4148
|
if (errors['max']) {
|
|
4149
4149
|
return `Maximum value is ${errors['max'].max}`;
|
|
4150
4150
|
}
|
|
4151
|
-
// Return custom error message if
|
|
4152
|
-
|
|
4151
|
+
// Return custom error message if the value is a string, otherwise use the key
|
|
4152
|
+
const firstKey = Object.keys(errors)[0];
|
|
4153
|
+
if (firstKey) {
|
|
4154
|
+
const value = errors[firstKey];
|
|
4155
|
+
return typeof value === 'string' ? value : firstKey;
|
|
4156
|
+
}
|
|
4157
|
+
return 'Invalid input';
|
|
4153
4158
|
}
|
|
4154
4159
|
showError = computed(() => {
|
|
4155
4160
|
return this.hasError() && !!this.errorMessage();
|