adminforth 1.3.28 → 1.3.29

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.3.28",
3
+ "version": "1.3.29",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -197,7 +197,13 @@ const columnError = (column) => {
197
197
  if ( column.maxLength && currentValues.value[column.name]?.length > column.maxLength ) {
198
198
  return `This field must be shorter than ${column.maxLength} characters`;
199
199
  }
200
+
200
201
  if ( column.minLength && currentValues.value[column.name]?.length < column.minLength ) {
202
+ // if column.required[mode.value] is false, then we check if the field is empty
203
+ let needToCheckEmpty = column.required[mode.value] || currentValues.value[column.name]?.length > 0;
204
+ if (!needToCheckEmpty) {
205
+ return null;
206
+ }
201
207
  return `This field must be longer than ${column.minLength} characters`;
202
208
  }
203
209
  }
@@ -212,10 +218,12 @@ const columnError = (column) => {
212
218
  return `This field must be less than ${column.maxValue}`;
213
219
  }
214
220
  }
215
-
216
- const error = applyRegexValidation(currentValues.value[column.name], column.validation);
217
- if (error) {
218
- return error;
221
+ console.log('column.validation: ', JSON.stringify(column), 'aa', JSON.stringify(currentValues.value[column.name]));
222
+ if (currentValues.value[column.name] && column.validation) {
223
+ const error = applyRegexValidation(currentValues.value[column.name], column.validation);
224
+ if (error) {
225
+ return error;
226
+ }
219
227
  }
220
228
 
221
229
  return null;
@@ -18,7 +18,8 @@
18
18
  Cancel
19
19
  </button>
20
20
 
21
- <button @click="saveRecord"
21
+ <button
22
+ @click="saveRecord"
22
23
  class="flex items-center py-1 px-3 text-sm font-medium rounded-default text-red-600 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-red-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-red-500 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 disabled:opacity-50"
23
24
  :disabled="saving || (validating && !isValid)"
24
25
  >
@@ -17,8 +17,9 @@
17
17
  Cancel
18
18
  </button>
19
19
 
20
- <button @click="saveRecord"
21
- class="flex items-center py-1 px-3 text-sm font-medium rounded-default text-red-600 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-red-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-red-500 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700"
20
+ <button
21
+ @click="saveRecord"
22
+ class="flex items-center py-1 px-3 text-sm font-medium rounded-default text-red-600 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-red-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-red-500 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 disabled:opacity-50"
22
23
  :disabled="saving || (validating && !isValid)"
23
24
  >
24
25
  <IconFloppyDiskSolid class="w-4 h-4" />
@@ -1524,17 +1524,17 @@ export type ValidationObject = {
1524
1524
  /**
1525
1525
  * Whether to check case sensitivity (i flag)
1526
1526
  */
1527
- caseSensitive: boolean,
1527
+ caseSensitive?: boolean,
1528
1528
 
1529
1529
  /**
1530
1530
  * Whether to check Multiline strings (m flag)
1531
1531
  */
1532
- multiline: boolean,
1532
+ multiline?: boolean,
1533
1533
 
1534
1534
  /**
1535
1535
  * Whether to check global strings (g flag)
1536
1536
  */
1537
- global: boolean
1537
+ global?: boolean
1538
1538
  }
1539
1539
 
1540
1540
  export type AdminForthComponentDeclarationFull = {