@drax/crud-vue 0.19.0 → 0.20.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
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.19.0",
6
+ "version": "0.20.0",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -24,10 +24,10 @@
24
24
  "format": "prettier --write src/"
25
25
  },
26
26
  "dependencies": {
27
- "@drax/common-front": "^0.19.0",
28
- "@drax/crud-front": "^0.19.0",
29
- "@drax/crud-share": "^0.19.0",
30
- "@drax/media-vue": "^0.19.0"
27
+ "@drax/common-front": "^0.20.0",
28
+ "@drax/crud-front": "^0.20.0",
29
+ "@drax/crud-share": "^0.20.0",
30
+ "@drax/media-vue": "^0.20.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "pinia": "^2.2.2",
@@ -64,5 +64,5 @@
64
64
  "vue-tsc": "^2.1.10",
65
65
  "vuetify": "^3.8.2"
66
66
  },
67
- "gitHead": "4e510d44b24ab2a3eaef06388f21b26c08e44a6d"
67
+ "gitHead": "2908130e8cebdb47177b7d78d01b49cd3dd962cf"
68
68
  }
@@ -230,11 +230,20 @@ export function useCrud(entity: IEntityCrud) {
230
230
  }
231
231
 
232
232
  function onEdit(item: object) {
233
- store.setForm(cast({...item}))
233
+ store.setForm(cast(cloneItem(item)))
234
234
  store.setOperation("edit")
235
235
  openDialog()
236
236
  }
237
237
 
238
+ function cloneItem(item: object):object {
239
+ try{
240
+ return JSON.parse(JSON.stringify(item))
241
+ }catch (error){
242
+ console.error("Error cloning item", error)
243
+ return ({})
244
+ }
245
+ }
246
+
238
247
  function onDelete(item: object) {
239
248
  store.setForm(cast({...item}))
240
249
  store.setOperation("delete")