adminforth 1.7.0-next.19 → 1.7.0-next.20
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.
|
@@ -99,15 +99,24 @@ const columnError = (column) => {
|
|
|
99
99
|
return customComponentsInValidity.value?.value?.[column.name];
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
if ( column.required[mode.value] ) {
|
|
103
|
+
const naturalEmptiness = currentValues.value[column.name] === undefined ||
|
|
104
|
+
currentValues.value[column.name] === null ||
|
|
105
|
+
currentValues.value[column.name] === '' ||
|
|
106
|
+
(column.isArray?.enabled && !currentValues.value[column.name].length);
|
|
107
|
+
|
|
108
|
+
const emitedEmptiness = customComponentsEmptiness.value?.value?.[column.name];
|
|
105
109
|
// if component is custum it might tell other criteria for emptiness by emitting 'update:emptiness'
|
|
106
110
|
// components which do not emit 'update:emptiness' will have undefined value in customComponentsEmptiness
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
let actualEmptiness;
|
|
112
|
+
if (emitedEmptiness !== undefined) {
|
|
113
|
+
actualEmptiness = emitedEmptiness;
|
|
114
|
+
} else {
|
|
115
|
+
actualEmptiness = naturalEmptiness;
|
|
116
|
+
}
|
|
117
|
+
if (actualEmptiness) {
|
|
118
|
+
return t('This field is required');
|
|
119
|
+
}
|
|
111
120
|
}
|
|
112
121
|
if (column.type === 'json' && !column.isArray?.enabled && currentValues.value[column.name]) {
|
|
113
122
|
try {
|