mlform 0.1.15 → 0.1.18

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.
Files changed (41) hide show
  1. package/README.md +2 -2
  2. package/dist/{builtins-CcS-sHJa.js → builtins-STiTwaH9.js} +102 -107
  3. package/dist/mlform/builtins.mjs +2 -2
  4. package/dist/mlform/kit.mjs +251 -231
  5. package/dist/mlform/primitives.mjs +1 -1
  6. package/dist/mlform/runtime.mjs +3 -3
  7. package/dist/mlform/schema.mjs +2 -2
  8. package/dist/mlform/transport.mjs +1 -1
  9. package/dist/{primitives-9obTthA6.js → primitives-BcXt2QWI.js} +83 -53
  10. package/dist/{runtime-Bn_x46y-.js → runtime-Eo_q4pgg.js} +610 -506
  11. package/dist/schema-CNKKJZRx.js +173 -0
  12. package/dist/{transport-D173EDlB.js → transport-Cloa_erk.js} +204 -196
  13. package/dist/types/src/builtins/constants.d.ts +0 -4
  14. package/dist/types/src/builtins/definitions/fields/series-helpers.d.ts +1 -0
  15. package/dist/types/src/builtins/definitions/shared.d.ts +1 -1
  16. package/dist/types/src/kit/mount-types.d.ts +2 -0
  17. package/dist/types/src/kit/view-core-types.d.ts +4 -1
  18. package/dist/types/src/primitives/components/form-root-templates.d.ts +3 -1
  19. package/dist/types/src/primitives/components/form-root.d.ts +3 -1
  20. package/dist/types/src/primitives/components/report-frame.d.ts +2 -1
  21. package/dist/types/src/primitives/controller-types.d.ts +46 -2
  22. package/dist/types/src/primitives/types.d.ts +6 -2
  23. package/dist/types/src/runtime/index.d.ts +4 -2
  24. package/dist/types/src/runtime/submission/index.d.ts +2 -0
  25. package/dist/types/src/runtime/submission/multi-backend.d.ts +25 -0
  26. package/dist/types/src/runtime/submission/request.d.ts +14 -0
  27. package/dist/types/src/runtime/submission/snapshot.d.ts +12 -0
  28. package/dist/types/src/runtime/types/behavior.d.ts +4 -0
  29. package/dist/types/src/runtime/types/field.d.ts +1 -0
  30. package/dist/types/src/runtime/types/form.d.ts +4 -0
  31. package/dist/types/src/runtime/types/transport.d.ts +11 -2
  32. package/dist/types/src/schema/index.d.ts +2 -0
  33. package/dist/types/src/schema/mapped-to.d.ts +3 -2
  34. package/dist/types/src/schema/onehot-display.d.ts +15 -0
  35. package/dist/types/src/schema/report-context.d.ts +17 -0
  36. package/dist/types/src/schema/types/field.d.ts +1 -0
  37. package/dist/types/src/schema/types/report.d.ts +7 -2
  38. package/dist/types/src/schema/types/submit.d.ts +31 -1
  39. package/dist/types/src/transport/types/core.d.ts +19 -2
  40. package/package.json +2 -1
  41. package/dist/schema-DYDo_1VV.js +0 -95
@@ -1,50 +1,50 @@
1
- import { t as e } from "../runtime-Bn_x46y-.js";
2
- import { i as t, u as n } from "../schema-DYDo_1VV.js";
3
- import { n as r } from "../builtins-CcS-sHJa.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-9obTthA6.js";
5
- import { d as f, h as p, r as m } from "../design-Dr7o4rR9.js";
6
- import { LitElement as h, css as g, html as _, nothing as v } from "lit";
7
- import { customElement as y, property as b, state as x } from "lit/decorators.js";
8
- import { repeat as S } from "lit/directives/repeat.js";
1
+ import { _ as e, t } from "../runtime-Eo_q4pgg.js";
2
+ import { m as n, s as r } from "../schema-CNKKJZRx.js";
3
+ import { n as i } from "../builtins-STiTwaH9.js";
4
+ import { _ as a, a as o, h as s, l as c, m as l, p as u, r as d, t as f } from "../primitives-BcXt2QWI.js";
5
+ import { d as p, h as m, r as h } from "../design-Dr7o4rR9.js";
6
+ import { LitElement as g, css as _, html as v, nothing as y } from "lit";
7
+ import { customElement as b, property as x, state as S } from "lit/decorators.js";
8
+ import { repeat as C } from "lit/directives/repeat.js";
9
9
  //#region src/kit/defaults.ts
10
- var C = { ...c }, w = {
10
+ var w = { ...l }, T = {
11
11
  mode: "auto",
12
12
  theme: "neutral",
13
13
  recipe: "default"
14
14
  }, ee = (e) => {
15
- let n = t();
16
- for (let t of e.listFields()) n.registerField(t);
17
- for (let t of e.listReports()) n.registerReport(t);
18
- return n;
19
- }, te = (e) => e?.clone() ?? u(), ne = (e) => e?.clone() ?? p.clone(), re = (e = {}) => ({
20
- ...C,
15
+ let t = r();
16
+ for (let n of e.listFields()) t.registerField(n);
17
+ for (let n of e.listReports()) t.registerReport(n);
18
+ return t;
19
+ }, te = (e) => e?.clone() ?? d(), ne = (e) => e?.clone() ?? m.clone(), re = (e = {}) => ({
20
+ ...w,
21
21
  ...e
22
- }), ie = (e = {}) => f(w, e), T = (e, t) => {
23
- if (t(e), "children" in e) for (let n of e.children) T(n, t);
24
- }, E = (e, t) => {
22
+ }), ie = (e = {}) => p(T, e), E = (e, t) => {
23
+ if (t(e), "children" in e) for (let n of e.children) E(n, t);
24
+ }, D = (e, t) => {
25
25
  switch (e.kind) {
26
26
  case "stacked":
27
27
  case "split":
28
- for (let n of e.children) T(n, t);
28
+ for (let n of e.children) E(n, t);
29
29
  return;
30
30
  case "wizard":
31
- for (let n of e.steps) for (let e of n.children) T(e, t);
31
+ for (let n of e.steps) for (let e of n.children) E(e, t);
32
32
  return;
33
33
  case "tabs":
34
- for (let n of e.tabs) for (let e of n.children) T(e, t);
34
+ for (let n of e.tabs) for (let e of n.children) E(e, t);
35
35
  return;
36
36
  }
37
- }, D = (e) => {
37
+ }, O = (e) => {
38
38
  let t = [];
39
- return E(e, (e) => {
39
+ return D(e, (e) => {
40
40
  t.push(e);
41
41
  }), t;
42
- }, O = (e) => {
42
+ }, k = (e) => {
43
43
  let t = {
44
44
  fields: [],
45
45
  reports: []
46
46
  };
47
- for (let n of D(e)) switch (n.kind) {
47
+ for (let n of O(e)) switch (n.kind) {
48
48
  case "field":
49
49
  t.fields.push(n.field);
50
50
  break;
@@ -54,7 +54,7 @@ var C = { ...c }, w = {
54
54
  default: break;
55
55
  }
56
56
  return t;
57
- }, k = {
57
+ }, A = {
58
58
  invalidDesignSystemSnapshot: "replaceDesignSystem requires an explicit mode, theme, and recipe.",
59
59
  fieldDuplicateInLayout: (e) => `Field "${e}" appears multiple times in layout.`,
60
60
  fieldMissingInLayout: (e) => `Field "${e}" is missing from layout.`,
@@ -71,7 +71,7 @@ var C = { ...c }, w = {
71
71
  unknownTab: (e) => `Unknown tab "${e}".`,
72
72
  unknownWizardStep: (e) => `Unknown wizard step "${e}".`,
73
73
  unknownDisclosureSection: (e) => `Unknown disclosure section "${e}".`
74
- }, A = {
74
+ }, j = {
75
75
  wizard: "mlf-kit-wizard",
76
76
  tabs: "mlf-kit-tabs",
77
77
  disclosure: "mlf-kit-disclosure",
@@ -81,64 +81,64 @@ var C = { ...c }, w = {
81
81
  }, oe = (e) => {
82
82
  let t = e.getSnapshot().fields.filter((e) => e.state.visible && e.state.errors.length > 0), n = new Map(e.getLayoutReferences().fields.map((e, t) => [e, t]));
83
83
  return t.sort((e, t) => (n.get(e.id) ?? 0) - (n.get(t.id) ?? 0)), t[0] ?? null;
84
- }, j = async (e, t, n) => {
84
+ }, M = async (e, t, n) => {
85
85
  let r = oe(t);
86
86
  if (!r) return !1;
87
87
  let i = t.getSnapshot().layout.kind;
88
88
  return i === "wizard" && r.stepId && await t.goToStep(r.stepId), i === "tabs" && r.tabId && t.setActiveTab(r.tabId), r.sectionId && t.openSection(r.sectionId), await ae(e), n(e, r.id);
89
- }, M = ({ node: e, view: t, snapshot: n, registry: r, primitiveText: i = o, sectionClass: a, sectionCopyClass: s, sectionTitleClass: c, sectionDescriptionClass: l, childrenClass: u, groupBaseClass: d }) => {
89
+ }, N = ({ node: e, view: t, snapshot: n, registry: r, primitiveText: i = s, sectionClass: a, sectionCopyClass: o, sectionTitleClass: c, sectionDescriptionClass: l, childrenClass: u, groupBaseClass: d }) => {
90
90
  switch (e.kind) {
91
91
  case "section": {
92
- let o = n.disclosure?.openSectionIds.includes(e.id) ?? !0;
93
- return _`
92
+ let s = n.disclosure?.openSectionIds.includes(e.id) ?? !0;
93
+ return v`
94
94
  <section class=${a} data-section-id=${e.id}>
95
- ${e.title || e.description ? _`
95
+ ${e.title || e.description ? v`
96
96
  <button
97
97
  type="button"
98
- class=${s}
99
- aria-expanded=${String(o)}
98
+ class=${o}
99
+ aria-expanded=${String(s)}
100
100
  @click=${() => t?.toggleSection(e.id)}
101
101
  >
102
102
  <span class="section-label">
103
- ${e.title ? _`<span class=${c}>${e.title}</span>` : v}
104
- ${e.description ? _`<span class=${l}>${e.description}</span>` : v}
103
+ ${e.title ? v`<span class=${c}>${e.title}</span>` : y}
104
+ ${e.description ? v`<span class=${l}>${e.description}</span>` : y}
105
105
  </span>
106
- <span class="section-toggle-icon" aria-hidden="true">${o ? "−" : "+"}</span>
106
+ <span class="section-toggle-icon" aria-hidden="true">${s ? "−" : "+"}</span>
107
107
  </button>
108
- ` : v}
109
- ${o ? _`
108
+ ` : y}
109
+ ${s ? v`
110
110
  <div class=${u}>
111
- ${S(e.children, (t, n) => `${e.id}-${n}`, (e) => M({
111
+ ${C(e.children, (t, n) => `${e.id}-${n}`, (e) => N({
112
112
  node: e,
113
113
  view: t,
114
114
  snapshot: n,
115
115
  registry: r,
116
116
  primitiveText: i,
117
117
  sectionClass: a,
118
- sectionCopyClass: s,
118
+ sectionCopyClass: o,
119
119
  sectionTitleClass: c,
120
120
  sectionDescriptionClass: l,
121
121
  childrenClass: u,
122
122
  groupBaseClass: d
123
123
  }))}
124
124
  </div>
125
- ` : v}
125
+ ` : y}
126
126
  </section>
127
127
  `;
128
128
  }
129
- case "group": return _`
129
+ case "group": return v`
130
130
  <div
131
131
  class=${`${d}${e.columns ? ` columns-${e.columns}` : ""}`}
132
132
  data-group-id=${e.id}
133
133
  >
134
- ${S(e.children, (t, n) => `${e.id}-${n}`, (e) => M({
134
+ ${C(e.children, (t, n) => `${e.id}-${n}`, (e) => N({
135
135
  node: e,
136
136
  view: t,
137
137
  snapshot: n,
138
138
  registry: r,
139
139
  primitiveText: i,
140
140
  sectionClass: a,
141
- sectionCopyClass: s,
141
+ sectionCopyClass: o,
142
142
  sectionTitleClass: c,
143
143
  sectionDescriptionClass: l,
144
144
  childrenClass: u,
@@ -148,7 +148,7 @@ var C = { ...c }, w = {
148
148
  `;
149
149
  case "field": {
150
150
  let t = n.fields.find((t) => t.id === e.field);
151
- return t ? _`
151
+ return t ? v`
152
152
  <mlf-field-frame
153
153
  data-field-id=${t.id}
154
154
  .controller=${t.controller}
@@ -156,11 +156,11 @@ var C = { ...c }, w = {
156
156
  .registry=${r}
157
157
  .text=${i}
158
158
  ></mlf-field-frame>
159
- ` : v;
159
+ ` : y;
160
160
  }
161
161
  case "report": {
162
162
  let t = n.reports.find((t) => t.id === e.report);
163
- return t ? _`
163
+ return t ? v`
164
164
  <mlf-report-frame
165
165
  .controller=${t.controller}
166
166
  .descriptor=${t.descriptor}
@@ -168,10 +168,10 @@ var C = { ...c }, w = {
168
168
  .text=${i}
169
169
  .lastResult=${n.form.lastResult}
170
170
  ></mlf-report-frame>
171
- ` : v;
171
+ ` : y;
172
172
  }
173
173
  }
174
- }, se = g`
174
+ }, se = _`
175
175
  :host {
176
176
  display: block;
177
177
  inline-size: 100%;
@@ -354,7 +354,7 @@ var C = { ...c }, w = {
354
354
  align-items: stretch;
355
355
  }
356
356
  }
357
- `, N = class extends h {
357
+ `, P = class extends g {
358
358
  static styles = se;
359
359
  #e;
360
360
  get view() {
@@ -370,7 +370,7 @@ var C = { ...c }, w = {
370
370
  set registry(e) {
371
371
  this.#t = e;
372
372
  }
373
- #n = o;
373
+ #n = s;
374
374
  get primitiveText() {
375
375
  return this.#n;
376
376
  }
@@ -416,13 +416,13 @@ var C = { ...c }, w = {
416
416
  }
417
417
  render() {
418
418
  let e = this.snapshot;
419
- if (!e || e.layout.kind !== "stacked" && e.layout.kind !== "split") return _``;
419
+ if (!e || e.layout.kind !== "stacked" && e.layout.kind !== "split") return v``;
420
420
  let t = e.form.status, n = t === "validating" ? this.validatingLabel : t === "submitting" ? this.submittingLabel : this.submitLabel;
421
- return _`
421
+ return v`
422
422
  <section class="root" part="layout-panel">
423
423
  <div class="body">
424
424
  <div class="collection">
425
- ${S(e.layout.children, (e, t) => `root-${t}`, (t) => M({
425
+ ${C(e.layout.children, (e, t) => `root-${t}`, (t) => N({
426
426
  node: t,
427
427
  view: this.view,
428
428
  snapshot: e,
@@ -456,14 +456,14 @@ var C = { ...c }, w = {
456
456
  if (this.view) try {
457
457
  await this.view.submit();
458
458
  } catch (e) {
459
- if (!await j(this, this.view, s)) throw e;
459
+ if (!await M(this, this.view, c)) throw e;
460
460
  }
461
461
  };
462
462
  };
463
- l([b({ attribute: !1 })], N.prototype, "view", null), l([b({ attribute: !1 })], N.prototype, "registry", null), l([b({ attribute: !1 })], N.prototype, "primitiveText", null), l([b({ type: String })], N.prototype, "submitLabel", null), l([b({ type: String })], N.prototype, "validatingLabel", null), l([b({ type: String })], N.prototype, "submittingLabel", null), l([x()], N.prototype, "snapshot", null), N = l([y(A.disclosure)], N);
463
+ u([x({ attribute: !1 })], P.prototype, "view", null), u([x({ attribute: !1 })], P.prototype, "registry", null), u([x({ attribute: !1 })], P.prototype, "primitiveText", null), u([x({ type: String })], P.prototype, "submitLabel", null), u([x({ type: String })], P.prototype, "validatingLabel", null), u([x({ type: String })], P.prototype, "submittingLabel", null), u([S()], P.prototype, "snapshot", null), P = u([b(j.disclosure)], P);
464
464
  //#endregion
465
465
  //#region src/kit/tabs-root-styles.ts
466
- var ce = g`
466
+ var ce = _`
467
467
  :host {
468
468
  display: block;
469
469
  flex: 1 1 auto;
@@ -686,7 +686,7 @@ var ce = g`
686
686
  justify-content: space-between;
687
687
  }
688
688
  }
689
- `, P = class extends h {
689
+ `, F = class extends g {
690
690
  static styles = ce;
691
691
  #e;
692
692
  get view() {
@@ -702,7 +702,7 @@ var ce = g`
702
702
  set registry(e) {
703
703
  this.#t = e;
704
704
  }
705
- #n = o;
705
+ #n = s;
706
706
  get primitiveText() {
707
707
  return this.#n;
708
708
  }
@@ -748,14 +748,14 @@ var ce = g`
748
748
  }
749
749
  render() {
750
750
  let e = this.snapshot, t = e?.tabs;
751
- if (!e || !t || e.layout.kind !== "tabs") return _``;
751
+ if (!e || !t || e.layout.kind !== "tabs") return v``;
752
752
  let n = e.layout.tabs[t.activeTabIndex];
753
- if (!n) return _``;
753
+ if (!n) return v``;
754
754
  let r = e.form.status, i = r === "validating" ? this.validatingLabel : r === "submitting" ? this.submittingLabel : this.submitLabel;
755
- return _`
755
+ return v`
756
756
  <section class="root" part="tabs-panel">
757
757
  <div class="tablist" role="tablist" aria-label="Form sections">
758
- ${S(e.layout.tabs, (e) => e.id, (e, n) => _`
758
+ ${C(e.layout.tabs, (e) => e.id, (e, n) => v`
759
759
  <button
760
760
  type="button"
761
761
  class="tab"
@@ -776,16 +776,16 @@ var ce = g`
776
776
  id=${`panel-${n.id}`}
777
777
  aria-labelledby=${`tab-${n.id}`}
778
778
  >
779
- ${n.title || n.description ? _`
779
+ ${n.title || n.description ? v`
780
780
  <header class="tab-header">
781
781
  <h1 class="tab-title">${n.title}</h1>
782
- ${n.description ? _`<p class="tab-description">${n.description}</p>` : v}
782
+ ${n.description ? v`<p class="tab-description">${n.description}</p>` : y}
783
783
  </header>
784
- ` : v}
784
+ ` : y}
785
785
 
786
786
  <div class="body">
787
787
  <div class="collection">
788
- ${S(n.children, (e, t) => `${n.id}-${t}`, (t) => M({
788
+ ${C(n.children, (e, t) => `${n.id}-${t}`, (t) => N({
789
789
  node: t,
790
790
  view: this.view,
791
791
  snapshot: e,
@@ -837,15 +837,15 @@ var ce = g`
837
837
  if (this.view) try {
838
838
  await this.view.submit();
839
839
  } catch (e) {
840
- if (!await j(this, this.view, s)) throw e;
840
+ if (!await M(this, this.view, c)) throw e;
841
841
  }
842
842
  };
843
843
  };
844
- l([b({ attribute: !1 })], P.prototype, "view", null), l([b({ attribute: !1 })], P.prototype, "registry", null), l([b({ attribute: !1 })], P.prototype, "primitiveText", null), l([b({ type: String })], P.prototype, "submitLabel", null), l([b({ type: String })], P.prototype, "validatingLabel", null), l([b({ type: String })], P.prototype, "submittingLabel", null), l([x()], P.prototype, "snapshot", null), P = l([y(A.tabs)], P);
844
+ u([x({ attribute: !1 })], F.prototype, "view", null), u([x({ attribute: !1 })], F.prototype, "registry", null), u([x({ attribute: !1 })], F.prototype, "primitiveText", null), u([x({ type: String })], F.prototype, "submitLabel", null), u([x({ type: String })], F.prototype, "validatingLabel", null), u([x({ type: String })], F.prototype, "submittingLabel", null), u([S()], F.prototype, "snapshot", null), F = u([b(j.tabs)], F);
845
845
  //#endregion
846
846
  //#region src/kit/step-indicator.ts
847
- var F = class extends h {
848
- static styles = g`
847
+ var I = class extends g {
848
+ static styles = _`
849
849
  :host {
850
850
  display: block;
851
851
  min-width: 0;
@@ -945,7 +945,7 @@ var F = class extends h {
945
945
  }
946
946
  render() {
947
947
  let e = this.total > 0 ? Math.round(this.current / this.total * 100) : 0;
948
- return _`
948
+ return v`
949
949
  <div
950
950
  class="indicator"
951
951
  role="status"
@@ -959,32 +959,32 @@ var F = class extends h {
959
959
  <div class="fill" style="width: ${e}%"></div>
960
960
  </div>
961
961
  <div class="dots" aria-hidden="true">
962
- ${Array.from({ length: this.total }, (e, t) => _`<div class=${t + 1 < this.current ? "dot done" : t + 1 === this.current ? "dot active" : "dot"}></div>`)}
962
+ ${Array.from({ length: this.total }, (e, t) => v`<div class=${t + 1 < this.current ? "dot done" : t + 1 === this.current ? "dot active" : "dot"}></div>`)}
963
963
  </div>
964
964
  </div>
965
965
  `;
966
966
  }
967
967
  };
968
- l([b({ type: Number })], F.prototype, "current", null), l([b({ type: Number })], F.prototype, "total", null), l([b({ type: String })], F.prototype, "label", null), F = l([y(A.stepIndicator)], F);
968
+ u([x({ type: Number })], I.prototype, "current", null), u([x({ type: Number })], I.prototype, "total", null), u([x({ type: String })], I.prototype, "label", null), I = u([b(j.stepIndicator)], I);
969
969
  //#endregion
970
970
  //#region src/kit/wizard-constants.ts
971
- var I = {
971
+ var L = {
972
972
  prev: "Previous",
973
973
  next: "Next",
974
974
  submit: "Submit",
975
975
  validating: "Validating...",
976
976
  submitting: "Submitting..."
977
- }, L = Object.freeze({
977
+ }, R = Object.freeze({
978
978
  stepLabel: (e, t) => `Step ${e} of ${t}`,
979
979
  prevLabel: "Previous",
980
980
  nextLabel: "Next",
981
981
  submitLabel: "Submit",
982
982
  validatingLabel: "Validating...",
983
983
  submittingLabel: "Submitting..."
984
- }), R = (e) => e ? Object.freeze({
985
- ...L,
984
+ }), z = (e) => e ? Object.freeze({
985
+ ...R,
986
986
  ...e
987
- }) : L, le = g`
987
+ }) : R, le = _`
988
988
  :host {
989
989
  display: block;
990
990
  flex: 1 1 auto;
@@ -1177,7 +1177,7 @@ var I = {
1177
1177
  grid-template-columns: minmax(0, 1fr);
1178
1178
  }
1179
1179
  }
1180
- `, z = class extends h {
1180
+ `, B = class extends g {
1181
1181
  static styles = le;
1182
1182
  #e;
1183
1183
  get view() {
@@ -1193,21 +1193,21 @@ var I = {
1193
1193
  set registry(e) {
1194
1194
  this.#t = e;
1195
1195
  }
1196
- #n = o;
1196
+ #n = s;
1197
1197
  get primitiveText() {
1198
1198
  return this.#n;
1199
1199
  }
1200
1200
  set primitiveText(e) {
1201
1201
  this.#n = e;
1202
1202
  }
1203
- #r = I;
1203
+ #r = L;
1204
1204
  get labels() {
1205
1205
  return this.#r;
1206
1206
  }
1207
1207
  set labels(e) {
1208
1208
  this.#r = e;
1209
1209
  }
1210
- #i = R();
1210
+ #i = z();
1211
1211
  get text() {
1212
1212
  return this.#i;
1213
1213
  }
@@ -1232,11 +1232,11 @@ var I = {
1232
1232
  }
1233
1233
  render() {
1234
1234
  let e = this.snapshot, t = e?.wizard;
1235
- if (!e || !t || e.layout.kind !== "wizard") return _``;
1235
+ if (!e || !t || e.layout.kind !== "wizard") return v``;
1236
1236
  let n = e.layout.steps[t.stepIndex];
1237
- if (!n) return _``;
1237
+ if (!n) return v``;
1238
1238
  let r = e.form.status, i = r === "validating" || r === "submitting", a = t.isLastStep ? r === "validating" ? this.labels.validating : r === "submitting" ? this.labels.submitting : this.labels.submit : this.labels.next;
1239
- return _`
1239
+ return v`
1240
1240
  <div class="root">
1241
1241
  <section class="panel" part="wizard-panel">
1242
1242
  <header class="pane-header">
@@ -1246,12 +1246,12 @@ var I = {
1246
1246
  .label=${this.text.stepLabel(t.stepIndex + 1, t.stepCount).split(" ")[0] ?? "Step"}
1247
1247
  ></mlf-kit-step-indicator>
1248
1248
  <h1 class="step-title">${n.title}</h1>
1249
- ${n.description ? _`<p class="step-description">${n.description}</p>` : v}
1249
+ ${n.description ? v`<p class="step-description">${n.description}</p>` : y}
1250
1250
  </header>
1251
1251
 
1252
1252
  <div class="pane-body">
1253
1253
  <div class="collection">
1254
- ${S(n.children, (e, t) => `${n.id}-${t}`, (t) => M({
1254
+ ${C(n.children, (e, t) => `${n.id}-${t}`, (t) => N({
1255
1255
  node: t,
1256
1256
  view: this.view,
1257
1257
  snapshot: e,
@@ -1294,23 +1294,23 @@ var I = {
1294
1294
  this.view?.prevStep();
1295
1295
  };
1296
1296
  #c = async () => {
1297
- await this.view?.nextStep() === !1 && this.view && await j(this, this.view, s);
1297
+ await this.view?.nextStep() === !1 && this.view && await M(this, this.view, c);
1298
1298
  };
1299
1299
  #l = async () => {
1300
1300
  if (this.view) {
1301
1301
  if (!await this.view.nextStep()) {
1302
- await j(this, this.view, s);
1302
+ await M(this, this.view, c);
1303
1303
  return;
1304
1304
  }
1305
1305
  try {
1306
1306
  await this.view.submit();
1307
1307
  } catch (e) {
1308
- if (!await j(this, this.view, s)) throw e;
1308
+ if (!await M(this, this.view, c)) throw e;
1309
1309
  }
1310
1310
  }
1311
1311
  };
1312
1312
  };
1313
- l([b({ attribute: !1 })], z.prototype, "view", null), l([b({ attribute: !1 })], z.prototype, "registry", null), l([b({ attribute: !1 })], z.prototype, "primitiveText", null), l([b({ attribute: !1 })], z.prototype, "labels", null), l([b({ attribute: !1 })], z.prototype, "text", null), l([x()], z.prototype, "snapshot", null), z = l([y(A.wizard)], z);
1313
+ u([x({ attribute: !1 })], B.prototype, "view", null), u([x({ attribute: !1 })], B.prototype, "registry", null), u([x({ attribute: !1 })], B.prototype, "primitiveText", null), u([x({ attribute: !1 })], B.prototype, "labels", null), u([x({ attribute: !1 })], B.prototype, "text", null), u([S()], B.prototype, "snapshot", null), B = u([b(j.wizard)], B);
1314
1314
  //#endregion
1315
1315
  //#region src/kit/layout-helpers.ts
1316
1316
  var ue = (e, t) => ({
@@ -1325,18 +1325,18 @@ var ue = (e, t) => ({
1325
1325
  reportSectionIds: /* @__PURE__ */ new Map(),
1326
1326
  fieldIdsInLayout: /* @__PURE__ */ new Set(),
1327
1327
  reportIdsInLayout: /* @__PURE__ */ new Set()
1328
- }), B = (e, t, r) => {
1328
+ }), V = (e, t, r) => {
1329
1329
  let i = n(t ?? e) || e, a = r.get(i) ?? 0;
1330
1330
  return r.set(i, a + 1), a === 0 ? i : `${i}-${a + 1}`;
1331
1331
  }, fe = (e, t) => {
1332
- if (!t.fieldIds.has(e)) throw TypeError(k.unknownFieldReference(e));
1332
+ if (!t.fieldIds.has(e)) throw TypeError(A.unknownFieldReference(e));
1333
1333
  }, pe = (e, t) => {
1334
- if (!t.reportIds.has(e)) throw TypeError(k.unknownReportReference(e));
1334
+ if (!t.reportIds.has(e)) throw TypeError(A.unknownReportReference(e));
1335
1335
  }, me = (e, t, n, r, i) => {
1336
- if (t.fieldIdsInLayout.has(e)) throw TypeError(k.fieldDuplicateInLayout(e));
1336
+ if (t.fieldIdsInLayout.has(e)) throw TypeError(A.fieldDuplicateInLayout(e));
1337
1337
  t.fieldIdsInLayout.add(e), n && t.fieldStepIds.set(e, n), r && t.fieldTabIds.set(e, r), i && t.fieldSectionIds.set(e, i);
1338
1338
  }, he = (e, t, n, r, i) => {
1339
- if (t.reportIdsInLayout.has(e)) throw TypeError(k.reportDuplicateInLayout(e));
1339
+ if (t.reportIdsInLayout.has(e)) throw TypeError(A.reportDuplicateInLayout(e));
1340
1340
  t.reportIdsInLayout.add(e), n && t.reportStepIds.set(e, n), r && t.reportTabIds.set(e, r), i && t.reportSectionIds.set(e, i);
1341
1341
  }, ge = (e, t) => [...e.map((e) => ({
1342
1342
  kind: "field",
@@ -1344,26 +1344,26 @@ var ue = (e, t) => ({
1344
1344
  })), ...t.map((e) => ({
1345
1345
  kind: "report",
1346
1346
  report: e.id
1347
- }))], V = (e, t) => {
1348
- for (let n of e) if (!t.fieldIdsInLayout.has(n.id)) throw TypeError(k.fieldMissingInLayout(n.id));
1349
- }, H = (e, t, n, r, i, a, o) => e.map((e) => {
1347
+ }))], H = (e, t) => {
1348
+ for (let n of e) if (!t.fieldIdsInLayout.has(n.id)) throw TypeError(A.fieldMissingInLayout(n.id));
1349
+ }, U = (e, t, n, r, i, a, o) => e.map((e) => {
1350
1350
  switch (e.kind) {
1351
1351
  case "section": {
1352
- let o = B("section", e.id ?? e.title, r);
1352
+ let o = V("section", e.id ?? e.title, r);
1353
1353
  return {
1354
1354
  kind: "section",
1355
1355
  id: o,
1356
1356
  title: e.title,
1357
1357
  description: e.description,
1358
1358
  defaultOpen: e.defaultOpen ?? !0,
1359
- children: H(e.children, t, n, r, i, a, o)
1359
+ children: U(e.children, t, n, r, i, a, o)
1360
1360
  };
1361
1361
  }
1362
1362
  case "group": return {
1363
1363
  kind: "group",
1364
- id: B("group", e.id, r),
1364
+ id: V("group", e.id, r),
1365
1365
  columns: e.columns,
1366
- children: H(e.children, t, n, r, i, a, o)
1366
+ children: U(e.children, t, n, r, i, a, o)
1367
1367
  };
1368
1368
  case "field": return fe(e.field, t), me(e.field, n, i, a, o), {
1369
1369
  kind: "field",
@@ -1377,8 +1377,8 @@ var ue = (e, t) => ({
1377
1377
  }), _e = (e, t, n) => {
1378
1378
  let r = ue(t, n), i = de(), a = /* @__PURE__ */ new Map();
1379
1379
  if (!e || e.kind === void 0 || e.kind === "stacked" || e.kind === "split") {
1380
- let o = H(e?.children ?? ge(t, n), r, i, a, null, null, null);
1381
- return V(t, i), {
1380
+ let o = U(e?.children ?? ge(t, n), r, i, a, null, null, null);
1381
+ return H(t, i), {
1382
1382
  layout: {
1383
1383
  kind: e?.kind ?? "stacked",
1384
1384
  children: o
@@ -1387,10 +1387,10 @@ var ue = (e, t) => ({
1387
1387
  };
1388
1388
  }
1389
1389
  if (e.kind === "tabs") {
1390
- if (e.tabs.length === 0) throw TypeError(k.tabsRequiresTabs);
1390
+ if (e.tabs.length === 0) throw TypeError(A.tabsRequiresTabs);
1391
1391
  let n = /* @__PURE__ */ new Map(), o = e.tabs.map((e, t) => {
1392
- let o = B("tab", e.id ?? e.title ?? `tab-${t + 1}`, n), s = H(e.children, r, i, a, null, o, null);
1393
- if (s.length === 0) throw TypeError(k.tabEmpty(o));
1392
+ let o = V("tab", e.id ?? e.title ?? `tab-${t + 1}`, n), s = U(e.children, r, i, a, null, o, null);
1393
+ if (s.length === 0) throw TypeError(A.tabEmpty(o));
1394
1394
  return {
1395
1395
  id: o,
1396
1396
  title: e.title,
@@ -1398,7 +1398,7 @@ var ue = (e, t) => ({
1398
1398
  children: s
1399
1399
  };
1400
1400
  });
1401
- return V(t, i), {
1401
+ return H(t, i), {
1402
1402
  layout: {
1403
1403
  kind: "tabs",
1404
1404
  tabs: o
@@ -1407,10 +1407,10 @@ var ue = (e, t) => ({
1407
1407
  };
1408
1408
  }
1409
1409
  let o = e;
1410
- if (o.steps.length === 0) throw TypeError(k.wizardRequiresSteps);
1410
+ if (o.steps.length === 0) throw TypeError(A.wizardRequiresSteps);
1411
1411
  let s = /* @__PURE__ */ new Map(), c = o.steps.map((e, t) => {
1412
- let n = B("step", e.id ?? e.title ?? `step-${t + 1}`, s), o = H(e.children, r, i, a, n, null, null);
1413
- if (o.length === 0) throw TypeError(k.wizardStepEmpty(n));
1412
+ let n = V("step", e.id ?? e.title ?? `step-${t + 1}`, s), o = U(e.children, r, i, a, n, null, null);
1413
+ if (o.length === 0) throw TypeError(A.wizardStepEmpty(n));
1414
1414
  return {
1415
1415
  id: n,
1416
1416
  title: e.title,
@@ -1418,14 +1418,14 @@ var ue = (e, t) => ({
1418
1418
  children: o
1419
1419
  };
1420
1420
  });
1421
- return V(t, i), {
1421
+ return H(t, i), {
1422
1422
  layout: {
1423
1423
  kind: "wizard",
1424
1424
  steps: c
1425
1425
  },
1426
1426
  maps: i
1427
1427
  };
1428
- }, U = (e, t, n) => {
1428
+ }, W = (e, t, n) => {
1429
1429
  if (n.length === 0) return null;
1430
1430
  let r = Math.min(Math.max(t, 0), n.length - 1);
1431
1431
  return {
@@ -1436,8 +1436,8 @@ var ue = (e, t) => ({
1436
1436
  canGoNext: r < n.length - 1,
1437
1437
  canGoPrev: r > 0
1438
1438
  };
1439
- }, W = ({ layout: e, stepIndex: t, formState: n }) => {
1440
- let r = U("wizard-step", t, (e.kind === "wizard" ? e.steps : []).map((e) => e.id));
1439
+ }, G = ({ layout: e, stepIndex: t, formState: n }) => {
1440
+ let r = W("wizard-step", t, (e.kind === "wizard" ? e.steps : []).map((e) => e.id));
1441
1441
  return r ? {
1442
1442
  stepIndex: r.index,
1443
1443
  stepCount: r.count,
@@ -1446,8 +1446,8 @@ var ue = (e, t) => ({
1446
1446
  canPrev: r.canGoPrev,
1447
1447
  isLastStep: r.index === r.count - 1
1448
1448
  } : null;
1449
- }, G = ({ layout: e, activeTabIndex: t }) => {
1450
- let n = U("tab", t, (e.kind === "tabs" ? e.tabs : []).map((e) => e.id));
1449
+ }, K = ({ layout: e, activeTabIndex: t }) => {
1450
+ let n = W("tab", t, (e.kind === "tabs" ? e.tabs : []).map((e) => e.id));
1451
1451
  return n ? {
1452
1452
  activeTabIndex: n.index,
1453
1453
  tabCount: n.count,
@@ -1455,24 +1455,24 @@ var ue = (e, t) => ({
1455
1455
  canGoNext: n.canGoNext,
1456
1456
  canGoPrev: n.canGoPrev
1457
1457
  } : null;
1458
- }, K = (e, t = []) => {
1458
+ }, q = (e, t = []) => {
1459
1459
  for (let n of e) n.kind === "section" ? (t.push({
1460
1460
  id: n.id,
1461
1461
  defaultOpen: n.defaultOpen
1462
- }), K(n.children, t)) : n.kind === "group" && K(n.children, t);
1462
+ }), q(n.children, t)) : n.kind === "group" && q(n.children, t);
1463
1463
  return t;
1464
- }, q = ({ layout: e, openSectionIds: t }) => {
1465
- let n = e.kind === "wizard" ? e.steps.flatMap((e) => K(e.children)) : e.kind === "tabs" ? e.tabs.flatMap((e) => K(e.children)) : K(e.children);
1464
+ }, J = ({ layout: e, openSectionIds: t }) => {
1465
+ let n = e.kind === "wizard" ? e.steps.flatMap((e) => q(e.children)) : e.kind === "tabs" ? e.tabs.flatMap((e) => q(e.children)) : q(e.children);
1466
1466
  return n.length === 0 ? null : {
1467
1467
  openSectionIds: n.map((e) => e.id).filter((e) => t.has(e)),
1468
1468
  sectionCount: n.length
1469
1469
  };
1470
1470
  }, ve = (e) => ({
1471
1471
  form: e.formState,
1472
- wizard: W(e),
1473
- tabs: G(e),
1474
- disclosure: q(e)
1475
- }), J = (e, t, n, r, i, a, o) => e.kind === "wizard" ? i === (e.steps[t]?.id ?? null) && (!o || r.has(o)) : e.kind === "tabs" ? a === (e.tabs[n]?.id ?? null) && (!o || r.has(o)) : !o || r.has(o), ye = (e) => ({
1472
+ wizard: G(e),
1473
+ tabs: K(e),
1474
+ disclosure: J(e)
1475
+ }), Y = (e, t, n, r, i, a, o) => e.kind === "wizard" ? i === (e.steps[t]?.id ?? null) && (!o || r.has(o)) : e.kind === "tabs" ? a === (e.tabs[n]?.id ?? null) && (!o || r.has(o)) : !o || r.has(o), ye = (e) => ({
1476
1476
  component: "unsupported-field",
1477
1477
  props: { label: e.config.label ?? e.id }
1478
1478
  }), be = (e, t, n, r, i, a) => {
@@ -1491,7 +1491,7 @@ var ue = (e, t) => ({
1491
1491
  stepId: o,
1492
1492
  tabId: s,
1493
1493
  sectionId: c,
1494
- visibleInLayout: J(n.layout, r, i, a, o, s, c)
1494
+ visibleInLayout: Y(n.layout, r, i, a, o, s, c)
1495
1495
  };
1496
1496
  }, xe = (e, t, n, r, i, a, o) => {
1497
1497
  let s = r.maps.reportStepIds.get(e.id) ?? null, c = r.maps.reportTabIds.get(e.id) ?? null, l = r.maps.reportSectionIds.get(e.id) ?? null, u = n.getReport(e.kind);
@@ -1510,28 +1510,28 @@ var ue = (e, t) => ({
1510
1510
  stepId: s,
1511
1511
  tabId: c,
1512
1512
  sectionId: l,
1513
- visibleInLayout: J(r.layout, i, a, o, s, c, l)
1513
+ visibleInLayout: Y(r.layout, i, a, o, s, c, l)
1514
1514
  };
1515
1515
  }, Se = ({ form: e, descriptorRegistry: t, resolvedLayout: n, stepIndex: r, activeTabIndex: i, openSectionIds: a }) => ({
1516
1516
  form: e.state,
1517
1517
  layout: n.layout,
1518
1518
  fields: e.fields.map((e) => be(e, t, n, r, i, a)),
1519
1519
  reports: e.reports.map((o) => xe(o, e, t, n, r, i, a)),
1520
- wizard: W({
1520
+ wizard: G({
1521
1521
  layout: n.layout,
1522
1522
  stepIndex: r,
1523
1523
  activeTabIndex: i,
1524
1524
  openSectionIds: a,
1525
1525
  formState: e.state
1526
1526
  }),
1527
- tabs: G({
1527
+ tabs: K({
1528
1528
  layout: n.layout,
1529
1529
  stepIndex: r,
1530
1530
  activeTabIndex: i,
1531
1531
  openSectionIds: a,
1532
1532
  formState: e.state
1533
1533
  }),
1534
- disclosure: q({
1534
+ disclosure: J({
1535
1535
  layout: n.layout,
1536
1536
  stepIndex: r,
1537
1537
  activeTabIndex: i,
@@ -1557,7 +1557,7 @@ var ue = (e, t) => ({
1557
1557
  openSectionIds: p
1558
1558
  }), u);
1559
1559
  };
1560
- }, Y = (e, t) => e.flatMap((e) => e.kind === "section" ? t.has(e.id) ? [e] : [] : [e]), Te = async (e, t, n) => {
1560
+ }, X = (e, t) => e.flatMap((e) => e.kind === "section" ? t.has(e.id) ? [e] : [] : [e]), Te = async (e, t, n) => {
1561
1561
  if (t.layout.kind !== "wizard") return !1;
1562
1562
  let r = t.layout.steps[n]?.id;
1563
1563
  if (!r) return !1;
@@ -1566,131 +1566,142 @@ var ue = (e, t) => ({
1566
1566
  }, Ee = (e, t, n, r) => {
1567
1567
  switch (e.layout.kind) {
1568
1568
  case "stacked":
1569
- case "split": return Y(e.layout.children, r);
1570
- case "wizard": return Y(e.layout.steps[t]?.children ?? [], r);
1571
- case "tabs": return Y(e.layout.tabs[n]?.children ?? [], r);
1569
+ case "split": return X(e.layout.children, r);
1570
+ case "wizard": return X(e.layout.steps[t]?.children ?? [], r);
1571
+ case "tabs": return X(e.layout.tabs[n]?.children ?? [], r);
1572
1572
  }
1573
- }, X = (e, t) => {
1574
- if (!e.some((e) => e.id === t)) throw TypeError(k.unknownDisclosureSection(t));
1575
- }, Z = (t) => {
1576
- let n = !t.registry || !t.descriptorRegistry || !t.behaviors ? r() : null, i = t.registry ? ee(t.registry) : n.registry, a = t.descriptorRegistry?.clone() ?? n.descriptorRegistry, o = e({
1577
- schema: t.schema,
1578
- registry: i,
1579
- behaviors: t.behaviors ?? n?.behaviors,
1580
- transport: t.transport,
1581
- initialValues: t.initialValues,
1582
- validators: t.validators,
1583
- hooks: t.hooks,
1584
- hookFailurePolicy: t.hookFailurePolicy,
1585
- inactiveFieldPolicy: t.inactiveFieldPolicy,
1586
- listenerErrorPolicy: t.listenerErrorPolicy,
1587
- onListenerError: t.onListenerError
1588
- }), s = _e(t.layout, o.fields, o.reports), c = 0, l = 0, u = s.layout.kind === "wizard" ? s.layout.steps.flatMap((e) => K(e.children)) : s.layout.kind === "tabs" ? s.layout.tabs.flatMap((e) => K(e.children)) : K(s.layout.children), d = new Set(u.filter((e) => e.defaultOpen).map((e) => e.id)), f = /* @__PURE__ */ new Set(), p = s.layout.kind === "wizard" ? s.layout.steps : [], m = s.layout.kind === "tabs" ? s.layout.tabs : [], h = O(s.layout), g = /* @__PURE__ */ new Map();
1589
- for (let e of D(s.layout)) "id" in e && g.set(e.id, e);
1590
- let _ = () => Ce(o, s.layout, c, l, d), v = we({
1591
- form: o,
1592
- descriptorRegistry: a,
1593
- resolvedLayout: s,
1594
- getStepIndex: () => c,
1595
- getActiveTabIndex: () => l,
1596
- getOpenSectionIds: () => d
1597
- }), y = () => {
1598
- let e = v();
1599
- for (let t of f) t(e);
1573
+ }, Z = (e, t) => {
1574
+ if (!e.some((e) => e.id === t)) throw TypeError(A.unknownDisclosureSection(t));
1575
+ }, Q = (n) => {
1576
+ let r = !n.registry || !n.descriptorRegistry || !n.behaviors ? i() : null, a = n.registry ? ee(n.registry) : r.registry, o = n.descriptorRegistry?.clone() ?? r.descriptorRegistry, s = t({
1577
+ schema: n.schema,
1578
+ registry: a,
1579
+ behaviors: n.behaviors ?? r?.behaviors,
1580
+ transport: n.transport,
1581
+ initialValues: n.initialValues,
1582
+ validators: n.validators,
1583
+ hooks: n.hooks,
1584
+ hookFailurePolicy: n.hookFailurePolicy,
1585
+ inactiveFieldPolicy: n.inactiveFieldPolicy,
1586
+ listenerErrorPolicy: n.listenerErrorPolicy,
1587
+ onListenerError: n.onListenerError
1588
+ }), c = n.reportFetchMode ?? "lazy", l = _e(n.layout, s.fields, s.reports), u = 0, d = 0, f = l.layout.kind === "wizard" ? l.layout.steps.flatMap((e) => q(e.children)) : l.layout.kind === "tabs" ? l.layout.tabs.flatMap((e) => q(e.children)) : q(l.layout.children), p = new Set(f.filter((e) => e.defaultOpen).map((e) => e.id)), m = /* @__PURE__ */ new Set(), h = l.layout.kind === "wizard" ? l.layout.steps : [], g = l.layout.kind === "tabs" ? l.layout.tabs : [], _ = k(l.layout), v = /* @__PURE__ */ new Map();
1589
+ for (let e of O(l.layout)) "id" in e && v.set(e.id, e);
1590
+ let y = () => Ce(s, l.layout, u, d, p), b = we({
1591
+ form: s,
1592
+ descriptorRegistry: o,
1593
+ resolvedLayout: l,
1594
+ getStepIndex: () => u,
1595
+ getActiveTabIndex: () => d,
1596
+ getOpenSectionIds: () => p
1597
+ }), x = () => {
1598
+ let e = b();
1599
+ for (let t of m) t(e);
1600
1600
  };
1601
- return o.subscribe(() => {
1602
- y();
1601
+ return s.subscribe(() => {
1602
+ x();
1603
1603
  }), Object.freeze({
1604
- form: o,
1605
- engineRegistry: i,
1606
- descriptorRegistry: a,
1604
+ form: s,
1605
+ engineRegistry: a,
1606
+ descriptorRegistry: o,
1607
1607
  get state() {
1608
- return _();
1608
+ return y();
1609
1609
  },
1610
- getSnapshot: v,
1610
+ getSnapshot: b,
1611
1611
  getNodeById(e) {
1612
- return g.get(e);
1612
+ return v.get(e);
1613
1613
  },
1614
1614
  getField(e) {
1615
- return v().fields.find((t) => t.id === e);
1615
+ return b().fields.find((t) => t.id === e);
1616
1616
  },
1617
1617
  getReport(e) {
1618
- return v().reports.find((t) => t.id === e);
1618
+ return b().reports.find((t) => t.id === e);
1619
1619
  },
1620
1620
  getVisibleFields() {
1621
- return v().fields.filter((e) => e.visibleInLayout && e.state.visible);
1621
+ return b().fields.filter((e) => e.visibleInLayout && e.state.visible);
1622
1622
  },
1623
1623
  getVisibleReports() {
1624
- return v().reports.filter((e) => e.visibleInLayout);
1624
+ return b().reports.filter((e) => e.visibleInLayout);
1625
1625
  },
1626
1626
  getActiveLayoutNodes() {
1627
- return Ee(s, c, l, d);
1627
+ return Ee(l, u, d, p);
1628
1628
  },
1629
1629
  getLayoutReferences() {
1630
- return h;
1630
+ return _;
1631
1631
  },
1632
1632
  validate() {
1633
- return o.validate();
1633
+ return s.validate();
1634
+ },
1635
+ async submit(t) {
1636
+ return c === "lazy" ? s.submit(t) : (await e({
1637
+ form: s,
1638
+ submit: t,
1639
+ reportFetchMode: c
1640
+ })).submitResult;
1634
1641
  },
1635
- submit(e) {
1636
- return o.submit(e);
1642
+ submitPipeline(t) {
1643
+ return e({
1644
+ form: s,
1645
+ submit: t,
1646
+ reportFetchMode: c === "lazy" ? "none" : c
1647
+ });
1637
1648
  },
1638
1649
  reset() {
1639
- o.reset();
1650
+ s.reset();
1640
1651
  },
1641
1652
  subscribe(e) {
1642
- return f.add(e), () => {
1643
- f.delete(e);
1653
+ return m.add(e), () => {
1654
+ m.delete(e);
1644
1655
  };
1645
1656
  },
1646
1657
  async nextStep() {
1647
- return s.layout.kind !== "wizard" || !await Te(o, s, c) ? !1 : (c < p.length - 1 && (c += 1, y()), !0);
1658
+ return l.layout.kind !== "wizard" || !await Te(s, l, u) ? !1 : (u < h.length - 1 && (u += 1, x()), !0);
1648
1659
  },
1649
1660
  prevStep() {
1650
- s.layout.kind === "wizard" && c > 0 && (--c, y());
1661
+ l.layout.kind === "wizard" && u > 0 && (--u, x());
1651
1662
  },
1652
1663
  async goToStep(e) {
1653
- if (s.layout.kind !== "wizard") throw TypeError(k.nonWizardGoToStep);
1654
- let t = p.findIndex((t) => t.id === e);
1655
- if (t < 0) throw TypeError(k.unknownWizardStep(e));
1656
- if (t <= c) return c = t, y(), !0;
1657
- for (; c < t;) if (!await this.nextStep()) return !1;
1664
+ if (l.layout.kind !== "wizard") throw TypeError(A.nonWizardGoToStep);
1665
+ let t = h.findIndex((t) => t.id === e);
1666
+ if (t < 0) throw TypeError(A.unknownWizardStep(e));
1667
+ if (t <= u) return u = t, x(), !0;
1668
+ for (; u < t;) if (!await this.nextStep()) return !1;
1658
1669
  return !0;
1659
1670
  },
1660
1671
  setActiveTab(e) {
1661
- if (s.layout.kind !== "tabs") throw TypeError(k.nonTabsSetActiveTab);
1662
- let t = m.findIndex((t) => t.id === e);
1663
- if (t < 0) throw TypeError(k.unknownTab(e));
1664
- t !== l && (l = t, y());
1672
+ if (l.layout.kind !== "tabs") throw TypeError(A.nonTabsSetActiveTab);
1673
+ let t = g.findIndex((t) => t.id === e);
1674
+ if (t < 0) throw TypeError(A.unknownTab(e));
1675
+ t !== d && (d = t, x());
1665
1676
  },
1666
1677
  nextTab() {
1667
- return s.layout.kind !== "tabs" || l >= m.length - 1 ? !1 : (l += 1, y(), !0);
1678
+ return l.layout.kind !== "tabs" || d >= g.length - 1 ? !1 : (d += 1, x(), !0);
1668
1679
  },
1669
1680
  prevTab() {
1670
- return s.layout.kind !== "tabs" || l <= 0 ? !1 : (--l, y(), !0);
1681
+ return l.layout.kind !== "tabs" || d <= 0 ? !1 : (--d, x(), !0);
1671
1682
  },
1672
1683
  toggleSection(e) {
1673
- X(u, e), d.has(e) ? d.delete(e) : d.add(e), y();
1684
+ Z(f, e), p.has(e) ? p.delete(e) : p.add(e), x();
1674
1685
  },
1675
1686
  openSection(e) {
1676
- X(u, e), d.has(e) || (d.add(e), y());
1687
+ Z(f, e), p.has(e) || (p.add(e), x());
1677
1688
  },
1678
1689
  closeSection(e) {
1679
- X(u, e), d.delete(e) && y();
1690
+ Z(f, e), p.delete(e) && x();
1680
1691
  },
1681
1692
  openAllSections() {
1682
- d = new Set(u.map((e) => e.id)), y();
1693
+ p = new Set(f.map((e) => e.id)), x();
1683
1694
  },
1684
1695
  closeAllSections() {
1685
- d = /* @__PURE__ */ new Set(), y();
1696
+ p = /* @__PURE__ */ new Set(), x();
1686
1697
  }
1687
1698
  });
1688
- }, Q = Symbol("mlform.kit.mounted"), De = (e) => {
1689
- if (!e.mode || !e.theme || !e.recipe) throw TypeError(k.invalidDesignSystemSnapshot);
1699
+ }, $ = Symbol("mlform.kit.mounted"), De = (e) => {
1700
+ if (!e.mode || !e.theme || !e.recipe) throw TypeError(A.invalidDesignSystemSnapshot);
1690
1701
  }, Oe = (e) => {
1691
1702
  let t = e.layout;
1692
1703
  return !!(t && "children" in t && t.children && t.children.length > 0);
1693
- }, ke = (e) => Z({
1704
+ }, ke = (e) => Q({
1694
1705
  schema: e.schema,
1695
1706
  transport: e.transport,
1696
1707
  registry: e.registry,
@@ -1703,12 +1714,13 @@ var ue = (e, t) => ({
1703
1714
  inactiveFieldPolicy: e.inactiveFieldPolicy,
1704
1715
  listenerErrorPolicy: e.listenerErrorPolicy,
1705
1716
  onListenerError: e.onListenerError,
1706
- layout: e.layout
1717
+ layout: e.layout,
1718
+ reportFetchMode: e.reportFetchMode
1707
1719
  }), Ae = (e, t) => {
1708
1720
  let n = e;
1709
- n[Q]?.unmount();
1721
+ n[$]?.unmount();
1710
1722
  let r = te(t.primitiveRegistry), i = ne(t.designSystemRegistry), a = re(t.labels), o = ie(t.designSystem), s = !t.layout || (t.layout.kind === void 0 || t.layout.kind === "stacked" || t.layout.kind === "split") && !Oe(t), c = ke(t), l = () => {}, u = s ? (() => {
1711
- let n = d(e, c.form, {
1723
+ let n = f(e, c.form, {
1712
1724
  registry: r,
1713
1725
  descriptorRegistry: c.descriptorRegistry,
1714
1726
  layout: t.layout?.kind === "split" ? "split" : "stacked",
@@ -1720,48 +1732,56 @@ var ue = (e, t) => ({
1720
1732
  submittingLabel: a.submitting,
1721
1733
  reportPane: t.reportPane,
1722
1734
  text: t.primitiveText,
1723
- reportTransport: t.reportTransport
1735
+ reportTransport: t.reportTransport,
1736
+ reportFetchMode: t.reportFetchMode,
1737
+ submitHandler: t.reportFetchMode && t.reportFetchMode !== "lazy" ? async () => {
1738
+ let e = await c.submitPipeline();
1739
+ return {
1740
+ result: e.submitResult,
1741
+ pipelineResult: e
1742
+ };
1743
+ } : void 0
1724
1744
  });
1725
1745
  return l = () => n.unmount(), n.host;
1726
1746
  })() : (() => {
1727
- let n = je(e, t, r, a, c);
1747
+ let n = Me(e, t, r, a, c);
1728
1748
  return l = () => n.remove(), n;
1729
- })(), f = m(u, {
1749
+ })(), d = h(u, {
1730
1750
  config: o,
1731
1751
  registry: i,
1732
1752
  onChange: t.onDesignSystemChange
1733
- }), p = !1, h = Object.freeze({
1753
+ }), p = !1, m = Object.freeze({
1734
1754
  form: c.form,
1735
1755
  host: u,
1736
1756
  engineRegistry: c.engineRegistry,
1737
1757
  descriptorRegistry: c.descriptorRegistry,
1738
1758
  primitiveRegistry: r,
1739
1759
  designSystemRegistry: i,
1740
- designSystem: f,
1760
+ designSystem: d,
1741
1761
  updateDesignSystem(e) {
1742
- f.update(e);
1762
+ d.update(e);
1743
1763
  },
1744
1764
  replaceDesignSystem(e) {
1745
- De(e), f.replace(e);
1765
+ De(e), d.replace(e);
1746
1766
  },
1747
1767
  resetDesignSystem() {
1748
- f.reset();
1768
+ d.reset();
1749
1769
  },
1750
1770
  unmount() {
1751
- p || (p = !0, n[Q] === h && delete n[Q], c.form.abortSubmit("unmount"), f.disconnect(), l());
1771
+ p || (p = !0, n[$] === m && delete n[$], c.form.abortSubmit("unmount"), d.disconnect(), l());
1752
1772
  }
1753
1773
  });
1754
- return n[Q] = h, h;
1755
- }, $ = (e) => {
1774
+ return n[$] = m, m;
1775
+ }, je = (e) => {
1756
1776
  e.unmount();
1757
- }, je = (e, t, n, r, a) => {
1758
- let o = a.getSnapshot(), s = o.layout.kind === "wizard" ? A.wizard : o.layout.kind === "tabs" ? A.tabs : A.disclosure, c = document.createElement(s);
1759
- if (c.view = a, c.registry = n, c.primitiveText = i(t.primitiveText), o.layout.kind === "wizard") {
1777
+ }, Me = (e, t, n, r, i) => {
1778
+ let o = i.getSnapshot(), s = o.layout.kind === "wizard" ? j.wizard : o.layout.kind === "tabs" ? j.tabs : j.disclosure, c = document.createElement(s);
1779
+ if (c.view = i, c.registry = n, c.primitiveText = a(t.primitiveText), o.layout.kind === "wizard") {
1760
1780
  let e = {
1761
- ...I,
1781
+ ...L,
1762
1782
  ...t.labels
1763
1783
  };
1764
- c.labels = e, c.text = R({
1784
+ c.labels = e, c.text = z({
1765
1785
  prevLabel: e.prev,
1766
1786
  nextLabel: e.next,
1767
1787
  submitLabel: e.submit,
@@ -1770,7 +1790,7 @@ var ue = (e, t) => ({
1770
1790
  });
1771
1791
  } else c.submitLabel = r.submit, c.validatingLabel = r.validating, c.submittingLabel = r.submitting;
1772
1792
  return e.replaceChildren(c), c;
1773
- }, Me = (e, t) => e ? typeof e == "function" ? e(t) ?? {} : e : {}, Ne = (e) => {
1793
+ }, Ne = (e, t) => e ? typeof e == "function" ? e(t) ?? {} : e : {}, Pe = (e) => {
1774
1794
  let t = e.validate, n = {
1775
1795
  kind: e.kind,
1776
1796
  schema: e.schema,
@@ -1787,7 +1807,7 @@ var ue = (e, t) => ({
1787
1807
  }, r = {
1788
1808
  kind: e.kind,
1789
1809
  describe(t, n) {
1790
- let r = Me(e.render.hints, {
1810
+ let r = Ne(e.render.hints, {
1791
1811
  config: t,
1792
1812
  fieldId: t.id,
1793
1813
  state: n.state,
@@ -1830,7 +1850,7 @@ var ue = (e, t) => ({
1830
1850
  definition: n,
1831
1851
  presenter: r
1832
1852
  };
1833
- }, Pe = (e) => {
1853
+ }, Fe = (e) => {
1834
1854
  let t = {
1835
1855
  kind: e.kind,
1836
1856
  schema: e.schema,
@@ -1867,7 +1887,7 @@ var ue = (e, t) => ({
1867
1887
  error: n.state.error,
1868
1888
  state: n.state.status,
1869
1889
  summary: e.render.summary?.(r) ?? null,
1870
- content: n.payload === void 0 ? [] : a(e.render.content(r)),
1890
+ content: n.payload === void 0 ? [] : o(e.render.content(r)),
1871
1891
  ...t.ui
1872
1892
  },
1873
1893
  meta: { declarative: !0 }
@@ -1887,10 +1907,10 @@ var ue = (e, t) => ({
1887
1907
  definition: t,
1888
1908
  presenter: n
1889
1909
  };
1890
- }, Fe = (e, t, n) => {
1891
- e.registerField(n.definition), t.registerField(n.presenter);
1892
1910
  }, Ie = (e, t, n) => {
1911
+ e.registerField(n.definition), t.registerField(n.presenter);
1912
+ }, Le = (e, t, n) => {
1893
1913
  e.registerReport(n.definition), t.registerReport(n.presenter);
1894
1914
  };
1895
1915
  //#endregion
1896
- export { O as collectLayoutReferences, Z as createFormView, w as defaultKitDesignSystem, C as defaultKitLabels, Ne as defineFieldKind, Pe as defineReportKind, D as flattenLayoutNodes, Ae as mountForm, Fe as registerDefinedFieldKind, Ie as registerDefinedReportKind, $ as unmountForm, E as walkLayoutNodes };
1916
+ export { k as collectLayoutReferences, Q as createFormView, T as defaultKitDesignSystem, w as defaultKitLabels, Pe as defineFieldKind, Fe as defineReportKind, O as flattenLayoutNodes, Ae as mountForm, Ie as registerDefinedFieldKind, Le as registerDefinedReportKind, je as unmountForm, D as walkLayoutNodes };