@ditojs/admin 2.36.1 → 2.36.2

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.36.1",
3
+ "version": "2.36.2",
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",
@@ -39,7 +39,7 @@
39
39
  "not ie_mob > 0"
40
40
  ],
41
41
  "dependencies": {
42
- "@ditojs/ui": "^2.36.1",
42
+ "@ditojs/ui": "^2.36.2",
43
43
  "@ditojs/utils": "^2.36.0",
44
44
  "@kyvg/vue3-notification": "^3.4.0",
45
45
  "@lk77/vue3-color": "^3.0.6",
@@ -83,10 +83,10 @@
83
83
  "vue-upload-component": "^3.1.17"
84
84
  },
85
85
  "devDependencies": {
86
- "@ditojs/build": "^2.36.1",
86
+ "@ditojs/build": "^2.36.2",
87
87
  "typescript": "^5.6.3",
88
88
  "vite": "^5.4.10"
89
89
  },
90
90
  "types": "types",
91
- "gitHead": "70fd2abe897c2a4fd5d51cdaa06493c059f05d46"
91
+ "gitHead": "1fe383dfcdd9f856f324450d60c081be51071cf9"
92
92
  }
@@ -119,14 +119,12 @@ export default DitoComponent.component('DitoRoot', {
119
119
  tippyDelegate(this.$el, {
120
120
  target: '.dito-info',
121
121
  theme: 'info',
122
- appendTo: node => node.closest('.dito-pane'),
123
122
  animation: 'shift-away-subtle',
124
123
  interactive: true,
125
124
  delay: 250,
126
125
  zIndex: 1,
127
- onShow(instance) {
128
- instance.setContent(instance.reference.dataset.info)
129
- }
126
+ appendTo: node => node.closest('.dito-pane'),
127
+ onShow: instance => instance.setContent(instance.reference.dataset.info)
130
128
  })
131
129
 
132
130
  // Clear the label marked as active on all mouse and keyboard events, except
@@ -598,26 +598,32 @@ export default DitoComponent.component('DitoSchema', {
598
598
  while (dataPathParts.length > 0) {
599
599
  const components = this.getComponentsByDataPath(dataPathParts)
600
600
  for (const component of components) {
601
- if (
602
- await component.navigateToComponent?.(
603
- fullDataPath,
604
- subComponents => {
605
- let found = false
606
- for (const component of subComponents) {
607
- const errs = errors[component.dataPath]
608
- if (
609
- errs &&
610
- component.showValidationErrors(errs, first && focus)
611
- ) {
612
- found = true
613
- first = false
614
- break
615
- }
601
+ const navigated = await component.navigateToComponent?.(
602
+ fullDataPath,
603
+ subComponents => {
604
+ let found = false
605
+ for (const component of subComponents) {
606
+ const matched = Object.fromEntries(
607
+ Object.entries(errors).filter(
608
+ ([dataPath]) =>
609
+ normalizeDataPath(dataPath).startsWith(
610
+ component.dataPath
611
+ )
612
+ )
613
+ )
614
+ if (
615
+ Object.keys(matched).length > 0 &&
616
+ component.showValidationErrors(matched, first && focus)
617
+ ) {
618
+ found = true
619
+ first = false
620
+ break
616
621
  }
617
- return found
618
622
  }
619
- )
620
- ) {
623
+ return found
624
+ }
625
+ )
626
+ if (navigated) {
621
627
  // Found a nested form to display at least parts fo the errors.
622
628
  // We can't show all errors at once, so we're done. Don't call
623
629
  // `notifyErrors()` yet, as we can only display it once
@@ -587,6 +587,7 @@ export default {
587
587
  this.$nextTick(callOnComplete)
588
588
  })
589
589
  }
590
+ return
590
591
  }
591
592
  // Keep removing the last part until we find a match.
592
593
  dataPathParts.pop()
@@ -95,6 +95,9 @@ export default {
95
95
  showValidationErrors(errors, focus) {
96
96
  // Convert from AJV errors objects to an array of error messages
97
97
  this.errors = []
98
+ if (errors.length === 0) {
99
+ return false
100
+ }
98
101
  for (const { message } of errors) {
99
102
  this.addError(message, true)
100
103
  }
@@ -31,7 +31,7 @@ export default DitoTypeComponent.register(
31
31
  get() {
32
32
  const { schema } = this
33
33
  if (schema.data || schema.dataPath) {
34
- const value = this.handleDataSchema(schema, 'schema')
34
+ const value = this.handleDataSchema(schema, 'value')
35
35
  // TODO: Fix side-effects
36
36
  // eslint-disable-next-line max-len
37
37
  // eslint-disable-next-line vue/no-side-effects-in-computed-properties