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
- column.required[mode.value] &&
104
- (currentValues.value[column.name] === undefined || currentValues.value[column.name] === null || currentValues.value[column.name] === '' || (column.isArray?.enabled && !currentValues.value[column.name].length)) &&
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
- (customComponentsEmptiness.value?.value?.[column.name] !== false)
108
-
109
- ) {
110
- return t('This field is required');
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.7.0-next.19",
3
+ "version": "1.7.0-next.20",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",