@ditojs/admin 2.99.0 → 2.99.1
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.99.
|
|
3
|
+
"version": "2.99.1",
|
|
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/main/packages/admin",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"typescript": "^6.0.3",
|
|
94
94
|
"vite": "^8.0.10"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "537d4483092604a1bfa055c151bccca4821de19a"
|
|
97
97
|
}
|
|
@@ -66,12 +66,15 @@ export default DitoComponent.component('DitoForm', {
|
|
|
66
66
|
return {
|
|
67
67
|
createdData: null,
|
|
68
68
|
clonedData: undefined,
|
|
69
|
-
sourceKey: null
|
|
70
|
-
isForm: true
|
|
69
|
+
sourceKey: null
|
|
71
70
|
}
|
|
72
71
|
},
|
|
73
72
|
|
|
74
73
|
computed: {
|
|
74
|
+
isForm() {
|
|
75
|
+
return true
|
|
76
|
+
},
|
|
77
|
+
|
|
75
78
|
verbs() {
|
|
76
79
|
// Add submit / submitted to the verbs returned by ResourceMixin
|
|
77
80
|
// NOTE: These get passed on to children through:
|
|
@@ -359,14 +362,6 @@ export default DitoComponent.component('DitoForm', {
|
|
|
359
362
|
this.setData(null)
|
|
360
363
|
},
|
|
361
364
|
|
|
362
|
-
// @override ResourceMixin.shouldApplyLoadedData()
|
|
363
|
-
shouldApplyLoadedData() {
|
|
364
|
-
// Drop a GET response if the user has made local edits while the
|
|
365
|
-
// request was in flight — applying it would wholesale-replace
|
|
366
|
-
// `loadedData` and silently clobber those edits.
|
|
367
|
-
return !this.isDirty
|
|
368
|
-
},
|
|
369
|
-
|
|
370
365
|
// @override ResourceMixin.setData()
|
|
371
366
|
setData(data) {
|
|
372
367
|
// setData() is called after submit when data has changed.
|
|
@@ -160,13 +160,6 @@ export default {
|
|
|
160
160
|
this.loadedData = null
|
|
161
161
|
},
|
|
162
162
|
|
|
163
|
-
// @overridable
|
|
164
|
-
// Subclasses override this to skip applying response data when local
|
|
165
|
-
// state would be overwritten — see DitoForm, which checks `isDirty`.
|
|
166
|
-
shouldApplyLoadedData() {
|
|
167
|
-
return true
|
|
168
|
-
},
|
|
169
|
-
|
|
170
163
|
// @overridable
|
|
171
164
|
setData(data) {
|
|
172
165
|
this.loadedData = data
|
|
@@ -224,11 +217,11 @@ export default {
|
|
|
224
217
|
}
|
|
225
218
|
}
|
|
226
219
|
} else {
|
|
227
|
-
// Skip applying response data
|
|
228
|
-
//
|
|
229
|
-
// GET was in flight. The 'load' event still
|
|
230
|
-
// complete; we just chose not to apply it.
|
|
231
|
-
if (this.
|
|
220
|
+
// Skip applying response data on a dirty form: `setData` would
|
|
221
|
+
// wholesale-replace `loadedData` and clobber any local edits the
|
|
222
|
+
// user made while the GET was in flight. The `'load'` event still
|
|
223
|
+
// fires — the GET *did* complete; we just chose not to apply it.
|
|
224
|
+
if (!(this.isForm && this.isDirty)) {
|
|
232
225
|
this.setData(response.data)
|
|
233
226
|
}
|
|
234
227
|
this.emitSchemaEvent('load')
|