@ditojs/admin 2.36.0 → 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/dist/dito-admin.es.js +219 -210
- package/dist/dito-admin.umd.js +4 -4
- package/package.json +30 -30
- package/src/DitoContext.js +2 -2
- package/src/components/DitoRoot.vue +2 -4
- package/src/components/DitoSchema.vue +24 -18
- package/src/mixins/SourceMixin.js +1 -0
- package/src/mixins/ValidationMixin.js +3 -0
- package/src/types/DitoTypeComputed.vue +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/admin",
|
|
3
|
-
"version": "2.36.
|
|
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,34 +39,34 @@
|
|
|
39
39
|
"not ie_mob > 0"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@ditojs/ui": "^2.36.
|
|
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",
|
|
46
|
-
"@tiptap/core": "^2.
|
|
47
|
-
"@tiptap/extension-blockquote": "^2.
|
|
48
|
-
"@tiptap/extension-bold": "^2.
|
|
49
|
-
"@tiptap/extension-bullet-list": "^2.
|
|
50
|
-
"@tiptap/extension-code": "^2.
|
|
51
|
-
"@tiptap/extension-code-block": "^2.
|
|
52
|
-
"@tiptap/extension-document": "^2.
|
|
53
|
-
"@tiptap/extension-hard-break": "^2.
|
|
54
|
-
"@tiptap/extension-heading": "^2.
|
|
55
|
-
"@tiptap/extension-history": "^2.
|
|
56
|
-
"@tiptap/extension-horizontal-rule": "^2.
|
|
57
|
-
"@tiptap/extension-italic": "^2.
|
|
58
|
-
"@tiptap/extension-link": "^2.
|
|
59
|
-
"@tiptap/extension-list-item": "^2.
|
|
60
|
-
"@tiptap/extension-ordered-list": "^2.
|
|
61
|
-
"@tiptap/extension-paragraph": "^2.
|
|
62
|
-
"@tiptap/extension-strike": "^2.
|
|
63
|
-
"@tiptap/extension-subscript": "^2.
|
|
64
|
-
"@tiptap/extension-superscript": "^2.
|
|
65
|
-
"@tiptap/extension-text": "^2.
|
|
66
|
-
"@tiptap/extension-text-style": "^2.
|
|
67
|
-
"@tiptap/extension-underline": "^2.
|
|
68
|
-
"@tiptap/pm": "^2.
|
|
69
|
-
"@tiptap/vue-3": "^2.
|
|
46
|
+
"@tiptap/core": "^2.9.1",
|
|
47
|
+
"@tiptap/extension-blockquote": "^2.9.1",
|
|
48
|
+
"@tiptap/extension-bold": "^2.9.1",
|
|
49
|
+
"@tiptap/extension-bullet-list": "^2.9.1",
|
|
50
|
+
"@tiptap/extension-code": "^2.9.1",
|
|
51
|
+
"@tiptap/extension-code-block": "^2.9.1",
|
|
52
|
+
"@tiptap/extension-document": "^2.9.1",
|
|
53
|
+
"@tiptap/extension-hard-break": "^2.9.1",
|
|
54
|
+
"@tiptap/extension-heading": "^2.9.1",
|
|
55
|
+
"@tiptap/extension-history": "^2.9.1",
|
|
56
|
+
"@tiptap/extension-horizontal-rule": "^2.9.1",
|
|
57
|
+
"@tiptap/extension-italic": "^2.9.1",
|
|
58
|
+
"@tiptap/extension-link": "^2.9.1",
|
|
59
|
+
"@tiptap/extension-list-item": "^2.9.1",
|
|
60
|
+
"@tiptap/extension-ordered-list": "^2.9.1",
|
|
61
|
+
"@tiptap/extension-paragraph": "^2.9.1",
|
|
62
|
+
"@tiptap/extension-strike": "^2.9.1",
|
|
63
|
+
"@tiptap/extension-subscript": "^2.9.1",
|
|
64
|
+
"@tiptap/extension-superscript": "^2.9.1",
|
|
65
|
+
"@tiptap/extension-text": "^2.9.1",
|
|
66
|
+
"@tiptap/extension-text-style": "^2.9.1",
|
|
67
|
+
"@tiptap/extension-underline": "^2.9.1",
|
|
68
|
+
"@tiptap/pm": "^2.9.1",
|
|
69
|
+
"@tiptap/vue-3": "^2.9.1",
|
|
70
70
|
"@vueuse/integrations": "^11.1.0",
|
|
71
71
|
"codeflask": "^1.4.1",
|
|
72
72
|
"filesize": "^10.1.6",
|
|
@@ -77,16 +77,16 @@
|
|
|
77
77
|
"tinycolor2": "^1.6.0",
|
|
78
78
|
"tippy.js": "^6.3.7",
|
|
79
79
|
"type-fest": "^4.26.1",
|
|
80
|
-
"vue": "^3.5.
|
|
80
|
+
"vue": "^3.5.12",
|
|
81
81
|
"vue-multiselect": "^3.1.0",
|
|
82
82
|
"vue-router": "^4.4.5",
|
|
83
83
|
"vue-upload-component": "^3.1.17"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@ditojs/build": "^2.36.
|
|
86
|
+
"@ditojs/build": "^2.36.2",
|
|
87
87
|
"typescript": "^5.6.3",
|
|
88
|
-
"vite": "^5.4.
|
|
88
|
+
"vite": "^5.4.10"
|
|
89
89
|
},
|
|
90
90
|
"types": "types",
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "1fe383dfcdd9f856f324450d60c081be51071cf9"
|
|
92
92
|
}
|
package/src/DitoContext.js
CHANGED
|
@@ -32,10 +32,10 @@ function toObject(context) {
|
|
|
32
32
|
if (object) break
|
|
33
33
|
raw = Object.getPrototypeOf(raw)
|
|
34
34
|
} while (raw)
|
|
35
|
-
if (raw !== rawStart) {
|
|
35
|
+
if (object && raw !== rawStart) {
|
|
36
36
|
// Assign the passed context with the original object as well, so we don't
|
|
37
37
|
// have to search for it again:
|
|
38
|
-
contexts.set(
|
|
38
|
+
contexts.set(raw, object)
|
|
39
39
|
}
|
|
40
40
|
return object
|
|
41
41
|
}
|
|
@@ -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
|
-
|
|
128
|
-
|
|
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
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
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
|
|
@@ -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, '
|
|
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
|