@ditojs/admin 2.99.0 → 2.100.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/admin",
3
- "version": "2.99.0",
3
+ "version": "2.100.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/main/packages/admin",
@@ -40,8 +40,8 @@
40
40
  "not ie_mob > 0"
41
41
  ],
42
42
  "dependencies": {
43
- "@ditojs/ui": "^2.99.0",
44
- "@ditojs/utils": "^2.99.0"
43
+ "@ditojs/ui": "^2.100.0",
44
+ "@ditojs/utils": "^2.100.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@kyvg/vue3-notification": "^3.4.2",
@@ -77,7 +77,7 @@
77
77
  "filesize": "^11.0.13",
78
78
  "filesize-parser": "^1.5.1",
79
79
  "focus-trap": "^8.0.0",
80
- "nanoid": "^5.1.6",
80
+ "nanoid": "^6.0.1",
81
81
  "sortablejs": "^1.15.7",
82
82
  "tinycolor2": "^1.6.0",
83
83
  "tippy.js": "^6.3.7",
@@ -89,9 +89,9 @@
89
89
  "vue-upload-component": "^3.1.17"
90
90
  },
91
91
  "devDependencies": {
92
- "@ditojs/build": "^2.99.0",
92
+ "@ditojs/build": "^2.100.0",
93
93
  "typescript": "^6.0.3",
94
- "vite": "^8.0.10"
94
+ "vite": "^8.3.2"
95
95
  },
96
- "gitHead": "ba1ce26d349a74e8143faa614488182b67416db1"
96
+ "gitHead": "c6fdbe03971188779fc9cf5f1b4202e08bc75a65"
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 when the consumer (e.g. a dirty
228
- // DitoForm) reports it would overwrite local edits made while the
229
- // GET was in flight. The 'load' event still fires — the GET *did*
230
- // complete; we just chose not to apply it.
231
- if (this.shouldApplyLoadedData()) {
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')
@@ -64,6 +64,10 @@ export default {
64
64
  return this.meta.nested
65
65
  },
66
66
 
67
+ isForm() {
68
+ return false
69
+ },
70
+
67
71
  isView() {
68
72
  return false
69
73
  },