@ditojs/admin 2.44.0 → 2.45.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 +16 -22
- package/dist/dito-admin.umd.js +2 -2
- package/package.json +8 -8
- package/src/components/DitoTreeItem.vue +26 -25
- package/src/types/DitoTypeList.vue +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/admin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.45.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",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"not ie_mob > 0"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@ditojs/ui": "^2.
|
|
43
|
-
"@ditojs/utils": "^2.
|
|
42
|
+
"@ditojs/ui": "^2.45.0",
|
|
43
|
+
"@ditojs/utils": "^2.45.0",
|
|
44
44
|
"@kyvg/vue3-notification": "^3.4.1",
|
|
45
45
|
"@lk77/vue3-color": "^3.0.6",
|
|
46
46
|
"@tiptap/core": "^2.11.5",
|
|
@@ -72,22 +72,22 @@
|
|
|
72
72
|
"filesize": "^10.1.6",
|
|
73
73
|
"filesize-parser": "^1.5.1",
|
|
74
74
|
"focus-trap": "^7.6.4",
|
|
75
|
-
"nanoid": "^5.1.
|
|
75
|
+
"nanoid": "^5.1.5",
|
|
76
76
|
"sortablejs": "^1.15.6",
|
|
77
77
|
"tinycolor2": "^1.6.0",
|
|
78
78
|
"tippy.js": "^6.3.7",
|
|
79
79
|
"tiptap-footnotes": "^2.0.3",
|
|
80
|
-
"type-fest": "^4.
|
|
80
|
+
"type-fest": "^4.38.0",
|
|
81
81
|
"vue": "^3.5.13",
|
|
82
82
|
"vue-multiselect": "^3.2.0",
|
|
83
83
|
"vue-router": "^4.5.0",
|
|
84
84
|
"vue-upload-component": "^3.1.17"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@ditojs/build": "^2.
|
|
87
|
+
"@ditojs/build": "^2.45.0",
|
|
88
88
|
"typescript": "^5.8.2",
|
|
89
|
-
"vite": "^6.2.
|
|
89
|
+
"vite": "^6.2.3"
|
|
90
90
|
},
|
|
91
91
|
"types": "types",
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "dfcb589d51438ee3d7ef0c34017cd7090e691653"
|
|
93
93
|
}
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
DitoDraggable(
|
|
77
77
|
v-if="childrenSchema"
|
|
78
78
|
v-show="opened"
|
|
79
|
-
:modelValue="updateOrder(childrenSchema, childrenList)"
|
|
80
79
|
:options="getDraggableOptions(true)"
|
|
81
80
|
:draggable="childrenDraggable"
|
|
81
|
+
:modelValue="updateOrder(childrenSchema, childrenList)"
|
|
82
82
|
@update:modelValue="value => (childrenList = value)"
|
|
83
83
|
)
|
|
84
84
|
DitoTreeItem(
|
|
@@ -160,15 +160,24 @@ export default DitoComponent.component('DitoTreeItem', {
|
|
|
160
160
|
|
|
161
161
|
childrenList: {
|
|
162
162
|
get() {
|
|
163
|
-
const name = this.childrenSchema
|
|
164
|
-
|
|
163
|
+
const { name, orderKey } = this.childrenSchema ?? {}
|
|
164
|
+
const value = name && this.data[name]
|
|
165
|
+
// In order to fix reactivity for `updateOrder()` at root level of tree
|
|
166
|
+
// views, we need to access all order keys once, in order to track them
|
|
167
|
+
// for reactivity.
|
|
168
|
+
// TODO: Find a proper fix.
|
|
169
|
+
value?.map(child => child[orderKey])
|
|
170
|
+
return value
|
|
165
171
|
},
|
|
166
172
|
|
|
167
173
|
set(value) {
|
|
168
174
|
const name = this.childrenSchema?.name
|
|
169
175
|
if (name) {
|
|
170
176
|
// eslint-disable-next-line vue/no-mutating-props
|
|
171
|
-
this.data[name] =
|
|
177
|
+
this.data[name] = this.updateOrder(
|
|
178
|
+
this.childrenSchema,
|
|
179
|
+
value
|
|
180
|
+
)
|
|
172
181
|
}
|
|
173
182
|
}
|
|
174
183
|
},
|
|
@@ -202,27 +211,19 @@ export default DitoComponent.component('DitoTreeItem', {
|
|
|
202
211
|
const { editPath } = this.container
|
|
203
212
|
const childrenOpen = !this.path && childrenSchema.open
|
|
204
213
|
// Build a children list with child meta information for the template.
|
|
205
|
-
return
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return {
|
|
219
|
-
data,
|
|
220
|
-
path,
|
|
221
|
-
open,
|
|
222
|
-
active
|
|
223
|
-
}
|
|
224
|
-
})
|
|
225
|
-
)
|
|
214
|
+
return childrenList.map((data, index) => {
|
|
215
|
+
const path = (
|
|
216
|
+
childrenSchema.path &&
|
|
217
|
+
`${this.path}/${childrenSchema.path}/${index}`
|
|
218
|
+
)
|
|
219
|
+
const open = (
|
|
220
|
+
childrenOpen ||
|
|
221
|
+
// Only count as "in edit path" when it's not the full edit path.
|
|
222
|
+
editPath.startsWith(path) && path.length < editPath.length
|
|
223
|
+
)
|
|
224
|
+
const active = editPath === path
|
|
225
|
+
return { data, path, open, active }
|
|
226
|
+
})
|
|
226
227
|
}
|
|
227
228
|
return []
|
|
228
229
|
},
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
)
|
|
39
39
|
DitoDraggable(
|
|
40
40
|
tag="tbody"
|
|
41
|
-
:modelValue="updateOrder(sourceSchema, listData, paginationRange)"
|
|
42
41
|
:options="getDraggableOptions()"
|
|
43
42
|
:draggable="draggable"
|
|
43
|
+
:modelValue="updateOrder(sourceSchema, listData, paginationRange)"
|
|
44
44
|
@update:modelValue="value => (listData = value)"
|
|
45
45
|
)
|
|
46
46
|
tr(
|