@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.
- package/dist/{as-array-DnxeuRPB.mjs → as-array-BKC7bBXf.mjs} +13 -18
- package/dist/{as-array-DjJ_GA65.cjs → as-array-C4Vv6k5I.cjs} +12 -17
- package/dist/{as-array-clear-btn-DkmJoCjN.mjs → as-array-clear-btn-ConR3zxV.mjs} +2 -2
- package/dist/{as-array-clear-btn-DSuk9U43.cjs → as-array-clear-btn-DeWeUqoX.cjs} +2 -2
- package/dist/as-array.cjs +1 -1
- package/dist/as-array.mjs +1 -1
- package/dist/{as-checkbox-BivClBCD.mjs → as-checkbox-Dux-KJVN.mjs} +3 -3
- package/dist/{as-checkbox-52v5CL8Z.cjs → as-checkbox-NjLPm4Kk.cjs} +3 -3
- package/dist/as-checkbox.cjs +1 -1
- package/dist/as-checkbox.mjs +1 -1
- package/dist/{as-collapsible-COchVoS0.cjs → as-collapsible-BXQ481-h.cjs} +4 -4
- package/dist/{as-collapsible-B_YnV9V8.mjs → as-collapsible-FoPTu4lF.mjs} +4 -4
- package/dist/as-collapsible.cjs +1 -1
- package/dist/as-collapsible.mjs +1 -1
- package/dist/{as-date-HUhD-kZ4.cjs → as-date-DSvDDvwH.cjs} +1 -1
- package/dist/{as-date-Dsv_nimP.mjs → as-date-DUUpb8ph.mjs} +1 -1
- package/dist/as-date.cjs +1 -1
- package/dist/as-date.mjs +1 -1
- package/dist/{as-datetime-CiL-vlD2.cjs → as-datetime-DZBCBpov.cjs} +1 -1
- package/dist/{as-datetime-BxMIrM_M.mjs → as-datetime-Dy1tGMrO.mjs} +1 -1
- package/dist/as-datetime.cjs +1 -1
- package/dist/as-datetime.mjs +1 -1
- package/dist/{as-decimal-DA24-Wtp.cjs → as-decimal-DYBEUokN.cjs} +2 -2
- package/dist/{as-decimal-DegSeh2G.mjs → as-decimal-HvUQANde.mjs} +2 -2
- package/dist/as-decimal.cjs +1 -1
- package/dist/as-decimal.mjs +1 -1
- package/dist/{as-field-CeJbqaGj.cjs → as-field-C3lIiHCI.cjs} +7 -11
- package/dist/{as-field-D6clFBPR.mjs → as-field-R3KYssad.mjs} +8 -12
- package/dist/{as-field-shell-rghztVd7.cjs → as-field-shell-BOeyo1FP.cjs} +4 -4
- package/dist/{as-field-shell-IaUBze1S.mjs → as-field-shell-BQPySL71.mjs} +4 -4
- package/dist/as-field-shell.cjs +1 -1
- package/dist/as-field-shell.mjs +1 -1
- package/dist/as-field.cjs +1 -1
- package/dist/as-field.mjs +1 -1
- package/dist/{as-form-D-RQUPnK.mjs → as-form-B9hRTvod.mjs} +68 -33
- package/dist/{as-form-Bo-QNGot.cjs → as-form-DroFS2lv.cjs} +67 -32
- package/dist/as-form.cjs +1 -1
- package/dist/as-form.d.cts +1 -1
- package/dist/as-form.d.mts +1 -1
- package/dist/as-form.mjs +1 -1
- package/dist/{as-form.vue-Bxq1IR_f.d.mts → as-form.vue-BO3bQmRB.d.mts} +34 -15
- package/dist/{as-form.vue-Bx1yZIBk.d.cts → as-form.vue-DT1D4aMl.d.cts} +34 -15
- package/dist/{as-input-DGvRZOy5.cjs → as-input-BRJYoNF0.cjs} +1 -1
- package/dist/{as-input-CijlzZ8Q.mjs → as-input-C3MkFToh.mjs} +1 -1
- package/dist/as-input.cjs +1 -1
- package/dist/as-input.mjs +1 -1
- package/dist/{as-iterator-D643RugN.cjs → as-iterator-BB7DB04y.cjs} +2 -2
- package/dist/{as-iterator-CgGSiI_d.mjs → as-iterator-Bd1fXGs6.mjs} +2 -2
- package/dist/as-iterator.cjs +1 -1
- package/dist/as-iterator.mjs +1 -1
- package/dist/{as-multi-select-BXnZLgjt.mjs → as-multi-select-4awmF8mN.mjs} +2 -2
- package/dist/{as-multi-select-JUB05J_p.cjs → as-multi-select-DPpAKUzQ.cjs} +2 -2
- package/dist/as-multi-select.cjs +1 -1
- package/dist/as-multi-select.mjs +1 -1
- package/dist/{as-number-TfNY5CgX.cjs → as-number-CAVTkGcp.cjs} +2 -2
- package/dist/{as-number-DkeEBWva.mjs → as-number-WcRwaMOt.mjs} +2 -2
- package/dist/as-number.cjs +1 -1
- package/dist/as-number.mjs +1 -1
- package/dist/{as-object-BAsjdh_N.mjs → as-object-3Tlk8bjl.mjs} +6 -6
- package/dist/{as-object-lKSwKkt7.cjs → as-object-Bnyck833.cjs} +6 -6
- package/dist/as-object.cjs +1 -1
- package/dist/as-object.mjs +1 -1
- package/dist/{as-radio-CHwzhcQE.mjs → as-radio-8udWHC-l.mjs} +1 -1
- package/dist/{as-radio-DEHsBgwQ.cjs → as-radio-P9rzMYNp.cjs} +1 -1
- package/dist/as-radio.cjs +1 -1
- package/dist/as-radio.mjs +1 -1
- package/dist/{as-ref-DgdRW4ST.cjs → as-ref-BvPM3G73.cjs} +34 -12
- package/dist/{as-ref-N0dohgyv.mjs → as-ref-C-U7wotf.mjs} +35 -13
- package/dist/as-ref.cjs +1 -1
- package/dist/as-ref.mjs +1 -1
- package/dist/{as-select-bmYhMEV_.mjs → as-select-3fZCzWku.mjs} +1 -1
- package/dist/{as-select-YPLFDuAQ.cjs → as-select-DVbegHcv.cjs} +1 -1
- package/dist/as-select.cjs +1 -1
- package/dist/as-select.mjs +1 -1
- package/dist/{as-time-D107-bEJ.mjs → as-time-BtTiGWOr.mjs} +1 -1
- package/dist/{as-time-21ZSGDiq.cjs → as-time-W1ExfNxT.cjs} +1 -1
- package/dist/as-time.cjs +1 -1
- package/dist/as-time.mjs +1 -1
- package/dist/{as-tuple-gNyJxwi4.mjs → as-tuple-CBOp5N1c.mjs} +10 -11
- package/dist/{as-tuple-5nsBvO-n.cjs → as-tuple-dfvCxm4R.cjs} +9 -10
- package/dist/as-tuple.cjs +1 -1
- package/dist/as-tuple.mjs +1 -1
- package/dist/{as-union-BuCn5dN6.cjs → as-union-B0h0AlsZ.cjs} +6 -9
- package/dist/{as-union-BLTGJOyB.mjs → as-union-izUcMyQt.mjs} +7 -10
- package/dist/as-union.cjs +1 -1
- package/dist/as-union.mjs +1 -1
- package/dist/{as-variant-picker-DJ_sqKD3.mjs → as-variant-picker-D0I5qR2w.mjs} +2 -2
- package/dist/{as-variant-picker-BxOP4dkG.cjs → as-variant-picker-oELBST6P.cjs} +2 -2
- package/dist/{focus-after-toggle-DRXAm5Xh.cjs → focus-after-toggle-B8DDrJ7d.cjs} +36 -0
- package/dist/{focus-after-toggle-CXzXFIdA.mjs → focus-after-toggle-CWw0i0B6.mjs} +31 -1
- package/dist/index.cjs +27 -27
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +27 -27
- package/dist/locale.cjs +1 -1
- package/dist/locale.mjs +1 -1
- package/dist/{use-as-model-texts-x-ioNOC1.cjs → use-as-model-texts-CLzPZ6Go.cjs} +2 -2
- package/dist/{use-as-model-texts-DJf4hBHf.mjs → use-as-model-texts-D3uf3X8L.mjs} +2 -2
- package/dist/{use-as-optional-add-flow-C7f0blhC.cjs → use-as-optional-add-flow-B7Pp6r-k.cjs} +2 -2
- package/dist/{use-as-optional-add-flow-fOglspPV.mjs → use-as-optional-add-flow-CdnxNOUT.mjs} +2 -2
- package/dist/{use-as-value-help-B2Ds6Iek.cjs → use-as-value-help-BG6aN4yQ.cjs} +4 -7
- package/dist/{use-as-value-help-C3-5RMoO.mjs → use-as-value-help-BWiBDup3.mjs} +4 -7
- package/dist/{use-form-context-ClLGWXWa.cjs → use-form-context-C5Q9Gznl.cjs} +5 -1
- package/dist/{use-form-context-D7fCP5H4.mjs → use-form-context-Cw-ETG8f.mjs} +6 -2
- package/package.json +5 -5
- /package/dist/{use-as-locale-CnNyyqcF.cjs → use-as-locale-BHltz8Wp.cjs} +0 -0
- /package/dist/{use-as-locale-BEzm7jbp.mjs → use-as-locale-WBFjL_OO.mjs} +0 -0
- /package/dist/{use-as-nested-sections-store-u1VgBJAP.cjs → use-as-nested-sections-store-ApstV9NL.cjs} +0 -0
- /package/dist/{use-as-nested-sections-store-Dfo971PK.mjs → use-as-nested-sections-store-CkrMJbnN.mjs} +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
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
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* detects its index once at setup and won't
|
|
53
|
-
* data swap. No-op for `rebase()` (which doesn't
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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(
|
|
691
|
-
renderSlot(_ctx.$slots, "form.before", normalizeProps(guardReactiveProps(
|
|
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(
|
|
697
|
-
unref(form).formError.value ? renderSlot(_ctx.$slots, "form.error", mergeProps({ key: 0 },
|
|
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 },
|
|
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",
|
|
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(
|
|
716
|
-
__props.loading ? (openBlock(), createElementBlock("div",
|
|
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
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
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
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* detects its index once at setup and won't
|
|
53
|
-
* data swap. No-op for `rebase()` (which doesn't
|
|
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
|
-
(
|
|
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
|
-
(
|
|
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
|
|
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)(
|
|
691
|
-
(0, vue.renderSlot)(_ctx.$slots, "form.before", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(
|
|
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)(
|
|
697
|
-
(0, vue.unref)(form).formError.value ? (0, vue.renderSlot)(_ctx.$slots, "form.error", (0, vue.mergeProps)({ key: 0 },
|
|
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 },
|
|
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",
|
|
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)(
|
|
716
|
-
__props.loading ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
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-
|
|
1
|
+
const require_as_form = require("./as-form-DroFS2lv.cjs");
|
|
2
2
|
module.exports = require_as_form.as_form_default;
|
package/dist/as-form.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _default, t as Props } from "./as-form.vue-
|
|
1
|
+
import { n as _default, t as Props } from "./as-form.vue-DT1D4aMl.cjs";
|
|
2
2
|
export { Props, _default as default };
|
package/dist/as-form.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _default, t as Props } from "./as-form.vue-
|
|
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-
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
343
|
-
* `
|
|
344
|
-
*
|
|
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
|
-
*
|
|
400
|
-
*
|
|
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
|
-
|
|
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;
|