@atscript/vue-form 0.1.176 → 0.1.178

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 (109) hide show
  1. package/dist/{as-array-DnxeuRPB.mjs → as-array-BKC7bBXf.mjs} +13 -18
  2. package/dist/{as-array-DjJ_GA65.cjs → as-array-C4Vv6k5I.cjs} +12 -17
  3. package/dist/{as-array-clear-btn-DkmJoCjN.mjs → as-array-clear-btn-ConR3zxV.mjs} +2 -2
  4. package/dist/{as-array-clear-btn-DSuk9U43.cjs → as-array-clear-btn-DeWeUqoX.cjs} +2 -2
  5. package/dist/as-array.cjs +1 -1
  6. package/dist/as-array.mjs +1 -1
  7. package/dist/{as-checkbox-BivClBCD.mjs → as-checkbox-Dux-KJVN.mjs} +3 -3
  8. package/dist/{as-checkbox-52v5CL8Z.cjs → as-checkbox-NjLPm4Kk.cjs} +3 -3
  9. package/dist/as-checkbox.cjs +1 -1
  10. package/dist/as-checkbox.mjs +1 -1
  11. package/dist/{as-collapsible-COchVoS0.cjs → as-collapsible-BXQ481-h.cjs} +4 -4
  12. package/dist/{as-collapsible-B_YnV9V8.mjs → as-collapsible-FoPTu4lF.mjs} +4 -4
  13. package/dist/as-collapsible.cjs +1 -1
  14. package/dist/as-collapsible.mjs +1 -1
  15. package/dist/{as-date-HUhD-kZ4.cjs → as-date-DSvDDvwH.cjs} +1 -1
  16. package/dist/{as-date-Dsv_nimP.mjs → as-date-DUUpb8ph.mjs} +1 -1
  17. package/dist/as-date.cjs +1 -1
  18. package/dist/as-date.mjs +1 -1
  19. package/dist/{as-datetime-CiL-vlD2.cjs → as-datetime-DZBCBpov.cjs} +1 -1
  20. package/dist/{as-datetime-BxMIrM_M.mjs → as-datetime-Dy1tGMrO.mjs} +1 -1
  21. package/dist/as-datetime.cjs +1 -1
  22. package/dist/as-datetime.mjs +1 -1
  23. package/dist/{as-decimal-DA24-Wtp.cjs → as-decimal-DYBEUokN.cjs} +2 -2
  24. package/dist/{as-decimal-DegSeh2G.mjs → as-decimal-HvUQANde.mjs} +2 -2
  25. package/dist/as-decimal.cjs +1 -1
  26. package/dist/as-decimal.mjs +1 -1
  27. package/dist/{as-field-CeJbqaGj.cjs → as-field-C3lIiHCI.cjs} +7 -11
  28. package/dist/{as-field-D6clFBPR.mjs → as-field-R3KYssad.mjs} +8 -12
  29. package/dist/{as-field-shell-rghztVd7.cjs → as-field-shell-BOeyo1FP.cjs} +4 -4
  30. package/dist/{as-field-shell-IaUBze1S.mjs → as-field-shell-BQPySL71.mjs} +4 -4
  31. package/dist/as-field-shell.cjs +1 -1
  32. package/dist/as-field-shell.mjs +1 -1
  33. package/dist/as-field.cjs +1 -1
  34. package/dist/as-field.mjs +1 -1
  35. package/dist/{as-form-D-RQUPnK.mjs → as-form-B9hRTvod.mjs} +68 -33
  36. package/dist/{as-form-Bo-QNGot.cjs → as-form-DroFS2lv.cjs} +67 -32
  37. package/dist/as-form.cjs +1 -1
  38. package/dist/as-form.d.cts +1 -1
  39. package/dist/as-form.d.mts +1 -1
  40. package/dist/as-form.mjs +1 -1
  41. package/dist/{as-form.vue-Bxq1IR_f.d.mts → as-form.vue-BO3bQmRB.d.mts} +34 -15
  42. package/dist/{as-form.vue-Bx1yZIBk.d.cts → as-form.vue-DT1D4aMl.d.cts} +34 -15
  43. package/dist/{as-input-DGvRZOy5.cjs → as-input-BRJYoNF0.cjs} +1 -1
  44. package/dist/{as-input-CijlzZ8Q.mjs → as-input-C3MkFToh.mjs} +1 -1
  45. package/dist/as-input.cjs +1 -1
  46. package/dist/as-input.mjs +1 -1
  47. package/dist/{as-iterator-D643RugN.cjs → as-iterator-BB7DB04y.cjs} +2 -2
  48. package/dist/{as-iterator-CgGSiI_d.mjs → as-iterator-Bd1fXGs6.mjs} +2 -2
  49. package/dist/as-iterator.cjs +1 -1
  50. package/dist/as-iterator.mjs +1 -1
  51. package/dist/{as-multi-select-BXnZLgjt.mjs → as-multi-select-4awmF8mN.mjs} +2 -2
  52. package/dist/{as-multi-select-JUB05J_p.cjs → as-multi-select-DPpAKUzQ.cjs} +2 -2
  53. package/dist/as-multi-select.cjs +1 -1
  54. package/dist/as-multi-select.mjs +1 -1
  55. package/dist/{as-number-TfNY5CgX.cjs → as-number-CAVTkGcp.cjs} +2 -2
  56. package/dist/{as-number-DkeEBWva.mjs → as-number-WcRwaMOt.mjs} +2 -2
  57. package/dist/as-number.cjs +1 -1
  58. package/dist/as-number.mjs +1 -1
  59. package/dist/{as-object-BAsjdh_N.mjs → as-object-3Tlk8bjl.mjs} +6 -6
  60. package/dist/{as-object-lKSwKkt7.cjs → as-object-Bnyck833.cjs} +6 -6
  61. package/dist/as-object.cjs +1 -1
  62. package/dist/as-object.mjs +1 -1
  63. package/dist/{as-radio-CHwzhcQE.mjs → as-radio-8udWHC-l.mjs} +1 -1
  64. package/dist/{as-radio-DEHsBgwQ.cjs → as-radio-P9rzMYNp.cjs} +1 -1
  65. package/dist/as-radio.cjs +1 -1
  66. package/dist/as-radio.mjs +1 -1
  67. package/dist/{as-ref-DgdRW4ST.cjs → as-ref-BvPM3G73.cjs} +34 -12
  68. package/dist/{as-ref-N0dohgyv.mjs → as-ref-C-U7wotf.mjs} +35 -13
  69. package/dist/as-ref.cjs +1 -1
  70. package/dist/as-ref.mjs +1 -1
  71. package/dist/{as-select-bmYhMEV_.mjs → as-select-3fZCzWku.mjs} +1 -1
  72. package/dist/{as-select-YPLFDuAQ.cjs → as-select-DVbegHcv.cjs} +1 -1
  73. package/dist/as-select.cjs +1 -1
  74. package/dist/as-select.mjs +1 -1
  75. package/dist/{as-time-D107-bEJ.mjs → as-time-BtTiGWOr.mjs} +1 -1
  76. package/dist/{as-time-21ZSGDiq.cjs → as-time-W1ExfNxT.cjs} +1 -1
  77. package/dist/as-time.cjs +1 -1
  78. package/dist/as-time.mjs +1 -1
  79. package/dist/{as-tuple-gNyJxwi4.mjs → as-tuple-CBOp5N1c.mjs} +10 -11
  80. package/dist/{as-tuple-5nsBvO-n.cjs → as-tuple-dfvCxm4R.cjs} +9 -10
  81. package/dist/as-tuple.cjs +1 -1
  82. package/dist/as-tuple.mjs +1 -1
  83. package/dist/{as-union-BuCn5dN6.cjs → as-union-B0h0AlsZ.cjs} +6 -9
  84. package/dist/{as-union-BLTGJOyB.mjs → as-union-izUcMyQt.mjs} +7 -10
  85. package/dist/as-union.cjs +1 -1
  86. package/dist/as-union.mjs +1 -1
  87. package/dist/{as-variant-picker-DJ_sqKD3.mjs → as-variant-picker-D0I5qR2w.mjs} +2 -2
  88. package/dist/{as-variant-picker-BxOP4dkG.cjs → as-variant-picker-oELBST6P.cjs} +2 -2
  89. package/dist/{focus-after-toggle-DRXAm5Xh.cjs → focus-after-toggle-B8DDrJ7d.cjs} +36 -0
  90. package/dist/{focus-after-toggle-CXzXFIdA.mjs → focus-after-toggle-CWw0i0B6.mjs} +31 -1
  91. package/dist/index.cjs +27 -27
  92. package/dist/index.d.cts +1 -1
  93. package/dist/index.d.mts +1 -1
  94. package/dist/index.mjs +27 -27
  95. package/dist/locale.cjs +1 -1
  96. package/dist/locale.mjs +1 -1
  97. package/dist/{use-as-model-texts-x-ioNOC1.cjs → use-as-model-texts-CLzPZ6Go.cjs} +2 -2
  98. package/dist/{use-as-model-texts-DJf4hBHf.mjs → use-as-model-texts-D3uf3X8L.mjs} +2 -2
  99. package/dist/{use-as-optional-add-flow-C7f0blhC.cjs → use-as-optional-add-flow-B7Pp6r-k.cjs} +2 -2
  100. package/dist/{use-as-optional-add-flow-fOglspPV.mjs → use-as-optional-add-flow-CdnxNOUT.mjs} +2 -2
  101. package/dist/{use-as-value-help-B2Ds6Iek.cjs → use-as-value-help-BG6aN4yQ.cjs} +4 -7
  102. package/dist/{use-as-value-help-C3-5RMoO.mjs → use-as-value-help-BWiBDup3.mjs} +4 -7
  103. package/dist/{use-form-context-ClLGWXWa.cjs → use-form-context-C5Q9Gznl.cjs} +5 -1
  104. package/dist/{use-form-context-D7fCP5H4.mjs → use-form-context-Cw-ETG8f.mjs} +6 -2
  105. package/package.json +5 -5
  106. /package/dist/{use-as-locale-CnNyyqcF.cjs → use-as-locale-BHltz8Wp.cjs} +0 -0
  107. /package/dist/{use-as-locale-BEzm7jbp.mjs → use-as-locale-WBFjL_OO.mjs} +0 -0
  108. /package/dist/{use-as-nested-sections-store-u1VgBJAP.cjs → use-as-nested-sections-store-ApstV9NL.cjs} +0 -0
  109. /package/dist/{use-as-nested-sections-store-Dfo971PK.mjs → use-as-nested-sections-store-CkrMJbnN.mjs} +0 -0
@@ -1,11 +1,12 @@
1
- import { _ as PATH_PREFIX_KEY, a as CHANGE_HANDLER_KEY, c as ERRORS_KEY, d as FORM_NORMALIZED_DATA_KEY, f as FORM_PATCH_KEY, g as MODEL_TEXTS_KEY, i as ACTION_HANDLER_KEY, l as FORM_CONTEXT_KEY, m as HIDE_ROOT_TITLE_KEY, o as COMPONENTS_KEY, p as FORM_STATE_KEY, s as DISMISS_EXTERNAL_AT_KEY, u as FORM_DATA_KEY, v as ROOT_DATA_KEY, y as TYPES_KEY } from "./use-form-context-D7fCP5H4.mjs";
2
- import { i as useAsNestedSectionsStore, n as provideAsNestedSectionsStore, t as DESCENDANT_ERROR_COUNTS_KEY } from "./use-as-nested-sections-store-Dfo971PK.mjs";
3
- import { o as useAsTexts } from "./use-as-locale-BEzm7jbp.mjs";
4
- import { t as CLIENT_FACTORY_KEY } from "./use-as-value-help-C3-5RMoO.mjs";
5
- import { t as as_field_default } from "./as-field-D6clFBPR.mjs";
6
- import { t as as_iterator_default } from "./as-iterator-CgGSiI_d.mjs";
1
+ import { r as resetKeepingFocus } from "./focus-after-toggle-CWw0i0B6.mjs";
2
+ import { _ as PATH_PREFIX_KEY, a as CHANGE_HANDLER_KEY, c as ERRORS_KEY, d as FORM_NORMALIZED_DATA_KEY, f as FORM_PATCH_KEY, g as MODEL_TEXTS_KEY, i as ACTION_HANDLER_KEY, l as FORM_CONTEXT_KEY, m as HIDE_ROOT_TITLE_KEY, o as COMPONENTS_KEY, p as FORM_STATE_KEY, s as DISMISS_EXTERNAL_AT_KEY, u as FORM_DATA_KEY, v as ROOT_DATA_KEY, y as TYPES_KEY } from "./use-form-context-Cw-ETG8f.mjs";
3
+ import { i as useAsNestedSectionsStore, n as provideAsNestedSectionsStore, t as DESCENDANT_ERROR_COUNTS_KEY } from "./use-as-nested-sections-store-CkrMJbnN.mjs";
4
+ import { o as useAsTexts } from "./use-as-locale-WBFjL_OO.mjs";
5
+ import { t as CLIENT_FACTORY_KEY } from "./use-as-value-help-BWiBDup3.mjs";
6
+ import { t as as_field_default } from "./as-field-R3KYssad.mjs";
7
+ import { t as as_iterator_default } from "./as-iterator-Bd1fXGs6.mjs";
7
8
  import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, inject, isProxy, isRef, mergeProps, nextTick, normalizeProps, openBlock, provide, reactive, ref, renderSlot, shallowRef, toDisplayString, toRaw, toValue, unref, watch, watchEffect, withModifiers } from "vue";
8
- import { FORM_ERROR_KEY, META_DESCRIPTION, META_LABEL, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_SUBMIT_TEXT, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, collectDirtyPaths, deepClone, getByPath, getDeclaredFormActions, getFormValidator, iteratePathAncestors, mergeErrorMaps, omitPaths, omitSkippedNavFields, resolveFormProp, setByPath, unionVariantChanged } from "@atscript/ui";
9
+ import { FORM_ERROR_KEY, META_DESCRIPTION, META_LABEL, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_SUBMIT_TEXT, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, collectDirtyPaths, createFormData, createFormValueResolver, deepClone, deleteByPath, getByPath, getDeclaredFormActions, getFormValidator, iteratePathAncestors, mergeErrorMaps, omitPaths, omitSkippedNavFields, resolveFormProp, setByPath, unionVariantChanged } from "@atscript/ui";
9
10
  //#region src/composables/use-as-form-patch.ts
10
11
  /**
11
12
  * Internal factory invoked by `useAsForm` when `trackChanges` is enabled. Owns
@@ -46,11 +47,12 @@ import { FORM_ERROR_KEY, META_DESCRIPTION, META_LABEL, UI_FORM_FN_DESCRIPTION, U
46
47
  * container reference is also the write target for
47
48
  * `rebaseOnto` — mutating its `.value` preserves the bound
48
49
  * `:form-data` identity so the deep watch fires once.
49
- * @param onRebased optional callback fired AFTER `rebaseOnto` rewrites the live
50
- * data, so the host can force-remount the field subtree (e.g.
51
- * bump a key) when a union variant changed — the variant picker
52
- * detects its index once at setup and won't re-detect on a
53
- * data swap. No-op for `rebase()` (which doesn't move data).
50
+ * @param onRebased optional callback fired when `rebaseOnto` — or a swap of the
51
+ * container's `value` — lands a different union variant, so the
52
+ * host can force-remount the field subtree (e.g. bump a key):
53
+ * the variant picker detects its index once at setup and won't
54
+ * re-detect on a data swap. No-op for `rebase()` (which doesn't
55
+ * move data).
54
56
  */
55
57
  function createAsFormPatch(def, getData, onRebased) {
56
58
  let baseline;
@@ -73,8 +75,10 @@ function createAsFormPatch(def, getData, onRebased) {
73
75
  baselineRev.value++;
74
76
  }
75
77
  capture();
78
+ let rebasing = false;
76
79
  watch(() => getData().value, (next, prev) => {
77
80
  if (next === prev) return;
81
+ if (!rebasing && unionVariantChanged(def(), { value: prev }, { value: next })) onRebased?.();
78
82
  if (baseline === void 0) {
79
83
  capture();
80
84
  return;
@@ -127,11 +131,19 @@ function createAsFormPatch(def, getData, onRebased) {
127
131
  * {@link AsFormPatchHandle.rebaseOnto}). One reactive write, then an explicit
128
132
  * re-baseline to the upstream snapshot.
129
133
  */
134
+ function write(value) {
135
+ rebasing = true;
136
+ try {
137
+ setByPath(getData(), "", value);
138
+ } finally {
139
+ rebasing = false;
140
+ }
141
+ }
130
142
  function rebaseOnto(upstream, opts) {
131
143
  const u = deepClone(upstream, toRaw);
132
144
  if (baseline === void 0) {
133
145
  const before = deepClone(getData(), toRaw);
134
- setByPath(getData(), "", u.value);
146
+ write(u.value);
135
147
  if (unionVariantChanged(def(), before, u)) onRebased?.();
136
148
  capture();
137
149
  return {
@@ -142,7 +154,7 @@ function createAsFormPatch(def, getData, onRebased) {
142
154
  const current = deepClone(getData(), toRaw);
143
155
  const { next, conflicts, reapplied } = buildFormRebase(def(), baseline, current, u, opts);
144
156
  const variantMoved = unionVariantChanged(def(), current, next);
145
- setByPath(getData(), "", next.value);
157
+ write(next.value);
146
158
  baseline = u;
147
159
  baselineRev.value++;
148
160
  if (variantMoved) onRebased?.();
@@ -427,12 +439,6 @@ function useAsForm(options) {
427
439
  remountKey.value++;
428
440
  }) : void 0;
429
441
  if (patch) provide(FORM_PATCH_KEY, patch);
430
- const reset = async () => {
431
- internalErrors.value = {};
432
- rootErrorDismissed.value = false;
433
- await resetState();
434
- patch?.rebase();
435
- };
436
442
  provide(ROOT_DATA_KEY, data);
437
443
  provide(PATH_PREFIX_KEY, computed(() => ""));
438
444
  provide(TYPES_KEY, computed(() => options.types()));
@@ -458,6 +464,28 @@ function useAsForm(options) {
458
464
  rootErrorDismissed.value = true;
459
465
  ext.dismissForm();
460
466
  }
467
+ const reset = async () => {
468
+ internalErrors.value = {};
469
+ rootErrorDismissed.value = false;
470
+ const def = options.def();
471
+ const container = data.value;
472
+ const empty = createFormData(def.type, createFormValueResolver({}, formContext.value ?? {}));
473
+ const errorPaths = Object.keys(ext.effective.value ?? {});
474
+ const before = errorPaths.map((path) => getByPath(container, path));
475
+ if (typeof container.value === "object" && container.value !== null) for (const { path } of def.fields) {
476
+ const value = getByPath(empty, path);
477
+ if (value === void 0) deleteByPath(container, path);
478
+ else setByPath(container, path, value);
479
+ }
480
+ else container.value = empty.value;
481
+ errorPaths.forEach((path, i) => {
482
+ if (getByPath(container, path) !== before[i]) ext.dismissAt(path);
483
+ });
484
+ remountKey.value++;
485
+ await nextTick();
486
+ await resetState();
487
+ patch?.rebase();
488
+ };
461
489
  provide(DESCENDANT_ERROR_COUNTS_KEY, computed(() => buildDescendantErrorCounts(allErrors.value)));
462
490
  watch(allErrors, (errors) => {
463
491
  for (const errPath of Object.keys(errors)) for (const ancestor of iteratePathAncestors(errPath)) sectionsStore.setOpen(ancestor, true);
@@ -568,10 +596,6 @@ const _hoisted_2 = {
568
596
  const _hoisted_3 = { class: "as-form-error-message" };
569
597
  const _hoisted_4 = ["disabled"];
570
598
  const _hoisted_5 = {
571
- key: 2,
572
- class: "as-form-grid"
573
- };
574
- const _hoisted_6 = {
575
599
  key: 3,
576
600
  class: "as-form-overlay"
577
601
  };
@@ -659,10 +683,16 @@ var as_form_default = /* @__PURE__ */ defineComponent({
659
683
  change: (type, path, value, formData) => emit("change", type, path, value, formData)
660
684
  }
661
685
  });
686
+ const formEl = ref();
687
+ const reset = () => resetKeepingFocus(form.reset, formEl.value);
688
+ const slotProps = computed(() => ({
689
+ ...form.slotProps.value,
690
+ reset
691
+ }));
662
692
  __expose({
663
693
  submit: form.onSubmit,
664
694
  action: form.invokeAction,
665
- reset: form.reset,
695
+ reset,
666
696
  clearErrors: form.clearErrors,
667
697
  setErrors: form.setErrors,
668
698
  get isDirty() {
@@ -683,18 +713,20 @@ var as_form_default = /* @__PURE__ */ defineComponent({
683
713
  const { t } = useAsTexts();
684
714
  return (_ctx, _cache) => {
685
715
  return openBlock(), createElementBlock("form", {
716
+ ref_key: "formEl",
717
+ ref: formEl,
686
718
  class: "as-form",
687
719
  inert: __props.loading,
688
720
  onSubmit: _cache[1] || (_cache[1] = withModifiers((...args) => unref(form).onSubmit && unref(form).onSubmit(...args), ["prevent"]))
689
721
  }, [
690
- renderSlot(_ctx.$slots, "form.header", normalizeProps(guardReactiveProps(unref(form).slotProps.value))),
691
- renderSlot(_ctx.$slots, "form.before", normalizeProps(guardReactiveProps(unref(form).slotProps.value))),
722
+ renderSlot(_ctx.$slots, "form.header", normalizeProps(guardReactiveProps(slotProps.value))),
723
+ renderSlot(_ctx.$slots, "form.before", normalizeProps(guardReactiveProps(slotProps.value))),
692
724
  (openBlock(), createBlock(as_field_default, {
693
725
  key: unref(form).remountKey.value,
694
726
  field: __props.def.rootField
695
727
  }, null, 8, ["field"])),
696
- renderSlot(_ctx.$slots, "form.after", normalizeProps(guardReactiveProps(unref(form).slotProps.value))),
697
- unref(form).formError.value ? renderSlot(_ctx.$slots, "form.error", mergeProps({ key: 0 }, unref(form).slotProps.value, {
728
+ renderSlot(_ctx.$slots, "form.after", normalizeProps(guardReactiveProps(slotProps.value))),
729
+ unref(form).formError.value ? renderSlot(_ctx.$slots, "form.error", mergeProps({ key: 0 }, slotProps.value, {
698
730
  message: unref(form).formError.value,
699
731
  dismiss: unref(form).dismissFormError
700
732
  }), () => [createElementVNode("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(unref(form).formError.value), 1), createElementVNode("button", {
@@ -702,18 +734,21 @@ var as_form_default = /* @__PURE__ */ defineComponent({
702
734
  class: "as-form-error-dismiss",
703
735
  onClick: _cache[0] || (_cache[0] = (...args) => unref(form).dismissFormError && unref(form).dismissFormError(...args))
704
736
  }, toDisplayString(unref(t)("UI_FORM_DISMISS")), 1)])]) : createCommentVNode("v-if", true),
705
- !__props.hideSubmit ? renderSlot(_ctx.$slots, "form.submit", mergeProps({ key: 1 }, unref(form).slotProps.value, { text: unref(form).submitText.value }), () => [createElementVNode("button", {
737
+ !__props.hideSubmit ? renderSlot(_ctx.$slots, "form.submit", mergeProps({ key: 1 }, slotProps.value, { text: unref(form).submitText.value }), () => [createElementVNode("button", {
706
738
  type: "submit",
707
739
  class: "as-submit-btn",
708
740
  disabled: unref(form).submitDisabled.value
709
741
  }, toDisplayString(unref(form).submitText.value), 9, _hoisted_4)]) : createCommentVNode("v-if", true),
710
742
  createCommentVNode(" `@ui.form.pushDown` fields render in their own grid below submit. "),
711
- __props.def.pushDownFields.length ? (openBlock(), createElementBlock("div", _hoisted_5, [createVNode(as_iterator_default, {
743
+ __props.def.pushDownFields.length ? (openBlock(), createElementBlock("div", {
744
+ key: unref(form).remountKey.value,
745
+ class: "as-form-grid"
746
+ }, [createVNode(as_iterator_default, {
712
747
  def: __props.def,
713
748
  fields: __props.def.pushDownFields
714
749
  }, null, 8, ["def", "fields"])])) : createCommentVNode("v-if", true),
715
- renderSlot(_ctx.$slots, "form.footer", normalizeProps(guardReactiveProps(unref(form).slotProps.value))),
716
- __props.loading ? (openBlock(), createElementBlock("div", _hoisted_6, [renderSlot(_ctx.$slots, "form.loading", normalizeProps(guardReactiveProps(unref(form).slotProps.value)), () => [_cache[2] || (_cache[2] = createElementVNode("span", {
750
+ renderSlot(_ctx.$slots, "form.footer", normalizeProps(guardReactiveProps(slotProps.value))),
751
+ __props.loading ? (openBlock(), createElementBlock("div", _hoisted_5, [renderSlot(_ctx.$slots, "form.loading", normalizeProps(guardReactiveProps(slotProps.value)), () => [_cache[2] || (_cache[2] = createElementVNode("span", {
717
752
  class: "as-form-overlay-icon",
718
753
  "aria-hidden": "true"
719
754
  }, null, -1))])])) : createCommentVNode("v-if", true)
@@ -1,9 +1,10 @@
1
- const require_use_form_context = require("./use-form-context-ClLGWXWa.cjs");
2
- const require_use_as_nested_sections_store = require("./use-as-nested-sections-store-u1VgBJAP.cjs");
3
- const require_use_as_locale = require("./use-as-locale-CnNyyqcF.cjs");
4
- const require_use_as_value_help = require("./use-as-value-help-B2Ds6Iek.cjs");
5
- const require_as_field = require("./as-field-CeJbqaGj.cjs");
6
- const require_as_iterator = require("./as-iterator-D643RugN.cjs");
1
+ const require_focus_after_toggle = require("./focus-after-toggle-B8DDrJ7d.cjs");
2
+ const require_use_form_context = require("./use-form-context-C5Q9Gznl.cjs");
3
+ const require_use_as_nested_sections_store = require("./use-as-nested-sections-store-ApstV9NL.cjs");
4
+ const require_use_as_locale = require("./use-as-locale-BHltz8Wp.cjs");
5
+ const require_use_as_value_help = require("./use-as-value-help-BG6aN4yQ.cjs");
6
+ const require_as_field = require("./as-field-C3lIiHCI.cjs");
7
+ const require_as_iterator = require("./as-iterator-BB7DB04y.cjs");
7
8
  let vue = require("vue");
8
9
  let _atscript_ui = require("@atscript/ui");
9
10
  //#region src/composables/use-as-form-patch.ts
@@ -46,11 +47,12 @@ let _atscript_ui = require("@atscript/ui");
46
47
  * container reference is also the write target for
47
48
  * `rebaseOnto` — mutating its `.value` preserves the bound
48
49
  * `:form-data` identity so the deep watch fires once.
49
- * @param onRebased optional callback fired AFTER `rebaseOnto` rewrites the live
50
- * data, so the host can force-remount the field subtree (e.g.
51
- * bump a key) when a union variant changed — the variant picker
52
- * detects its index once at setup and won't re-detect on a
53
- * data swap. No-op for `rebase()` (which doesn't move data).
50
+ * @param onRebased optional callback fired when `rebaseOnto` — or a swap of the
51
+ * container's `value` — lands a different union variant, so the
52
+ * host can force-remount the field subtree (e.g. bump a key):
53
+ * the variant picker detects its index once at setup and won't
54
+ * re-detect on a data swap. No-op for `rebase()` (which doesn't
55
+ * move data).
54
56
  */
55
57
  function createAsFormPatch(def, getData, onRebased) {
56
58
  let baseline;
@@ -73,8 +75,10 @@ function createAsFormPatch(def, getData, onRebased) {
73
75
  baselineRev.value++;
74
76
  }
75
77
  capture();
78
+ let rebasing = false;
76
79
  (0, vue.watch)(() => getData().value, (next, prev) => {
77
80
  if (next === prev) return;
81
+ if (!rebasing && (0, _atscript_ui.unionVariantChanged)(def(), { value: prev }, { value: next })) onRebased?.();
78
82
  if (baseline === void 0) {
79
83
  capture();
80
84
  return;
@@ -127,11 +131,19 @@ function createAsFormPatch(def, getData, onRebased) {
127
131
  * {@link AsFormPatchHandle.rebaseOnto}). One reactive write, then an explicit
128
132
  * re-baseline to the upstream snapshot.
129
133
  */
134
+ function write(value) {
135
+ rebasing = true;
136
+ try {
137
+ (0, _atscript_ui.setByPath)(getData(), "", value);
138
+ } finally {
139
+ rebasing = false;
140
+ }
141
+ }
130
142
  function rebaseOnto(upstream, opts) {
131
143
  const u = (0, _atscript_ui.deepClone)(upstream, vue.toRaw);
132
144
  if (baseline === void 0) {
133
145
  const before = (0, _atscript_ui.deepClone)(getData(), vue.toRaw);
134
- (0, _atscript_ui.setByPath)(getData(), "", u.value);
146
+ write(u.value);
135
147
  if ((0, _atscript_ui.unionVariantChanged)(def(), before, u)) onRebased?.();
136
148
  capture();
137
149
  return {
@@ -142,7 +154,7 @@ function createAsFormPatch(def, getData, onRebased) {
142
154
  const current = (0, _atscript_ui.deepClone)(getData(), vue.toRaw);
143
155
  const { next, conflicts, reapplied } = (0, _atscript_ui.buildFormRebase)(def(), baseline, current, u, opts);
144
156
  const variantMoved = (0, _atscript_ui.unionVariantChanged)(def(), current, next);
145
- (0, _atscript_ui.setByPath)(getData(), "", next.value);
157
+ write(next.value);
146
158
  baseline = u;
147
159
  baselineRev.value++;
148
160
  if (variantMoved) onRebased?.();
@@ -427,12 +439,6 @@ function useAsForm(options) {
427
439
  remountKey.value++;
428
440
  }) : void 0;
429
441
  if (patch) (0, vue.provide)(require_use_form_context.FORM_PATCH_KEY, patch);
430
- const reset = async () => {
431
- internalErrors.value = {};
432
- rootErrorDismissed.value = false;
433
- await resetState();
434
- patch?.rebase();
435
- };
436
442
  (0, vue.provide)(require_use_form_context.ROOT_DATA_KEY, data);
437
443
  (0, vue.provide)(require_use_form_context.PATH_PREFIX_KEY, (0, vue.computed)(() => ""));
438
444
  (0, vue.provide)(require_use_form_context.TYPES_KEY, (0, vue.computed)(() => options.types()));
@@ -458,6 +464,28 @@ function useAsForm(options) {
458
464
  rootErrorDismissed.value = true;
459
465
  ext.dismissForm();
460
466
  }
467
+ const reset = async () => {
468
+ internalErrors.value = {};
469
+ rootErrorDismissed.value = false;
470
+ const def = options.def();
471
+ const container = data.value;
472
+ const empty = (0, _atscript_ui.createFormData)(def.type, (0, _atscript_ui.createFormValueResolver)({}, formContext.value ?? {}));
473
+ const errorPaths = Object.keys(ext.effective.value ?? {});
474
+ const before = errorPaths.map((path) => (0, _atscript_ui.getByPath)(container, path));
475
+ if (typeof container.value === "object" && container.value !== null) for (const { path } of def.fields) {
476
+ const value = (0, _atscript_ui.getByPath)(empty, path);
477
+ if (value === void 0) (0, _atscript_ui.deleteByPath)(container, path);
478
+ else (0, _atscript_ui.setByPath)(container, path, value);
479
+ }
480
+ else container.value = empty.value;
481
+ errorPaths.forEach((path, i) => {
482
+ if ((0, _atscript_ui.getByPath)(container, path) !== before[i]) ext.dismissAt(path);
483
+ });
484
+ remountKey.value++;
485
+ await (0, vue.nextTick)();
486
+ await resetState();
487
+ patch?.rebase();
488
+ };
461
489
  (0, vue.provide)(require_use_as_nested_sections_store.DESCENDANT_ERROR_COUNTS_KEY, (0, vue.computed)(() => (0, _atscript_ui.buildDescendantErrorCounts)(allErrors.value)));
462
490
  (0, vue.watch)(allErrors, (errors) => {
463
491
  for (const errPath of Object.keys(errors)) for (const ancestor of (0, _atscript_ui.iteratePathAncestors)(errPath)) sectionsStore.setOpen(ancestor, true);
@@ -568,10 +596,6 @@ const _hoisted_2 = {
568
596
  const _hoisted_3 = { class: "as-form-error-message" };
569
597
  const _hoisted_4 = ["disabled"];
570
598
  const _hoisted_5 = {
571
- key: 2,
572
- class: "as-form-grid"
573
- };
574
- const _hoisted_6 = {
575
599
  key: 3,
576
600
  class: "as-form-overlay"
577
601
  };
@@ -659,10 +683,16 @@ var as_form_default = /* @__PURE__ */ (0, vue.defineComponent)({
659
683
  change: (type, path, value, formData) => emit("change", type, path, value, formData)
660
684
  }
661
685
  });
686
+ const formEl = (0, vue.ref)();
687
+ const reset = () => require_focus_after_toggle.resetKeepingFocus(form.reset, formEl.value);
688
+ const slotProps = (0, vue.computed)(() => ({
689
+ ...form.slotProps.value,
690
+ reset
691
+ }));
662
692
  __expose({
663
693
  submit: form.onSubmit,
664
694
  action: form.invokeAction,
665
- reset: form.reset,
695
+ reset,
666
696
  clearErrors: form.clearErrors,
667
697
  setErrors: form.setErrors,
668
698
  get isDirty() {
@@ -683,18 +713,20 @@ var as_form_default = /* @__PURE__ */ (0, vue.defineComponent)({
683
713
  const { t } = require_use_as_locale.useAsTexts();
684
714
  return (_ctx, _cache) => {
685
715
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("form", {
716
+ ref_key: "formEl",
717
+ ref: formEl,
686
718
  class: "as-form",
687
719
  inert: __props.loading,
688
720
  onSubmit: _cache[1] || (_cache[1] = (0, vue.withModifiers)((...args) => (0, vue.unref)(form).onSubmit && (0, vue.unref)(form).onSubmit(...args), ["prevent"]))
689
721
  }, [
690
- (0, vue.renderSlot)(_ctx.$slots, "form.header", (0, vue.normalizeProps)((0, vue.guardReactiveProps)((0, vue.unref)(form).slotProps.value))),
691
- (0, vue.renderSlot)(_ctx.$slots, "form.before", (0, vue.normalizeProps)((0, vue.guardReactiveProps)((0, vue.unref)(form).slotProps.value))),
722
+ (0, vue.renderSlot)(_ctx.$slots, "form.header", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(slotProps.value))),
723
+ (0, vue.renderSlot)(_ctx.$slots, "form.before", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(slotProps.value))),
692
724
  ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_field.as_field_default, {
693
725
  key: (0, vue.unref)(form).remountKey.value,
694
726
  field: __props.def.rootField
695
727
  }, null, 8, ["field"])),
696
- (0, vue.renderSlot)(_ctx.$slots, "form.after", (0, vue.normalizeProps)((0, vue.guardReactiveProps)((0, vue.unref)(form).slotProps.value))),
697
- (0, vue.unref)(form).formError.value ? (0, vue.renderSlot)(_ctx.$slots, "form.error", (0, vue.mergeProps)({ key: 0 }, (0, vue.unref)(form).slotProps.value, {
728
+ (0, vue.renderSlot)(_ctx.$slots, "form.after", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(slotProps.value))),
729
+ (0, vue.unref)(form).formError.value ? (0, vue.renderSlot)(_ctx.$slots, "form.error", (0, vue.mergeProps)({ key: 0 }, slotProps.value, {
698
730
  message: (0, vue.unref)(form).formError.value,
699
731
  dismiss: (0, vue.unref)(form).dismissFormError
700
732
  }), () => [(0, vue.createElementVNode)("div", _hoisted_2, [(0, vue.createElementVNode)("span", _hoisted_3, (0, vue.toDisplayString)((0, vue.unref)(form).formError.value), 1), (0, vue.createElementVNode)("button", {
@@ -702,18 +734,21 @@ var as_form_default = /* @__PURE__ */ (0, vue.defineComponent)({
702
734
  class: "as-form-error-dismiss",
703
735
  onClick: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(form).dismissFormError && (0, vue.unref)(form).dismissFormError(...args))
704
736
  }, (0, vue.toDisplayString)((0, vue.unref)(t)("UI_FORM_DISMISS")), 1)])]) : (0, vue.createCommentVNode)("v-if", true),
705
- !__props.hideSubmit ? (0, vue.renderSlot)(_ctx.$slots, "form.submit", (0, vue.mergeProps)({ key: 1 }, (0, vue.unref)(form).slotProps.value, { text: (0, vue.unref)(form).submitText.value }), () => [(0, vue.createElementVNode)("button", {
737
+ !__props.hideSubmit ? (0, vue.renderSlot)(_ctx.$slots, "form.submit", (0, vue.mergeProps)({ key: 1 }, slotProps.value, { text: (0, vue.unref)(form).submitText.value }), () => [(0, vue.createElementVNode)("button", {
706
738
  type: "submit",
707
739
  class: "as-submit-btn",
708
740
  disabled: (0, vue.unref)(form).submitDisabled.value
709
741
  }, (0, vue.toDisplayString)((0, vue.unref)(form).submitText.value), 9, _hoisted_4)]) : (0, vue.createCommentVNode)("v-if", true),
710
742
  (0, vue.createCommentVNode)(" `@ui.form.pushDown` fields render in their own grid below submit. "),
711
- __props.def.pushDownFields.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5, [(0, vue.createVNode)(require_as_iterator.as_iterator_default, {
743
+ __props.def.pushDownFields.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
744
+ key: (0, vue.unref)(form).remountKey.value,
745
+ class: "as-form-grid"
746
+ }, [(0, vue.createVNode)(require_as_iterator.as_iterator_default, {
712
747
  def: __props.def,
713
748
  fields: __props.def.pushDownFields
714
749
  }, null, 8, ["def", "fields"])])) : (0, vue.createCommentVNode)("v-if", true),
715
- (0, vue.renderSlot)(_ctx.$slots, "form.footer", (0, vue.normalizeProps)((0, vue.guardReactiveProps)((0, vue.unref)(form).slotProps.value))),
716
- __props.loading ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6, [(0, vue.renderSlot)(_ctx.$slots, "form.loading", (0, vue.normalizeProps)((0, vue.guardReactiveProps)((0, vue.unref)(form).slotProps.value)), () => [_cache[2] || (_cache[2] = (0, vue.createElementVNode)("span", {
750
+ (0, vue.renderSlot)(_ctx.$slots, "form.footer", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(slotProps.value))),
751
+ __props.loading ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5, [(0, vue.renderSlot)(_ctx.$slots, "form.loading", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(slotProps.value)), () => [_cache[2] || (_cache[2] = (0, vue.createElementVNode)("span", {
717
752
  class: "as-form-overlay-icon",
718
753
  "aria-hidden": "true"
719
754
  }, null, -1))])])) : (0, vue.createCommentVNode)("v-if", true)
package/dist/as-form.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const require_as_form = require("./as-form-Bo-QNGot.cjs");
1
+ const require_as_form = require("./as-form-DroFS2lv.cjs");
2
2
  module.exports = require_as_form.as_form_default;
@@ -1,2 +1,2 @@
1
- import { n as _default, t as Props } from "./as-form.vue-Bx1yZIBk.cjs";
1
+ import { n as _default, t as Props } from "./as-form.vue-DT1D4aMl.cjs";
2
2
  export { Props, _default as default };
@@ -1,2 +1,2 @@
1
- import { n as _default, t as Props } from "./as-form.vue-Bxq1IR_f.mjs";
1
+ import { n as _default, t as Props } from "./as-form.vue-BO3bQmRB.mjs";
2
2
  export { Props, _default as default };
package/dist/as-form.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as as_form_default } from "./as-form-D-RQUPnK.mjs";
1
+ import { t as as_form_default } from "./as-form-B9hRTvod.mjs";
2
2
  export { as_form_default as default };
@@ -79,7 +79,13 @@ interface UseAsFieldOptions<TValue = any, TFormData = any, TContext = any> {
79
79
  setValue: (v: TValue) => void;
80
80
  rules?: TFormRule<TValue, TFormData, TContext>[];
81
81
  path: () => string;
82
- /** Value to set on reset. Defaults to `''`. Use `[]` for arrays, `{}` for objects. */
82
+ /**
83
+ * Value written on form reset, after the form has reset its data to the
84
+ * empty-form values. Left out (the usual case), the field keeps the value
85
+ * that reset gives it; pass it (`undefined` included) for a value the form
86
+ * data does not hold, e.g. when `getValue` / `setValue` reach state outside
87
+ * the form data.
88
+ */
83
89
  resetValue?: TValue;
84
90
  }
85
91
  interface UseAsFieldReturn<TValue = any> {
@@ -339,9 +345,17 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
339
345
  /** Errors discovered by the local validator on the most-recent submit. */
340
346
  internalErrors: Ref<Record<string, string>>;
341
347
  /**
342
- * Reset internal validator + dismissal state and re-run field defaults. When
343
- * `trackChanges` is enabled, also re-baselines the change tracker to the
344
- * post-reset state (the form becomes clean again).
348
+ * Return the form's fields to what a newly created form holds
349
+ * (`createFormData` — annotation defaults included, optional fields absent;
350
+ * loaded values are not kept). Properties of the data that are not form
351
+ * fields (an edit form's version column, navigation rows) are left as they
352
+ * are. The field subtree remounts (`remountKey`); touched state, submit and
353
+ * live errors are cleared; a server error (`errors`) is dismissed where the
354
+ * reset changed the value — on other paths, and the external `__form`
355
+ * banner, it stays. When `trackChanges` is enabled, the post-reset state
356
+ * becomes the new clean baseline. Focus is left alone: `<AsForm>` moves it
357
+ * to the first field control when the reset removed or disabled the
358
+ * focused element.
345
359
  */
346
360
  reset: () => Promise<void>;
347
361
  /**
@@ -395,9 +409,10 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
395
409
  */
396
410
  patch: AsFormPatchHandle | undefined;
397
411
  /**
398
- * Remount key for the field subtree. Bound as `:key` on the root `<AsField>`.
399
- * Bumped by `patch.rebaseOnto` only when a rebase lands a different union
400
- * variant, forcing the variant picker to re-detect. `0` otherwise.
412
+ * Remount key for the field subtree. Bound as `:key` on the root `<AsField>`
413
+ * (and on the pushed-down fields). Bumped by every `reset()`, and — with
414
+ * `trackChanges` — when `patch.rebaseOnto` or a swap of the data's `value`
415
+ * lands a different union variant, forcing the variant picker to re-detect.
401
416
  */
402
417
  remountKey: Ref<number>;
403
418
  /** Dispatch an action — invoked by `<AsAction>`. */
@@ -550,7 +565,11 @@ interface UseAsValueHelpReturn {
550
565
  labelIsFkValue: ComputedRef<boolean>;
551
566
  kickoff: () => Promise<void>;
552
567
  selectItem: (item: Record<string, unknown>) => void;
553
- clear: () => void;
568
+ /**
569
+ * Clear the picker: set the model to `value` (`undefined` — unset — when
570
+ * omitted) and empty the search text.
571
+ */
572
+ clear: (value?: unknown) => void;
554
573
  }
555
574
  declare function useAsValueHelp(options: UseAsValueHelpOptions): UseAsValueHelpReturn;
556
575
  //#endregion
@@ -1232,6 +1251,7 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1232
1251
  attrs: any;
1233
1252
  slots: {
1234
1253
  'form.header'?: (props: {
1254
+ reset: () => Promise<void>;
1235
1255
  title: string | undefined;
1236
1256
  description: string | undefined;
1237
1257
  data: TFormData;
@@ -1241,7 +1261,6 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1241
1261
  loading: boolean;
1242
1262
  submitText: string;
1243
1263
  submit: () => void;
1244
- reset: () => Promise<void>;
1245
1264
  clearErrors: () => void;
1246
1265
  setErrors: (errors: Record<string, string>) => void;
1247
1266
  dismissError: (path: string) => void;
@@ -1255,6 +1274,7 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1255
1274
  }) => any;
1256
1275
  } & {
1257
1276
  'form.before'?: (props: {
1277
+ reset: () => Promise<void>;
1258
1278
  title: string | undefined;
1259
1279
  description: string | undefined;
1260
1280
  data: TFormData;
@@ -1264,7 +1284,6 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1264
1284
  loading: boolean;
1265
1285
  submitText: string;
1266
1286
  submit: () => void;
1267
- reset: () => Promise<void>;
1268
1287
  clearErrors: () => void;
1269
1288
  setErrors: (errors: Record<string, string>) => void;
1270
1289
  dismissError: (path: string) => void;
@@ -1278,6 +1297,7 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1278
1297
  }) => any;
1279
1298
  } & {
1280
1299
  'form.after'?: (props: {
1300
+ reset: () => Promise<void>;
1281
1301
  title: string | undefined;
1282
1302
  description: string | undefined;
1283
1303
  data: TFormData;
@@ -1287,7 +1307,6 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1287
1307
  loading: boolean;
1288
1308
  submitText: string;
1289
1309
  submit: () => void;
1290
- reset: () => Promise<void>;
1291
1310
  clearErrors: () => void;
1292
1311
  setErrors: (errors: Record<string, string>) => void;
1293
1312
  dismissError: (path: string) => void;
@@ -1303,6 +1322,7 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1303
1322
  'form.error'?: (props: {
1304
1323
  message: string;
1305
1324
  dismiss: () => void;
1325
+ reset: () => Promise<void>;
1306
1326
  title: string | undefined;
1307
1327
  description: string | undefined;
1308
1328
  data: TFormData;
@@ -1312,7 +1332,6 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1312
1332
  loading: boolean;
1313
1333
  submitText: string;
1314
1334
  submit: () => void;
1315
- reset: () => Promise<void>;
1316
1335
  clearErrors: () => void;
1317
1336
  setErrors: (errors: Record<string, string>) => void;
1318
1337
  dismissError: (path: string) => void;
@@ -1327,6 +1346,7 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1327
1346
  } & {
1328
1347
  'form.submit'?: (props: {
1329
1348
  text: string;
1349
+ reset: () => Promise<void>;
1330
1350
  title: string | undefined;
1331
1351
  description: string | undefined;
1332
1352
  data: TFormData;
@@ -1336,7 +1356,6 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1336
1356
  loading: boolean;
1337
1357
  submitText: string;
1338
1358
  submit: () => void;
1339
- reset: () => Promise<void>;
1340
1359
  clearErrors: () => void;
1341
1360
  setErrors: (errors: Record<string, string>) => void;
1342
1361
  dismissError: (path: string) => void;
@@ -1350,6 +1369,7 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1350
1369
  }) => any;
1351
1370
  } & {
1352
1371
  'form.footer'?: (props: {
1372
+ reset: () => Promise<void>;
1353
1373
  title: string | undefined;
1354
1374
  description: string | undefined;
1355
1375
  data: TFormData;
@@ -1359,7 +1379,6 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1359
1379
  loading: boolean;
1360
1380
  submitText: string;
1361
1381
  submit: () => void;
1362
- reset: () => Promise<void>;
1363
1382
  clearErrors: () => void;
1364
1383
  setErrors: (errors: Record<string, string>) => void;
1365
1384
  dismissError: (path: string) => void;
@@ -1373,6 +1392,7 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1373
1392
  }) => any;
1374
1393
  } & {
1375
1394
  'form.loading'?: (props: {
1395
+ reset: () => Promise<void>;
1376
1396
  title: string | undefined;
1377
1397
  description: string | undefined;
1378
1398
  data: TFormData;
@@ -1382,7 +1402,6 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
1382
1402
  loading: boolean;
1383
1403
  submitText: string;
1384
1404
  submit: () => void;
1385
- reset: () => Promise<void>;
1386
1405
  clearErrors: () => void;
1387
1406
  setErrors: (errors: Record<string, string>) => void;
1388
1407
  dismissError: (path: string) => void;