haze-ui 1.12.0 → 1.12.1

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/README.md CHANGED
@@ -70,9 +70,16 @@ function NameField({ form }) {
70
70
  ```
71
71
 
72
72
  The handle is a real `Control`: reads subscribe to the field (sibling
73
- fields stay isolated), writes go through `setValueByPath`, and functional
74
- updates evaluate against the live form value. `reset(form, newValues)`
75
- re-seeds every bridged control with no remounting.
73
+ fields stay isolated), and writes go through react-f0rm's user-change
74
+ channel (`changeValueByPath`, 0.7) a control write fires exactly the
75
+ validation a user typing into the field would fire: the field's effective
76
+ `mode` (a `FormItem`/`useField` per-field override included) and the
77
+ form's `reValidateMode`. With the default `mode: 'onSubmit'` +
78
+ `reValidateMode: 'onChange'`, typing through a bridged control after a
79
+ failed submit re-validates per keystroke and clears the error as soon as
80
+ the value is valid — no blur, no resubmit. Functional updates evaluate
81
+ against the live form value. `reset(form, newValues)` re-seeds every
82
+ bridged control with no remounting.
76
83
 
77
84
  ### FormItem: label, errors and aria wiring
78
85
 
@@ -1,6 +1,6 @@
1
1
  import { useControl as e, useThru as t } from "react-use-control";
2
2
  import { useMemo as n } from "react";
3
- import { getValueByPath as r, setValueByPath as i, useValueByPath as a } from "react-f0rm";
3
+ import { changeValueByPath as r, getValueByPath as i, useValueByPath as a } from "react-f0rm";
4
4
  //#region src/lib/form/useFormControl.ts
5
5
  var o = /* @__PURE__ */ new Map();
6
6
  function s(e) {
@@ -46,8 +46,8 @@ function l(e) {
46
46
  function u(n, o) {
47
47
  let s = l(o), c = a(n, s), [, , u] = e();
48
48
  return t(u, () => [c, (e) => {
49
- let t = r(n, s), a = typeof e == "function" ? e(t) : e;
50
- i(n, s, a);
49
+ let t = i(n, s), a = typeof e == "function" ? e(t) : e;
50
+ r(n, s, a);
51
51
  }]);
52
52
  }
53
53
  //#endregion
@@ -18,8 +18,11 @@ export type { FormInstance, PathValueOf };
18
18
  * `getValueByPath` at render time (kept fresh by a `useValueByPath`
19
19
  * subscription that re-renders this component on own-field changes — and
20
20
  * only those, so sibling fields stay isolated); writes go through
21
- * `setValueByPath`, accepting either a plain value or a functional updater
22
- * that is evaluated against the live form value.
21
+ * `changeValueByPath` react-f0rm's user-change channel so a control
22
+ * write fires exactly the validation a user typing into the field would
23
+ * fire (the field's effective `mode`, per-field override included, and the
24
+ * form's `reValidateMode`). The setter accepts either a plain value or a
25
+ * functional updater that is evaluated against the live form value.
23
26
  *
24
27
  * The handle's identity is stable across re-renders, including own-field
25
28
  * value changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haze-ui",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "type": "module",
5
5
  "description": "A React UI component library powered by react-use-control and Linaria",
6
6
  "main": "./dist/index.js",
@@ -49,7 +49,7 @@
49
49
  "peerDependencies": {
50
50
  "@linaria/core": "^7.0.0 || ^8.0.0",
51
51
  "react": "^19.0.0",
52
- "react-f0rm": ">=0.3.0"
52
+ "react-f0rm": ">=0.7.0"
53
53
  },
54
54
  "dependencies": {
55
55
  "react-toolroom": "^0.11.0",
@@ -95,7 +95,7 @@
95
95
  "ramda": "^0.32.0",
96
96
  "react": "^19.2.8",
97
97
  "react-dom": "^19.2.8",
98
- "react-f0rm": "^0.6.0",
98
+ "react-f0rm": "^0.7.0",
99
99
  "react-icons": "^5.7.0",
100
100
  "rollup-plugin-type-as-json-schema": "^0.2.6",
101
101
  "semantic-release": "^25.0.9",