@ditojs/admin 2.15.0 → 2.17.0

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": "@ditojs/admin",
3
- "version": "2.15.0",
3
+ "version": "2.17.0",
4
4
  "type": "module",
5
5
  "description": "Dito.js Admin is a schema based admin interface for Dito.js Server, featuring auto-generated views and forms and built with Vue.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/master/packages/admin",
@@ -33,8 +33,8 @@
33
33
  "not ie_mob > 0"
34
34
  ],
35
35
  "dependencies": {
36
- "@ditojs/ui": "^2.15.0",
37
- "@ditojs/utils": "^2.15.0",
36
+ "@ditojs/ui": "^2.17.0",
37
+ "@ditojs/utils": "^2.17.0",
38
38
  "@kyvg/vue3-notification": "^3.0.2",
39
39
  "@lk77/vue3-color": "^3.0.6",
40
40
  "@tiptap/core": "^2.1.12",
@@ -67,23 +67,23 @@
67
67
  "sortablejs": "^1.15.0",
68
68
  "tinycolor2": "^1.6.0",
69
69
  "tippy.js": "^6.3.7",
70
- "type-fest": "^4.8.1",
71
- "vue": "^3.3.8",
70
+ "type-fest": "^4.8.2",
71
+ "vue": "^3.3.9",
72
72
  "vue-multiselect": "^3.0.0-beta.3",
73
73
  "vue-router": "^4.2.5",
74
74
  "vue-upload-component": "^3.1.8"
75
75
  },
76
76
  "devDependencies": {
77
- "@ditojs/build": "^2.15.0",
77
+ "@ditojs/build": "^2.17.0",
78
78
  "@vitejs/plugin-vue": "^4.5.0",
79
- "@vue/compiler-sfc": "^3.3.8",
79
+ "@vue/compiler-sfc": "^3.3.9",
80
80
  "pug": "^3.0.2",
81
81
  "sass": "1.69.5",
82
82
  "typescript": "^5.3.2",
83
- "vite": "^5.0.0"
83
+ "vite": "^5.0.4"
84
84
  },
85
85
  "types": "types",
86
- "gitHead": "46264fec6c56b192695fa113059ddb1fcb20da94",
86
+ "gitHead": "e0609d98891263c136320e65480c42ad7a289b4b",
87
87
  "scripts": {
88
88
  "build": "vite build",
89
89
  "watch": "yarn build --mode 'development' --watch",
@@ -559,10 +559,10 @@ export default DitoComponent.component('DitoSchema', {
559
559
  return this.validateAll(match, false)
560
560
  },
561
561
 
562
- async showValidationErrors(errors, focus) {
562
+ async showValidationErrors(errors, focus, first = true) {
563
563
  this.clearErrors()
564
- let first = true
565
564
  const unmatched = []
565
+ const wasFirst = first
566
566
  for (const [dataPath, errs] of Object.entries(errors)) {
567
567
  // If the schema is a data-root, prefix its own dataPath to all errors,
568
568
  // since the data that it sends and validates will be unprefixed.
@@ -579,6 +579,7 @@ export default DitoComponent.component('DitoSchema', {
579
579
  if (component.showValidationErrors(errs, first && focus)) {
580
580
  found = true
581
581
  first = false
582
+ break
582
583
  }
583
584
  }
584
585
  if (!found) {
@@ -602,6 +603,7 @@ export default DitoComponent.component('DitoSchema', {
602
603
  ) {
603
604
  found = true
604
605
  first = false
606
+ break
605
607
  }
606
608
  }
607
609
  return found
@@ -630,9 +632,10 @@ export default DitoComponent.component('DitoSchema', {
630
632
  }
631
633
  first = false
632
634
  }
633
- if (!first) {
635
+ if (wasFirst && !first) {
634
636
  this.notifyErrors(unmatched.join('\n'))
635
637
  }
638
+ return !first
636
639
  },
637
640
 
638
641
  notifyErrors(message) {
@@ -43,10 +43,15 @@ export default {
43
43
  this.schemaComponents.forEach(it => it.clearErrors())
44
44
  },
45
45
 
46
- showValidationErrors(errors, focus) {
46
+ showValidationErrors(errors, focus, first = true) {
47
47
  this.schemaComponents.forEach(
48
- it => it.showValidationErrors(errors, focus)
48
+ schemaComponent => {
49
+ if (schemaComponent.showValidationErrors(errors, focus, first)) {
50
+ first = false
51
+ }
52
+ }
49
53
  )
54
+ return !first
50
55
  }
51
56
  }
52
57
  }