@bagelink/vue 1.15.579 → 1.15.581
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
|
@@ -71,6 +71,8 @@ const props = defineProps<Props<T>>()
|
|
|
71
71
|
|
|
72
72
|
const emit = defineEmits<{
|
|
73
73
|
'update:modelValue': [value: T]
|
|
74
|
+
/** Emitted only for user-driven field updates, not model initialization/defaults. */
|
|
75
|
+
'change': [value: T, previousValue: T]
|
|
74
76
|
}>()
|
|
75
77
|
|
|
76
78
|
defineSlots<FormFlowSlots<T>>()
|
|
@@ -255,7 +257,9 @@ function fieldLayoutStyle(field: FieldBuilder): Record<string, string> | undefin
|
|
|
255
257
|
}
|
|
256
258
|
|
|
257
259
|
function updateField(key: string, value: any, field: FieldBuilder) {
|
|
260
|
+
const previousValue = cloneDefault(formData.value)
|
|
258
261
|
setNestedValue(formData.value, key, value)
|
|
262
|
+
emit('change', cloneDefault(formData.value), previousValue)
|
|
259
263
|
if (formState.value === 'success' || formState.value === 'error') {
|
|
260
264
|
formState.value = 'idle'
|
|
261
265
|
}
|