@ditojs/admin 2.4.2 → 2.4.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 +179 -164
- package/dist/dito-admin.umd.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/DitoUploadFile.vue +3 -0
- package/src/mixins/DitoMixin.js +30 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/admin",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.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",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"vite": "^4.3.1"
|
|
84
84
|
},
|
|
85
85
|
"types": "types",
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "fa8525e80d6cce3844fb8c62d665c60761a564b1",
|
|
87
87
|
"scripts": {
|
|
88
88
|
"build": "vite build",
|
|
89
89
|
"watch": "yarn build --mode 'development' --watch",
|
package/src/mixins/DitoMixin.js
CHANGED
|
@@ -192,17 +192,37 @@ export default {
|
|
|
192
192
|
return value
|
|
193
193
|
},
|
|
194
194
|
|
|
195
|
+
removeStore(key) {
|
|
196
|
+
delete this.store[key]
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
getStoreKeyByIndex(index) {
|
|
200
|
+
return this.store.$keysByIndex?.[index]
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
setStoreKeyByIndex(index, key) {
|
|
204
|
+
this.store.$keysByIndex ??= {}
|
|
205
|
+
this.store.$keysByIndex[index] = key
|
|
206
|
+
},
|
|
207
|
+
|
|
195
208
|
getChildStore(key, index) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
this.
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
209
|
+
let store = this.getStore(key)
|
|
210
|
+
if (!store && index != null) {
|
|
211
|
+
// When storing, temporary ids change to permanent ones and thus the key
|
|
212
|
+
// can change. To still find the store, we reference by index as well,
|
|
213
|
+
// to be able to find the store again after the item was saved.
|
|
214
|
+
const oldKey = this.getStoreKeyByIndex(index)
|
|
215
|
+
store = this.getStore(oldKey)
|
|
216
|
+
if (store) {
|
|
217
|
+
this.setStore(key, store)
|
|
218
|
+
this.removeStore(oldKey)
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (!store) {
|
|
222
|
+
store = this.setStore(key, reactive({}))
|
|
223
|
+
if (index != null) {
|
|
224
|
+
this.setStoreKeyByIndex(index, key)
|
|
225
|
+
}
|
|
206
226
|
}
|
|
207
227
|
return store
|
|
208
228
|
},
|