@koumoul/vjsf 3.17.3 → 3.17.5

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": "@koumoul/vjsf",
3
- "version": "3.17.3",
3
+ "version": "3.17.5",
4
4
  "description": "Generate forms for the vuetify UI library (vuejs) based on annotated JSON schemas.",
5
5
  "scripts": {
6
6
  "test": "vitest run",
@@ -71,7 +71,7 @@
71
71
  "vuetify": "^3.8.12"
72
72
  },
73
73
  "dependencies": {
74
- "@json-layout/core": "~1.12.4",
74
+ "@json-layout/core": "~1.12.5",
75
75
  "@json-layout/vocabulary": "~2.6.0",
76
76
  "@vueuse/core": "^12.5.0",
77
77
  "debug": "^4.3.4"
@@ -86,14 +86,21 @@ export const useVjsf = (schema, modelValue, options, nodeComponents, emit, compi
86
86
  else form.update(formMemberId, false, [])
87
87
  }
88
88
  }
89
+
90
+ let lastDataUpdate
89
91
  /**
90
92
  * @param {any} data
91
93
  */
92
94
  const onDataUpdate = async (data) => {
93
95
  debug('onDataUpdate', data)
96
+ lastDataUpdate = data
94
97
  await nextTick() // necessary for form validation to be applied before emitting new data
95
- debug(' -> emit update:modelValue', data)
96
- emit('update:modelValue', data)
98
+ if (lastDataUpdate !== data) {
99
+ debug('onDataUpdate data changed while waiting for nextTick, do not emit')
100
+ } else {
101
+ debug(' -> emit update:modelValue', data)
102
+ emit('update:modelValue', data)
103
+ }
97
104
  }
98
105
  const onAutofocus = () => {
99
106
  if (!el.value) return
@@ -1 +1 @@
1
- {"version":3,"file":"use-vjsf.d.ts","sourceRoot":"","sources":["../../src/composables/use-vjsf.js"],"names":[],"mappings":"AAaA;IACE;;MAEE;gCADO,GAAG;IAGZ;;MAEE;4BADO,OAAO,aAAa,EAAE,kBAAkB;EAGlD;AAYM,gCATI,OAAO,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,cACzB,OAAO,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,WACtB,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAAC,kBAClE,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,QACvC,GAAG;;;;EAgJb"}
1
+ {"version":3,"file":"use-vjsf.d.ts","sourceRoot":"","sources":["../../src/composables/use-vjsf.js"],"names":[],"mappings":"AAaA;IACE;;MAEE;gCADO,GAAG;IAGZ;;MAEE;4BADO,OAAO,aAAa,EAAE,kBAAkB;EAGlD;AAYM,gCATI,OAAO,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,cACzB,OAAO,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,WACtB,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAAC,kBAClE,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,QACvC,GAAG;;;;EAuJb"}