@ditojs/admin 2.27.2 → 2.28.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/dist/dito-admin.es.js +17 -14
- package/dist/dito-admin.umd.js +4 -4
- package/package.json +8 -8
- package/src/components/DitoForm.vue +3 -3
- package/src/mixins/DitoMixin.js +1 -1
- package/src/mixins/ResourceMixin.js +5 -5
- package/src/mixins/SourceMixin.js +1 -1
- package/src/types/DitoTypeMarkup.vue +9 -1
- package/src/types/DitoTypeUpload.vue +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/admin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.28.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.
|
|
37
|
-
"@ditojs/utils": "^2.
|
|
36
|
+
"@ditojs/ui": "^2.28.0",
|
|
37
|
+
"@ditojs/utils": "^2.28.0",
|
|
38
38
|
"@kyvg/vue3-notification": "^3.2.1",
|
|
39
39
|
"@lk77/vue3-color": "^3.0.6",
|
|
40
40
|
"@tiptap/core": "^2.3.0",
|
|
@@ -70,20 +70,20 @@
|
|
|
70
70
|
"type-fest": "^4.15.0",
|
|
71
71
|
"vue": "3.4.10",
|
|
72
72
|
"vue-multiselect": "^3.0.0",
|
|
73
|
-
"vue-router": "^4.3.
|
|
73
|
+
"vue-router": "^4.3.2",
|
|
74
74
|
"vue-upload-component": "^3.1.15"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@ditojs/build": "^2.
|
|
77
|
+
"@ditojs/build": "^2.28.0",
|
|
78
78
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
79
|
-
"@vue/compiler-sfc": "3.4.
|
|
79
|
+
"@vue/compiler-sfc": "3.4.23",
|
|
80
80
|
"pug": "^3.0.2",
|
|
81
81
|
"sass": "1.75.0",
|
|
82
82
|
"typescript": "^5.4.5",
|
|
83
|
-
"vite": "^5.2.
|
|
83
|
+
"vite": "^5.2.10"
|
|
84
84
|
},
|
|
85
85
|
"types": "types",
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "2bb631b6048da2d1dcb850d89796c87a4787b258",
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "vite build",
|
|
89
89
|
"watch": "yarn build --mode 'development' --watch",
|
|
@@ -322,8 +322,8 @@ export default DitoComponent.component('DitoForm', {
|
|
|
322
322
|
},
|
|
323
323
|
|
|
324
324
|
// @override ResourceMixin.getResource()
|
|
325
|
-
getResource(
|
|
326
|
-
const resource = ResourceMixin.methods.getResource.call(this,
|
|
325
|
+
getResource(method = 'get') {
|
|
326
|
+
const resource = ResourceMixin.methods.getResource.call(this, method)
|
|
327
327
|
return getMemberResource(this.itemId, resource) || resource
|
|
328
328
|
},
|
|
329
329
|
|
|
@@ -404,7 +404,7 @@ export default DitoComponent.component('DitoForm', {
|
|
|
404
404
|
|
|
405
405
|
// Allow buttons to override both method and resource path to submit to:
|
|
406
406
|
let { method } = this
|
|
407
|
-
let resource = this.getResource(
|
|
407
|
+
let resource = this.getResource(method)
|
|
408
408
|
const buttonResource = getResource(button.schema.resource, {
|
|
409
409
|
parent: resource
|
|
410
410
|
})
|
package/src/mixins/DitoMixin.js
CHANGED
|
@@ -314,7 +314,7 @@ export default {
|
|
|
314
314
|
resource = getResource(resource, {
|
|
315
315
|
// Resources without a parent inherit the one from `dataComponent`
|
|
316
316
|
// automatically.
|
|
317
|
-
parent: this.dataComponent?.resource ?? null
|
|
317
|
+
parent: this.dataComponent?.getResource(resource?.method) ?? null
|
|
318
318
|
})
|
|
319
319
|
return this.api.resources.any(resource)
|
|
320
320
|
},
|
|
@@ -124,13 +124,13 @@ export default {
|
|
|
124
124
|
},
|
|
125
125
|
|
|
126
126
|
methods: {
|
|
127
|
-
getResource(
|
|
127
|
+
getResource(method = 'get') {
|
|
128
128
|
// Returns the resource object representing the resource for the
|
|
129
129
|
// associated source schema.
|
|
130
130
|
return getResource(this.sourceSchema?.resource, {
|
|
131
131
|
type: 'collection',
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
method,
|
|
133
|
+
parent: this.parentResourceComponent?.getResource(method) ?? null
|
|
134
134
|
})
|
|
135
135
|
},
|
|
136
136
|
|
|
@@ -229,7 +229,7 @@ export default {
|
|
|
229
229
|
async handleRequest(
|
|
230
230
|
{
|
|
231
231
|
method,
|
|
232
|
-
resource = this.getResource(
|
|
232
|
+
resource = this.getResource(method),
|
|
233
233
|
query,
|
|
234
234
|
data
|
|
235
235
|
},
|
|
@@ -286,7 +286,7 @@ export default {
|
|
|
286
286
|
|
|
287
287
|
async submit(button) {
|
|
288
288
|
const resource = getResource(button.schema.resource, {
|
|
289
|
-
parent: this.resource
|
|
289
|
+
parent: this.getResource(button.schema.resource?.method)
|
|
290
290
|
})
|
|
291
291
|
if (resource) {
|
|
292
292
|
const { method } = resource
|
|
@@ -208,7 +208,15 @@ export default DitoTypeComponent.register('markup', {
|
|
|
208
208
|
|
|
209
209
|
const onFocus = () => this.onFocus()
|
|
210
210
|
|
|
211
|
-
const onBlur = () => {
|
|
211
|
+
const onBlur = ({ editor }) => {
|
|
212
|
+
// This change handling code on blur is only needed to make e2e testing
|
|
213
|
+
// through puppeteer work, since we couldn't figure out how to trigger
|
|
214
|
+
// tiptap's update events programmatically from the outside.
|
|
215
|
+
const value = editor.getHTML()
|
|
216
|
+
if (value !== this.value) {
|
|
217
|
+
this.value = value
|
|
218
|
+
changed = true
|
|
219
|
+
}
|
|
212
220
|
this.onBlur()
|
|
213
221
|
onChange()
|
|
214
222
|
}
|