@ditojs/admin 2.28.1 → 2.28.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.28.
|
|
3
|
+
"version": "2.28.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",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"vite": "^5.2.10"
|
|
84
84
|
},
|
|
85
85
|
"types": "types",
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "a9db3666df01cb3ee66a0ec7525d9221e15c5655",
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "vite build",
|
|
89
89
|
"watch": "yarn build --mode 'development' --watch",
|
|
@@ -8,6 +8,7 @@ component.dito-panel(
|
|
|
8
8
|
)
|
|
9
9
|
DitoSchema.dito-panel__schema(
|
|
10
10
|
:schema="panelSchema"
|
|
11
|
+
:dataSchema="panelDataSchema"
|
|
11
12
|
:dataPath="panelDataPath"
|
|
12
13
|
:data="panelData"
|
|
13
14
|
:meta="meta"
|
|
@@ -114,6 +115,10 @@ export default DitoComponent.component('DitoPanel', {
|
|
|
114
115
|
return this.hasOwnData ? 'form' : 'div'
|
|
115
116
|
},
|
|
116
117
|
|
|
118
|
+
panelDataSchema() {
|
|
119
|
+
return this.hasOwnData ? this.schema : this.schemaComponent.schema
|
|
120
|
+
},
|
|
121
|
+
|
|
117
122
|
panelDataPath() {
|
|
118
123
|
// If the panel provides its own data, then it needs to prefix all
|
|
119
124
|
// components with its data-path, but if it shares data with the schema
|
|
@@ -145,6 +145,9 @@ export default DitoComponent.component('DitoSchema', {
|
|
|
145
145
|
|
|
146
146
|
props: {
|
|
147
147
|
schema: { type: Object, required: true },
|
|
148
|
+
// `dataSchema` is only provided for panels, where the panel schema
|
|
149
|
+
// is different from the data schema for panels without own data.
|
|
150
|
+
dataSchema: { type: Object, default: props => props.schema },
|
|
148
151
|
dataPath: { type: String, default: '' },
|
|
149
152
|
data: { type: Object, default: null },
|
|
150
153
|
meta: { type: Object, default: () => ({}) },
|
|
@@ -675,7 +678,7 @@ export default DitoComponent.component('DitoSchema', {
|
|
|
675
678
|
// We can't set `this.data = ...` because it's a property, but we can set
|
|
676
679
|
// all known properties on it to the values returned by
|
|
677
680
|
// `setDefaultValues()`, as they are all reactive already from the starts:
|
|
678
|
-
Object.assign(this.data, setDefaultValues(this.
|
|
681
|
+
Object.assign(this.data, setDefaultValues(this.dataSchema, {}, this))
|
|
679
682
|
this.clearErrors()
|
|
680
683
|
},
|
|
681
684
|
|
|
@@ -715,7 +718,7 @@ export default DitoComponent.component('DitoSchema', {
|
|
|
715
718
|
|
|
716
719
|
processData({ target = 'clipboard', schemaOnly = true } = {}) {
|
|
717
720
|
return processData(
|
|
718
|
-
this.
|
|
721
|
+
this.dataSchema,
|
|
719
722
|
this.sourceSchema,
|
|
720
723
|
this.data,
|
|
721
724
|
this.dataPath,
|