@atscript/vue-form 0.1.114 → 0.1.116
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-opoGhD7Q.cjs → as-array-9FTuRC1M.cjs} +1 -1
- package/dist/{as-array-DMMA0WhA.mjs → as-array-BrtqWXjO.mjs} +1 -1
- package/dist/as-array.cjs +1 -1
- package/dist/as-array.mjs +1 -1
- package/dist/{as-field-oZeBwI9U.mjs → as-field-CCzocwup.mjs} +3 -2
- package/dist/{as-field-BC3LdGue.cjs → as-field-CTjDoAZ-.cjs} +3 -2
- package/dist/as-field.cjs +1 -1
- package/dist/as-field.mjs +1 -1
- package/dist/{as-form-KXdLWQMq.mjs → as-form-Ckj7mjOo.mjs} +38 -20
- package/dist/{as-form-qrsfdEOq.cjs → as-form-DY8uOvQf.cjs} +36 -18
- 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-DJZ7Ub54.d.mts → as-form.vue-Bdvel5Mo.d.mts} +28 -3
- package/dist/{as-form.vue-DLFb1NRU.d.cts → as-form.vue-CWZlihHy.d.cts} +28 -3
- package/dist/{as-iterator-CaXKhPjU.mjs → as-iterator-QrcUfX6I.mjs} +1 -1
- package/dist/{as-iterator-Cs1qZXGu.cjs → as-iterator-mM4ppMQE.cjs} +1 -1
- package/dist/as-iterator.cjs +1 -1
- package/dist/as-iterator.mjs +1 -1
- package/dist/{as-object-BJG7f5tQ.mjs → as-object-C8ic4o0z.mjs} +1 -1
- package/dist/{as-object-DindiCq4.cjs → as-object-DspRIlMC.cjs} +1 -1
- package/dist/as-object.cjs +1 -1
- package/dist/as-object.mjs +1 -1
- package/dist/{as-tuple-Ca4bIuag.cjs → as-tuple-BpfLMtoJ.cjs} +1 -1
- package/dist/{as-tuple-H0qDsZKS.mjs → as-tuple-Ckmki4p_.mjs} +1 -1
- package/dist/as-tuple.cjs +1 -1
- package/dist/as-tuple.mjs +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +6 -6
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_use_form_context = require("./use-form-context-B6ZnzfxG.cjs");
|
|
2
|
-
const require_as_field = require("./as-field-
|
|
2
|
+
const require_as_field = require("./as-field-CTjDoAZ-.cjs");
|
|
3
3
|
const require_as_collapsible = require("./as-collapsible-nMEolKb7.cjs");
|
|
4
4
|
const require_as_variant_picker = require("./as-variant-picker-JlEhh7YO.cjs");
|
|
5
5
|
const require_use_as_dropdown = require("./use-as-dropdown-Bj9toVdw.cjs");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as CHANGE_HANDLER_KEY, n as useAsUnionVariant, r as useFormContext } from "./use-form-context-cDW2GW4-.mjs";
|
|
2
|
-
import { t as as_field_default } from "./as-field-
|
|
2
|
+
import { t as as_field_default } from "./as-field-CCzocwup.mjs";
|
|
3
3
|
import { t as as_collapsible_default } from "./as-collapsible-_RN5621d.mjs";
|
|
4
4
|
import { t as as_variant_picker_default } from "./as-variant-picker-B3GLhKyt.mjs";
|
|
5
5
|
import { t as useAsDropdown } from "./use-as-dropdown-B2Shb7wn.mjs";
|
package/dist/as-array.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_array = require("./as-array-
|
|
1
|
+
const require_as_array = require("./as-array-9FTuRC1M.cjs");
|
|
2
2
|
module.exports = require_as_array.as_array_default;
|
package/dist/as-array.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_array_default } from "./as-array-
|
|
1
|
+
import { t as as_array_default } from "./as-array-BrtqWXjO.mjs";
|
|
2
2
|
export { as_array_default as default };
|
|
@@ -69,7 +69,8 @@ function useAsField(opts) {
|
|
|
69
69
|
},
|
|
70
70
|
setExternalError: (msg) => {
|
|
71
71
|
externalError.value = msg;
|
|
72
|
-
}
|
|
72
|
+
},
|
|
73
|
+
getError: () => error.value
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
76
|
onUnmounted(() => {
|
|
@@ -251,7 +252,7 @@ var as_field_default = /* @__PURE__ */ defineComponent({
|
|
|
251
252
|
}
|
|
252
253
|
function buildFieldClasses(classValue, isDisabled, isRequired, isOptional) {
|
|
253
254
|
return {
|
|
254
|
-
...typeof classValue === "string" ? { [classValue]: true } : classValue,
|
|
255
|
+
...typeof classValue === "string" ? { [classValue]: true } : Array.isArray(classValue) ? Object.fromEntries(classValue.filter((c) => typeof c === "string").map((c) => [c, true])) : classValue,
|
|
255
256
|
disabled: isDisabled,
|
|
256
257
|
required: isRequired && !isOptional
|
|
257
258
|
};
|
|
@@ -69,7 +69,8 @@ function useAsField(opts) {
|
|
|
69
69
|
},
|
|
70
70
|
setExternalError: (msg) => {
|
|
71
71
|
externalError.value = msg;
|
|
72
|
-
}
|
|
72
|
+
},
|
|
73
|
+
getError: () => error.value
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
76
|
(0, vue.onUnmounted)(() => {
|
|
@@ -251,7 +252,7 @@ var as_field_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
251
252
|
}
|
|
252
253
|
function buildFieldClasses(classValue, isDisabled, isRequired, isOptional) {
|
|
253
254
|
return {
|
|
254
|
-
...typeof classValue === "string" ? { [classValue]: true } : classValue,
|
|
255
|
+
...typeof classValue === "string" ? { [classValue]: true } : Array.isArray(classValue) ? Object.fromEntries(classValue.filter((c) => typeof c === "string").map((c) => [c, true])) : classValue,
|
|
255
256
|
disabled: isDisabled,
|
|
256
257
|
required: isRequired && !isOptional
|
|
257
258
|
};
|
package/dist/as-field.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_field = require("./as-field-
|
|
1
|
+
const require_as_field = require("./as-field-CTjDoAZ-.cjs");
|
|
2
2
|
module.exports = require_as_field.as_field_default;
|
package/dist/as-field.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_field_default } from "./as-field-
|
|
1
|
+
import { t as as_field_default } from "./as-field-CCzocwup.mjs";
|
|
2
2
|
export { as_field_default as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as TYPES_KEY, a as CHANGE_HANDLER_KEY, c as ERRORS_KEY, d as FORM_PATCH_KEY, f as FORM_STATE_KEY, g as ROOT_DATA_KEY, h as PATH_PREFIX_KEY, i as ACTION_HANDLER_KEY, l as FORM_CONTEXT_KEY, o as COMPONENTS_KEY, p as HIDE_ROOT_TITLE_KEY, s as DISMISS_EXTERNAL_AT_KEY, u as FORM_DATA_KEY } from "./use-form-context-cDW2GW4-.mjs";
|
|
2
2
|
import { i as useAsNestedSectionsStore, n as provideAsNestedSectionsStore, t as DESCENDANT_ERROR_COUNTS_KEY } from "./use-as-nested-sections-store-Dfo971PK.mjs";
|
|
3
3
|
import { t as CLIENT_FACTORY_KEY } from "./use-as-value-help-DrISSxCz.mjs";
|
|
4
|
-
import { t as as_field_default } from "./as-field-
|
|
5
|
-
import { t as as_iterator_default } from "./as-iterator-
|
|
6
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, inject, mergeProps, nextTick, normalizeProps, openBlock, provide, reactive, ref, renderSlot, toDisplayString, toRaw, toValue, unref, watch, watchEffect, withModifiers } from "vue";
|
|
7
|
-
import { 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, getDeclaredFormActions, getFormValidator, iteratePathAncestors, mergeErrorMaps, resolveFormProp, setByPath, unionVariantChanged } from "@atscript/ui";
|
|
4
|
+
import { t as as_field_default } from "./as-field-CCzocwup.mjs";
|
|
5
|
+
import { t as as_iterator_default } from "./as-iterator-QrcUfX6I.mjs";
|
|
6
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, inject, mergeProps, nextTick, normalizeProps, openBlock, provide, reactive, ref, renderSlot, shallowRef, toDisplayString, toRaw, toValue, unref, watch, watchEffect, withModifiers } from "vue";
|
|
7
|
+
import { 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, getDeclaredFormActions, getFormValidator, iteratePathAncestors, mergeErrorMaps, omitPaths, resolveFormProp, setByPath, unionVariantChanged } from "@atscript/ui";
|
|
8
8
|
//#region src/composables/use-as-form-patch.ts
|
|
9
9
|
/**
|
|
10
10
|
* Internal factory invoked by `useAsForm` when `trackChanges` is enabled. Owns
|
|
@@ -241,12 +241,15 @@ function useAsExternalErrors(options) {
|
|
|
241
241
|
//#region src/composables/use-as-state.ts
|
|
242
242
|
function useAsState(opts) {
|
|
243
243
|
const fieldsById = /* @__PURE__ */ new Map();
|
|
244
|
+
const fieldsRevision = shallowRef(0);
|
|
244
245
|
const register = (id, registration) => {
|
|
245
246
|
fieldsById.set(id, registration);
|
|
247
|
+
fieldsRevision.value++;
|
|
246
248
|
if (formState.firstSubmitHappened) formState.freshFields.add(id);
|
|
247
249
|
};
|
|
248
250
|
const unregister = (id) => {
|
|
249
251
|
fieldsById.delete(id);
|
|
252
|
+
fieldsRevision.value++;
|
|
250
253
|
formState.freshFields.delete(id);
|
|
251
254
|
};
|
|
252
255
|
const formState = reactive({
|
|
@@ -311,7 +314,22 @@ function useAsState(opts) {
|
|
|
311
314
|
reset,
|
|
312
315
|
submit,
|
|
313
316
|
setErrors,
|
|
314
|
-
formState
|
|
317
|
+
formState,
|
|
318
|
+
liveErrors: computed(() => {
|
|
319
|
+
fieldsRevision.value;
|
|
320
|
+
const errors = {};
|
|
321
|
+
for (const reg of fieldsById.values()) {
|
|
322
|
+
const msg = reg.callbacks.getError?.();
|
|
323
|
+
if (msg) errors[reg.path()] = msg;
|
|
324
|
+
}
|
|
325
|
+
return errors;
|
|
326
|
+
}),
|
|
327
|
+
registeredPaths: computed(() => {
|
|
328
|
+
fieldsRevision.value;
|
|
329
|
+
const paths = /* @__PURE__ */ new Set();
|
|
330
|
+
for (const reg of fieldsById.values()) paths.add(reg.path());
|
|
331
|
+
return paths;
|
|
332
|
+
})
|
|
315
333
|
};
|
|
316
334
|
}
|
|
317
335
|
//#endregion
|
|
@@ -346,7 +364,7 @@ function useAsForm(options) {
|
|
|
346
364
|
const domainData = () => toRaw(getDomainData());
|
|
347
365
|
const formContext = computed(() => options.formContext?.());
|
|
348
366
|
const formValidator = computed(() => getFormValidator(options.def(), { errorLimit: Number.MAX_SAFE_INTEGER }));
|
|
349
|
-
const { clearErrors, reset: resetState, submit, setErrors } = useAsState({
|
|
367
|
+
const { clearErrors: clearFieldErrors, reset: resetState, submit, setErrors, liveErrors, registeredPaths } = useAsState({
|
|
350
368
|
formData: data,
|
|
351
369
|
formContext,
|
|
352
370
|
firstValidation: computed(() => options.firstValidation?.()),
|
|
@@ -360,10 +378,11 @@ function useAsForm(options) {
|
|
|
360
378
|
remountKey.value++;
|
|
361
379
|
}) : void 0;
|
|
362
380
|
if (patch) provide(FORM_PATCH_KEY, patch);
|
|
363
|
-
const reset =
|
|
381
|
+
const reset = async () => {
|
|
382
|
+
internalErrors.value = {};
|
|
364
383
|
await resetState();
|
|
365
|
-
patch
|
|
366
|
-
}
|
|
384
|
+
patch?.rebase();
|
|
385
|
+
};
|
|
367
386
|
provide(ROOT_DATA_KEY, data);
|
|
368
387
|
provide(PATH_PREFIX_KEY, computed(() => ""));
|
|
369
388
|
provide(TYPES_KEY, computed(() => options.types()));
|
|
@@ -376,7 +395,12 @@ function useAsForm(options) {
|
|
|
376
395
|
const cf = options.clientFactory?.();
|
|
377
396
|
if (cf) provide(CLIENT_FACTORY_KEY, cf);
|
|
378
397
|
const internalErrors = ref({});
|
|
379
|
-
const
|
|
398
|
+
const orphanInternalErrors = computed(() => omitPaths(internalErrors.value, registeredPaths.value));
|
|
399
|
+
const allErrors = computed(() => mergeErrorMaps(ext.effective.value, orphanInternalErrors.value, liveErrors.value));
|
|
400
|
+
function clearErrors() {
|
|
401
|
+
internalErrors.value = {};
|
|
402
|
+
clearFieldErrors();
|
|
403
|
+
}
|
|
380
404
|
provide(DESCENDANT_ERROR_COUNTS_KEY, computed(() => buildDescendantErrorCounts(allErrors.value)));
|
|
381
405
|
watch(allErrors, (errors) => {
|
|
382
406
|
for (const errPath of Object.keys(errors)) for (const ancestor of iteratePathAncestors(errPath)) sectionsStore.setOpen(ancestor, true);
|
|
@@ -428,16 +452,8 @@ function useAsForm(options) {
|
|
|
428
452
|
function handleChange(type, path, value) {
|
|
429
453
|
ext.dismissAt(path);
|
|
430
454
|
const errors = internalErrors.value;
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
for (const key in errors) {
|
|
434
|
-
if (!stale) stale = new Set(iteratePathAncestors(path));
|
|
435
|
-
if (stale.has(key)) {
|
|
436
|
-
if (!next) next = { ...errors };
|
|
437
|
-
delete next[key];
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
if (next) {
|
|
455
|
+
const next = omitPaths(errors, new Set(iteratePathAncestors(path)));
|
|
456
|
+
if (next !== errors) {
|
|
441
457
|
internalErrors.value = next;
|
|
442
458
|
setErrors(next);
|
|
443
459
|
}
|
|
@@ -583,6 +599,8 @@ var as_form_default = /* @__PURE__ */ defineComponent({
|
|
|
583
599
|
__expose({
|
|
584
600
|
submit: form.onSubmit,
|
|
585
601
|
reset: form.reset,
|
|
602
|
+
clearErrors: form.clearErrors,
|
|
603
|
+
setErrors: form.setErrors,
|
|
586
604
|
get isDirty() {
|
|
587
605
|
return form.patch?.isDirty.value ?? false;
|
|
588
606
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_use_form_context = require("./use-form-context-B6ZnzfxG.cjs");
|
|
2
2
|
const require_use_as_nested_sections_store = require("./use-as-nested-sections-store-u1VgBJAP.cjs");
|
|
3
3
|
const require_use_as_value_help = require("./use-as-value-help-BsAriqCI.cjs");
|
|
4
|
-
const require_as_field = require("./as-field-
|
|
5
|
-
const require_as_iterator = require("./as-iterator-
|
|
4
|
+
const require_as_field = require("./as-field-CTjDoAZ-.cjs");
|
|
5
|
+
const require_as_iterator = require("./as-iterator-mM4ppMQE.cjs");
|
|
6
6
|
let vue = require("vue");
|
|
7
7
|
let _atscript_ui = require("@atscript/ui");
|
|
8
8
|
//#region src/composables/use-as-form-patch.ts
|
|
@@ -241,12 +241,15 @@ function useAsExternalErrors(options) {
|
|
|
241
241
|
//#region src/composables/use-as-state.ts
|
|
242
242
|
function useAsState(opts) {
|
|
243
243
|
const fieldsById = /* @__PURE__ */ new Map();
|
|
244
|
+
const fieldsRevision = (0, vue.shallowRef)(0);
|
|
244
245
|
const register = (id, registration) => {
|
|
245
246
|
fieldsById.set(id, registration);
|
|
247
|
+
fieldsRevision.value++;
|
|
246
248
|
if (formState.firstSubmitHappened) formState.freshFields.add(id);
|
|
247
249
|
};
|
|
248
250
|
const unregister = (id) => {
|
|
249
251
|
fieldsById.delete(id);
|
|
252
|
+
fieldsRevision.value++;
|
|
250
253
|
formState.freshFields.delete(id);
|
|
251
254
|
};
|
|
252
255
|
const formState = (0, vue.reactive)({
|
|
@@ -311,7 +314,22 @@ function useAsState(opts) {
|
|
|
311
314
|
reset,
|
|
312
315
|
submit,
|
|
313
316
|
setErrors,
|
|
314
|
-
formState
|
|
317
|
+
formState,
|
|
318
|
+
liveErrors: (0, vue.computed)(() => {
|
|
319
|
+
fieldsRevision.value;
|
|
320
|
+
const errors = {};
|
|
321
|
+
for (const reg of fieldsById.values()) {
|
|
322
|
+
const msg = reg.callbacks.getError?.();
|
|
323
|
+
if (msg) errors[reg.path()] = msg;
|
|
324
|
+
}
|
|
325
|
+
return errors;
|
|
326
|
+
}),
|
|
327
|
+
registeredPaths: (0, vue.computed)(() => {
|
|
328
|
+
fieldsRevision.value;
|
|
329
|
+
const paths = /* @__PURE__ */ new Set();
|
|
330
|
+
for (const reg of fieldsById.values()) paths.add(reg.path());
|
|
331
|
+
return paths;
|
|
332
|
+
})
|
|
315
333
|
};
|
|
316
334
|
}
|
|
317
335
|
//#endregion
|
|
@@ -346,7 +364,7 @@ function useAsForm(options) {
|
|
|
346
364
|
const domainData = () => (0, vue.toRaw)(getDomainData());
|
|
347
365
|
const formContext = (0, vue.computed)(() => options.formContext?.());
|
|
348
366
|
const formValidator = (0, vue.computed)(() => (0, _atscript_ui.getFormValidator)(options.def(), { errorLimit: Number.MAX_SAFE_INTEGER }));
|
|
349
|
-
const { clearErrors, reset: resetState, submit, setErrors } = useAsState({
|
|
367
|
+
const { clearErrors: clearFieldErrors, reset: resetState, submit, setErrors, liveErrors, registeredPaths } = useAsState({
|
|
350
368
|
formData: data,
|
|
351
369
|
formContext,
|
|
352
370
|
firstValidation: (0, vue.computed)(() => options.firstValidation?.()),
|
|
@@ -360,10 +378,11 @@ function useAsForm(options) {
|
|
|
360
378
|
remountKey.value++;
|
|
361
379
|
}) : void 0;
|
|
362
380
|
if (patch) (0, vue.provide)(require_use_form_context.FORM_PATCH_KEY, patch);
|
|
363
|
-
const reset =
|
|
381
|
+
const reset = async () => {
|
|
382
|
+
internalErrors.value = {};
|
|
364
383
|
await resetState();
|
|
365
|
-
patch
|
|
366
|
-
}
|
|
384
|
+
patch?.rebase();
|
|
385
|
+
};
|
|
367
386
|
(0, vue.provide)(require_use_form_context.ROOT_DATA_KEY, data);
|
|
368
387
|
(0, vue.provide)(require_use_form_context.PATH_PREFIX_KEY, (0, vue.computed)(() => ""));
|
|
369
388
|
(0, vue.provide)(require_use_form_context.TYPES_KEY, (0, vue.computed)(() => options.types()));
|
|
@@ -376,7 +395,12 @@ function useAsForm(options) {
|
|
|
376
395
|
const cf = options.clientFactory?.();
|
|
377
396
|
if (cf) (0, vue.provide)(require_use_as_value_help.CLIENT_FACTORY_KEY, cf);
|
|
378
397
|
const internalErrors = (0, vue.ref)({});
|
|
379
|
-
const
|
|
398
|
+
const orphanInternalErrors = (0, vue.computed)(() => (0, _atscript_ui.omitPaths)(internalErrors.value, registeredPaths.value));
|
|
399
|
+
const allErrors = (0, vue.computed)(() => (0, _atscript_ui.mergeErrorMaps)(ext.effective.value, orphanInternalErrors.value, liveErrors.value));
|
|
400
|
+
function clearErrors() {
|
|
401
|
+
internalErrors.value = {};
|
|
402
|
+
clearFieldErrors();
|
|
403
|
+
}
|
|
380
404
|
(0, vue.provide)(require_use_as_nested_sections_store.DESCENDANT_ERROR_COUNTS_KEY, (0, vue.computed)(() => (0, _atscript_ui.buildDescendantErrorCounts)(allErrors.value)));
|
|
381
405
|
(0, vue.watch)(allErrors, (errors) => {
|
|
382
406
|
for (const errPath of Object.keys(errors)) for (const ancestor of (0, _atscript_ui.iteratePathAncestors)(errPath)) sectionsStore.setOpen(ancestor, true);
|
|
@@ -428,16 +452,8 @@ function useAsForm(options) {
|
|
|
428
452
|
function handleChange(type, path, value) {
|
|
429
453
|
ext.dismissAt(path);
|
|
430
454
|
const errors = internalErrors.value;
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
for (const key in errors) {
|
|
434
|
-
if (!stale) stale = new Set((0, _atscript_ui.iteratePathAncestors)(path));
|
|
435
|
-
if (stale.has(key)) {
|
|
436
|
-
if (!next) next = { ...errors };
|
|
437
|
-
delete next[key];
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
if (next) {
|
|
455
|
+
const next = (0, _atscript_ui.omitPaths)(errors, new Set((0, _atscript_ui.iteratePathAncestors)(path)));
|
|
456
|
+
if (next !== errors) {
|
|
441
457
|
internalErrors.value = next;
|
|
442
458
|
setErrors(next);
|
|
443
459
|
}
|
|
@@ -583,6 +599,8 @@ var as_form_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
583
599
|
__expose({
|
|
584
600
|
submit: form.onSubmit,
|
|
585
601
|
reset: form.reset,
|
|
602
|
+
clearErrors: form.clearErrors,
|
|
603
|
+
setErrors: form.setErrors,
|
|
586
604
|
get isDirty() {
|
|
587
605
|
return form.patch?.isDirty.value ?? false;
|
|
588
606
|
},
|
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-DY8uOvQf.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-CWZlihHy.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-Bdvel5Mo.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-Ckj7mjOo.mjs";
|
|
2
2
|
export { as_form_default as default };
|
|
@@ -241,6 +241,16 @@ interface TFormFieldCallbacks {
|
|
|
241
241
|
clearErrors: () => void;
|
|
242
242
|
reset: () => void;
|
|
243
243
|
setExternalError: (msg?: string) => void;
|
|
244
|
+
/**
|
|
245
|
+
* Read the error message the field is DISPLAYING right now (external >
|
|
246
|
+
* submit > live-validated per `firstValidation` gating), or `undefined`
|
|
247
|
+
* when clean. Feeds the form-level live error aggregation (descendant
|
|
248
|
+
* error-count badges / auto-open), so badges track what's on screen
|
|
249
|
+
* without waiting for a submit. Optional so manually built registrations
|
|
250
|
+
* keep working — a field that omits it simply doesn't contribute live
|
|
251
|
+
* errors (submit-time errors still count through the form's own map).
|
|
252
|
+
*/
|
|
253
|
+
getError?: () => string | undefined;
|
|
244
254
|
}
|
|
245
255
|
interface TFormFieldRegistration {
|
|
246
256
|
path: () => string;
|
|
@@ -302,6 +312,15 @@ interface UseAsStateReturn {
|
|
|
302
312
|
message: string;
|
|
303
313
|
}[];
|
|
304
314
|
setErrors: (errors: Record<string, string>) => void;
|
|
315
|
+
/**
|
|
316
|
+
* What every registered field DISPLAYS right now, keyed by path
|
|
317
|
+
* (`callbacks.getError` per field; fields without the callback are
|
|
318
|
+
* skipped). Recomputes when any field's displayed error changes and on
|
|
319
|
+
* register/unregister — the live source for error-count badges.
|
|
320
|
+
*/
|
|
321
|
+
liveErrors: ComputedRef<Record<string, string>>;
|
|
322
|
+
/** Paths of all currently registered (mounted) fields. */
|
|
323
|
+
registeredPaths: ComputedRef<Set<string>>;
|
|
305
324
|
}
|
|
306
325
|
declare function useAsState<TFormData, TContext>(opts: {
|
|
307
326
|
formData: MaybeRef<TFormData>;
|
|
@@ -510,7 +529,11 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
|
|
|
510
529
|
* post-reset state (the form becomes clean again).
|
|
511
530
|
*/
|
|
512
531
|
reset: () => Promise<void>;
|
|
513
|
-
/**
|
|
532
|
+
/**
|
|
533
|
+
* Imperatively clear ALL error state: per-field (touched / blur / submit /
|
|
534
|
+
* external via `useAsState().clearErrors`) plus the form-level submit-time
|
|
535
|
+
* error map that feeds the descendant-count badges.
|
|
536
|
+
*/
|
|
514
537
|
clearErrors: () => void;
|
|
515
538
|
/** Imperatively set external-error messages by path. */
|
|
516
539
|
setErrors: (errors: Record<string, string>) => void;
|
|
@@ -1316,11 +1339,11 @@ interface Props<TF, TC> {
|
|
|
1316
1339
|
}
|
|
1317
1340
|
declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
1318
1341
|
props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
|
|
1319
|
-
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1320
1342
|
onError?: ((errors: {
|
|
1321
1343
|
path: string;
|
|
1322
1344
|
message: string;
|
|
1323
1345
|
}[]) => any) | undefined;
|
|
1346
|
+
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1324
1347
|
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
1325
1348
|
"onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
|
|
1326
1349
|
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
|
|
@@ -1329,7 +1352,9 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
|
|
|
1329
1352
|
} ? P : {});
|
|
1330
1353
|
expose: (exposed: vue.ShallowUnwrapRef<{
|
|
1331
1354
|
submit: () => void;
|
|
1332
|
-
reset: () => Promise<void>; /**
|
|
1355
|
+
reset: () => Promise<void>; /** Clear all error state (per-field + the submit-time map behind badges). */
|
|
1356
|
+
clearErrors: () => void; /** Set external-error messages by path (e.g. mapping a server 400). */
|
|
1357
|
+
setErrors: (errors: Record<string, string>) => void; /** True when `track-changes` is on AND data differs from baseline. */
|
|
1333
1358
|
readonly isDirty: boolean; /** Revert-aware per-field change list (empty when tracking is off). */
|
|
1334
1359
|
readonly changes: FormFieldChange[]; /** Build the `@atscript/db` patch object on demand (`{}` when off). */
|
|
1335
1360
|
getPatch: ((opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>) | (() => {}); /** Build the per-field change list on demand (`[]` when off). */
|
|
@@ -241,6 +241,16 @@ interface TFormFieldCallbacks {
|
|
|
241
241
|
clearErrors: () => void;
|
|
242
242
|
reset: () => void;
|
|
243
243
|
setExternalError: (msg?: string) => void;
|
|
244
|
+
/**
|
|
245
|
+
* Read the error message the field is DISPLAYING right now (external >
|
|
246
|
+
* submit > live-validated per `firstValidation` gating), or `undefined`
|
|
247
|
+
* when clean. Feeds the form-level live error aggregation (descendant
|
|
248
|
+
* error-count badges / auto-open), so badges track what's on screen
|
|
249
|
+
* without waiting for a submit. Optional so manually built registrations
|
|
250
|
+
* keep working — a field that omits it simply doesn't contribute live
|
|
251
|
+
* errors (submit-time errors still count through the form's own map).
|
|
252
|
+
*/
|
|
253
|
+
getError?: () => string | undefined;
|
|
244
254
|
}
|
|
245
255
|
interface TFormFieldRegistration {
|
|
246
256
|
path: () => string;
|
|
@@ -302,6 +312,15 @@ interface UseAsStateReturn {
|
|
|
302
312
|
message: string;
|
|
303
313
|
}[];
|
|
304
314
|
setErrors: (errors: Record<string, string>) => void;
|
|
315
|
+
/**
|
|
316
|
+
* What every registered field DISPLAYS right now, keyed by path
|
|
317
|
+
* (`callbacks.getError` per field; fields without the callback are
|
|
318
|
+
* skipped). Recomputes when any field's displayed error changes and on
|
|
319
|
+
* register/unregister — the live source for error-count badges.
|
|
320
|
+
*/
|
|
321
|
+
liveErrors: ComputedRef<Record<string, string>>;
|
|
322
|
+
/** Paths of all currently registered (mounted) fields. */
|
|
323
|
+
registeredPaths: ComputedRef<Set<string>>;
|
|
305
324
|
}
|
|
306
325
|
declare function useAsState<TFormData, TContext>(opts: {
|
|
307
326
|
formData: MaybeRef<TFormData>;
|
|
@@ -510,7 +529,11 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
|
|
|
510
529
|
* post-reset state (the form becomes clean again).
|
|
511
530
|
*/
|
|
512
531
|
reset: () => Promise<void>;
|
|
513
|
-
/**
|
|
532
|
+
/**
|
|
533
|
+
* Imperatively clear ALL error state: per-field (touched / blur / submit /
|
|
534
|
+
* external via `useAsState().clearErrors`) plus the form-level submit-time
|
|
535
|
+
* error map that feeds the descendant-count badges.
|
|
536
|
+
*/
|
|
514
537
|
clearErrors: () => void;
|
|
515
538
|
/** Imperatively set external-error messages by path. */
|
|
516
539
|
setErrors: (errors: Record<string, string>) => void;
|
|
@@ -1316,11 +1339,11 @@ interface Props<TF, TC> {
|
|
|
1316
1339
|
}
|
|
1317
1340
|
declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
1318
1341
|
props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
|
|
1319
|
-
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1320
1342
|
onError?: ((errors: {
|
|
1321
1343
|
path: string;
|
|
1322
1344
|
message: string;
|
|
1323
1345
|
}[]) => any) | undefined;
|
|
1346
|
+
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1324
1347
|
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
1325
1348
|
"onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
|
|
1326
1349
|
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
|
|
@@ -1329,7 +1352,9 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
|
|
|
1329
1352
|
} ? P : {});
|
|
1330
1353
|
expose: (exposed: vue.ShallowUnwrapRef<{
|
|
1331
1354
|
submit: () => void;
|
|
1332
|
-
reset: () => Promise<void>; /**
|
|
1355
|
+
reset: () => Promise<void>; /** Clear all error state (per-field + the submit-time map behind badges). */
|
|
1356
|
+
clearErrors: () => void; /** Set external-error messages by path (e.g. mapping a server 400). */
|
|
1357
|
+
setErrors: (errors: Record<string, string>) => void; /** True when `track-changes` is on AND data differs from baseline. */
|
|
1333
1358
|
readonly isDirty: boolean; /** Revert-aware per-field change list (empty when tracking is off). */
|
|
1334
1359
|
readonly changes: FormFieldChange[]; /** Build the `@atscript/db` patch object on demand (`{}` when off). */
|
|
1335
1360
|
getPatch: ((opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>) | (() => {}); /** Build the per-field change list on demand (`[]` when off). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as PATH_PREFIX_KEY, m as LEVEL_KEY } from "./use-form-context-cDW2GW4-.mjs";
|
|
2
|
-
import { t as as_field_default } from "./as-field-
|
|
2
|
+
import { t as as_field_default } from "./as-field-CCzocwup.mjs";
|
|
3
3
|
import { Fragment, computed, createBlock, createElementBlock, defineComponent, inject, openBlock, provide, renderList } from "vue";
|
|
4
4
|
import { joinPath } from "@atscript/ui";
|
|
5
5
|
//#region src/composables/use-as-level.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_use_form_context = require("./use-form-context-B6ZnzfxG.cjs");
|
|
2
|
-
const require_as_field = require("./as-field-
|
|
2
|
+
const require_as_field = require("./as-field-CTjDoAZ-.cjs");
|
|
3
3
|
let vue = require("vue");
|
|
4
4
|
let _atscript_ui = require("@atscript/ui");
|
|
5
5
|
//#region src/composables/use-as-level.ts
|
package/dist/as-iterator.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_iterator = require("./as-iterator-
|
|
1
|
+
const require_as_iterator = require("./as-iterator-mM4ppMQE.cjs");
|
|
2
2
|
module.exports = require_as_iterator.as_iterator_default;
|
package/dist/as-iterator.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_iterator_default } from "./as-iterator-
|
|
1
|
+
import { t as as_iterator_default } from "./as-iterator-QrcUfX6I.mjs";
|
|
2
2
|
export { as_iterator_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as useAsUnionVariant } from "./use-form-context-cDW2GW4-.mjs";
|
|
2
|
-
import { t as as_iterator_default } from "./as-iterator-
|
|
2
|
+
import { t as as_iterator_default } from "./as-iterator-QrcUfX6I.mjs";
|
|
3
3
|
import { t as as_collapsible_default } from "./as-collapsible-_RN5621d.mjs";
|
|
4
4
|
import { n as as_optional_clear_default, t as as_variant_picker_default } from "./as-variant-picker-B3GLhKyt.mjs";
|
|
5
5
|
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-BdjKNx9P.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_use_form_context = require("./use-form-context-B6ZnzfxG.cjs");
|
|
2
|
-
const require_as_iterator = require("./as-iterator-
|
|
2
|
+
const require_as_iterator = require("./as-iterator-mM4ppMQE.cjs");
|
|
3
3
|
const require_as_collapsible = require("./as-collapsible-nMEolKb7.cjs");
|
|
4
4
|
const require_as_variant_picker = require("./as-variant-picker-JlEhh7YO.cjs");
|
|
5
5
|
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-CD8seN3C.cjs");
|
package/dist/as-object.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_object = require("./as-object-
|
|
1
|
+
const require_as_object = require("./as-object-DspRIlMC.cjs");
|
|
2
2
|
module.exports = require_as_object.as_object_default;
|
package/dist/as-object.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_object_default } from "./as-object-
|
|
1
|
+
import { t as as_object_default } from "./as-object-C8ic4o0z.mjs";
|
|
2
2
|
export { as_object_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_use_form_context = require("./use-form-context-B6ZnzfxG.cjs");
|
|
2
|
-
const require_as_field = require("./as-field-
|
|
2
|
+
const require_as_field = require("./as-field-CTjDoAZ-.cjs");
|
|
3
3
|
const require_as_collapsible = require("./as-collapsible-nMEolKb7.cjs");
|
|
4
4
|
const require_as_variant_picker = require("./as-variant-picker-JlEhh7YO.cjs");
|
|
5
5
|
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-CD8seN3C.cjs");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as CHANGE_HANDLER_KEY, n as useAsUnionVariant, r as useFormContext } from "./use-form-context-cDW2GW4-.mjs";
|
|
2
|
-
import { t as as_field_default } from "./as-field-
|
|
2
|
+
import { t as as_field_default } from "./as-field-CCzocwup.mjs";
|
|
3
3
|
import { t as as_collapsible_default } from "./as-collapsible-_RN5621d.mjs";
|
|
4
4
|
import { t as as_variant_picker_default } from "./as-variant-picker-B3GLhKyt.mjs";
|
|
5
5
|
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-BdjKNx9P.mjs";
|
package/dist/as-tuple.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_tuple = require("./as-tuple-
|
|
1
|
+
const require_as_tuple = require("./as-tuple-BpfLMtoJ.cjs");
|
|
2
2
|
module.exports = require_as_tuple.as_tuple_default;
|
package/dist/as-tuple.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_tuple_default } from "./as-tuple-
|
|
1
|
+
import { t as as_tuple_default } from "./as-tuple-Ckmki4p_.mjs";
|
|
2
2
|
export { as_tuple_default as default };
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_use_form_context = require("./use-form-context-B6ZnzfxG.cjs");
|
|
3
|
-
const require_as_form = require("./as-form-
|
|
3
|
+
const require_as_form = require("./as-form-DY8uOvQf.cjs");
|
|
4
4
|
const require_use_as_nested_sections_store = require("./use-as-nested-sections-store-u1VgBJAP.cjs");
|
|
5
5
|
const require_use_as_value_help = require("./use-as-value-help-BsAriqCI.cjs");
|
|
6
|
-
const require_as_field = require("./as-field-
|
|
6
|
+
const require_as_field = require("./as-field-CTjDoAZ-.cjs");
|
|
7
7
|
const require_use_as_locale = require("./use-as-locale-C4z5stwD.cjs");
|
|
8
|
-
const require_as_iterator = require("./as-iterator-
|
|
8
|
+
const require_as_iterator = require("./as-iterator-mM4ppMQE.cjs");
|
|
9
9
|
const require_focus_after_toggle = require("./focus-after-toggle-CWxiPZWi.cjs");
|
|
10
10
|
const require_as_collapsible = require("./as-collapsible-nMEolKb7.cjs");
|
|
11
11
|
const require_as_field_shell = require("./as-field-shell-_XX9G3PP.cjs");
|
|
@@ -18,10 +18,10 @@ const require_as_checkbox = require("./as-checkbox-C-NoKSv6.cjs");
|
|
|
18
18
|
const require_as_paragraph = require("./as-paragraph-CPhDTH_V.cjs");
|
|
19
19
|
const require_as_action = require("./as-action-B712j9xf.cjs");
|
|
20
20
|
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-CD8seN3C.cjs");
|
|
21
|
-
const require_as_object = require("./as-object-
|
|
22
|
-
const require_as_array = require("./as-array-
|
|
21
|
+
const require_as_object = require("./as-object-DspRIlMC.cjs");
|
|
22
|
+
const require_as_array = require("./as-array-9FTuRC1M.cjs");
|
|
23
23
|
const require_as_union = require("./as-union-CovWOnmN.cjs");
|
|
24
|
-
const require_as_tuple = require("./as-tuple-
|
|
24
|
+
const require_as_tuple = require("./as-tuple-BpfLMtoJ.cjs");
|
|
25
25
|
const require_as_ref = require("./as-ref-CMDYGqL6.cjs");
|
|
26
26
|
const require_as_decimal = require("./as-decimal-B1_3ivMF.cjs");
|
|
27
27
|
const require_as_number = require("./as-number-Bv33W-S9.cjs");
|
package/dist/index.d.cts
CHANGED
|
@@ -20,5 +20,5 @@ import { t as _default$13 } from "./as-number.vue-CZC0-zs8.cjs";
|
|
|
20
20
|
import { t as _default$4 } from "./as-date.vue-BZiy1s5s.cjs";
|
|
21
21
|
import { t as _default$5 } from "./as-datetime.vue-DYEHokj_.cjs";
|
|
22
22
|
import { t as _default$19 } from "./as-time.vue-DMy_Au0C.cjs";
|
|
23
|
-
import { $ as AsNestedSectionsStore, A as UseAsDecimalOptions, At as TFormFieldCallbacks, B as UseAsOptionalAddFlowReturn, C as useAsDate, Ct as useAsFormPatch, D as UseAsNumberOptions, Dt as UseAsFieldOptions, E as useAsDualInput, Et as useAsState, F as useAsLocale, Ft as createAsFormDef, G as useAsVisibleFields, H as focusFirstAfter, I as UseAsTriStateCheckboxOptions, J as TResolveFieldPropOptions, K as UseAsOptionalFieldReturn, L as UseAsTriStateCheckboxReturn, M as useAsDecimal, Mt as TFormRule, N as UseAsLocaleReturn, Nt as TFormState, O as UseAsNumberReturn, Ot as UseAsFieldReturn, P as provideAsLocale, Pt as createDefaultTypes, Q as useAsLevel, R as useAsTriStateCheckbox, S as UseAsDateReturn, St as RebaseOntoResult, T as UseAsDualInputReturn, Tt as UseAsStateReturn, U as focusNewFocusableAfter, V as useAsOptionalAddFlow, W as useAsFocusFirstAfter, X as useAsFieldScope, Y as UseAsFieldScopeReturn, Z as provideAsNestedLevel, _ as UseAsTypeMapReturn, _t as useAsExternalErrors, a as FormFieldChange, at as UseAsValueHelpReturn, b as useAsPath, bt as useAsForm, c as hasFieldMeta, ct as useAsUnionVariant, d as resetDefaultClientFactory, dt as UseAsTupleReturn, et as provideAsNestedSectionsStore, f as setDefaultClientFactory, ft as useAsTuple, g as useAsData, gt as UseAsExternalErrorsReturn, h as UseAsDataReturn, ht as UseAsExternalErrorsOptions, i as FormDiffOptions, it as UseAsValueHelpOptions, j as UseAsDecimalReturn, jt as TFormFieldRegistration, k as useAsNumber, kt as useAsField, l as isFieldHidden, lt as UseAsUnionReturn, m as useAsErrorDismiss, mt as useAsArray, n as _default$9, nt as useAsNestedSectionsStore, o as FormRebaseOptions, ot as useAsValueHelp, p as AsErrorDismiss, pt as UseAsArrayReturn, q as useAsOptionalField, r as ClientFactory, rt as useAsDropdown, s as getDefaultClientFactory, st as formatIndexedLabelParts, tt as useAsDescendantErrorCounts, u as joinPath, ut as useAsUnion, v as useAsTypeMap, vt as UseAsFormOptions, w as UseAsDualInputOptions, wt as TFormSubmitValidator, x as UseAsDateOptions, xt as AsFormPatchHandle, y as UseAsPathReturn, yt as UseAsFormReturn, z as UseAsOptionalAddFlowOptions } from "./as-form.vue-
|
|
23
|
+
import { $ as AsNestedSectionsStore, A as UseAsDecimalOptions, At as TFormFieldCallbacks, B as UseAsOptionalAddFlowReturn, C as useAsDate, Ct as useAsFormPatch, D as UseAsNumberOptions, Dt as UseAsFieldOptions, E as useAsDualInput, Et as useAsState, F as useAsLocale, Ft as createAsFormDef, G as useAsVisibleFields, H as focusFirstAfter, I as UseAsTriStateCheckboxOptions, J as TResolveFieldPropOptions, K as UseAsOptionalFieldReturn, L as UseAsTriStateCheckboxReturn, M as useAsDecimal, Mt as TFormRule, N as UseAsLocaleReturn, Nt as TFormState, O as UseAsNumberReturn, Ot as UseAsFieldReturn, P as provideAsLocale, Pt as createDefaultTypes, Q as useAsLevel, R as useAsTriStateCheckbox, S as UseAsDateReturn, St as RebaseOntoResult, T as UseAsDualInputReturn, Tt as UseAsStateReturn, U as focusNewFocusableAfter, V as useAsOptionalAddFlow, W as useAsFocusFirstAfter, X as useAsFieldScope, Y as UseAsFieldScopeReturn, Z as provideAsNestedLevel, _ as UseAsTypeMapReturn, _t as useAsExternalErrors, a as FormFieldChange, at as UseAsValueHelpReturn, b as useAsPath, bt as useAsForm, c as hasFieldMeta, ct as useAsUnionVariant, d as resetDefaultClientFactory, dt as UseAsTupleReturn, et as provideAsNestedSectionsStore, f as setDefaultClientFactory, ft as useAsTuple, g as useAsData, gt as UseAsExternalErrorsReturn, h as UseAsDataReturn, ht as UseAsExternalErrorsOptions, i as FormDiffOptions, it as UseAsValueHelpOptions, j as UseAsDecimalReturn, jt as TFormFieldRegistration, k as useAsNumber, kt as useAsField, l as isFieldHidden, lt as UseAsUnionReturn, m as useAsErrorDismiss, mt as useAsArray, n as _default$9, nt as useAsNestedSectionsStore, o as FormRebaseOptions, ot as useAsValueHelp, p as AsErrorDismiss, pt as UseAsArrayReturn, q as useAsOptionalField, r as ClientFactory, rt as useAsDropdown, s as getDefaultClientFactory, st as formatIndexedLabelParts, tt as useAsDescendantErrorCounts, u as joinPath, ut as useAsUnion, v as useAsTypeMap, vt as UseAsFormOptions, w as UseAsDualInputOptions, wt as TFormSubmitValidator, x as UseAsDateOptions, xt as AsFormPatchHandle, y as UseAsPathReturn, yt as UseAsFormReturn, z as UseAsOptionalAddFlowOptions } from "./as-form.vue-CWZlihHy.cjs";
|
|
24
24
|
export { _default as AsAction, _default$1 as AsArray, _default$2 as AsCheckbox, _default$3 as AsCollapsible, _default$4 as AsDate, _default$5 as AsDatetime, _default$6 as AsDecimal, AsErrorDismiss, _default$7 as AsField, _default$8 as AsFieldShell, _default$9 as AsForm, AsFormPatchHandle, _default$10 as AsInput, _default$11 as AsIterator, _default$12 as AsMultiSelect, AsNestedSectionsStore, _default$13 as AsNumber, _default$14 as AsObject, _default$15 as AsParagraph, _default$16 as AsRadio, _default$17 as AsRef, _default$18 as AsSelect, _default$19 as AsTime, _default$20 as AsTuple, _default$21 as AsUnion, ClientFactory, FormDiffOptions, FormFieldChange, FormRebaseOptions, RebaseOntoResult, TAsBaseComponentProps, TAsChangeType, TAsCollapsibleProps, TAsCollapsibleSlots, TAsComponentEmits, TAsComponentProps, TAsTypeComponents, TAsUnionContext, TFormFieldCallbacks, TFormFieldRegistration, TFormRule, TFormState, TFormSubmitValidator, TResolveFieldPropOptions, UseAsArrayReturn, UseAsDataReturn, UseAsDateOptions, UseAsDateReturn, UseAsDecimalOptions, UseAsDecimalReturn, UseAsDualInputOptions, UseAsDualInputReturn, UseAsExternalErrorsOptions, UseAsExternalErrorsReturn, UseAsFieldOptions, UseAsFieldReturn, UseAsFieldScopeReturn, UseAsFormOptions, UseAsFormReturn, UseAsLocaleReturn, UseAsNumberOptions, UseAsNumberReturn, UseAsOptionalAddFlowOptions, UseAsOptionalAddFlowReturn, UseAsOptionalFieldReturn, UseAsPathReturn, UseAsStateReturn, UseAsTriStateCheckboxOptions, UseAsTriStateCheckboxReturn, UseAsTupleReturn, UseAsTypeMapReturn, UseAsUnionReturn, UseAsValueHelpOptions, UseAsValueHelpReturn, createAsFormDef, createDefaultTypes, focusFirstAfter, focusNewFocusableAfter, formatIndexedLabelParts, getDefaultClientFactory, hasFieldMeta, isFieldHidden, joinPath, provideAsLocale, provideAsNestedLevel, provideAsNestedSectionsStore, resetDefaultClientFactory, setDefaultClientFactory, useAsArray, useAsData, useAsDate, useAsDecimal, useAsDescendantErrorCounts, useAsDropdown, useAsDualInput, useAsErrorDismiss, useAsExternalErrors, useAsField, useAsFieldScope, useAsFocusFirstAfter, useAsForm, useAsFormPatch, useAsLevel, useAsLocale, useAsNestedSectionsStore, useAsNumber, useAsOptionalAddFlow, useAsOptionalField, useAsPath, useAsState, useAsTriStateCheckbox, useAsTuple, useAsTypeMap, useAsUnion, useAsUnionVariant, useAsValueHelp, useAsVisibleFields };
|
package/dist/index.d.mts
CHANGED
|
@@ -20,5 +20,5 @@ import { t as _default$13 } from "./as-number.vue-DrvjSOdq.mjs";
|
|
|
20
20
|
import { t as _default$4 } from "./as-date.vue-DWWoojir.mjs";
|
|
21
21
|
import { t as _default$5 } from "./as-datetime.vue-NblA-SVE.mjs";
|
|
22
22
|
import { t as _default$19 } from "./as-time.vue-DgW7qSAM.mjs";
|
|
23
|
-
import { $ as AsNestedSectionsStore, A as UseAsDecimalOptions, At as TFormFieldCallbacks, B as UseAsOptionalAddFlowReturn, C as useAsDate, Ct as useAsFormPatch, D as UseAsNumberOptions, Dt as UseAsFieldOptions, E as useAsDualInput, Et as useAsState, F as useAsLocale, Ft as createAsFormDef, G as useAsVisibleFields, H as focusFirstAfter, I as UseAsTriStateCheckboxOptions, J as TResolveFieldPropOptions, K as UseAsOptionalFieldReturn, L as UseAsTriStateCheckboxReturn, M as useAsDecimal, Mt as TFormRule, N as UseAsLocaleReturn, Nt as TFormState, O as UseAsNumberReturn, Ot as UseAsFieldReturn, P as provideAsLocale, Pt as createDefaultTypes, Q as useAsLevel, R as useAsTriStateCheckbox, S as UseAsDateReturn, St as RebaseOntoResult, T as UseAsDualInputReturn, Tt as UseAsStateReturn, U as focusNewFocusableAfter, V as useAsOptionalAddFlow, W as useAsFocusFirstAfter, X as useAsFieldScope, Y as UseAsFieldScopeReturn, Z as provideAsNestedLevel, _ as UseAsTypeMapReturn, _t as useAsExternalErrors, a as FormFieldChange, at as UseAsValueHelpReturn, b as useAsPath, bt as useAsForm, c as hasFieldMeta, ct as useAsUnionVariant, d as resetDefaultClientFactory, dt as UseAsTupleReturn, et as provideAsNestedSectionsStore, f as setDefaultClientFactory, ft as useAsTuple, g as useAsData, gt as UseAsExternalErrorsReturn, h as UseAsDataReturn, ht as UseAsExternalErrorsOptions, i as FormDiffOptions, it as UseAsValueHelpOptions, j as UseAsDecimalReturn, jt as TFormFieldRegistration, k as useAsNumber, kt as useAsField, l as isFieldHidden, lt as UseAsUnionReturn, m as useAsErrorDismiss, mt as useAsArray, n as _default$9, nt as useAsNestedSectionsStore, o as FormRebaseOptions, ot as useAsValueHelp, p as AsErrorDismiss, pt as UseAsArrayReturn, q as useAsOptionalField, r as ClientFactory, rt as useAsDropdown, s as getDefaultClientFactory, st as formatIndexedLabelParts, tt as useAsDescendantErrorCounts, u as joinPath, ut as useAsUnion, v as useAsTypeMap, vt as UseAsFormOptions, w as UseAsDualInputOptions, wt as TFormSubmitValidator, x as UseAsDateOptions, xt as AsFormPatchHandle, y as UseAsPathReturn, yt as UseAsFormReturn, z as UseAsOptionalAddFlowOptions } from "./as-form.vue-
|
|
23
|
+
import { $ as AsNestedSectionsStore, A as UseAsDecimalOptions, At as TFormFieldCallbacks, B as UseAsOptionalAddFlowReturn, C as useAsDate, Ct as useAsFormPatch, D as UseAsNumberOptions, Dt as UseAsFieldOptions, E as useAsDualInput, Et as useAsState, F as useAsLocale, Ft as createAsFormDef, G as useAsVisibleFields, H as focusFirstAfter, I as UseAsTriStateCheckboxOptions, J as TResolveFieldPropOptions, K as UseAsOptionalFieldReturn, L as UseAsTriStateCheckboxReturn, M as useAsDecimal, Mt as TFormRule, N as UseAsLocaleReturn, Nt as TFormState, O as UseAsNumberReturn, Ot as UseAsFieldReturn, P as provideAsLocale, Pt as createDefaultTypes, Q as useAsLevel, R as useAsTriStateCheckbox, S as UseAsDateReturn, St as RebaseOntoResult, T as UseAsDualInputReturn, Tt as UseAsStateReturn, U as focusNewFocusableAfter, V as useAsOptionalAddFlow, W as useAsFocusFirstAfter, X as useAsFieldScope, Y as UseAsFieldScopeReturn, Z as provideAsNestedLevel, _ as UseAsTypeMapReturn, _t as useAsExternalErrors, a as FormFieldChange, at as UseAsValueHelpReturn, b as useAsPath, bt as useAsForm, c as hasFieldMeta, ct as useAsUnionVariant, d as resetDefaultClientFactory, dt as UseAsTupleReturn, et as provideAsNestedSectionsStore, f as setDefaultClientFactory, ft as useAsTuple, g as useAsData, gt as UseAsExternalErrorsReturn, h as UseAsDataReturn, ht as UseAsExternalErrorsOptions, i as FormDiffOptions, it as UseAsValueHelpOptions, j as UseAsDecimalReturn, jt as TFormFieldRegistration, k as useAsNumber, kt as useAsField, l as isFieldHidden, lt as UseAsUnionReturn, m as useAsErrorDismiss, mt as useAsArray, n as _default$9, nt as useAsNestedSectionsStore, o as FormRebaseOptions, ot as useAsValueHelp, p as AsErrorDismiss, pt as UseAsArrayReturn, q as useAsOptionalField, r as ClientFactory, rt as useAsDropdown, s as getDefaultClientFactory, st as formatIndexedLabelParts, tt as useAsDescendantErrorCounts, u as joinPath, ut as useAsUnion, v as useAsTypeMap, vt as UseAsFormOptions, w as UseAsDualInputOptions, wt as TFormSubmitValidator, x as UseAsDateOptions, xt as AsFormPatchHandle, y as UseAsPathReturn, yt as UseAsFormReturn, z as UseAsOptionalAddFlowOptions } from "./as-form.vue-Bdvel5Mo.mjs";
|
|
24
24
|
export { _default as AsAction, _default$1 as AsArray, _default$2 as AsCheckbox, _default$3 as AsCollapsible, _default$4 as AsDate, _default$5 as AsDatetime, _default$6 as AsDecimal, AsErrorDismiss, _default$7 as AsField, _default$8 as AsFieldShell, _default$9 as AsForm, AsFormPatchHandle, _default$10 as AsInput, _default$11 as AsIterator, _default$12 as AsMultiSelect, AsNestedSectionsStore, _default$13 as AsNumber, _default$14 as AsObject, _default$15 as AsParagraph, _default$16 as AsRadio, _default$17 as AsRef, _default$18 as AsSelect, _default$19 as AsTime, _default$20 as AsTuple, _default$21 as AsUnion, ClientFactory, FormDiffOptions, FormFieldChange, FormRebaseOptions, RebaseOntoResult, TAsBaseComponentProps, TAsChangeType, TAsCollapsibleProps, TAsCollapsibleSlots, TAsComponentEmits, TAsComponentProps, TAsTypeComponents, TAsUnionContext, TFormFieldCallbacks, TFormFieldRegistration, TFormRule, TFormState, TFormSubmitValidator, TResolveFieldPropOptions, UseAsArrayReturn, UseAsDataReturn, UseAsDateOptions, UseAsDateReturn, UseAsDecimalOptions, UseAsDecimalReturn, UseAsDualInputOptions, UseAsDualInputReturn, UseAsExternalErrorsOptions, UseAsExternalErrorsReturn, UseAsFieldOptions, UseAsFieldReturn, UseAsFieldScopeReturn, UseAsFormOptions, UseAsFormReturn, UseAsLocaleReturn, UseAsNumberOptions, UseAsNumberReturn, UseAsOptionalAddFlowOptions, UseAsOptionalAddFlowReturn, UseAsOptionalFieldReturn, UseAsPathReturn, UseAsStateReturn, UseAsTriStateCheckboxOptions, UseAsTriStateCheckboxReturn, UseAsTupleReturn, UseAsTypeMapReturn, UseAsUnionReturn, UseAsValueHelpOptions, UseAsValueHelpReturn, createAsFormDef, createDefaultTypes, focusFirstAfter, focusNewFocusableAfter, formatIndexedLabelParts, getDefaultClientFactory, hasFieldMeta, isFieldHidden, joinPath, provideAsLocale, provideAsNestedLevel, provideAsNestedSectionsStore, resetDefaultClientFactory, setDefaultClientFactory, useAsArray, useAsData, useAsDate, useAsDecimal, useAsDescendantErrorCounts, useAsDropdown, useAsDualInput, useAsErrorDismiss, useAsExternalErrors, useAsField, useAsFieldScope, useAsFocusFirstAfter, useAsForm, useAsFormPatch, useAsLevel, useAsLocale, useAsNestedSectionsStore, useAsNumber, useAsOptionalAddFlow, useAsOptionalField, useAsPath, useAsState, useAsTriStateCheckbox, useAsTuple, useAsTypeMap, useAsUnion, useAsUnionVariant, useAsValueHelp, useAsVisibleFields };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { h as PATH_PREFIX_KEY, n as useAsUnionVariant, s as DISMISS_EXTERNAL_AT_KEY, t as formatIndexedLabelParts } from "./use-form-context-cDW2GW4-.mjs";
|
|
2
|
-
import { a as useAsFormPatch, i as useAsExternalErrors, n as useAsForm, r as useAsState, t as as_form_default } from "./as-form-
|
|
2
|
+
import { a as useAsFormPatch, i as useAsExternalErrors, n as useAsForm, r as useAsState, t as as_form_default } from "./as-form-Ckj7mjOo.mjs";
|
|
3
3
|
import { i as useAsNestedSectionsStore, n as provideAsNestedSectionsStore, r as useAsDescendantErrorCounts } from "./use-as-nested-sections-store-Dfo971PK.mjs";
|
|
4
4
|
import { n as useAsValueHelp } from "./use-as-value-help-DrISSxCz.mjs";
|
|
5
|
-
import { a as useAsField, i as useAsFieldScope, n as useAsData, r as useAsOptionalField, t as as_field_default } from "./as-field-
|
|
5
|
+
import { a as useAsField, i as useAsFieldScope, n as useAsData, r as useAsOptionalField, t as as_field_default } from "./as-field-CCzocwup.mjs";
|
|
6
6
|
import { n as useAsLocale, t as provideAsLocale } from "./use-as-locale-BrFdAgnU.mjs";
|
|
7
|
-
import { n as provideAsNestedLevel, r as useAsLevel, t as as_iterator_default } from "./as-iterator-
|
|
7
|
+
import { n as provideAsNestedLevel, r as useAsLevel, t as as_iterator_default } from "./as-iterator-QrcUfX6I.mjs";
|
|
8
8
|
import { n as focusNewFocusableAfter, r as useAsFocusFirstAfter, t as focusFirstAfter } from "./focus-after-toggle-Dtl3P6CS.mjs";
|
|
9
9
|
import { t as as_collapsible_default } from "./as-collapsible-_RN5621d.mjs";
|
|
10
10
|
import { t as as_field_shell_default } from "./as-field-shell-BErcR8c9.mjs";
|
|
@@ -17,10 +17,10 @@ import { n as useAsTriStateCheckbox, t as as_checkbox_default } from "./as-check
|
|
|
17
17
|
import { t as as_paragraph_default } from "./as-paragraph-BP3-0EY4.mjs";
|
|
18
18
|
import { t as as_action_default } from "./as-action-CCjN5EFP.mjs";
|
|
19
19
|
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-BdjKNx9P.mjs";
|
|
20
|
-
import { t as as_object_default } from "./as-object-
|
|
21
|
-
import { n as useAsArray, t as as_array_default } from "./as-array-
|
|
20
|
+
import { t as as_object_default } from "./as-object-C8ic4o0z.mjs";
|
|
21
|
+
import { n as useAsArray, t as as_array_default } from "./as-array-BrtqWXjO.mjs";
|
|
22
22
|
import { n as useAsTypeMap, r as useAsUnion, t as as_union_default } from "./as-union-Car_1kUS.mjs";
|
|
23
|
-
import { n as useAsTuple, t as as_tuple_default } from "./as-tuple-
|
|
23
|
+
import { n as useAsTuple, t as as_tuple_default } from "./as-tuple-Ckmki4p_.mjs";
|
|
24
24
|
import { t as as_ref_default } from "./as-ref-v00Tyeum.mjs";
|
|
25
25
|
import { n as useAsDualInput, r as useAsDecimal, t as as_decimal_default } from "./as-decimal-CVp3Wtrz.mjs";
|
|
26
26
|
import { n as useAsNumber, t as as_number_default } from "./as-number-Cros_r8k.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/vue-form",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.116",
|
|
4
4
|
"description": "Type-driven form rendering for Atscript with Vue 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"access": "public"
|
|
161
161
|
},
|
|
162
162
|
"dependencies": {
|
|
163
|
-
"@atscript/ui": "^0.1.
|
|
163
|
+
"@atscript/ui": "^0.1.116"
|
|
164
164
|
},
|
|
165
165
|
"devDependencies": {
|
|
166
166
|
"@atscript/core": "^0.1.79",
|
|
@@ -176,13 +176,13 @@
|
|
|
176
176
|
"vue": "^3",
|
|
177
177
|
"vue-tsc": "~3.2.9",
|
|
178
178
|
"vunor": "^0.2.1",
|
|
179
|
-
"@atscript/ui-fns": "^0.1.
|
|
179
|
+
"@atscript/ui-fns": "^0.1.116"
|
|
180
180
|
},
|
|
181
181
|
"peerDependencies": {
|
|
182
182
|
"@atscript/db-client": "^0.1.111",
|
|
183
183
|
"reka-ui": "^2.9.8",
|
|
184
184
|
"vue": "^3",
|
|
185
|
-
"@atscript/ui-fns": "^0.1.
|
|
185
|
+
"@atscript/ui-fns": "^0.1.116"
|
|
186
186
|
},
|
|
187
187
|
"scripts": {
|
|
188
188
|
"build": "node ../../scripts/gen-exports.mjs && vp pack",
|