@ditojs/admin 2.34.2 → 2.34.3
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 +1081 -1069
- package/dist/dito-admin.umd.js +5 -5
- package/package.json +2 -2
- package/src/components/DitoTreeItem.vue +19 -2
- package/src/mixins/DitoMixin.js +3 -3
- package/src/types/DitoTypeMarkup.vue +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/admin",
|
|
3
|
-
"version": "2.34.
|
|
3
|
+
"version": "2.34.3",
|
|
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",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"vite": "^5.4.8"
|
|
92
92
|
},
|
|
93
93
|
"types": "types",
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "5a5381114ae8012a9111015e2279fbc9e322c73a"
|
|
95
95
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
'dito-active': active
|
|
7
7
|
}`
|
|
8
8
|
:style="level > 0 && { '--level': level }"
|
|
9
|
+
:data-path="path"
|
|
9
10
|
)
|
|
10
11
|
.dito-tree-header(
|
|
11
12
|
v-if="label"
|
|
@@ -271,22 +272,38 @@ export default DitoComponent.component('DitoTreeItem', {
|
|
|
271
272
|
return appendDataPath(this.dataPath, property.name)
|
|
272
273
|
},
|
|
273
274
|
|
|
274
|
-
|
|
275
|
+
editPath(path) {
|
|
275
276
|
// All we got to do is push the right edit path to the router, the rest
|
|
276
277
|
// is handled by our routes, allowing reloads as well.
|
|
277
278
|
this.$router.push({
|
|
278
|
-
path: `${this.container.path}${
|
|
279
|
+
path: `${this.container.path}${path}`,
|
|
279
280
|
// Preserve current query
|
|
280
281
|
query: this.$route.query
|
|
281
282
|
})
|
|
282
283
|
},
|
|
283
284
|
|
|
285
|
+
onEdit() {
|
|
286
|
+
this.editPath(this.path)
|
|
287
|
+
},
|
|
288
|
+
|
|
284
289
|
onDelete() {
|
|
285
290
|
// TODO: Implement!
|
|
286
291
|
},
|
|
287
292
|
|
|
288
293
|
onChange() {
|
|
289
294
|
this.container.onChange()
|
|
295
|
+
},
|
|
296
|
+
|
|
297
|
+
// @override
|
|
298
|
+
onEndDrag(event) {
|
|
299
|
+
SortableMixin.methods.onEndDrag.call(this, event)
|
|
300
|
+
const { item } = event
|
|
301
|
+
// Preserve active state of edited sub-items, by editing their new path.
|
|
302
|
+
if (item.classList.contains('dito-active')) {
|
|
303
|
+
this.$nextTick(() => {
|
|
304
|
+
this.editPath(event.item.dataset.path)
|
|
305
|
+
})
|
|
306
|
+
}
|
|
290
307
|
}
|
|
291
308
|
}
|
|
292
309
|
})
|
package/src/mixins/DitoMixin.js
CHANGED
|
@@ -234,9 +234,9 @@ export default {
|
|
|
234
234
|
}
|
|
235
235
|
if (!store) {
|
|
236
236
|
store = this.setStore(key, reactive({}))
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
237
|
+
}
|
|
238
|
+
if (index != null) {
|
|
239
|
+
this.setStoreKeyByIndex(index, key)
|
|
240
240
|
}
|
|
241
241
|
return store
|
|
242
242
|
},
|
|
@@ -373,11 +373,11 @@ export default DitoTypeComponent.register('markup', {
|
|
|
373
373
|
|
|
374
374
|
HardBreak.extend({
|
|
375
375
|
addKeyboardShortcuts: () => {
|
|
376
|
-
const
|
|
376
|
+
const setHardBreak = () => this.editor.commands.setHardBreak()
|
|
377
377
|
return {
|
|
378
|
-
'Mod-Enter':
|
|
379
|
-
'Shift-Enter':
|
|
380
|
-
...(this.hardBreak ? { Enter:
|
|
378
|
+
'Mod-Enter': setHardBreak,
|
|
379
|
+
'Shift-Enter': setHardBreak,
|
|
380
|
+
...(this.hardBreak ? { Enter: setHardBreak } : null)
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
})
|