mlform 0.1.12 → 0.1.13

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
@@ -9,7 +9,7 @@ Schema-driven forms for machine learning applications.
9
9
 
10
10
  MLForm gives you a predictable UI layer between users and model backends. You describe inputs and reports with a schema, MLForm renders accessible Web Components, validates values, submits structured payloads, and displays model results in the same host container.
11
11
 
12
- Version `0.1.12` is the current release in this repository.
12
+ Version `0.1.13` is the current release in this repository.
13
13
 
14
14
  ## Why MLForm
15
15
 
@@ -306,7 +306,7 @@ The main package targets Node.js `>=24.9.0`.
306
306
 
307
307
  ## Release Notes
308
308
 
309
- For `0.1.12`, use the repository release entry and the published docs as the source of truth:
309
+ For `0.1.13`, use the repository release entry and the published docs as the source of truth:
310
310
 
311
311
  - GitHub releases: https://github.com/UlloaSP/mlform/releases
312
312
  - npm package: https://www.npmjs.com/package/mlform
@@ -1,5 +1,5 @@
1
1
  import { i as e, s as t } from "./schema-DSAZ6bts.js";
2
- import { s as n } from "./primitives-WssgAn8W.js";
2
+ import { s as n } from "./primitives-bjfDE5G2.js";
3
3
  import * as r from "zod";
4
4
  //#region src/builtins/constants.ts
5
5
  var i = {
@@ -161,10 +161,10 @@ var i = {
161
161
  falseLabel: r.string().optional()
162
162
  }),
163
163
  getDefaultValue(e) {
164
- return typeof e.defaultValue == "boolean" ? e.defaultValue : !1;
164
+ return typeof e.defaultValue == "boolean" ? e.defaultValue : null;
165
165
  },
166
166
  normalizeValue(e) {
167
- return !!e;
167
+ return e == null || e === "" ? null : e === !0 || e === "true" ? !0 : e === !1 || e === "false" ? !1 : !!e;
168
168
  },
169
169
  describe(e, t) {
170
170
  return y("boolean-field", e, {
@@ -1,2 +1,2 @@
1
- import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, x as b, y as x } from "../builtins-DpaxP2NX.js";
1
+ import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, x as b, y as x } from "../builtins-yzeQlyRt.js";
2
2
  export { s as booleanFieldDefinition, t as builtinFieldKinds, y as builtinLegacyOutputTypes, x as builtinReportFallbacks, r as builtinReportKinds, b as builtinReportLabels, e as builtinValidationMessages, c as categoryFieldDefinition, n as classifierReportDefinition, _ as createBuiltinMlRegistry, h as createMappedCategoryBehavior, f as createMlRegistryPack, m as dateFieldDefinition, o as longTextFieldDefinition, d as mappedCategoryFieldDefinition, a as multiChoiceFieldDefinition, v as numberFieldDefinition, u as ratingFieldDefinition, l as regressorReportDefinition, g as seriesFieldDefinition, p as singleChoiceFieldDefinition, i as textFieldDefinition };
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "../runtime-CI7vlp9i.js";
2
2
  import { i as t, s as n } from "../schema-DSAZ6bts.js";
3
- import { n as r } from "../builtins-DpaxP2NX.js";
4
- import { _ as i, a, h as o, l as s, m as c, p as l, r as u, t as d } from "../primitives-WssgAn8W.js";
3
+ import { n as r } from "../builtins-yzeQlyRt.js";
4
+ import { _ as i, a, h as o, l as s, m as c, p as l, r as u, t as d } from "../primitives-bjfDE5G2.js";
5
5
  import { d as f, h as p, r as m } from "../design-6suKVQDo.js";
6
6
  import { LitElement as h, css as g, html as _, nothing as v } from "lit";
7
7
  import { customElement as y, property as b, state as x } from "lit/decorators.js";
@@ -1,2 +1,2 @@
1
- import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, r as f, s as p, t as m, u as h } from "../primitives-WssgAn8W.js";
1
+ import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, r as f, s as p, t as m, u as h } from "../primitives-bjfDE5G2.js";
2
2
  export { h as PrimitiveAsyncReportElement, d as PrimitiveDescriptorRegistry, i as PrimitiveFieldElement, n as PrimitiveFormElement, r as PrimitiveReportElement, f as createBuiltinPrimitiveRegistry, p as createPrimitiveDescriptorRegistry, s as createPrimitiveRegistry, c as focusPrimitiveField, m as mountForm, l as primitiveDefaultLabels, o as primitiveStaticText, a as primitiveTagNames, e as resolvePrimitiveText, t as toDescriptorNodes, u as unmountForm };
@@ -2159,7 +2159,7 @@ var B = {
2159
2159
  }
2160
2160
  #t(e) {
2161
2161
  let t = { ...this.props };
2162
- return delete t.widget, e === "boolean" && (t.checked = t.value === !0), t;
2162
+ return delete t.widget, e === "boolean" && (t.checked = t.value === !0 ? !0 : t.value === !1 ? !1 : null), t;
2163
2163
  }
2164
2164
  };
2165
2165
  V = _([i(d.declarativeField)], V);
@@ -2782,7 +2782,7 @@ var q = class extends v {
2782
2782
  }
2783
2783
  `];
2784
2784
  render() {
2785
- let e = this.props, t = this.fieldContext, r = e.checked === !0, i = this.text, a = g.booleanGroup, o = `${t?.controlId ?? a}-true`, s = `${t?.controlId ?? a}-false`, c = F(e.trueLabel, i.booleanTrue), l = F(e.falseLabel, i.booleanFalse), d = !!(this.fieldContext?.disabled || this.fieldContext?.readOnly);
2785
+ let e = this.props, t = this.fieldContext, r = e.checked === !0 ? !0 : e.checked === !1 ? !1 : null, i = this.text, a = g.booleanGroup, o = `${t?.controlId ?? a}-true`, s = `${t?.controlId ?? a}-false`, c = F(e.trueLabel, i.booleanTrue), l = F(e.falseLabel, i.booleanFalse), d = !!(this.fieldContext?.disabled || this.fieldContext?.readOnly);
2786
2786
  return n`
2787
2787
  <fieldset
2788
2788
  role="radiogroup"
@@ -2796,7 +2796,7 @@ var q = class extends v {
2796
2796
  id=${o}
2797
2797
  name=${t?.controlId ?? a}
2798
2798
  value="true"
2799
- .checked=${r}
2799
+ .checked=${r === !0}
2800
2800
  ?disabled=${d}
2801
2801
  @change=${this.#e}
2802
2802
  @blur=${this.#t}
@@ -2808,7 +2808,7 @@ var q = class extends v {
2808
2808
  id=${s}
2809
2809
  name=${t?.controlId ?? a}
2810
2810
  value="false"
2811
- .checked=${!r}
2811
+ .checked=${r === !1}
2812
2812
  ?disabled=${d}
2813
2813
  @change=${this.#e}
2814
2814
  @blur=${this.#t}
@@ -15,7 +15,7 @@ export declare const builtinFieldDefinitions: readonly [import('./shared').Built
15
15
  kind: "boolean";
16
16
  trueLabel?: string;
17
17
  falseLabel?: string;
18
- }, boolean>, import('./shared').BuiltinFieldDefinition<import('../../schema').BaseFieldConfig & {
18
+ }, boolean | null>, import('./shared').BuiltinFieldDefinition<import('../../schema').BaseFieldConfig & {
19
19
  kind: "category";
20
20
  options: (string | {
21
21
  label: string;
@@ -5,5 +5,5 @@ type BooleanFieldConfig = BaseFieldConfig & {
5
5
  trueLabel?: string;
6
6
  falseLabel?: string;
7
7
  };
8
- export declare const booleanFieldDefinition: BuiltinFieldDefinition<BooleanFieldConfig, boolean>;
8
+ export declare const booleanFieldDefinition: BuiltinFieldDefinition<BooleanFieldConfig, boolean | null>;
9
9
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mlform",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "private": false,
5
5
  "description": "Composable form generation utilities for machine learning backend integration",
6
6
  "keywords": [