@ditojs/admin 2.28.1 → 2.29.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.28.1",
3
+ "version": "2.29.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.28.0",
37
- "@ditojs/utils": "^2.28.0",
36
+ "@ditojs/ui": "^2.29.0",
37
+ "@ditojs/utils": "^2.29.0",
38
38
  "@kyvg/vue3-notification": "^3.2.1",
39
39
  "@lk77/vue3-color": "^3.0.6",
40
40
  "@tiptap/core": "^2.3.0",
@@ -74,7 +74,7 @@
74
74
  "vue-upload-component": "^3.1.15"
75
75
  },
76
76
  "devDependencies": {
77
- "@ditojs/build": "^2.28.0",
77
+ "@ditojs/build": "^2.29.0",
78
78
  "@vitejs/plugin-vue": "^5.0.4",
79
79
  "@vue/compiler-sfc": "3.4.23",
80
80
  "pug": "^3.0.2",
@@ -83,7 +83,7 @@
83
83
  "vite": "^5.2.10"
84
84
  },
85
85
  "types": "types",
86
- "gitHead": "19a0a2b37e1b5d2089079b6d624912f2a3f03f60",
86
+ "gitHead": "bdf4f66c3d6232f2322dacb088a0611f1e07dc7b",
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.schema, {}, 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.schema,
721
+ this.dataSchema,
719
722
  this.sourceSchema,
720
723
  this.data,
721
724
  this.dataPath,