mlform 0.1.22 → 0.1.24
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 +98 -229
- package/dist/builtins-jvAitKUC.js +560 -0
- package/dist/{design-Dr7o4rR9.js → design-D8zce4Mh.js} +13 -12
- package/dist/mlform/builtins.mjs +2 -2
- package/dist/mlform/design.mjs +1 -1
- package/dist/mlform/kit.mjs +435 -275
- package/dist/mlform/primitives.mjs +2 -2
- package/dist/mlform/runtime.mjs +1 -1
- package/dist/mlform/schema.mjs +1 -1
- package/dist/{primitives-ljp3c5R8.js → primitives-ChLgMFl9.js} +452 -450
- package/dist/{runtime-C9ZioNpI.js → runtime-B_vnmwya.js} +9 -9
- package/dist/{schema-CiCjXECD.js → schema-C34LJ8aV.js} +99 -110
- package/dist/types/{src/builtins → builtins}/definitions/collections.d.ts +12 -12
- package/dist/types/{src/builtins → builtins}/definitions/fields/boolean.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/fields/category.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/fields/date.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/fields/long-text.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/fields/mapped-category.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/fields/multi-choice.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/fields/number.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/fields/onehot-category.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/fields/rating.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/fields/series-helpers.d.ts +4 -4
- package/dist/types/{src/builtins → builtins}/definitions/fields/single-choice.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/fields/text.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/reports/classifier.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/reports/regressor.d.ts +1 -1
- package/dist/types/{src/builtins → builtins}/definitions/shared.d.ts +3 -28
- package/dist/types/{src/builtins → builtins}/index.d.ts +2 -3
- package/dist/types/{src/builtins → builtins}/mapped-category-behavior.d.ts +1 -1
- package/dist/types/builtins/registry.d.ts +2 -0
- package/dist/types/kit/builtin-presenters.d.ts +2 -0
- package/dist/types/{src/kit → kit}/defaults.d.ts +3 -3
- package/dist/types/{src/kit → kit}/index.d.ts +3 -0
- package/dist/types/{src/kit → kit}/kinds/define-field-kind.d.ts +4 -3
- package/dist/types/{src/kit → kit}/kinds/define-report-kind.d.ts +4 -3
- package/dist/types/kit/kinds/register-kind.d.ts +6 -0
- package/dist/types/{src/kit → kit}/layout-helpers.d.ts +1 -1
- package/dist/types/{src/kit → kit}/layout-node-render.d.ts +1 -1
- package/dist/types/{src/kit → kit}/layout-root.d.ts +1 -1
- package/dist/types/{src/kit → kit}/layout-utils.d.ts +1 -1
- package/dist/types/{src/kit → kit}/layout.d.ts +1 -1
- package/dist/types/{src/kit → kit}/mount-types.d.ts +5 -3
- package/dist/types/kit/plugin.d.ts +19 -0
- package/dist/types/kit/registry-pack.d.ts +16 -0
- package/dist/types/{src/kit → kit}/tabs-root.d.ts +1 -1
- package/dist/types/{src/kit → kit}/view-core-types.d.ts +4 -2
- package/dist/types/{src/kit → kit}/view-navigation.d.ts +1 -1
- package/dist/types/{src/kit → kit}/view-snapshot-cache.d.ts +2 -2
- package/dist/types/{src/kit → kit}/view-snapshot.d.ts +2 -2
- package/dist/types/{src/kit → kit}/wizard-root.d.ts +1 -1
- package/dist/types/{src/primitives → primitives}/descriptors/registry.d.ts +2 -1
- package/dist/types/{src/primitives → primitives}/index.d.ts +1 -1
- package/dist/types/primitives/mount-form.d.ts +4 -0
- package/dist/types/{src/runtime → runtime}/errors.d.ts +1 -1
- package/dist/types/{src/runtime → runtime}/runtime-behaviors.d.ts +1 -1
- package/dist/types/{src/runtime → runtime}/submission/request.d.ts +1 -1
- package/dist/types/{src/runtime → runtime}/submission/types.d.ts +1 -1
- package/dist/types/{src/runtime → runtime}/types/behavior.d.ts +2 -2
- package/dist/types/{src/runtime → runtime}/types/field.d.ts +3 -3
- package/dist/types/{src/runtime → runtime}/types/form.d.ts +3 -2
- package/dist/types/{src/runtime → runtime}/types/index.d.ts +1 -0
- package/dist/types/{src/runtime → runtime}/types/registry.d.ts +1 -1
- package/dist/types/{src/runtime → runtime}/types/report.d.ts +5 -5
- package/dist/types/runtime/types/status.d.ts +1 -0
- package/dist/types/{src/runtime → runtime}/types/transport.d.ts +5 -5
- package/dist/types/{src/runtime → runtime}/validation/form.d.ts +1 -1
- package/dist/types/{src/schema → schema}/index.d.ts +1 -0
- package/dist/types/{src/schema → schema}/mapped-to.d.ts +2 -6
- package/dist/types/{src/schema → schema}/normalize.d.ts +2 -1
- package/dist/types/{src/schema → schema}/registry.d.ts +3 -1
- package/dist/types/{src/schema → schema}/types/field.d.ts +1 -1
- package/dist/types/schema/types/mapping.d.ts +6 -0
- package/dist/types/{src/schema → schema}/types/report.d.ts +1 -1
- package/dist/types/{src/schema → schema}/types/submit.d.ts +1 -1
- package/dist/types/{src/schema → schema}/validation.d.ts +3 -1
- package/dist/types/{src/transport → transport}/types.d.ts +1 -1
- package/package.json +27 -20
- package/dist/builtins-B2U_ViF6.js +0 -749
- package/dist/types/src/builtins/registry-pack.d.ts +0 -10
- package/dist/types/src/kit/kinds/register-kind.d.ts +0 -5
- package/dist/types/src/primitives/mount-form.d.ts +0 -4
- /package/dist/types/{src/builtins → builtins}/constants.d.ts +0 -0
- /package/dist/types/{src/builtins → builtins}/definitions/fields/series.d.ts +0 -0
- /package/dist/types/{src/builtins → builtins}/definitions/fields/value-helpers.d.ts +0 -0
- /package/dist/types/{src/builtins → builtins}/definitions/index.d.ts +0 -0
- /package/dist/types/{src/design → design}/constants.d.ts +0 -0
- /package/dist/types/{src/design → design}/contract/component-keys.d.ts +0 -0
- /package/dist/types/{src/design → design}/contract/component-tokens.d.ts +0 -0
- /package/dist/types/{src/design → design}/contract/global-tokens.d.ts +0 -0
- /package/dist/types/{src/design → design}/contract/index.d.ts +0 -0
- /package/dist/types/{src/design → design}/contract/token-keys.d.ts +0 -0
- /package/dist/types/{src/design → design}/index.d.ts +0 -0
- /package/dist/types/{src/design → design}/recipes/collections.d.ts +0 -0
- /package/dist/types/{src/design → design}/recipes/contrast.d.ts +0 -0
- /package/dist/types/{src/design → design}/recipes/default.d.ts +0 -0
- /package/dist/types/{src/design → design}/recipes/index.d.ts +0 -0
- /package/dist/types/{src/design → design}/recipes/minimal.d.ts +0 -0
- /package/dist/types/{src/design → design}/recipes/soft.d.ts +0 -0
- /package/dist/types/{src/design → design}/registry/builtins.d.ts +0 -0
- /package/dist/types/{src/design → design}/registry/create-registry.d.ts +0 -0
- /package/dist/types/{src/design → design}/registry/deep-freeze.d.ts +0 -0
- /package/dist/types/{src/design → design}/registry/define-recipe.d.ts +0 -0
- /package/dist/types/{src/design → design}/registry/define-theme.d.ts +0 -0
- /package/dist/types/{src/design → design}/registry/define-token-maps.d.ts +0 -0
- /package/dist/types/{src/design → design}/registry/index.d.ts +0 -0
- /package/dist/types/{src/design → design}/resolve/diagnostics.d.ts +0 -0
- /package/dist/types/{src/design → design}/resolve/index.d.ts +0 -0
- /package/dist/types/{src/design → design}/resolve/merge-config.d.ts +0 -0
- /package/dist/types/{src/design → design}/resolve/migrate-tokens.d.ts +0 -0
- /package/dist/types/{src/design → design}/resolve/resolve-design.d.ts +0 -0
- /package/dist/types/{src/design → design}/resolve/resolve-mode.d.ts +0 -0
- /package/dist/types/{src/design → design}/resolve/resolve-recipe.d.ts +0 -0
- /package/dist/types/{src/design → design}/resolve/resolve-theme.d.ts +0 -0
- /package/dist/types/{src/design → design}/resolve/resolve-tokens.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/apply-tokens.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/attach-design.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/controller-helpers.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/create-stylesheet.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/declarations.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/design-controller.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/fingerprint.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/host-observer.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/host-state.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/hydrate-design.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/hydration-state.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/index.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/inherited-scheme.d.ts +0 -0
- /package/dist/types/{src/design → design}/runtime/media.d.ts +0 -0
- /package/dist/types/{src/design → design}/themes/airbnb.d.ts +0 -0
- /package/dist/types/{src/design → design}/themes/clickhouse.d.ts +0 -0
- /package/dist/types/{src/design → design}/themes/cobalt.d.ts +0 -0
- /package/dist/types/{src/design → design}/themes/collections.d.ts +0 -0
- /package/dist/types/{src/design → design}/themes/graphite.d.ts +0 -0
- /package/dist/types/{src/design → design}/themes/index.d.ts +0 -0
- /package/dist/types/{src/design → design}/themes/neutral.d.ts +0 -0
- /package/dist/types/{src/design → design}/themes/sage.d.ts +0 -0
- /package/dist/types/{src/design → design}/themes/sunset.d.ts +0 -0
- /package/dist/types/{src/design → design}/tokens/base.d.ts +0 -0
- /package/dist/types/{src/design → design}/tokens/contrast.d.ts +0 -0
- /package/dist/types/{src/design → design}/tokens/density.d.ts +0 -0
- /package/dist/types/{src/design → design}/tokens/forced-colors.d.ts +0 -0
- /package/dist/types/{src/design → design}/tokens/index.d.ts +0 -0
- /package/dist/types/{src/design → design}/tokens/motion.d.ts +0 -0
- /package/dist/types/{src/design → design}/types.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/constants.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/disclosure-root-styles.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/error-navigation.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/kinds/index.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/layout-node-resolver.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/layout-types.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/mount-form.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/panel-nav.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/step-indicator.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/tabs-root-styles.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/types.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/view-layout-state.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/view-types.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/view.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/wizard-constants.d.ts +0 -0
- /package/dist/types/{src/kit → kit}/wizard-root-styles.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/base-async-report-element.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/base-field-element.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/base-report-element.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/declarative-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/declarative-report.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/descriptor-content.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/error-focus.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/field-frame-feedback.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/field-frame-styles.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/field-frame.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/form-errors.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/form-root-presenters.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/form-root-split-styles.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/form-root-state.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/form-root-styles.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/form-root-templates.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/form-root.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/mounted-report.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/report-frame.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/submit-button.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/components/unsupported-component.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/constants.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/controller-binding.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/controller-types.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/descriptor-resolution.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/descriptors/content.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/descriptors/field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/descriptors/index.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/descriptors/report.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/boolean-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/category-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/date-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/long-text-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/multi-choice-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/number-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/rating-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/series-field-helpers.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/series-field-renderers.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/series-field-styles.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/series-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/single-choice-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/fields/text-field.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/register.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/registry.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/reports/classifier-report.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/reports/regressor-report.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/request-runner.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/types.d.ts +0 -0
- /package/dist/types/{src/primitives → primitives}/utils.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/comparison.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/create-runtime-helpers.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/create-runtime.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/equality.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/fields/controller.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/fields/index.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/fields/state-calculations.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/fields/state.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/form.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/index.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/paths.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/reports/controller.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/reports/index.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/runtime-controller.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/runtime-refresh.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/runtime-values.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/state/engine.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/state/index.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/state/snapshots.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/state/store.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/abort.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/create-submitter.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/error-flow.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/index.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/lifecycle.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/multi-backend.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/pipeline.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/report-fetches.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/reports.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/result.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/snapshot.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/submitter.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/submission/transport-response.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/types/pipeline.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/utils.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/validation/conditions.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/validation/field-state.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/validation/field-validator.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/validation/field.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/validation/index.d.ts +0 -0
- /package/dist/types/{src/runtime → runtime}/values.d.ts +0 -0
- /package/dist/types/{src/schema → schema}/ids.d.ts +0 -0
- /package/dist/types/{src/schema → schema}/onehot-display.d.ts +0 -0
- /package/dist/types/{src/schema → schema}/report-context.d.ts +0 -0
- /package/dist/types/{src/schema → schema}/report-fetch-request.d.ts +0 -0
- /package/dist/types/{src/schema → schema}/types/form.d.ts +0 -0
- /package/dist/types/{src/schema → schema}/types/registry.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/errors.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/fanout.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/index.d.ts +0 -0
- /package/dist/types/{src/transport → transport}/request-runner.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, b as t, g as n, h as r, l as i, m as a, t as o, v as s, y as c } from "./schema-
|
|
1
|
+
import { a as e, b as t, g as n, h as r, l as i, m as a, t as o, v as s, y as c } from "./schema-C34LJ8aV.js";
|
|
2
2
|
import { a as l, n as u, r as d } from "./transport-KUB3zfW9.js";
|
|
3
3
|
//#region src/runtime/submission/report-fetches.ts
|
|
4
4
|
var f = "Unknown report fetch error.", p = async ({ reports: e, request: t }) => {
|
|
@@ -79,7 +79,7 @@ var f = "Unknown report fetch error.", p = async ({ reports: e, request: t }) =>
|
|
|
79
79
|
if (n?.dirty || n?.touched) return !0;
|
|
80
80
|
}
|
|
81
81
|
return !1;
|
|
82
|
-
}, T = (e, t) => e.config.inactiveFieldPolicy ?? t ?? "omit", E = (e, t) => new g(`${e} definition "${t}" disappeared during form creation.`), D = (e) => typeof e == "object" && !!e && !Array.isArray(e), te = (e) => typeof e == "object" && !!e || typeof e == "function", O = (e) => te(e) && "then" in e && typeof e.then == "function", k = (e) => e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : e instanceof Date
|
|
82
|
+
}, T = (e, t) => e.config.inactiveFieldPolicy ?? t ?? "omit", E = (e, t) => new g(`${e} definition "${t}" disappeared during form creation.`), D = (e) => typeof e == "object" && !!e && !Array.isArray(e), te = (e) => typeof e == "object" && !!e || typeof e == "function", O = (e) => te(e) && "then" in e && typeof e.then == "function", k = (e) => e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : e instanceof Date && Number.isNaN(e.getTime()), ne = (e) => e, A = (e) => {
|
|
83
83
|
let t = typeof ArrayBuffer < "u" && ArrayBuffer.isView(e), n = typeof ArrayBuffer < "u" && e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer, r = typeof Blob < "u" && e instanceof Blob || typeof File < "u" && e instanceof File;
|
|
84
84
|
if (e !== null && (typeof e == "object" || typeof e == "function") && !t && !n && !r && !Object.isFrozen(e)) {
|
|
85
85
|
Object.freeze(e);
|
|
@@ -116,7 +116,7 @@ var f = "Unknown report fetch error.", p = async ({ reports: e, request: t }) =>
|
|
|
116
116
|
}, se = (e) => typeof File < "u" && e instanceof File ? new File([e], e.name, {
|
|
117
117
|
type: e.type,
|
|
118
118
|
lastModified: e.lastModified
|
|
119
|
-
}) : typeof Blob < "u" && e instanceof Blob ? e.slice(0, e.size, e.type) : e, ce = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), le = (e, t) => e.byteLength === t.byteLength
|
|
119
|
+
}) : typeof Blob < "u" && e instanceof Blob ? e.slice(0, e.size, e.type) : e, ce = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), le = (e, t) => e.byteLength === t.byteLength && ce(new Uint8Array(e), new Uint8Array(t)), M = (e) => {
|
|
120
120
|
if (e instanceof Date) return new Date(e.getTime());
|
|
121
121
|
if (e instanceof RegExp) return new RegExp(e.source, e.flags);
|
|
122
122
|
if (e instanceof ArrayBuffer) return oe(e);
|
|
@@ -149,7 +149,7 @@ var f = "Unknown report fetch error.", p = async ({ reports: e, request: t }) =>
|
|
|
149
149
|
}
|
|
150
150
|
return n.length === 0;
|
|
151
151
|
}
|
|
152
|
-
if (typeof Blob < "u" && typeof File < "u" && e instanceof Blob && t instanceof Blob) return e.size
|
|
152
|
+
if (typeof Blob < "u" && typeof File < "u" && e instanceof Blob && t instanceof Blob) return e.size !== t.size || e.type !== t.type ? !1 : e instanceof File && t instanceof File ? e.name === t.name && e.lastModified === t.lastModified : !0;
|
|
153
153
|
if (Array.isArray(e) && Array.isArray(t)) return e.length === t.length && e.every((e, n) => N(e, t[n]));
|
|
154
154
|
if (D(e) && D(t)) {
|
|
155
155
|
let n = Object.keys(e), r = Object.keys(t);
|
|
@@ -163,7 +163,7 @@ var f = "Unknown report fetch error.", p = async ({ reports: e, request: t }) =>
|
|
|
163
163
|
}), ue = (e, t) => {
|
|
164
164
|
if (e.config.includeInSubmission === !1) return !1;
|
|
165
165
|
let n = t(e), r = e.state;
|
|
166
|
-
return
|
|
166
|
+
return !!r.visible && !r.disabled || n !== "omit" && n !== "reset-on-hide";
|
|
167
167
|
}, de = (e) => e.kind === "onehot-category" && Array.isArray(e.options), fe = (e, t, n, r) => {
|
|
168
168
|
j(e, ie(t, n), M(r));
|
|
169
169
|
}, pe = (e, t) => {
|
|
@@ -189,7 +189,7 @@ var f = "Unknown report fetch error.", p = async ({ reports: e, request: t }) =>
|
|
|
189
189
|
let t = e.config.displayKey.trim();
|
|
190
190
|
return t.length > 0 ? t : void 0;
|
|
191
191
|
}, he = (e, t, n, r, i) => {
|
|
192
|
-
if (
|
|
192
|
+
if (n.state.visible && r !== void 0) {
|
|
193
193
|
if (t.has(r)) throw Error(`field "${n.id}": duplicate displayKey "${r}".`);
|
|
194
194
|
t.add(r), e[r] = M(i);
|
|
195
195
|
}
|
|
@@ -622,7 +622,7 @@ var f = "Unknown report fetch error.", p = async ({ reports: e, request: t }) =>
|
|
|
622
622
|
reports: a.reports,
|
|
623
623
|
signal: D
|
|
624
624
|
}, l = await n.submit(c);
|
|
625
|
-
if (
|
|
625
|
+
if (_.getCurrentRequestId() !== f || t.getState().lifecycleVersion !== E || D.aborted || _.isAborted(f)) throw S(_.getAbortReason(f));
|
|
626
626
|
let u = Ne(l), d = {
|
|
627
627
|
backend: p,
|
|
628
628
|
...w,
|
|
@@ -666,10 +666,10 @@ var f = "Unknown report fetch error.", p = async ({ reports: e, request: t }) =>
|
|
|
666
666
|
_.reset();
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
|
-
}, Le = (e) => typeof e == "object" && !!e && !Array.isArray(e), V = (e, t) => Object.is(e, t), Re = (e, t) => e === t
|
|
669
|
+
}, Le = (e) => typeof e == "object" && !!e && !Array.isArray(e), V = (e, t) => Object.is(e, t), Re = (e, t) => e === t || e.length === t.length && e.every((e, n) => Object.is(e, t[n])), ze = (e, t) => {
|
|
670
670
|
if (e === t) return !0;
|
|
671
671
|
let n = Object.keys(e), r = Object.keys(t);
|
|
672
|
-
return n.length === r.length
|
|
672
|
+
return n.length === r.length && n.every((n) => Object.is(e[n], t[n]));
|
|
673
673
|
}, Be = (e, t) => Object.is(e, t) ? !0 : Array.isArray(e) && Array.isArray(t) ? Re(e, t) : Le(e) && Le(t) ? ze(e, t) : !1, Ve = (e) => {
|
|
674
674
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e.getTime();
|
|
675
675
|
if (typeof e == "number") return Number.isNaN(e) ? null : e;
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { array as e, never as t, strictObject as n, toJSONSchema as r, xor as i } from "zod";
|
|
2
2
|
//#region src/schema/ids.ts
|
|
3
|
-
var
|
|
3
|
+
var a = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "item", o = (e, t) => {
|
|
4
4
|
if (typeof e == "string" || typeof e == "number") return e;
|
|
5
5
|
if (e) return (t ? e[t] : void 0) ?? e.default ?? void 0;
|
|
6
|
-
},
|
|
7
|
-
let
|
|
8
|
-
if (t !== void 0 || typeof e != "object" || !e) return
|
|
9
|
-
let
|
|
6
|
+
}, s = (e) => String(e), c = (e, t) => {
|
|
7
|
+
let n = o(e, t);
|
|
8
|
+
if (t !== void 0 || typeof e != "object" || !e) return n === void 0 ? [] : [n];
|
|
9
|
+
let r = /* @__PURE__ */ new Set();
|
|
10
10
|
return Object.values(e).filter((e) => {
|
|
11
11
|
if (typeof e != "string" && typeof e != "number") return !1;
|
|
12
|
-
let t =
|
|
13
|
-
return
|
|
12
|
+
let t = s(e);
|
|
13
|
+
return !r.has(t) && (r.add(t), !0);
|
|
14
14
|
});
|
|
15
|
-
},
|
|
15
|
+
}, l = (e, t) => {
|
|
16
16
|
if (typeof e == "string" || typeof e == "number") return [{
|
|
17
17
|
backend: t ?? "default",
|
|
18
18
|
mappedTo: e
|
|
19
19
|
}];
|
|
20
20
|
if (!e) return [];
|
|
21
21
|
if (t) {
|
|
22
|
-
let
|
|
23
|
-
return
|
|
22
|
+
let n = o(e, t);
|
|
23
|
+
return n === void 0 ? [] : [{
|
|
24
24
|
backend: t,
|
|
25
|
-
mappedTo:
|
|
25
|
+
mappedTo: n
|
|
26
26
|
}];
|
|
27
27
|
}
|
|
28
28
|
return Object.entries(e).flatMap(([e, t]) => typeof t == "string" || typeof t == "number" ? [{
|
|
29
29
|
backend: e,
|
|
30
30
|
mappedTo: t
|
|
31
31
|
}] : []);
|
|
32
|
-
},
|
|
33
|
-
let n =
|
|
34
|
-
if (
|
|
35
|
-
let e =
|
|
32
|
+
}, u = (e, t) => {
|
|
33
|
+
let n = l(e.mappedTo, t.backend), r = t.reports.filter((e) => n.some((t) => t.backend === e.backend && s(t.mappedTo) === s(e.mappedTo)));
|
|
34
|
+
if (r.length > 1) {
|
|
35
|
+
let e = r[0];
|
|
36
36
|
throw Error(`Duplicate report result for backend "${e?.backend}" and mappedTo "${String(e?.mappedTo)}".`);
|
|
37
37
|
}
|
|
38
|
-
return
|
|
39
|
-
},
|
|
40
|
-
let n =
|
|
38
|
+
return r[0];
|
|
39
|
+
}, d = (e, t) => {
|
|
40
|
+
let n = u(e, t);
|
|
41
41
|
return n?.status === "ready" ? n.payload : void 0;
|
|
42
|
-
},
|
|
42
|
+
}, f = class extends Error {
|
|
43
43
|
constructor(e) {
|
|
44
44
|
super(e), this.name = "RegistryError";
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, p = class {
|
|
47
47
|
fieldDefinitions = /* @__PURE__ */ new Map();
|
|
48
48
|
reportDefinitions = /* @__PURE__ */ new Map();
|
|
49
49
|
registerField(e) {
|
|
50
|
-
if (this.fieldDefinitions.has(e.kind)) throw new
|
|
50
|
+
if (this.fieldDefinitions.has(e.kind)) throw new f(`Field kind "${e.kind}" is already registered.`);
|
|
51
51
|
return this.fieldDefinitions.set(e.kind, e), this;
|
|
52
52
|
}
|
|
53
53
|
unregisterField(e) {
|
|
54
54
|
return this.fieldDefinitions.delete(e), this;
|
|
55
55
|
}
|
|
56
56
|
registerReport(e) {
|
|
57
|
-
if (this.reportDefinitions.has(e.kind)) throw new
|
|
57
|
+
if (this.reportDefinitions.has(e.kind)) throw new f(`Report kind "${e.kind}" is already registered.`);
|
|
58
58
|
return this.reportDefinitions.set(e.kind, e), this;
|
|
59
59
|
}
|
|
60
60
|
unregisterReport(e) {
|
|
@@ -72,68 +72,68 @@ var t = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/
|
|
|
72
72
|
listReports() {
|
|
73
73
|
return Array.from(this.reportDefinitions.values());
|
|
74
74
|
}
|
|
75
|
-
},
|
|
75
|
+
}, m = () => new p(), h = (e) => e, g = (e) => e, _ = class extends Error {
|
|
76
76
|
path;
|
|
77
77
|
code;
|
|
78
78
|
constructor(e, t, n = "invalid-config") {
|
|
79
79
|
super(e), this.path = t, this.code = n, this.name = "SchemaNormalizationError";
|
|
80
80
|
}
|
|
81
|
-
},
|
|
82
|
-
if (typeof n != "object" || !n) throw new
|
|
81
|
+
}, v = (e, t, n, r, i) => {
|
|
82
|
+
if (typeof n != "object" || !n) throw new _(`Series field "${e}" requires "${t}" configuration.`, [
|
|
83
83
|
"fields",
|
|
84
84
|
i,
|
|
85
85
|
t
|
|
86
86
|
]);
|
|
87
87
|
let a = "kind" in n && typeof n.kind == "string" ? n.kind : "";
|
|
88
|
-
if (a.length === 0) throw new
|
|
88
|
+
if (a.length === 0) throw new _(`Series field "${e}" requires "${t}.kind".`, [
|
|
89
89
|
"fields",
|
|
90
90
|
i,
|
|
91
91
|
t,
|
|
92
92
|
"kind"
|
|
93
93
|
]);
|
|
94
|
-
if (a === "series") throw new
|
|
94
|
+
if (a === "series") throw new _(`Series field "${e}" cannot nest series in "${t}".`, [
|
|
95
95
|
"fields",
|
|
96
96
|
i,
|
|
97
97
|
t,
|
|
98
98
|
"kind"
|
|
99
99
|
]);
|
|
100
|
-
if (!r.getField(a)) throw new
|
|
100
|
+
if (!r.getField(a)) throw new _(`Series field "${e}" uses unknown sub-field kind "${a}" in "${t}".`, [
|
|
101
101
|
"fields",
|
|
102
102
|
i,
|
|
103
103
|
t,
|
|
104
104
|
"kind"
|
|
105
105
|
], "unknown-kind");
|
|
106
|
-
},
|
|
107
|
-
if (e.kind === "series" && (
|
|
106
|
+
}, y = (e, t, n) => {
|
|
107
|
+
if (e.kind === "series" && (v(e.label, "field1", e.field1, t, n), v(e.label, "field2", e.field2, t, n), typeof e.minPoints == "number" && typeof e.maxPoints == "number" && e.minPoints > e.maxPoints)) throw new _(`Series field "${e.label}" requires minPoints to be less than or equal to maxPoints.`, [
|
|
108
108
|
"fields",
|
|
109
109
|
n,
|
|
110
110
|
"minPoints"
|
|
111
111
|
]);
|
|
112
|
-
},
|
|
113
|
-
let o =
|
|
112
|
+
}, b = (e, t, n, r, i) => {
|
|
113
|
+
let o = a((e ?? t) || r);
|
|
114
114
|
if (e) {
|
|
115
|
-
if (
|
|
116
|
-
return
|
|
115
|
+
if (n.has(o)) throw new _(`Duplicate explicit id "${o}" in schema.`, i);
|
|
116
|
+
return n.add(o), o;
|
|
117
117
|
}
|
|
118
118
|
let s = o, c = 2;
|
|
119
|
-
for (;
|
|
120
|
-
return
|
|
121
|
-
},
|
|
119
|
+
for (; n.has(s);) s = `${o}-${c}`, c += 1;
|
|
120
|
+
return n.add(s), s;
|
|
121
|
+
}, x = (e, t, n, r) => {
|
|
122
122
|
let i = n.getField(e.kind);
|
|
123
|
-
if (!i) throw new
|
|
123
|
+
if (!i) throw new f(`Unknown field kind "${e.kind}".`);
|
|
124
124
|
let a = i.schema.parse(e);
|
|
125
|
-
return
|
|
125
|
+
return y(a, n, t), {
|
|
126
126
|
...a,
|
|
127
|
-
id:
|
|
127
|
+
id: b(a.id, a.label, r, `field-${t + 1}`, [
|
|
128
128
|
"fields",
|
|
129
129
|
t,
|
|
130
130
|
"id"
|
|
131
131
|
])
|
|
132
132
|
};
|
|
133
|
-
},
|
|
133
|
+
}, S = (e, t, n, r) => {
|
|
134
134
|
let i = n.getReport(e.kind);
|
|
135
|
-
if (!i) throw new
|
|
136
|
-
let a = i.schema.parse(e), o =
|
|
135
|
+
if (!i) throw new f(`Unknown report kind "${e.kind}".`);
|
|
136
|
+
let a = i.schema.parse(e), o = b(e.id ?? a.id, e.label ?? a.label ?? a.kind, r, `report-${t + 1}`, [
|
|
137
137
|
"reports",
|
|
138
138
|
t,
|
|
139
139
|
"id"
|
|
@@ -146,62 +146,62 @@ var t = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/
|
|
|
146
146
|
...e.ui === void 0 ? {} : { ui: e.ui },
|
|
147
147
|
id: o
|
|
148
148
|
};
|
|
149
|
-
},
|
|
150
|
-
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = (e.reports ?? []).map((e, n) =>
|
|
149
|
+
}, C = (e, t) => {
|
|
150
|
+
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = (e.reports ?? []).map((e, n) => S(e, n, t, r));
|
|
151
151
|
return {
|
|
152
|
-
fields: e.fields.map((e, r) =>
|
|
152
|
+
fields: e.fields.map((e, r) => x(e, r, t, n)),
|
|
153
153
|
reports: i
|
|
154
154
|
};
|
|
155
|
-
},
|
|
155
|
+
}, w = (e) => e === 1 || e === "1" || e === !0, T = (e, t, n = {}) => {
|
|
156
156
|
if (e.kind !== "onehot-category" || !Array.isArray(e.options)) return;
|
|
157
|
-
let
|
|
158
|
-
for (let
|
|
159
|
-
let c =
|
|
160
|
-
if (c === void 0) throw Error(`onehot-category "${e.id ?? e.kind}": option "${
|
|
161
|
-
let l =
|
|
162
|
-
if (
|
|
163
|
-
if (
|
|
164
|
-
if (
|
|
165
|
-
|
|
157
|
+
let r = /* @__PURE__ */ new Set(), i;
|
|
158
|
+
for (let a of e.options) {
|
|
159
|
+
let c = o(a.mappedTo, n.backend);
|
|
160
|
+
if (c === void 0) throw Error(`onehot-category "${e.id ?? e.kind}": option "${a.value}" has no mappedTo.`);
|
|
161
|
+
let l = s(c);
|
|
162
|
+
if (r.has(l)) throw Error(`onehot-category "${e.id ?? e.kind}": duplicate mappedTo "${l}".`);
|
|
163
|
+
if (r.add(l), w(t[l])) {
|
|
164
|
+
if (i !== void 0) throw Error(`onehot-category "${e.id ?? e.kind}": multiple selected mapped values.`);
|
|
165
|
+
i = a.value;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
return
|
|
169
|
-
},
|
|
168
|
+
return i;
|
|
169
|
+
}, E = (e) => {
|
|
170
170
|
if (typeof e == "string") return e;
|
|
171
171
|
if (typeof e != "number") return e.id ?? e.config?.id;
|
|
172
|
-
},
|
|
172
|
+
}, D = (e, t) => {
|
|
173
173
|
if (typeof e == "string" || typeof e == "number") return String(e);
|
|
174
|
-
let
|
|
175
|
-
return
|
|
176
|
-
},
|
|
177
|
-
let
|
|
174
|
+
let n = o(e.mappedTo ?? e.config?.mappedTo, t);
|
|
175
|
+
return n === void 0 ? void 0 : s(n);
|
|
176
|
+
}, O = (e, t) => Object.fromEntries(e.map((e) => {
|
|
177
|
+
let n = u(e, t), r = n?.context, i = n?.mappedTo ?? o(e.mappedTo, t.backend);
|
|
178
178
|
return [e.id, {
|
|
179
179
|
reportId: e.id,
|
|
180
180
|
kind: e.kind,
|
|
181
181
|
label: e.label,
|
|
182
182
|
mappedTo: e.mappedTo,
|
|
183
|
-
target:
|
|
184
|
-
targetKey:
|
|
185
|
-
backend:
|
|
186
|
-
displayValues:
|
|
187
|
-
modelValues:
|
|
183
|
+
target: i,
|
|
184
|
+
targetKey: i === void 0 ? void 0 : s(i),
|
|
185
|
+
backend: n?.backend ?? t.backend,
|
|
186
|
+
displayValues: r?.displayValues ?? t.displayValues,
|
|
187
|
+
modelValues: r?.modelValues ?? t.modelValues,
|
|
188
188
|
reports: t.reports,
|
|
189
|
-
meta:
|
|
190
|
-
raw:
|
|
189
|
+
meta: r?.meta ?? t.meta,
|
|
190
|
+
raw: r && "raw" in r ? r.raw : t.raw
|
|
191
191
|
}];
|
|
192
|
-
})),
|
|
193
|
-
let n = e.reportContexts, r =
|
|
192
|
+
})), k = (e, t) => {
|
|
193
|
+
let n = e.reportContexts, r = E(t);
|
|
194
194
|
if (r && n[r]) return n[r];
|
|
195
|
-
let i =
|
|
195
|
+
let i = D(t, e.backend);
|
|
196
196
|
if (i === void 0) return;
|
|
197
197
|
let a = Object.values(n).filter((t) => t.targetKey === i && (e.backend === void 0 || t.backend === e.backend));
|
|
198
198
|
return a.length === 1 ? a[0] : void 0;
|
|
199
|
-
},
|
|
200
|
-
if (!
|
|
199
|
+
}, A = (e) => typeof e == "object" && !!e && !Array.isArray(e), j = (e, t) => {
|
|
200
|
+
if (!A(e)) return [];
|
|
201
201
|
let n = [], r = (r) => {
|
|
202
202
|
let i = e[r];
|
|
203
203
|
Array.isArray(i) && i.forEach((e, i) => {
|
|
204
|
-
if (
|
|
204
|
+
if (A(e) && typeof e.kind == "string" && ((r === "fields" ? t.getField(e.kind) : t.getReport(e.kind)) || n.push({
|
|
205
205
|
section: r,
|
|
206
206
|
index: i,
|
|
207
207
|
kind: e.kind,
|
|
@@ -212,7 +212,7 @@ var t = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/
|
|
|
212
212
|
]
|
|
213
213
|
}), r === "fields" && e.kind === "series")) for (let a of ["field1", "field2"]) {
|
|
214
214
|
let o = e[a];
|
|
215
|
-
|
|
215
|
+
A(o) && typeof o.kind == "string" && (t.getField(o.kind) || n.push({
|
|
216
216
|
section: r,
|
|
217
217
|
index: i,
|
|
218
218
|
kind: o.kind,
|
|
@@ -222,12 +222,12 @@ var t = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/
|
|
|
222
222
|
a,
|
|
223
223
|
"kind"
|
|
224
224
|
]
|
|
225
|
-
});
|
|
225
|
+
}));
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
};
|
|
229
229
|
return r("fields"), r("reports"), n;
|
|
230
|
-
},
|
|
230
|
+
}, M = (e, t, n, r) => {
|
|
231
231
|
if (!Array.isArray(t)) {
|
|
232
232
|
r.push({
|
|
233
233
|
path: [e],
|
|
@@ -237,7 +237,7 @@ var t = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/
|
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
239
|
t.forEach((t, i) => {
|
|
240
|
-
if (!
|
|
240
|
+
if (!A(t)) {
|
|
241
241
|
r.push({
|
|
242
242
|
path: [e, i],
|
|
243
243
|
message: `${e === "fields" ? "Field" : "Report"} must be an object.`,
|
|
@@ -270,8 +270,8 @@ var t = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/
|
|
|
270
270
|
code: "invalid-config"
|
|
271
271
|
});
|
|
272
272
|
});
|
|
273
|
-
},
|
|
274
|
-
if (!
|
|
273
|
+
}, N = (e, t) => {
|
|
274
|
+
if (!A(e)) return {
|
|
275
275
|
success: !1,
|
|
276
276
|
issues: [{
|
|
277
277
|
path: [],
|
|
@@ -279,14 +279,14 @@ var t = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/
|
|
|
279
279
|
code: "invalid-schema"
|
|
280
280
|
}]
|
|
281
281
|
};
|
|
282
|
-
let n = [], r = new Set(["fields", "reports"]);
|
|
282
|
+
let n = [], r = /* @__PURE__ */ new Set(["fields", "reports"]);
|
|
283
283
|
for (let t of Object.keys(e)) r.has(t) || n.push({
|
|
284
284
|
path: [t],
|
|
285
285
|
message: `Unsupported schema property "${t}".`,
|
|
286
286
|
code: "invalid-schema"
|
|
287
287
|
});
|
|
288
|
-
|
|
289
|
-
for (let r of
|
|
288
|
+
M("fields", e.fields, t, n), M("reports", e.reports ?? [], t, n);
|
|
289
|
+
for (let r of j(e, t)) n.push({
|
|
290
290
|
path: r.path,
|
|
291
291
|
message: `Unknown ${r.section === "fields" ? "field" : "report"} kind "${r.kind}".`,
|
|
292
292
|
code: "unknown-kind"
|
|
@@ -298,11 +298,11 @@ var t = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/
|
|
|
298
298
|
try {
|
|
299
299
|
return {
|
|
300
300
|
success: !0,
|
|
301
|
-
data:
|
|
301
|
+
data: C(e, t),
|
|
302
302
|
issues: []
|
|
303
303
|
};
|
|
304
304
|
} catch (e) {
|
|
305
|
-
let t = e instanceof
|
|
305
|
+
let t = e instanceof _ ? e : void 0;
|
|
306
306
|
return {
|
|
307
307
|
success: !1,
|
|
308
308
|
issues: [{
|
|
@@ -312,39 +312,28 @@ var t = (e) => e.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/
|
|
|
312
312
|
}]
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
|
-
},
|
|
315
|
+
}, P = (e) => {
|
|
316
|
+
let n = e.map((e) => e.schema);
|
|
317
|
+
return n.length > 0 ? i(n) : t();
|
|
318
|
+
}, F = (t) => r(n({
|
|
319
|
+
fields: e(P(t.listFields())),
|
|
320
|
+
reports: e(P(t.listReports())).optional()
|
|
321
|
+
}), {
|
|
322
|
+
target: "draft-2020-12",
|
|
316
323
|
io: "input",
|
|
317
324
|
unrepresentable: "any"
|
|
318
|
-
})
|
|
319
|
-
let t = A(e);
|
|
320
|
-
return t.length > 0 ? { oneOf: t } : !1;
|
|
321
|
-
}, M = (e) => ({
|
|
322
|
-
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
323
|
-
type: "object",
|
|
324
|
-
additionalProperties: !1,
|
|
325
|
-
required: ["fields"],
|
|
326
|
-
properties: {
|
|
327
|
-
fields: {
|
|
328
|
-
type: "array",
|
|
329
|
-
items: j(e.listFields())
|
|
330
|
-
},
|
|
331
|
-
reports: {
|
|
332
|
-
type: "array",
|
|
333
|
-
items: j(e.listReports())
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}), N = (e, t = {}) => ({
|
|
325
|
+
}), I = (e, t = {}) => ({
|
|
337
326
|
reportId: t.reportId ?? "",
|
|
338
327
|
backend: e.backend,
|
|
339
328
|
inputs: e.inputs,
|
|
340
329
|
displayValues: e.displayValues,
|
|
341
330
|
modelValues: e.modelValues,
|
|
342
331
|
reports: e.reports,
|
|
343
|
-
reportContext: t.reportId === void 0 ? void 0 :
|
|
332
|
+
reportContext: t.reportId === void 0 ? void 0 : k(e, t.reportId),
|
|
344
333
|
reportContexts: e.reportContexts,
|
|
345
334
|
meta: e.meta,
|
|
346
335
|
raw: e.raw,
|
|
347
336
|
signal: t.signal
|
|
348
337
|
});
|
|
349
338
|
//#endregion
|
|
350
|
-
export {
|
|
339
|
+
export { l as _, O as a, a as b, _ as c, m as d, h as f, u as g, d as h, N as i, C as l, s as m, j as n, k as o, g as p, F as r, T as s, I as t, f as u, c as v, o as y };
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
export declare const builtinFieldDefinitions: readonly [import('./shared').BuiltinFieldDefinition<import('
|
|
1
|
+
export declare const builtinFieldDefinitions: readonly [import('./shared').BuiltinFieldDefinition<import('mlform/schema').BaseFieldConfig & {
|
|
2
2
|
kind: "text";
|
|
3
3
|
placeholder?: string;
|
|
4
4
|
minLength?: number;
|
|
5
5
|
maxLength?: number;
|
|
6
6
|
pattern?: string;
|
|
7
|
-
}, string>, import('./shared').BuiltinFieldDefinition<import('
|
|
7
|
+
}, string>, import('./shared').BuiltinFieldDefinition<import('mlform/schema').BaseFieldConfig & {
|
|
8
8
|
kind: "number";
|
|
9
9
|
min?: number;
|
|
10
10
|
max?: number;
|
|
11
11
|
step?: number;
|
|
12
12
|
unit?: string;
|
|
13
13
|
placeholder?: string;
|
|
14
|
-
}, string | number | null>, import('./shared').BuiltinFieldDefinition<import('
|
|
14
|
+
}, string | number | null>, import('./shared').BuiltinFieldDefinition<import('mlform/schema').BaseFieldConfig & {
|
|
15
15
|
kind: "boolean";
|
|
16
16
|
trueLabel?: string;
|
|
17
17
|
falseLabel?: string;
|
|
18
|
-
}, boolean | null>, import('./shared').BuiltinFieldDefinition<import('
|
|
18
|
+
}, boolean | null>, import('./shared').BuiltinFieldDefinition<import('mlform/schema').BaseFieldConfig & {
|
|
19
19
|
kind: "category";
|
|
20
20
|
options: (string | {
|
|
21
21
|
label: string;
|
|
22
22
|
value: string;
|
|
23
23
|
})[];
|
|
24
|
-
}, string | null>, import('./shared').BuiltinFieldDefinition<import('
|
|
24
|
+
}, string | null>, import('./shared').BuiltinFieldDefinition<import('mlform/schema').BaseFieldConfig & {
|
|
25
25
|
kind: "mapped-category";
|
|
26
26
|
options: {
|
|
27
27
|
label: string;
|
|
28
28
|
value: string;
|
|
29
29
|
mapping: Record<string, unknown>;
|
|
30
30
|
}[];
|
|
31
|
-
}, string | null>, import('./shared').BuiltinFieldDefinition<import('.').OneHotCategoryFieldConfig, string | null>, import('./shared').BuiltinFieldDefinition<import('
|
|
31
|
+
}, string | null>, import('./shared').BuiltinFieldDefinition<import('.').OneHotCategoryFieldConfig, string | null>, import('./shared').BuiltinFieldDefinition<import('mlform/schema').BaseFieldConfig & {
|
|
32
32
|
kind: "date";
|
|
33
33
|
min?: string;
|
|
34
34
|
max?: string;
|
|
35
35
|
step?: number;
|
|
36
|
-
}, Date | null>, import('./shared').BuiltinFieldDefinition<import('.').SeriesFieldConfig, import('.').SeriesPoint[]>, import('./shared').BuiltinFieldDefinition<import('
|
|
36
|
+
}, Date | null>, import('./shared').BuiltinFieldDefinition<import('.').SeriesFieldConfig, import('.').SeriesPoint[]>, import('./shared').BuiltinFieldDefinition<import('mlform/schema').BaseFieldConfig & {
|
|
37
37
|
kind: "long-text";
|
|
38
38
|
placeholder?: string;
|
|
39
39
|
minLength?: number;
|
|
40
40
|
maxLength?: number;
|
|
41
41
|
rows?: number;
|
|
42
|
-
}, string>, import('./shared').BuiltinFieldDefinition<import('
|
|
42
|
+
}, string>, import('./shared').BuiltinFieldDefinition<import('mlform/schema').BaseFieldConfig & {
|
|
43
43
|
kind: "single-choice";
|
|
44
44
|
options: (string | {
|
|
45
45
|
label: string;
|
|
46
46
|
value: string;
|
|
47
47
|
})[];
|
|
48
48
|
layout?: "horizontal" | "vertical";
|
|
49
|
-
}, string | null>, import('./shared').BuiltinFieldDefinition<import('
|
|
49
|
+
}, string | null>, import('./shared').BuiltinFieldDefinition<import('mlform/schema').BaseFieldConfig & {
|
|
50
50
|
kind: "multi-choice";
|
|
51
51
|
options: (string | {
|
|
52
52
|
label: string;
|
|
53
53
|
value: string;
|
|
54
54
|
})[];
|
|
55
55
|
layout?: "horizontal" | "vertical";
|
|
56
|
-
}, string[]>, import('./shared').BuiltinFieldDefinition<import('
|
|
56
|
+
}, string[]>, import('./shared').BuiltinFieldDefinition<import('mlform/schema').BaseFieldConfig & {
|
|
57
57
|
kind: "rating";
|
|
58
58
|
min?: number;
|
|
59
59
|
max: number;
|
|
60
60
|
step?: number;
|
|
61
61
|
}, number | null>];
|
|
62
|
-
export declare const builtinReportDefinitions: readonly [import('./shared').BuiltinReportDefinition<import('
|
|
62
|
+
export declare const builtinReportDefinitions: readonly [import('./shared').BuiltinReportDefinition<import('mlform/schema').BaseReportConfig & {
|
|
63
63
|
kind: "classifier";
|
|
64
64
|
labels?: string[];
|
|
65
65
|
showClassProbabilities?: boolean;
|
|
66
|
-
}>, import('./shared').BuiltinReportDefinition<import('
|
|
66
|
+
}>, import('./shared').BuiltinReportDefinition<import('mlform/schema').BaseReportConfig & {
|
|
67
67
|
kind: "regressor";
|
|
68
68
|
unit?: string;
|
|
69
69
|
precision?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseFieldConfig } from '
|
|
1
|
+
import { BaseFieldConfig } from 'mlform/schema';
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
export type SeriesPoint = {
|
|
4
4
|
field1: unknown;
|
|
@@ -30,9 +30,9 @@ export declare const seriesFieldSchema: z.ZodObject<{
|
|
|
30
30
|
disabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
31
31
|
hidden: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
32
32
|
readOnly: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
33
|
-
disabledWhen: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<(context: unknown) => boolean, (context: unknown) => boolean>, z.ZodType<import('
|
|
34
|
-
hiddenWhen: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<(context: unknown) => boolean, (context: unknown) => boolean>, z.ZodType<import('
|
|
35
|
-
readOnlyWhen: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<(context: unknown) => boolean, (context: unknown) => boolean>, z.ZodType<import('
|
|
33
|
+
disabledWhen: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<(context: unknown) => boolean, (context: unknown) => boolean>, z.ZodType<import('mlform/schema').DeclarativeFieldCondition, unknown, z.core.$ZodTypeInternals<import('mlform/schema').DeclarativeFieldCondition, unknown>>]>>;
|
|
34
|
+
hiddenWhen: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<(context: unknown) => boolean, (context: unknown) => boolean>, z.ZodType<import('mlform/schema').DeclarativeFieldCondition, unknown, z.core.$ZodTypeInternals<import('mlform/schema').DeclarativeFieldCondition, unknown>>]>>;
|
|
35
|
+
readOnlyWhen: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<(context: unknown) => boolean, (context: unknown) => boolean>, z.ZodType<import('mlform/schema').DeclarativeFieldCondition, unknown, z.core.$ZodTypeInternals<import('mlform/schema').DeclarativeFieldCondition, unknown>>]>>;
|
|
36
36
|
asyncValidationDebounceMs: z.ZodOptional<z.ZodNumber>;
|
|
37
37
|
inactiveFieldPolicy: z.ZodOptional<z.ZodEnum<{
|
|
38
38
|
include: "include";
|