mtrl-addons 0.6.0 → 0.7.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.
@@ -24,20 +24,27 @@ export declare const getFieldValue: (field: FormField) => FieldValue;
24
24
  */
25
25
  export declare const setFieldValue: (field: FormField, value: FieldValue, silent?: boolean) => void;
26
26
  /**
27
- * Updates the tracked value for a field
28
- * Called when setData is used with silent=true to keep deduplication in sync
27
+ * Binds change and input events to fields
28
+ * Calls the provided callback when any field changes
29
+ *
30
+ * Listens to both 'input' (for immediate feedback while typing)
31
+ * and 'change' (for components that only emit on blur/selection)
32
+ *
33
+ * Deduplicates events to prevent double-firing when both input and change
34
+ * emit for the same value (e.g., textfield input followed by blur)
29
35
  */
30
- export declare const updateTrackedFieldValue: (name: string, value: FieldValue) => void;
31
36
  /**
32
- * Updates all tracked field values from a fields registry
33
- * Called after silent setData to sync deduplication state
37
+ * Updates the tracked value for a field in the given tracker
34
38
  */
35
- export declare const syncTrackedFieldValues: (fields: FormFieldRegistry) => void;
39
+ export declare const updateTrackedFieldValue: (name: string, value: FieldValue, tracker?: Map<string, FieldValue>) => void;
36
40
  /**
37
- * Resets the field value tracker for a new form
38
- * Should be called at the start of withFields before bindFieldEvents
41
+ * Updates all tracked field values from a fields registry
42
+ * Called after silent setData to sync deduplication state
43
+ *
44
+ * @param fields - The form's field registry
45
+ * @param tracker - The per-form tracker map (stored on the component as _fieldValueTracker)
39
46
  */
40
- export declare const resetFieldValueTracker: () => void;
47
+ export declare const syncTrackedFieldValues: (fields: FormFieldRegistry, tracker?: Map<string, FieldValue>) => void;
41
48
  /**
42
49
  * withFields feature
43
50
  * Adds field extraction and registry management to the form
@@ -3,7 +3,7 @@
3
3
  * Each feature adds specific capabilities to the form component
4
4
  */
5
5
  export { withLayout } from "./layout";
6
- export { withFields, getFieldValue, setFieldValue, updateTrackedFieldValue, syncTrackedFieldValues, resetFieldValueTracker, } from "./fields";
6
+ export { withFields, getFieldValue, setFieldValue, updateTrackedFieldValue, syncTrackedFieldValues, } from "./fields";
7
7
  export { withData, flatToNested, getNestedValue, setNestedValue } from "./data";
8
8
  export { withController } from "./controller";
9
9
  export { withSubmit, validateData, performRequest } from "./submit";