schema-components 1.5.0 → 1.5.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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [1.5.1](https://github.com/Mearman/schema-components/compare/v1.5.0...v1.5.1) (2026-05-14)
2
+
3
+ ### Bug Fixes
4
+
5
+ * blank writeOnly values in boolean and number renderers ([b46ecac](https://github.com/Mearman/schema-components/commit/b46ecac8d997fd4b875d6090d5374cded1143e5d))
6
+
1
7
  ## [1.5.0](https://github.com/Mearman/schema-components/compare/v1.4.0...v1.5.0) (2026-05-14)
2
8
 
3
9
  ### Features
@@ -133,7 +133,7 @@ function renderBooleanEditable(props) {
133
133
  type: "checkbox",
134
134
  name: id
135
135
  };
136
- if (props.value === true) attrs.checked = true;
136
+ if (!props.writeOnly && props.value === true) attrs.checked = true;
137
137
  Object.assign(attrs, ariaRequiredAttrs(props.tree));
138
138
  Object.assign(attrs, ariaLabelAttrs(props.meta.description));
139
139
  return h("input", attrs);
@@ -200,7 +200,7 @@ function renderBoolean(props) {
200
200
  return /* @__PURE__ */ jsx("input", {
201
201
  id,
202
202
  type: "checkbox",
203
- checked: props.value === true,
203
+ checked: props.writeOnly ? false : props.value === true,
204
204
  onChange: (e) => {
205
205
  props.onChange(e.target.checked);
206
206
  },
@@ -45,7 +45,7 @@ function renderNumberInput(props) {
45
45
  return /* @__PURE__ */ jsx(MuiTextField, {
46
46
  label,
47
47
  type: "number",
48
- value: typeof props.value === "number" ? props.value : "",
48
+ value: props.writeOnly ? "" : typeof props.value === "number" ? props.value : "",
49
49
  onChange: (e) => {
50
50
  props.onChange(Number(e.target.value));
51
51
  },
@@ -73,7 +73,7 @@ function renderBooleanInput(props) {
73
73
  }
74
74
  return /* @__PURE__ */ jsx(MuiFormControlLabel, {
75
75
  control: /* @__PURE__ */ jsx(MuiCheckbox, {
76
- checked: props.value === true,
76
+ checked: props.writeOnly ? false : props.value === true,
77
77
  onChange: (e) => {
78
78
  props.onChange(e.target.checked);
79
79
  }
@@ -51,7 +51,7 @@ function renderNumberInput(props) {
51
51
  return /* @__PURE__ */ jsx("input", {
52
52
  type: "number",
53
53
  className,
54
- value: typeof props.value === "number" ? props.value : "",
54
+ value: props.writeOnly ? "" : typeof props.value === "number" ? props.value : "",
55
55
  onChange: (e) => {
56
56
  props.onChange(Number(e.target.value));
57
57
  },
@@ -74,7 +74,7 @@ function renderBooleanInput(props) {
74
74
  return /* @__PURE__ */ jsx("input", {
75
75
  type: "checkbox",
76
76
  className,
77
- checked: props.value === true,
77
+ checked: props.writeOnly ? false : props.value === true,
78
78
  onChange: (e) => {
79
79
  props.onChange(e.target.checked);
80
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "schema-components",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "React components that render UI from Zod schemas, JSON Schema, and OpenAPI documents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",